tiptap
tiptap copied to clipboard
fix(extension-code-block-lowlight): Bump lowlight to 2.7.0, remove outdated @types
Closes https://github.com/ueberdosis/tiptap/issues/2880
Lowlight now has TS types in the package itself. This PR bumps to latest 2.7.0, and removes the @types package which is very out of date and actively prevents developers from using current version of lowlight (because @types always takes precedence over built in types, causing TS to throw errors, see https://github.com/ueberdosis/tiptap/issues/2880
We may also choose to leave lowlight at 1.2.0, but without @types built-in, it would add friction to devs who want to plug-and-play the CodeBlockLowlight extension. IMO updating to 2.7.0 preserves this single npm install experience.
FWIW the docs are a little confusing, the currently claim that:
You should provide the lowlight module to this extension. Decoupling the lowlight package from the extension allows the client application to control which version of lowlight it uses and which programming language packages it needs to load.
which I would personally love, but the extension currently provides an out of date lowlight with types that prevent client apps from using the latest lowlight.
happy to also put up a version with that change (just removing lowlight from the extension)
Deploy Preview for tiptap-embed ready!
Name | Link |
---|---|
Latest commit | d5206961f7224603ed8545584674780f74a6111d |
Latest deploy log | https://app.netlify.com/sites/tiptap-embed/deploys/6310ef96924b820008755537 |
Deploy Preview | https://deploy-preview-3002--tiptap-embed.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
i also found that package-lock.json in /demos no longer gets used, i'm guessing from before lerna was used. it's probably worth just deleting that file, too. it made local testing very confusing.
It seems like code highlighting isn't working in the demo anymore. Could you check out what went wrong there?
https://deploy-preview-3002--tiptap-embed.netlify.app/src/nodes/codeblocklowlight/react/ https://deploy-preview-3002--tiptap-embed.netlify.app/src/nodes/codeblocklowlight/vue/
I think you now have to register the languages in the demos. Take a look here: https://github.com/ueberdosis/tiptap/pull/2965
Maybe that's why code highlighting currently isn't working.
Any updates @tarngerine
I’ll check it out today sorry for the delay!
OK! I pushed fixes and checked the deploy preview, they all syntax highlight now. Thanks for the reference PR.
Thank you a lot! :)
Seems like the test is failing. Could you take a look into this again @tarngerine ?