-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Use Prismjs dependency info from library instead of vendored version #5000
Conversation
Deploy preview for using-drupal ready! Built with commit 4dbb56f3f6bb07aafaa703f18d161ce60965dfd3 |
Deploy preview for using-drupal ready! Built with commit 27ddff316c4a4d473b294fb366ef9c0dda4f1b3b |
Deploy preview for gatsbygram ready! Built with commit 4dbb56f3f6bb07aafaa703f18d161ce60965dfd3 |
Deploy preview for gatsbygram ready! Built with commit 27ddff316c4a4d473b294fb366ef9c0dda4f1b3b |
Deploy preview for gatsbygram ready! Built with commit 7935568 |
Deploy preview for using-drupal ready! Built with commit 7935568 |
Couldn't prismjs be peerDependency then? This update still ties prismjs version to gatsby-remark-prismjs. If prismjs would become peerDependency it would be up to user to pick prismjs version and even less maintenance needed for gatsby plugin. (just thinking here) |
I don't have an opinion there. As long as we're using prismJS > 1.13.0, whatever version of Prism should be fine. Would peerDependency require the user to install PrismJS explicitly, or would it be installed automatically still? (ie: Would the instructions need to change to |
User would have to explicitly install prismjs - we already do this with react helmet plugin ( https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-react-helmet#install ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's move to requiring PrismJS as a peerDependency
, this is a pattern that's been adopted by other plugins too.
e.g. see https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-styled-components
Ok, will do shortly. |
Thanks for adding it to devDeps too. I've missed that this would cause issues with tests. Last things from me:
|
Signed-off-by: Rob Bayliss <[email protected]>
Ok, think we're all set with the requested changes. Sorry for the commit noise... having some trouble remembering to |
Don't worry about the noise. One snapshot is missing update - I guess this change got lost in all the signoff handling, because that test was passing before change to peerDeps. |
Signed-off-by: Rob Bayliss <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for the PR! Always glad when it gets simpler to support an upstream :-)
prismjs now moved to peerDependencies
Oh, and congrats on snagging issue #5000!!! :-D |
Previously it appears to only work for Javascript and HTML gatsbyjs/gatsby#5000
gatsby-remark-prismjs
has historically used a vendored copy of PrismJS's language dependencies, because this data wasn't exposed on the PrismJS side. This is no longer the case - as of 1.13.0, language dependency data is exposed incomponents.js
. This PR uses the data fromcomponents.js
to load languages, meaning there will be no more maintenance required to stay current with PrismJS changes.Fixes #5001