-
-
Notifications
You must be signed in to change notification settings - Fork 578
feat: send request reference within the RESPONSE event
#2510
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
Conversation
|
Hi, @IrishBruse. I hope you don't mind me moving the discussion around the fix here. UpdateYour solution does work but it doesn't account for nested clients (i.e. requests coming from iframes). In those cases, the That's a pickle because resolving the actual client id is an asynchronous action (we already have the |
cd5b912 to
37be6c1
Compare
UpdateSince the original proposal breaks the nested frames support, I'm trying to remove the need in That being said, I don't expect any performance degradation or impact, for that matter, from this change. |
0592e6f to
06b1133
Compare
commit: |
request reference within the RESPONSE event
|
I updated my repo to use this build during our tests (vitest browser). This version seem to fix the Note: I've seen the comment about the worker script. In my case no such thing was required. I created this little vite plugin for msw running in the browser: |
|
@dmezei, thank you so much for confirming! I was just thinking about making a Vite plugin for MSW's worker yesterday! What a coincidence. Still weighing the pros and cons but thinking it would be worth it. We can have a simple plugin that appends a new route handler to Vite's dev server and make it serve If you feel like it, you can suggest this as a feature so we can track it. Thanks. |
Released: v2.9.0 🎉This has been released in v2.9.0! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Warning
This change will require you to upgrade your worker script via
npm init. If you've saved the worker script location in the past using the--saveflag, the worker script will be updated automatically.Test attempt at #2473. Highly flaky due to how the client registrations are resolved across tabs. I don't believe it's worth it to pursue that test.