tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

fix(extension-code-block-lowlight): Bump lowlight to 2.7.0, remove outdated @types

Open tarngerine opened this issue 1 year ago • 2 comments

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)

tarngerine avatar Jul 19 '22 04:07 tarngerine

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jul 19 '22 04:07 netlify[bot]

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.

tarngerine avatar Jul 19 '22 05:07 tarngerine

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/

bdbch avatar Aug 22 '22 11:08 bdbch

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.

bdbch avatar Aug 22 '22 12:08 bdbch

Any updates @tarngerine

bdbch avatar Sep 01 '22 11:09 bdbch

I’ll check it out today sorry for the delay!

tarngerine avatar Sep 01 '22 14:09 tarngerine

OK! I pushed fixes and checked the deploy preview, they all syntax highlight now. Thanks for the reference PR.

tarngerine avatar Sep 01 '22 18:09 tarngerine

Thank you a lot! :)

bdbch avatar Sep 01 '22 22:09 bdbch

Seems like the test is failing. Could you take a look into this again @tarngerine ?

bdbch avatar Sep 02 '22 00:09 bdbch