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

[EuiCodeBlock] Replace highlight.js as the engine #3947

Closed
snide opened this issue Aug 20, 2020 · 2 comments · Fixed by #4638
Closed

[EuiCodeBlock] Replace highlight.js as the engine #3947

snide opened this issue Aug 20, 2020 · 2 comments · Fixed by #4638
Assignees
Labels
dependencies Pull requests that update a dependency file

Comments

@snide
Copy link
Contributor

snide commented Aug 20, 2020

Although popular, highlight.js is pretty slow and getting a little old in its methodology. I often see it fail in complex syntax blocks and it'd be nice if we had something that provided virtualization out of the gate.

I'd like to look into replacing it with react-syntax-highlighter which is backed by Prism JS (which I have some love and familiarity with) and comes with virtualization (which would close #1208).

I can give this a shot myself, but please give a yell if anything looks out of sort from that dependency. The bulk of the work I think will be transferring our styling over.

@snide snide self-assigned this Aug 20, 2020
@timroes
Copy link
Contributor

timroes commented Sep 7, 2020

When using EUI, highlight.js is currently one of the dependencies really bloating your bundle sizes, even if you never use EuiCodeBlock in your project. While I know that there is some long term work for modularizing EUI better to prevent such things I wonder, if we could (as a quick win), make react-syntax-highlighter/Prism JS a peer dependency and use async import when required, so that not the full syntax highlighter will be bundled into every project that uses EUI?

@cchaos cchaos added the dependencies Pull requests that update a dependency file label Sep 20, 2020
@cchaos cchaos changed the title Replace highlight.js as the engine for EuiCodeBlock [EuiCodeBlock] Replace highlight.js as the engine Sep 20, 2020
@github-actions
Copy link

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants