Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from
Sep 10, 2022

Conversation

tarngerine
Copy link
Contributor

@tarngerine tarngerine commented Jul 19, 2022

Closes #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 #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)

@netlify
Copy link

netlify bot commented Jul 19, 2022

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit d520696
🔍 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.

@tarngerine tarngerine closed this Jul 19, 2022
@tarngerine tarngerine reopened this Jul 19, 2022
@tarngerine tarngerine changed the title Bump lowlight to 2.7.0, remove outdated @types fix(extension-code-block-lowlight): Bump lowlight to 2.7.0, remove outdated @types Jul 19, 2022
@tarngerine
Copy link
Contributor Author

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.

Copy link
Member

@bdbch bdbch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - will test this on the staging environment. Thanks for the PR! :)

@bdbch
Copy link
Member

bdbch commented Aug 22, 2022

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
Copy link
Member

bdbch commented Aug 22, 2022

I think you now have to register the languages in the demos. Take a look here:
#2965

Maybe that's why code highlighting currently isn't working.

@bdbch
Copy link
Member

bdbch commented Sep 1, 2022

Any updates @tarngerine

@tarngerine
Copy link
Contributor Author

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

@tarngerine
Copy link
Contributor Author

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

@bdbch
Copy link
Member

bdbch commented Sep 1, 2022

Thank you a lot! :)

@bdbch
Copy link
Member

bdbch commented Sep 2, 2022

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

@bdbch bdbch merged commit af3568f into ueberdosis:main Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove @types/lowlight from @tiptap/extension-code-block-lowlight dependencies
2 participants