mswjs/msw 562fac96..773a6d28
base and head as given
- WebSocket mocking entered the core API through a new ws namespace.
- WebSocket client management entered the system as a new component.
- Browser worker setup now depends on WebSocket interception.
- Node server setup now depends on WebSocket interception.
- files changed
- 63
- in a component
- 27
- lines in components
- 1,323
- components
- 10
- public routes changed
- 0
- schema statements
- 0
- new dependencies
- 3
- excluded by role
- 36
WebSocket mocking
Added- Before
- WebSocket handler API did not exist
- After
- Handlers mock matching socket links
Applications can define URL-matched WebSocket links, receive connection events, send messages, and broadcast to connected clients. Browser and server setups enable interception, while browser runtimes share active clients for cross-runtime broadcasts.
In favour
- In favour: Reuses URL matching for HTTP and WebSocket handlers
- In favour: Shares clients across browser runtimes for link-wide broadcasts
The model found nothing to weigh against this.
Inspect 12 source files behind this explanation
- src/core/ws/utils/attachWebSocketLogger.ts
- src/core/ws.ts
- src/core/handlers/WebSocketHandler.ts
- src/core/utils/executeHandlers.ts
- src/browser/setupWorker/setupWorker.ts
- src/node/SetupServerCommonApi.ts
- src/core/utils/matching/matchRequestUrl.ts
- src/core/utils/logging/getTimestamp.ts
- src/browser/setupWorker/start/createRequestListener.ts
- src/browser/setupWorker/stop/createStop.ts
- src/core/ws/WebSocketClientManager.ts
- src/core/SetupApi.ts
4 new dependencies between components — Setup Worker → WebSocket Support · WebSocket Support → Handlers · Node → WebSocket Support · Core → WebSocket Support
What else could behave differently
13 components · 43 filesThese components import changed code, directly or through other files. A traced dependency is a place to review, not a confirmed runtime failure.
Reached 3
| Component | Symbol | Cited at | Files | Reached by |
|---|---|---|---|---|
| WebSocket Supportsrc/core/ws/ | Added kDispatchEvent1 of 11 changed symbols reaching it | src/core/handlers/WebSocketHandler.ts:25 | 6 | 6 directTrace pathShortest component path from the changed symbol:
Later steps follow file imports; they do not prove this symbol is called. |
| Coresrc/core/ | Added WebSocketHandlerEventMap1 of 16 changed symbols reaching it | src/core/handlers/WebSocketHandler.ts:16-18 | 6 | 4 direct · 2 at two stepsTrace pathShortest component path from the changed symbol:
Later steps follow file imports; they do not prove this symbol is called. |
| src/core/utils/internal/ | Signature changed getTimestamp | src/core/utils/logging/getTimestamp.ts:8-17 | 1 | none direct · 1 at two stepsTrace pathShortest component path from the changed symbol:
Later steps follow file imports; they do not prove this symbol is called. |
Ranked lower 10
| Component | Files | Reached by |
|---|---|---|
| src/core/handlers/ | 2 | 2 direct |
| src/core/utils/ | 1 | 1 direct |
| src/browser/setupWorker/ | 2 | 2 direct |
| src/node/ | 5 | 5 direct |
| src/browser/ | 1 | 1 direct |
| src/browser/utils/ | 3 | 1 direct · 2 at two steps |
| src/native/ | 1 | 1 direct |
| src/iife/ | 1 | none direct · 1 at two steps |
| src/browser/setupWorker/start/ | 12 | 7 direct · 5 at two steps |
| src/browser/setupWorker/stop/ | 2 | 2 direct |
Statements 3
kDispatchEvent reached 6 WebSocket support files. 6WebSocketHandlerEventMap reached 6 Core files. 42getTimestamp signature change reached 1 internal utility file. 127 reached files belong to no component — tests, docs and config.
Routes, schema, dependencies
| What | Object | Where |
|---|---|---|
| + dependency | @fastify/websocket@^8.3.1 | declared, and used by no file in any component |
| + dependency | @open-draft/deferred-promise@^2.2.0 | src/core/ws/WebSocketIndexedDBClientStore.ts:1 |
| + dependency | fastify@^4.26.0 | declared, and used by no file in any component |
3 statements, with the lines behind them
@open-draft/deferred-promise ^2.2.0 was added as a dependency.Inspect components, files and symbols
Component
File
Function
imports what changeddownstream of it, one mark per step
Diff
Analysis scope
554 → 10- files at head554
- components24
- changed by this change10
- shown above of 106
Where the new files landed
12 new files| New file | Belongs to | Used by | Calls | Serves |
|---|---|---|---|---|
| src/core/ws/10 new filesimports 1 package this change added | WebSocket Supportnew territory | Setup WorkerCoreNode | Handlerssrc/core/utils/internal/Logging Utilitiessrc/core/utils/request/ | — |
| src/core/ws.ts | Corebase frame | — | HandlersMatching UtilitiesWebSocket Support | ./core/ws |
| src/core/handlers/WebSocketHandler.ts | Handlersbase frame | Setup WorkerCoreWebSocket SupportNode | src/core/utils/internal/Matching Utilities | — |
28 added files carry no component — 28 test.
63 files changed, 30 claims stated. 13 components reached in total.