feat!: v3.0.0 - #2692
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
Hey @kettanaito, thanks a lot for your great work! Is it possible to include this feature? Here’s the link: #2357 |
|
@dsonet GraphQL subscriptions will likely make it either to 3.0 or even to 2.0. They aren't as tedious to implement with the new architecture now. I've introduced the concept of handlers merging in the recent changes to 2.0 and that was the missing piece for the subscriptions. As always, if your company needs that support in MSW, please consider becoming a sponsor! Thank you. |
navigaterequests #1594BREAKING CHANGES
Headers.getSetCookie#2730)worker.stop()returns a Promise (fix: await in-flight requests from closing clients #2724). Awaiting it is relevant only for in-flight critical scenarios.graphqlis now exported asmsw/graphql(feat!:msw/graphql,graphqlas an optional peer dependency #2691). GraphQL is now handled as a proper optional peer dependency.handleRequest()utility. Please use thedefineNetwork()API instead.GraphQLLinkHandlerstype has been renamed toGraphQLLink.file://requests now throw in Node.js as they normally do (not supported byfetch).Content-Lengthrequest header is now removed bybypass().fetch()now throw in Node.js as they normally do (not supported byfetch).Features
path-to-regexpto@msw/url(feat!: migrate to@msw/url#2678).graphqlpath-to-regexppicocolorsstatusesstrict-event-emitterBug fixes
beforeunloadlistener would unregister the MSW worker (My app hooks in beforeunload with a confirmation message and then MSW stops working #1105).maxWorkers: 1(Firefox & Vitest Browser Mode Timing Problems (CI) #2726).worker.stop()(fix: await in-flight requests from closing clients #2724, MSW sometimes still handles requests after worker is stopped #2597).Roadmap
msw/wsmsw/httpmsw/graphqlis the only way to consume GraphQL due to optional peer dependency ongraphql.msw/nativetomsw/react-nativeOR consider@msw/react-nativealtogether to have necessary polyfills, full RN app tests, etc.defineNetworkand move it out from/experimental.pnpm@11.statuses. That's the only CJS dependency requiring a shim.graphqlversion (d9f389d).postinstallhook in favor of explicitmsw init(Make worker autoupdate an explicit choice #1297, Issue: postinstall breaks during ci installation #2704).cookiepackage since it now ships ESM (drop the shim).undici@latestnow that node@20 is dropped.graphql.*methods. Make GraphQL mocking link-first:graphql.link().src/core/utils/handleRequest.ts, it's no longer used by anything.connection->websocket:connection. Ensure the WebSocket connection life cycle is sufficiently represented with events.deferred-promisein favor ofPromise.withResolvers()./node,/nativedirectories.kebab-case.webpackand its dependencies.http.connect(),http.query(), and any other methods we can now intercept. They wont do anything in the browser, let them be. Add Node.js tests.Todos