-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
build: remove codemirror dependency from lsp #1998
Conversation
🦋 Changeset detectedLatest commit: 500520d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
`CodeMirror.Token` is identical to `ContextTokenForCodeMirror`. see graphql/vscode-graphql#335 (comment)
4b9698d
to
500520d
Compare
Codecov Report
@@ Coverage Diff @@
## main #1998 +/- ##
==========================================
+ Coverage 65.70% 66.40% +0.70%
==========================================
Files 85 86 +1
Lines 5106 5153 +47
Branches 1631 1643 +12
==========================================
+ Hits 3355 3422 +67
+ Misses 1747 1727 -20
Partials 4 4
Continue to review full report at Codecov.
|
I'm trying to recall exactly why we made this change before, but it doesn't seem like we need to import all of |
Is there a best practice for a typescript lib (like this one) that is expected to integrate with another package with its own types, if you don't want to make it a dependency? My first thought was making codemirror an optional peer dependency for graphql-language-service-interface... but then I'm not sure what to do with that codemirror import (I'm not a TS master yet but I'm working on it lol) In other lib projects I've worked on, I've just added the types package as a dev dep and an optional peer dep. Then in a package that uses that lib, I have it add the same types package as a dev dep so it can build. Translating that strategy here might look like:
|
Now that I say that though, why does vscode-graphql's build type check this module anyway? Shouldn't node_modules get excluded? |
The only issue I see here would be keeping the types in sync, assuming the Token type in codemirror is updated, but this looks like a cleaner alternative, considering how the codemirror Token is probably the most used (and frequently referenced) type in the Codemirror package. |
@ferm10n excellent point! i think we need to tweak some tsconfig on the vscode-graphql side at least... @imolorhe another great point. I swear I found a way to automatically extract external definititions statically to the .d.ts files once, but after some time searching I couldn't remember how I accomplished it. Triple slash directives perhaps? |
CodeMirror.Token
is identical toContextTokenForCodeMirror
see graphql/vscode-graphql#335 (comment)
this will allow updating the vscode-graphql to update to the latest packages from this project without having to add codemirror as a dependency