-
Notifications
You must be signed in to change notification settings - Fork 39
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
BREAKING CHANGE: Support MSW 2.0 #122
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
3a02d97
to
3bcd3bf
Compare
Co-authored-by: Gert Hengeveld <[email protected]>
3bcd3bf
to
b106c13
Compare
Thanks @yannbf for your great work, |
I'd like to add my thanks. I also use the canary in our (smaller) setup. Works nicely with our graphql calls! |
Hey @yannbf thanks for your work getting this released. It works nicely for Storybook in the browser, but I'm unfortunately facing a similar issue to the one you have in https://github.com/mswjs/msw-storybook-addon/actions/runs/6625684339/job/17997112847?pr=122 😢 jest + storybook composeStories |
3622457
to
dc531d0
Compare
Would it be an idea to combine forces? With @offbeat-dev ? |
@the-ult, that would be amazing! I have a chat with them on Discord but haven't got to reply just yet. Been extremely busy couple of weeks. Will get back to the convo and, hopefully, we will make the add-on even better. |
* migrate docs example to vite * migrate from jest to vitest * add rollup workaround * migrate example to Typescript
🚀 |
Issue: #121
Release notes
MSW required version is now ^2.0.0
The addon now requires your MSW version to be 2.0.0 or higher. This means you will have to change the format of your handlers as well. More info on how to migrate to MSW 2.0.0: https://mswjs.io/docs/migrations/1.x-to-2.x/
mswDecorator is deprecated in favor of mswLoader
Using MSW in a decorator worked for most scenarios, but there's a slight chance the service worker will not get registered in time. As a result, a story that requests data might actually request real data. Since v1.7.0, this addon provided a
mswLoader
to use instead of themswDecorator
. Loaders get executed before a story renders, differently than decorators, which execute as the story renders.Please replace your
mswDecorator
withmswLoader
, as themswDecorator
will be removed in the next major release. It works the same, respecting the parameters you set, so there's no need to change anything else in your codebase.parameters.msw Array notation deprecated in favor of Object notation
Since v1.5.0, this addon started supporting the
parameters.msw.handlers
object format instead of usingparameters.msw
as an Array. This change was done to follow convention for Storybook addon parameters, but also allows for more advanced usage and make the addon more future proof for upcoming features. You can find more information here.Please migrate to this format, and the previous format will be removed in the next major release.
📦 Published PR as canary version:
2.0.0--canary.122.133be34.0
✨ Test out this PR locally via: