Skip to content

Update msw 2.15.0 → 3.0.3 (major) - #547

Merged
milailijevic merged 2 commits into
mainfrom
depfu/update/npm/msw-3.0.3
Nov 13, 2026
Merged

milailijevic merged 2 commits into
mainfrom
depfu/update/npm/msw-3.0.3

Conversation

@depfu

@depfu depfu Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ msw (2.15.0 → 3.0.3) · Repo · Changelog

Release Notes

3.0.3

v3.0.3 (2026-10-10)

Bug Fixes

3.0.2

v3.0.2 (2026-10-03)

Bug Fixes

3.0.1

v3.0.1 (2026-09-30)

Bug Fixes

3.0.0

v3.0.0 (2026-09-28)

⚠️ BREAKING CHANGES

  • MSW is now ESM-only (#2765).
  • Deprecate support for Node.js v18 and v20 (#2729). The minimal supported Node.js version is v22.
  • msw/native is removed in favor of @msw/react-native.
  • Require TypeScript 5.9 as the minimal version.
  • Deprecate support for TypeScript 5.1 and 5.2 (#2730)
  • worker.stop() returns a Promise (#2724). Awaiting it is relevant only for in-flight critical scenarios.
  • graphql is now exported as msw/graphql (#2691). GraphQL is now handled as a proper optional peer dependency.
  • Removes the handleRequest() utility. Please use the defineNetwork() API instead.
  • GraphQLLinkHandlers type has been renamed to GraphQLLink.
  • The file:// requests now throw in Node.js as they normally do (not supported by fetch).
  • The Content-Length request header is now removed by bypass().
  • HTTP-to-WebSocket upgrade requests performed via fetch() now throw in Node.js as they normally do (not supported by fetch).
  • Cookies are no longer managed in Node.js for better compatibilty. Instead, whatever is the default behavior of your environment that's the cookie behavior you get. This has no effect on the browser.
  • WebSocket connection life cycle event has been renamed to websocket:connection (#2783).
  • onUnhandledRequest option has been renamed to onUnhandledFrame.
  • The library no longer patches setTimeout to circumvent fake timers in test runners. You should advance the fake timers normally for delayed mocked responses to resolve.
  • The library no longer returns a mocked cookie string on request.headers.get('cookie') in the handlers. It returns null in all environments. Please use the cookies resolver argument to have cookie-based logic.

Features

  • Supports Node.js v24 and v26.
  • Supports TypeScript v6.0 and v7.0.
  • You can import individual utilities, like delay or passthrough, from the new msw/utils entrypoint for smaller footprint on your bundle.
  • Support GraphQL v17.0.
  • Support intercepting page navigations and form submissions (#2721).
  • Support GraphQL subscriptions (#285, #2763).
  • Migrate from path-to-regexp to @msw/url (#2678).
  • Remove the following dependencies:
    • graphql
    • path-to-regexp
    • picocolors
    • statuses
    • strict-event-emitter
  • Adds a Vite plugin for MSW (#2781).
  • Adds a websocket:error life cycle event to listen to WebSocket connection errors (#2784).
  • Support modifying the intercepted request headers in passthrough scenarios (#2786).
  • Support a new WebSocket Extension API that allows for better custom experiences (#2791).

Bug fixes

  • Fix an issue where preventing a page closure via the beforeunload listener would unregister the MSW worker (#1105).
  • Fix an issue that caused intermittent test failures in Vitest Browser Mode and Firefox if using maxWorkers: 1 (#2726).
  • Fix an issue where in-flight requests were incorrectly passthrough when performed before calling worker.stop() (#2724, #2597).
  • Fix an issue where persisting cookies in localStorage would cause a maximum quota exceeded errors.
  • Fix various issues related to the network interception in Node.js.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 18 commits:

↗️ @​mswjs/interceptors (indirect, 0.41.9 → 0.45.12) · Repo

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 75 commits:

🆕 @​msw/url (added, 0.1.2)

🗑️ @​open-draft/deferred-promise (removed)

🗑️ @​open-draft/deferred-promise (removed)

🗑️ @​open-draft/logger (removed)

🗑️ @​types/statuses (removed)

🗑️ statuses (removed)

🗑️ strict-event-emitter (removed)

🗑️ graphql (removed)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu Bot added the depfu label Nov 4, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://depfu-update-npm-msw-3-0-3-head-start.voorhoede.workers.dev (commit 28764f3)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://80d2abac-head-start.voorhoede.workers.dev 28764f3 2026-11-13T14:59:14.966Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9fee6d46-head-start.voorhoede.workers.dev a52e063 2026-11-13T14:38:31.980Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://4320dcd7-head-start.voorhoede.workers.dev 6801a05 2026-11-04T16:35:37.372Z Visit the dashboard ↗

@depfu
depfu Bot force-pushed the depfu/update/npm/msw-3.0.3 branch from 6801a05 to a52e063 Compare November 13, 2026 14:36
@milailijevic
milailijevic merged commit 2ac4dad into main Nov 13, 2026
5 checks passed
@milailijevic
milailijevic deleted the depfu/update/npm/msw-3.0.3 branch November 13, 2026 14:59
@milailijevic

Copy link
Copy Markdown
Member

Updated the msw test mocks for v3, following the official migration guide: https://mswjs.io/docs/migrations/2.x-to-3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant