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: revert "graphql" as optional peer dependency #2267

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

kettanaito
Copy link
Member

@kettanaito kettanaito commented Sep 7, 2024

Motivation

ESM imports of optional peer dependencies are virtually impossible. You have to opt-out from your bundler treating them as code splitting points because the dependency may not exist, and then as a result, you become in charge of serving that dependency over HTTP + providing an importmap for the browser to understand where to look it up.

This is an insane ask from a developer, and I'm not willing to make it. I was prematurely optimistic about the state of optional peer dependencies, causing the recent release to be a failure. Lessons learned.

Resolving the original issue

The original issue reported in #2185 states that the graphql dependency has to be a peer dependency to prevent duplicate GraphQL versions installed in a single app (MSW installs v16.1, your app has v16.8, and that potentially causes issues).

@kettanaito kettanaito merged commit 7cd39e7 into main Sep 7, 2024
12 checks passed
@kettanaito kettanaito deleted the fix/revert-graphql-optional-peer branch September 7, 2024 15:08
@kettanaito
Copy link
Member Author

Released: v2.4.3 🎉

This has been released in v2.4.3!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant