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

fix: move @codemirror packages to peer deps, upgrade to 0.20.0 #2369

Merged
merged 3 commits into from
Apr 22, 2022

Conversation

sergeichestakov
Copy link
Contributor

It looks like when CodeMirror 6 support was first added to the codemirror-graphql package, @codemirror/stream-parser was mistakenly added as a regular dependency rather than a peer dependency (unlike the CM5 codemirror package).

This may lead to conflicts when upgrading upstream CM6 packages in a project that depends on this package (especially when upgrading major/minor versions) since you end up with multiple versions of core packages like @codemirror/view which leads to bugs. This is especially relevant as there is now a new release for each of the core CodeMirror packages (0.20.0).

This PR moves @codemirror/ packages to peerDependencies and upgrades the CM6 packages to the latest version in the new release. Note that I remove @codemirror/stream-parser in favor of @codemirror/language as per the release notes linked above.

@changeset-bot
Copy link

changeset-bot bot commented Apr 21, 2022

🦋 Changeset detected

Latest commit: b80d2d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
codemirror-graphql Minor

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 21, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: sergeichestakov / name: Sergei Chestakov (8cea539)

@acao
Copy link
Member

acao commented Apr 21, 2022

@sergeichestakov thanks for this! I was wondering what else we needed for cm6. Perhaps we should upgrade the codemirror-graphql peer range for codemirror as well?

perhaps on a follow up PR, we could even upgrade graphiql to use cm6 in legacy mode over a minor version release? This would probably drastically improve accessibility without users needing to wait for monaco which may not come til 2.0

@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #2369 (b80d2d6) into main (2d91916) will decrease coverage by 0.98%.
The diff coverage is 73.64%.

@@            Coverage Diff             @@
##             main    #2369      +/-   ##
==========================================
- Coverage   65.70%   64.72%   -0.99%     
==========================================
  Files          85       81       -4     
  Lines        5106     5321     +215     
  Branches     1631     1703      +72     
==========================================
+ Hits         3355     3444      +89     
- Misses       1747     1873     +126     
  Partials        4        4              
Impacted Files Coverage Δ
packages/codemirror-graphql/src/hint.ts 94.73% <ø> (ø)
packages/codemirror-graphql/src/lint.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/results/mode.ts 47.05% <ø> (ø)
...kages/codemirror-graphql/src/utils/forEachState.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/utils/hintList.ts 95.65% <ø> (ø)
...ackages/codemirror-graphql/src/utils/info-addon.ts 1.02% <ø> (ø)
...ckages/codemirror-graphql/src/utils/mode-indent.ts 0.00% <0.00%> (ø)
packages/codemirror-graphql/src/variables/hint.ts 89.70% <ø> (ø)
packages/codemirror-graphql/src/variables/mode.ts 79.48% <ø> (ø)
packages/graphiql/src/utility/fillLeafs.ts 5.33% <ø> (ø)
... and 76 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 376b86c...b80d2d6. Read the comment docs.

@acao acao requested a review from yoshiakis April 21, 2022 04:54
@sergeichestakov
Copy link
Contributor Author

good point! upgraded codemirror and @types/codemirror to the latest versions too in the latest commit

@acao
Copy link
Member

acao commented Apr 22, 2022

looks great! I think it's ready to merge. the deploy preview looks almost exactly the same!

oh I meant to upgrade to codemirror 6 in graphiql, but we can do that later

@acao acao merged commit eab257b into graphql:main Apr 22, 2022
@github-actions github-actions bot mentioned this pull request Apr 22, 2022
@sergeichestakov sergeichestakov deleted the upgrade-cm6 branch April 22, 2022 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants