Update to stable CodeMirror 6?
JRaspass opened this issue · 12 comments
Depending on the old 0.19 versions (and removed libraries like @codemirror/highlight) makes it really hard to use this library in a project using stable CM6 now that it's been released.
@ErikSchierboom I assume if I update this and push a new release that won't harm Exercism because we're (maybe?) pinned to the existing NPM release, or is that a faulty assumption because we're not 1.0 yet?
Actually if we're major pinned and I bump it all the way to 1.0 with the next release, that would be good, yes? Then Exercism could catch up when ready?
Let me know if I'm mistaken here.
makes it really hard to use this library in a project using stable CM6 now that it's been released.
For sure, upgrading to stable would be great.
Do you know what happened to highlight
? Did it just get absorbed? I haven't been following CodeMirror - I only built this because it was necessary for full Wren support on Exercism.
The deprecated notice says:
As of 0.20.0, this package has been split between @lezer/highlight and @codemirror/language
Thanks! I'll look into this after we hear back from Erik. Could you possibly share what project you're using this in? Pretty awesome to see it being used outside of the Exercism ecosystem.
Sure, code.golf gained support for Wren today with code-golf/code-golf@f7c0d8a but no syntax highlighting yet. The frontend is all CM6.
I wonder if there is some best practice on what versions we should pin against to be most useful:
"@codemirror/autocomplete": "^6.2.0",
"@codemirror/language": "^6.2.1",
"codemirror": "^6.0.1",
Is that going to disallow people using 6.0.0?
Assuming these changes also work with 6.0.0
(I haven't tested. Then I think ^6
would offer the best compatibility with end users:
Assuming these changes also work with 6.0.0
I the API is stable I'd assume it should.
After review I'll merge and ship 1.0.0.
re Exercism: we really were at a beta version before. Bumping it should be okay, because if you bump it, it won't stop Exercism from building as they will need to udpate their log file. If this code language pack works with both the older version and the newer version, there are different ways to accomplish this instead.
re version range:
It really depends what you're trying to accomplish.
So for both things, it comes down to the following: this is a language pack. It makes no sense to install this without depending on code mirror. That means that the version requirement is just that: indicatory of what it expects and supports. In this particular case I highly recommend removing any code mirror dependency and instead add those as peer dependencies. This will lead to deduplication no matter what tool the consumer is using and it leads to a warning instead of a double packaged version or error if the version doesn't match.
If you intend to release or recheck this library regularly you could pick ^6.0.0 / 6.x. If you don't care at all but it may break in the future you can do * which means "be installed, don't care which version".
6.x is the same as ^6.0.0 and 6. ^6 is also the same, but not a syntax i recommend.
~ is meant for patch, ^ mean for minor. Setting a lowest x and y that you support is generally not bad.
codemirror-lang-wren/package.json
Lines 30 to 34 in 77cbbbc
It sounds like you're suggesting I make all 4 (all of the actual non-dev dependencies) peer, am I understanding correctly?
If you intend to release or recheck this library regularly you could pick ^6.0.0 / 6.x.
Wait, "if I intend to check regularly"... isn't pinning ^6.0.0
then periodic (not regular) option? I'm assuming this is reliable semver
, so if it works now it (in theory) shouldn't break until 7. If that's the case and there are no bugs here I'd prefer to not need to touch this again until CodeMirror 7. :-)
@ErikSchierboom I assume if I update this and push a new release that won't harm Exercism because we're (maybe?) pinned to the existing NPM release, or is that a faulty assumption because we're not 1.0 yet?
Currently, we're not even pinning to NPM but to the repo:
"@exercism/codemirror-lang-wren": "https://github.com/exercism/codemirror-lang-wren",
See https://github.com/exercism/website/blob/main/package.json#L18
Let me know what you'd like me to pin it to, and then I can update.