A note about upgrading dependencies from version 9 version 10
See original GitHub issueIf your library (or a dependency) depends on v9 and you’re trying to upgrade to v10
Let’s say you want to help upgrade an open source package that depends on Highlight.js v9. You’d like to help upgrade it to v10 because it’s a dependency of your project but the maintainer seems busy, or no longer around - but you know JavaScript and you have some time to work on a PR. And of course even if the fix is easy if the author is no longer around getting that fix on NPM might require republishing the library or some such, but if so that’d just be what had to be done. Best case is the author is around (just busy) and could merge a PR if you could submit one.
So this can be SUPER easy or it can be insanely difficult - all depends on the library. lowlight is a popular dependent of Highlight.js. In prior versions (v9) they pretty much maintained their own fork of the library - because that’s what they had to do to hook into the internals they needed. Not a trivial upgrade scenario.
Yet several of the libraries I’ve see at a glance just call our public API (highlight
, highlightAuto
, etc)… Our public API between v9 and v10 was remarkably stable.
It’s possible some of these libraries might actually “just work” with ONLY a version bump:
# fetch the library
git clone older-library
cd older-library
# install the latest v10 version of Highlight.js
npm install highlight.js@latest
# run tests maybe?
git commit
# make PR request
Obviously knowing a little about NPM and JavaScript will go a long ways if you wanted to help out here. If anyone has any specific questions about the process of upgrading or any of the breaking changes mentioned below, I’m happy to help as I can. I just don’t have time to update all the possible dependents because NPM says that’s almost 3000 packages. 😃
The biggest thing is we no longer support IE11 on the client-side… but if you’re only using our library on the server-side that wouldn’t matter at all.
Reference:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
You can add the warning during
yarn install
ornpm install
…https://docs.npmjs.com/cli/v6/commands/npm-deprecate
Closing this in favor of it’s mention at https://github.com/highlightjs/highlight.js/issues/2877.