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

feat: add experimental loaders #72

Merged
merged 2 commits into from
Jan 11, 2023
Merged

Conversation

yannbf
Copy link
Collaborator

@yannbf yannbf commented Feb 26, 2022

MSW is currently used in a decorator in this addon, however that has a limitation: The handlers are used only during the render cycle of the component. If you were to try and use this addon with Storybook loaders, which execute before of the rendering of the component, it wouldn't be possible to mock those requests.

This PR introduces an experimental mswLoader, which allows for requests to be mocked before the component renders.
For now we should just experiment with it, but there is a possibility this should be the way to go, as registering the handlers before the render cycle will make sure there's no chance for flake.

@yannbf yannbf added the enhancement New feature or request label Feb 26, 2022
@vercel
Copy link

vercel bot commented Feb 26, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mswjs/msw-storybook-addon/AprRarRc3rZ9bnib3TY7t9nG4FZT
✅ Preview: https://msw-storybook-addon-git-feat-add-experimental-loaders-mswjs.vercel.app

@vercel
Copy link

vercel bot commented Dec 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
msw-storybook-addon ✅ Ready (Inspect) Visit Preview Dec 22, 2022 at 1:47PM (UTC)

@github-actions
Copy link

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants