Closed tmeindle closed 2 weeks ago
Hi. The change that added graphql
as a optional peer dependency has been reverted. Update msw
to get the changes.
Introducing optional peer dependencies is not a breaking change—that's the whole point of them being optional. Sadly, there isn't a proper protocol to achieve optional peer dependencies in JavaScript as of now, especially across multiple module formats.
Hello Atyem,
I will start by saying that msw and msw-storybook-addon are awesome invaluable tools for developing, testing, and demoing! I thank you and all contributors.
However, I have to politely disagree with your thinking above. In my case adding this optional peerDependency was a breaking change I had to track down why stuff broke and stopped working and then actually install graphql to get stuff working again. This is the only reason I made an issue. Reverting the change would of been another breaking change major update because people need to be able to adjust their installed dependencies when they are utilizing lax semver such as ^ and ~ and run a npm update. Luckily I lock all my versions and knew exactly where the issue arose because I only updated the two package versions manually.
please see:
https://github.com/semver/semver/issues/502#issuecomment-466501843
https://github.com/semver/semver/issues/502#issuecomment-2215443827
and this article which the above is a reply to: https://8hob.io/posts/semantic-versioning-npm-packages-after-dependency-update/#versioning-after-updating-a-peer-dependency
Thanks again for all the awesome tools, Tim
When updating my msw to versions greater than 2.4.0 msw-storybook-addon stops functioning in portable stories rendered in tests in vitest (and react swc plugin).
Using latest versions of storybook, vitest, and storybook.
Msw 2.4.1 added a peer dependency on graphql in a patch version update. Adding a peer dependency is usually introduces breaking changes.