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: deprecate "waitUntilReady" (deferNetworkUntil) worker option #1964

Merged
merged 3 commits into from
Jan 15, 2024

Conversation

kettanaito
Copy link
Member

This removes the deferNetworkUntil functionality altogether. It's been introduced in the past to support use cases when developers ran worker.start() and their application rendering in parallel. This has since been discouraged. You must defer your application's rendering to eliminate any race conditions between the worker registration and any requests your app makes on the initial render. The default recommended browser integration also encourages that in the docs.

@kettanaito kettanaito changed the title fix: deprecate "waitUntilReady" (deferNetworkUntil) worker option feat: deprecate "waitUntilReady" (deferNetworkUntil) worker option Jan 14, 2024
@kettanaito
Copy link
Member Author

Marking this as a minor version bump to be safe. There are no breaking changes for those not using the waitUntilReady options. For those using it, the deprecation warning suggests how to migrate to the deferred application rendering scenario by linking to the docs. The deferNetworkUntil functionality itself introduced a bunch of issues that went unnoticed, which makes me believe there's a small percentage of people actually using that option.

@kettanaito kettanaito merged commit 86a22ac into main Jan 15, 2024
11 checks passed
@kettanaito kettanaito deleted the fix/remove-defer-network-until branch January 15, 2024 10:09
@kettanaito
Copy link
Member Author

Released: v2.1.0 🎉

This has been released in v2.1.0!

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.

@kettanaito kettanaito mentioned this pull request Jan 26, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSW doesn't restore fetch is the worker is stopped before "deferNetworkRequestUntil" resolves
1 participant