mswjs/msw (msw)
### [`v2.0.0`](https://togithub.com/mswjs/msw/releases/tag/v2.0.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.3.2...v2.0.0)
#### v2.0.0 (2023-10-23)
> \[!IMPORTANT]
> **This release is a BREAKING CHANGE**. Please follow the [Migration guidelines](https://mswjs.io/docs/migrations/1.x-to-2.x) to upgrade. This release took a lot of effort to make, and I expect a bit of that effort on your part while upgrading. Most of the changes are mechanical, and a simple Find/Replace All will get you a long way. For the rest of it, you will learn how to handle requests and responses using the standard JavaScript API. Thank you!
#### Breaking changes
- **Drops support for Node.js 16**. Please upgrade to Node.js 18 or later to use the global Fetch API.
- **Drops support for TypeScript `< 4.7`.**
- All browser-side exports, like `setupWorker`, `SetupWorkerApi`, etc., must be imported from `msw/browser` now.
- Renames the `rest` object to `http` (`rest.get` -> `http.get`).
- Response resolver call signature is no longer `(req, res, ctx) => res()` but instead `({ request }) => new Response()`.
- The following exports are removed due to no longer being needed:
- `response`
- `context` and related exports (`defaultContext`, `restContext`, `graphqlContext`).
- `compose` and `createResponseComposition`
- `res.once()` is removed in favor of the `{ once: boolean }` option on the request handler.
- Replaces the `.printHandlers()` method with `.listHandlers()`.
- Removes the `NetworkError` class in favor of the standard `Response.error()`.
- Moves request error handling from the worker thread to the client thread.
- Changes the call signature of the Life-cycle Events API to accept a single object argument.
- Uses `crypto.randomUUID()` instead of `Math.random()` in the worker.
- **For the full list of changes and detailed instructions on how to upgrade please see the [Migration guidelines](docs/migrations/1.x-to-2.x).**
#### Features
- **Adopts Fetch API primitives**. Represent intercepted requests and mocked responses as `Request` and `Response` instances respectively.
- **Supports Node.js v18**.
- Supports `ReadableStream` as a mocked response body.
- Supports reading the intercepted request body as `FormData`.
- Supports `FormData` as a mocked response body.
- Uses `File` polyfill in Node.js.
- Supports XMLHttpRequest “upload” events when responding with a mocked stream response.
- Allows mocking a network error once using the `{ once: true }` request handler option.
- Makes the `RequestHandler` API public.
#### Bug fixes
- Fixes the issue where the request body couldn’t be properly read as `FormData`.
- Fixes a set of issues related to response patching when using the `FormData` response body.
- Fixes the issue where `URLSearchParams` as the request body couldn’t be read.
- Fixes the issue where a bypassed request’s `referrerPolicy` was reset to a different value than the original.
- Fixes the wrong order of `XMLHttpRequest` events and `readyState` changes.
- Fixes the issue when reading an XMLHttpRequest body of `responseType` equal to `"arraybuffer"` as an incorrect buffer (previously, always assumed to be a string).
- Fixes the order of `XMLHttpRequest` events when the request fails.
- Keeps XMLHttpRequest `status` equal to 0 until the request actually resolves.
- Fixes the issue when the `onload` event callback was called twice for `XMLHttpRequest`.
- Various improvements in Node.js network behavior compliance.
[@dbritto-dev](https://togithub.com/dbritto-dev) [@ddolcimascolo](https://togithub.com/ddolcimascolo) [@markwhitfeld](https://togithub.com/markwhitfeld) [@christoph-fricke](https://togithub.com/christoph-fricke) [@thepassle](https://togithub.com/thepassle) [@piotr-cz](https://togithub.com/piotr-cz) [@mattcosta7](https://togithub.com/mattcosta7) [@koddsson](https://togithub.com/koddsson) [@dkobierski](https://togithub.com/dkobierski) [@ricardocosta](https://togithub.com/ricardocosta) [@dxlbnl](https://togithub.com/dxlbnl) [@zkochan](https://togithub.com/zkochan) [@felipefreitag](https://togithub.com/felipefreitag) [@weyert](https://togithub.com/weyert) [@95th](https://togithub.com/95th) [@committomaster](https://togithub.com/committomaster) [@Xayer](https://togithub.com/Xayer) [@Kosai106](https://togithub.com/Kosai106) [@colinsullivan](https://togithub.com/colinsullivan) [@xmlking](https://togithub.com/xmlking) [@thw0rted](https://togithub.com/thw0rted) [@lee-reinhardt](https://togithub.com/lee-reinhardt) [@wKovacs64](https://togithub.com/wKovacs64) [@TeChn4K](https://togithub.com/TeChn4K) [@cmolina](https://togithub.com/cmolina) [@nickrttn](https://togithub.com/nickrttn) [@thomasbertet](https://togithub.com/thomasbertet) [@mscottnelson](https://togithub.com/mscottnelson) [@jonnedeprez](https://togithub.com/jonnedeprez) [@negabaro](https://togithub.com/negabaro) [@the-ult](https://togithub.com/the-ult) [@WesleyYue](https://togithub.com/WesleyYue) [@cwagner22](https://togithub.com/cwagner22) [@skvale](https://togithub.com/skvale) [@alawiii521](https://togithub.com/alawiii521) [@csantos1113](https://togithub.com/csantos1113) [@elliotgonzalez123](https://togithub.com/elliotgonzalez123) [@committomaster](https://togithub.com/committomaster) [@tsteckenborn](https://togithub.com/tsteckenborn) [@xxleyi](https://togithub.com/xxleyi) [@jonnedeprez](https://togithub.com/jonnedeprez) [@danny-does-stuff](https://togithub.com/danny-does-stuff) [@lemcii](https://togithub.com/lemcii) [@mattrodak](https://togithub.com/mattrodak) [@luisr-carrillo](https://togithub.com/luisr-carrillo) [@lee-reinhardt](https://togithub.com/lee-reinhardt) [@ealejandrootalvaro](https://togithub.com/ealejandrootalvaro) [@tomdglenn91](https://togithub.com/tomdglenn91)
### [`v1.3.2`](https://togithub.com/mswjs/msw/releases/tag/v1.3.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.3.1...v1.3.2)
#### v1.3.2 (2023-10-01)
##### Bug Fixes
- set minimal "graphql" version to 16.18.1 ([#1754](https://togithub.com/mswjs/msw/issues/1754)) ([`0a857f6`](https://togithub.com/mswjs/msw/commit/0a857f67b6e0883336a790633aa9bafc0b16c7cb)) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.3.1`](https://togithub.com/mswjs/msw/releases/tag/v1.3.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.3.0...v1.3.1)
#### v1.3.1 (2023-09-13)
##### Bug Fixes
- pin "headers-polyfill" to 3.2.5 ([#1736](https://togithub.com/mswjs/msw/issues/1736)) ([`2e53ae7`](https://togithub.com/mswjs/msw/commit/2e53ae73bd734c435ac447ca2b60cdaaebc1390b)) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.3.0`](https://togithub.com/mswjs/msw/releases/tag/v1.3.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.5...v1.3.0)
#### v1.3.0 (2023-09-03)
##### Features
- support TypeScript 5.2 ([#1711](https://togithub.com/mswjs/msw/issues/1711)) ([`2ca791e`](https://togithub.com/mswjs/msw/commit/2ca791e437256452f63b95cf5ef19c91c7ac0b9a)) [@chentsulin](https://togithub.com/chentsulin) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.2.5`](https://togithub.com/mswjs/msw/releases/tag/v1.2.5)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.4...v1.2.5)
#### v1.2.5 (2023-08-28)
##### Bug Fixes
- allow installs with any version of pnpm ([#1713](https://togithub.com/mswjs/msw/issues/1713)) ([`d35e851`](https://togithub.com/mswjs/msw/commit/d35e851faa3d75b58b8051084c50b7f02491df84)) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.2.4`](https://togithub.com/mswjs/msw/releases/tag/v1.2.4)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.3...v1.2.4)
#### v1.2.4 (2023-08-25)
##### Bug Fixes
- **dependency:** unpin the "chalk" dependency ([#1639](https://togithub.com/mswjs/msw/issues/1639)) ([`a93f63b`](https://togithub.com/mswjs/msw/commit/a93f63b345dc46548e42b71954b16b4a87d90fb8)) [@blowery](https://togithub.com/blowery) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.2.3`](https://togithub.com/mswjs/msw/releases/tag/v1.2.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.2...v1.2.3)
#### v1.2.3 (2023-07-20)
##### Bug Fixes
- clone Response before logging ([#1662](https://togithub.com/mswjs/msw/issues/1662)) ([`daa04af`](https://togithub.com/mswjs/msw/commit/daa04af4075b06607b81ed23bbe5ea09d56e8825)) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.2.2`](https://togithub.com/mswjs/msw/releases/tag/v1.2.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.1...v1.2.2)
#### v1.2.2 (2023-06-09)
##### Bug Fixes
- log `ReadableStream` responses as text/json ([#1622](https://togithub.com/mswjs/msw/issues/1622)) ([`4c7e952`](https://togithub.com/mswjs/msw/commit/4c7e952e69f1a82115fafa695ae39b3169486570)) [@esquevin](https://togithub.com/esquevin) [@kettanaito](https://togithub.com/kettanaito)
- support typescript 5.1 as a peer dependency ([#1633](https://togithub.com/mswjs/msw/issues/1633)) ([`8e37d9c`](https://togithub.com/mswjs/msw/commit/8e37d9cbdef16bc6f5c1146a493bfced49657a5d)) [@gthb](https://togithub.com/gthb) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.2.1`](https://togithub.com/mswjs/msw/releases/tag/v1.2.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.0...v1.2.1)
#### v1.2.1 (2023-03-24)
##### Bug Fixes
- update dependencies to support ESM ([#1575](https://togithub.com/mswjs/msw/issues/1575)) ([`e7a6008`](https://togithub.com/mswjs/msw/commit/e7a60081526bd6f00ac17a62c424abf59976555b)) [@kettanaito](https://togithub.com/kettanaito)
- update "headers-polyfill" to 3.1.2 to fix the ESM issue ([#1571](https://togithub.com/mswjs/msw/issues/1571)) ([`4f44f11`](https://togithub.com/mswjs/msw/commit/4f44f115e28d35ff137c7ccf886c0029399b5d30)) [@cstenglein](https://togithub.com/cstenglein)
### [`v1.2.0`](https://togithub.com/mswjs/msw/releases/tag/v1.2.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.1.1...v1.2.0)
#### v1.2.0 (2023-03-22)
##### Features
- add `operationName` to GraphQL request ([#1568](https://togithub.com/mswjs/msw/issues/1568)) ([`115b435`](https://togithub.com/mswjs/msw/commit/115b435aef089a3c4fe9a618d5756c9cb944fe13)) [@ligaz](https://togithub.com/ligaz) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.1.1`](https://togithub.com/mswjs/msw/releases/tag/v1.1.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.1.0...v1.1.1)
#### v1.1.1 (2023-03-20)
##### Bug Fixes
- **typescript:** support typescript 5.0 ([#1566](https://togithub.com/mswjs/msw/issues/1566)) ([`c0616d1`](https://togithub.com/mswjs/msw/commit/c0616d1473d168018ad8bba7194f8654a6ed153a)) [@mattcosta7](https://togithub.com/mattcosta7)
### [`v1.1.0`](https://togithub.com/mswjs/msw/releases/tag/v1.1.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.0.1...v1.1.0)
##### v1.1.0 (2023-02-24)
##### Features
- support global fetch in Node.js ([#1543](https://togithub.com/mswjs/msw/issues/1543)) ([`049f21d`](https://togithub.com/mswjs/msw/commit/049f21df0e7c1b9811e083e83b7534cf0a06021a)) [@kettanaito](https://togithub.com/kettanaito)
##### Bug Fixes
- return types of "setupWorker" and "setupServer" API ([#1540](https://togithub.com/mswjs/msw/issues/1540)) ([`78d1834`](https://togithub.com/mswjs/msw/commit/78d18344388d5e17cb71ae67f5d250ce139baf59)) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.0.1`](https://togithub.com/mswjs/msw/releases/tag/v1.0.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v1.0.0...v1.0.1)
#### v1.0.1 (2023-02-10)
##### Bug Fixes
- add "package.json" subpath export ([#1530](https://togithub.com/mswjs/msw/issues/1530)) ([`12a581f`](https://togithub.com/mswjs/msw/commit/12a581f480e3a2f9bdcda7874f98114c148c9d85)) [@iceu-bb](https://togithub.com/iceu-bb) [@kettanaito](https://togithub.com/kettanaito)
### [`v1.0.0`](https://togithub.com/mswjs/msw/releases/tag/v1.0.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.3...v1.0.0)
#### v1.0.0 (2023-01-25)
##### ⚠️ BREAKING CHANGES
- rename "SetupWorkerApi"/"SetupServerApi" types to "SetupWorker"/"SetupServer" ([#1478](https://togithub.com/mswjs/msw/issues/1478)) ([`4fde47e`](https://togithub.com/mswjs/msw/commit/4fde47ef00bbddc6fdea2b6bdb8ac77b1d398c33)) [@gduliscouet-ubitransport](https://togithub.com/gduliscouet-ubitransport) [@kettanaito](https://togithub.com/kettanaito)
##### Features
- throw and suggest a URL polyfill for React Native ([#1520](https://togithub.com/mswjs/msw/issues/1520)) ([`b4ac829`](https://togithub.com/mswjs/msw/commit/b4ac82921d13bd539f1d53ec9c6345c91dc6637b)) [@kettanaito](https://togithub.com/kettanaito)
### [`v0.49.3`](https://togithub.com/mswjs/msw/releases/tag/v0.49.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.2...v0.49.3)
#### v0.49.3 (2023-01-19)
##### Bug Fixes
- use EventTarget-based event emitter ([#1522](https://togithub.com/mswjs/msw/issues/1522)) ([`6a94b8c`](https://togithub.com/mswjs/msw/commit/6a94b8c06d7a6fbc7be0c5224ba35f38888964b1)) [@chrisguttandin](https://togithub.com/chrisguttandin)
### [`v0.49.2`](https://togithub.com/mswjs/msw/releases/tag/v0.49.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.1...v0.49.2)
##### v0.49.2 (2022-12-13)
##### Bug Fixes
- use `globalThis.fetch` in `ctx.fetch` utility ([#1490](https://togithub.com/mswjs/msw/issues/1490)) ([`42cdbc7`](https://togithub.com/mswjs/msw/commit/42cdbc79654d90b3edce747ea044513f2f964958)) [@Toxiapo](https://togithub.com/Toxiapo) [@kettanaito](https://togithub.com/kettanaito)
### [`v0.49.1`](https://togithub.com/mswjs/msw/releases/tag/v0.49.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.0...v0.49.1)
#### v0.49.1 (2022-11-28)
##### Bug Fixes
- **setupWorker:** resolve the TS4094 error ([#1477](https://togithub.com/mswjs/msw/issues/1477)) ([`c268796`](https://togithub.com/mswjs/msw/commit/c268796eb7a20a1b1f2959cdb1b256a36519a60d)) [@gduliscouet-ubitransport](https://togithub.com/gduliscouet-ubitransport)
### [`v0.49.0`](https://togithub.com/mswjs/msw/releases/tag/v0.49.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.3...v0.49.0)
#### v0.49.0 (2022-11-19)
##### Features
- support TypeScript 4.9, drop support for TypeScript 4.2, 4.3 ([#1467](https://togithub.com/mswjs/msw/issues/1467)) ([`af0277d`](https://togithub.com/mswjs/msw/commit/af0277da900e20c7fb270ddb46be20deb487aefc)) [@wtchnm](https://togithub.com/wtchnm)
### [`v0.48.3`](https://togithub.com/mswjs/msw/releases/tag/v0.48.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.2...v0.48.3)
#### v0.48.3 (2022-11-15)
##### Bug Fixes
- **SetupApi:** validate given request handlers ([#1460](https://togithub.com/mswjs/msw/issues/1460)) ([`a06a944`](https://togithub.com/mswjs/msw/commit/a06a9447d09d93a2a0a108cb27bc183e5bd4716d)) [@kettanaito](https://togithub.com/kettanaito)
- inline `statuses` dependency during the build ([#1458](https://togithub.com/mswjs/msw/issues/1458)) ([`99d49f9`](https://togithub.com/mswjs/msw/commit/99d49f9b1ee71cdb945bd9ae3e78d89c23c2b74e)) [@mattcosta7](https://togithub.com/mattcosta7) [@kettanaito](https://togithub.com/kettanaito)
### [`v0.48.2`](https://togithub.com/mswjs/msw/releases/tag/v0.48.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.1...v0.48.2)
#### v0.48.2 (2022-11-13)
##### Bug Fixes
- resolve absolute worker url against the current path ([#1456](https://togithub.com/mswjs/msw/issues/1456)) ([`f8d15b4`](https://togithub.com/mswjs/msw/commit/f8d15b41a941613cd4868cf0e85d2d3aa075d067)) [@kettanaito](https://togithub.com/kettanaito)
### [`v0.48.1`](https://togithub.com/mswjs/msw/releases/tag/v0.48.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.0...v0.48.1)
#### v0.48.1 (2022-11-10)
##### Bug Fixes
- bufferUtils import path ([#1453](https://togithub.com/mswjs/msw/issues/1453)) ([`91b2902`](https://togithub.com/mswjs/msw/commit/91b2902ded79bea2d649057bd7858862ac91c4c4)) [@cksal0805](https://togithub.com/cksal0805)
### [`v0.48.0`](https://togithub.com/mswjs/msw/releases/tag/v0.48.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.4...v0.48.0)
#### v0.48.0 (2022-11-08)
##### Features
- add "SetupApi" base class ([#1445](https://togithub.com/mswjs/msw/issues/1445)) ([`85ba844`](https://togithub.com/mswjs/msw/commit/85ba8440f57d15e6ce948f2350488365e809dce5)) [@Toxiapo](https://togithub.com/Toxiapo) [@kettanaito](https://togithub.com/kettanaito)
- do not interfere with shared workers ([#1448](https://togithub.com/mswjs/msw/issues/1448)) ([`670dda7`](https://togithub.com/mswjs/msw/commit/670dda7b97f6430418d6faf09698f9a1bca5cf07)) [@mucsi96](https://togithub.com/mucsi96) [@kettanaito](https://togithub.com/kettanaito)
- makes the library esm-compatible ([#1399](https://togithub.com/mswjs/msw/issues/1399)) ([`41798eb`](https://togithub.com/mswjs/msw/commit/41798ebc695e04719e198a7867be6d80e053fd0e)) [@ivanhofer](https://togithub.com/ivanhofer) [@kettanaito](https://togithub.com/kettanaito)
### [`v0.47.4`](https://togithub.com/mswjs/msw/releases/tag/v0.47.4)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.3...v0.47.4)
#### v0.47.4 (2022-10-04)
##### Bug Fixes
- correctly link types in `package.json` `exports` field ([#1395](https://togithub.com/mswjs/msw/issues/1395)) ([`3902b8c`](https://togithub.com/mswjs/msw/commit/3902b8c216b2254beef7c35519cc2242b4535b22)) [@ivanhofer](https://togithub.com/ivanhofer) [@kettanaito](https://togithub.com/kettanaito)
- include error stack in log when handling uncaught exceptions ([#1417](https://togithub.com/mswjs/msw/issues/1417)) ([`933a9d6`](https://togithub.com/mswjs/msw/commit/933a9d607f12cb0d510c40ce3572168a39f26566)) [@jkieboom](https://togithub.com/jkieboom) [@kettanaito](https://togithub.com/kettanaito)
- remove duplicate response logging in the browser console ([#1418](https://togithub.com/mswjs/msw/issues/1418)) ([`78d155f`](https://togithub.com/mswjs/msw/commit/78d155fd46b7b711dfd6c70f62da96fbad5c55fa)) [@snaka](https://togithub.com/snaka) [@kettanaito](https://togithub.com/kettanaito)
### [`v0.47.3`](https://togithub.com/mswjs/msw/releases/tag/v0.47.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.2...v0.47.3)
#### v0.47.3 (2022-09-15)
##### Bug Fixes
- update "headers-polyfill" and "[@mswjs/interceptors](https://togithub.com/mswjs/interceptors)" to fix "/lib" issue ([#1407](https://togithub.com/mswjs/msw/issues/1407)) ([`41d8c08`](https://togithub.com/mswjs/msw/commit/41d8c0895e5ca7bf12da86a8a94b974e19b93d5d))
### [`v0.47.2`](https://togithub.com/mswjs/msw/releases/tag/v0.47.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.1...v0.47.2)
#### v0.47.2 (2022-09-13)
##### Bug Fixes
- fix a typo in the "listHandlers" method jsdoc ([#1403](https://togithub.com/mswjs/msw/issues/1403)) ([`c90eafb`](https://togithub.com/mswjs/msw/commit/c90eafb5caf0d27b81eced6cae4d1a257a7757b6))
### [`v0.47.1`](https://togithub.com/mswjs/msw/releases/tag/v0.47.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.0...v0.47.1)
#### v0.47.1 (2022-09-10)
##### Bug Fixes
- print response log only when response arrives ([#1392](https://togithub.com/mswjs/msw/issues/1392)) ([`638fad9`](https://togithub.com/mswjs/msw/commit/638fad9640885c0a85153c1b9ade61495d4295bb))
### [`v0.47.0`](https://togithub.com/mswjs/msw/releases/tag/v0.47.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.46.1...v0.47.0)
#### v0.47.0 (2022-09-04)
##### Features
- add explicit `exports` map in package.json ([#1383](https://togithub.com/mswjs/msw/issues/1383)) ([`5e1c1a6`](https://togithub.com/mswjs/msw/commit/5e1c1a6a9ab4450073adf571d4b68978d177bf52))
### [`v0.46.1`](https://togithub.com/mswjs/msw/releases/tag/v0.46.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.46.0...v0.46.1)
#### v0.46.1 (2022-09-01)
##### Bug Fixes
- **deps:** include "graphql" as a dependency ([#1381](https://togithub.com/mswjs/msw/issues/1381)) ([`8436515`](https://togithub.com/mswjs/msw/commit/8436515fd93e3f372205815b52ffc3a572da2690))
### [`v0.46.0`](https://togithub.com/mswjs/msw/releases/tag/v0.46.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.45.0...v0.46.0)
#### v0.46.0 (2022-08-31)
##### Features
- fix a typo in the worker script ([`62f7c4d`](https://togithub.com/mswjs/msw/commit/62f7c4d885c73c7401af85ca2e5da2db9f2cf212))
- support typescript v4.8 ([#1375](https://togithub.com/mswjs/msw/issues/1375)) ([`631f629`](https://togithub.com/mswjs/msw/commit/631f6297979e0b398d1353963ad7b4166e53f40c))
- add "listHandlers" method to server and worker ([#1369](https://togithub.com/mswjs/msw/issues/1369)) ([`18f5778`](https://togithub.com/mswjs/msw/commit/18f57789f6ff620c0b1c2ee472673eb85d0575c9))
```js
server.listHandlers()
worker.listHandlers()
```
### [`v0.45.0`](https://togithub.com/mswjs/msw/releases/tag/v0.45.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.44.2...v0.45.0)
#### v0.45.0 (2022-08-22)
##### Features
- make GraphQL a peer dependency, support GraphQL v15.0 ([#1356](https://togithub.com/mswjs/msw/issues/1356)) ([`ca0e2e0`](https://togithub.com/mswjs/msw/commit/ca0e2e074d8156a6cbd212501e28130b9118f824))
### [`v0.44.2`](https://togithub.com/mswjs/msw/releases/tag/v0.44.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.44.1...v0.44.2)
#### v0.44.2 (2022-07-19)
##### Bug Fixes
- transfer mocked response as ArrayBuffer to the worker ([#1337](https://togithub.com/mswjs/msw/issues/1337)) ([`95be5f8`](https://togithub.com/mswjs/msw/commit/95be5f8ac1c0f02b2d4b5e6e0dd02d2cf7342008))
### [`v0.44.1`](https://togithub.com/mswjs/msw/releases/tag/v0.44.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.44.0...v0.44.1)
#### v0.44.1 (2022-07-14)
##### Bug Fixes
- super call stack overflow ([#1328](https://togithub.com/mswjs/msw/issues/1328)) ([`6a3f442`](https://togithub.com/mswjs/msw/commit/6a3f442bdea1d4ba615020ccece22a9e091e5f3c))
### [`v0.44.0`](https://togithub.com/mswjs/msw/releases/tag/v0.44.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.43.1...v0.44.0)
#### v0.44.0 (2022-07-13)
##### Breaking changes
- `req.destination` default value is now `""` (empty string), previously `"document"`.
- `req.redirect` default value is now `""follow"`, previously `"manual"`.
- The library no longer exports the `parseIsomorphicRequest()` function ([#1316](https://togithub.com/mswjs/msw/issues/1316)). Please use `MockedRequest` class instead.
##### Features
- adhere to [Fetch API "Request"](https://developer.mozilla.org/en-US/docs/Web/API/Request) in response resolver ([#1316](https://togithub.com/mswjs/msw/issues/1316), [@95th](https://togithub.com/95th)) ([`fc7f00c`](https://togithub.com/mswjs/msw/commit/fc7f00c96e79ad0be83cbaf7c82ceff23f0c4355)). This means the addition of a few properties on the `req` instance:
- [`req.priority`](https://developer.mozilla.org/en-US/docs/Web/API/Request/priority), indicates a priority of request relatively to other requests (default `"auto"`);
- [`req.text()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/text), reads the request body as plain text;
- [`req.json()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/json), reads the request body as JSON;
- [`req.arrayBuffer()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/arrayBuffer), reads the request body as `ArrayBuffer`;
- [`req.clone()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/clone), clones a request instance (i.e. so its body could be read multiple times).
- remove unnecessary stringification of worker-client messages ([#1320](https://togithub.com/mswjs/msw/issues/1320)) ([`6990c3a`](https://togithub.com/mswjs/msw/commit/6990c3a57a1f515fe977c2eaa7741005b885b8af))
##### Deprecations
- **`req.body` is deprecated**. Please use explicit request body reading methods: `req.text()`, `req.json()`, `req.arrayBuffer()` (other methods, like `req.formData()` are currently not supported).
```js
rest.post('/user', async (req, res, ctx) => {
const newUser = await req.json()
})
```
> `req.body` is still present for compatibility reasons but will be removed in the next releases.
### [`v0.43.1`](https://togithub.com/mswjs/msw/releases/tag/v0.43.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.43.0...v0.43.1)
#### v0.43.1 (2022-07-07)
##### Bug Fixes
- support multiple response cookies using "ctx.cookie()" ([#1311](https://togithub.com/mswjs/msw/issues/1311)) ([`66c3ad8`](https://togithub.com/mswjs/msw/commit/66c3ad888058f92db7dc94ad9d1c408a4ea9e14f))
### [`v0.43.0`](https://togithub.com/mswjs/msw/releases/tag/v0.43.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.3...v0.43.0)
#### v0.43.0 (2022-07-04)
##### Features
- send mocked response body as ReadableStream to the worker ([#1288](https://togithub.com/mswjs/msw/issues/1288)) ([`78c7d7e`](https://togithub.com/mswjs/msw/commit/78c7d7eee84b961eb29b2591bd78f81e0c48deef))
### [`v0.42.3`](https://togithub.com/mswjs/msw/releases/tag/v0.42.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.2...v0.42.3)
#### v0.42.3 (2022-06-22)
##### Bug Fixes
- apply response delay conditionally ([#1300](https://togithub.com/mswjs/msw/issues/1300)) ([`496154d`](https://togithub.com/mswjs/msw/commit/496154da7e76007977d0c5e937a79e0fc55ae34b))
### [`v0.42.2`](https://togithub.com/mswjs/msw/releases/tag/v0.42.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.1...v0.42.2)
#### v0.42.2 (2022-06-22)
##### Bug Fixes
- **setupServer:** reference interceptors to support fast refresh ([#1299](https://togithub.com/mswjs/msw/issues/1299)) ([`72f0b25`](https://togithub.com/mswjs/msw/commit/72f0b2516bc2fd0372cd62fc54fcf1f4e0b46b7f))
### [`v0.42.1`](https://togithub.com/mswjs/msw/releases/tag/v0.42.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.0...v0.42.1)
#### v0.42.1 (2022-06-07)
##### Bug Fixes
- add "ctx.field()" for GraphQL responses ([#1257](https://togithub.com/mswjs/msw/issues/1257)) ([`442f48d`](https://togithub.com/mswjs/msw/commit/442f48dd606fca8fa9156785fc0e85e9e9d48793))
### [`v0.42.0`](https://togithub.com/mswjs/msw/releases/tag/v0.42.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.41.1...v0.42.0)
#### v0.42.0 (2022-05-30)
##### Features
- upgrade to [@mswjs/interceptors](https://togithub.com/mswjs/interceptors) 0.16 ([#1262](https://togithub.com/mswjs/msw/issues/1262)) ([`2176577`](https://togithub.com/mswjs/msw/commit/2176577bebda3b6e3a3f6027f4f0ebe2974af86a))
##### Bug Fixes
- remove "esm" build target ([#1263](https://togithub.com/mswjs/msw/issues/1263)) ([`61a755a`](https://togithub.com/mswjs/msw/commit/61a755a4b2672187847bfaf95f99b5f984c64854))
### [`v0.41.1`](https://togithub.com/mswjs/msw/releases/tag/v0.41.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.41.0...v0.41.1)
#### v0.41.1 (2022-05-27)
##### Bug Fixes
- support typescript 4.7 ([#1256](https://togithub.com/mswjs/msw/issues/1256)) ([`b020270`](https://togithub.com/mswjs/msw/commit/b02027005969c70fd414df1d45def9ebed1a88c3))
### [`v0.41.0`](https://togithub.com/mswjs/msw/releases/tag/v0.41.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.40.2...v0.41.0)
#### v0.41.0 (2022-05-22)
##### Features
- improve module formats (cjs, esm, iife) ([#1247](https://togithub.com/mswjs/msw/issues/1247)) ([`00e9c58`](https://togithub.com/mswjs/msw/commit/00e9c58c242d77fc5ce7966ce6e289b0a7e2cf0e))
### [`v0.40.2`](https://togithub.com/mswjs/msw/releases/tag/v0.40.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.40.1...v0.40.2)
#### v0.40.2 (2022-05-20)
##### Bug Fixes
- support typescript 4.4.x, 4.5.x, 4.6.x ([#1245](https://togithub.com/mswjs/msw/issues/1245)) ([`5378416`](https://togithub.com/mswjs/msw/commit/5378416792be4f0d573149290f920e10ffdd2c61))
### [`v0.40.1`](https://togithub.com/mswjs/msw/releases/tag/v0.40.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.40.0...v0.40.1)
#### v0.40.1 (2022-05-19)
##### Bug Fixes
- support typescript 4.3.x ([#1244](https://togithub.com/mswjs/msw/issues/1244)) ([`3bca5be`](https://togithub.com/mswjs/msw/commit/3bca5be178cf719b7776654b6875baba664af5af))
### [`v0.40.0`](https://togithub.com/mswjs/msw/releases/tag/v0.40.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.39.2...v0.40.0)
#### v0.40.0 (2022-05-17)
##### Breaking changes
- Returning `undefined`, or early returns, from response resolvers, now does not perform request as-is, and is instead treated as a handler that didn't do anything. Please return [`req.passthrough()`](https://mswjs.io/docs/api/request/passthrough) if you wish to bypass a request.
```diff
rest.get('/resource', (req, res, ctx) => {
// I want to perform this intercepted request as-is.
- return
+ return req.passthrough()
})
```
##### Features
- add "unhandledException" life-cycle event ([#1199](https://togithub.com/mswjs/msw/issues/1199)) ([`5c90799`](https://togithub.com/mswjs/msw/commit/5c9079904202bf968c0f7c3c8da0fa68173ce7b4))
- improve PathParams type to support interface ([#1219](https://togithub.com/mswjs/msw/issues/1219)) ([`b70266f`](https://togithub.com/mswjs/msw/commit/b70266f4da5baa94e746fa56d9cd02594304799d))
- rename "DefaultRequestBody" to "DefaultBodyType" ([`53aa3a1`](https://togithub.com/mswjs/msw/commit/53aa3a1c755685a56ae240ebc0f1fe2d3468527a))
- add "req.passthrough" ([#1204](https://togithub.com/mswjs/msw/issues/1204)) ([`4e1b1ad`](https://togithub.com/mswjs/msw/commit/4e1b1ad87a87240d7ff6ff9f07fee3521e23435d))
- add service worker scope and worker script URL to "Mocking enabled" message ([#1172](https://togithub.com/mswjs/msw/issues/1172)) ([`ab3d399`](https://togithub.com/mswjs/msw/commit/ab3d3996728985bc4d1c8c820eb91e9e5a3d9378))
- set "typescript" optional peer dependency to 4.2.x ([#985](https://togithub.com/mswjs/msw/issues/985)) ([`b1004a6`](https://togithub.com/mswjs/msw/commit/b1004a6d89bd737cb8784c937298120d95ce364e))
##### Bug Fixes
- **setupWorker:** warn on multiple "worker.start" and "worker.stop" calls ([#1238](https://togithub.com/mswjs/msw/issues/1238)) ([`cfe0709`](https://togithub.com/mswjs/msw/commit/cfe07099587827b8e482015e47ba2d1a49119cd2))
- remove console.log from "setRequestCookies" ([`6f7ed98`](https://togithub.com/mswjs/msw/commit/6f7ed98cfcbfc20c614c6f1e5b1fe0da9010ed62))
- set "credentials" to "same-origin" for "ClientRequest" ([#1159](https://togithub.com/mswjs/msw/issues/1159)) ([`c3cd80a`](https://togithub.com/mswjs/msw/commit/c3cd80a724eacae897a2d06fbec0eb9107be525c))
### [`v0.39.2`](https://togithub.com/mswjs/msw/releases/tag/v0.39.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.39.1...v0.39.2)
##### Bug Fixes
- **parseIsomorphicRequest:** bypassing cookies properly ([#1155](https://togithub.com/mswjs/msw/issues/1155)) ([755bc9d](https://togithub.com/mswjs/msw/commit/755bc9d57f6dc1a6cf2aa5285eb189f4cee66f43))
- set "credentials" to "same-origin" for "ClientRequest" ([#1159](https://togithub.com/mswjs/msw/issues/1159)) ([c3cd80a](https://togithub.com/mswjs/msw/commit/c3cd80a724eacae897a2d06fbec0eb9107be525c))
- set minimal supported Node.js version to 14 ([#1160](https://togithub.com/mswjs/msw/issues/1160)) ([d7ab139](https://togithub.com/mswjs/msw/commit/d7ab1399e986167ff036312ea59c978f419a9b72))
### [`v0.39.1`](https://togithub.com/mswjs/msw/releases/tag/v0.39.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.39.0...v0.39.1)
##### Bug Fixes
- add fallback for "\_defaultAgent" in ClientRequest ([#1152](https://togithub.com/mswjs/msw/issues/1152)) ([21fcbc5](https://togithub.com/mswjs/msw/commit/21fcbc5b75e66eab01193ebbc8876818c16d84dc))
### [`v0.39.0`](https://togithub.com/mswjs/msw/releases/tag/v0.39.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.38.2...v0.39.0)
##### Breaking changes
- require node 16 and higher ([#1136](https://togithub.com/mswjs/msw/issues/1136)) ([6f4895e](https://togithub.com/mswjs/msw/commit/6f4895e9a37d1ae0d6eaafb04e17afcdefc3c2d3))
##### Bug Fixes
- **setupWorker:** resolve the "start" promise after the worker has activated ([#1146](https://togithub.com/mswjs/msw/issues/1146)) ([f6e709c](https://togithub.com/mswjs/msw/commit/f6e709c3c7d1ac60f99cac6699e83565d8401cd0))
### [`v0.38.2`](https://togithub.com/mswjs/msw/releases/tag/v0.38.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.38.1...v0.38.2)
##### Bug Fixes
- update [@mswjs/interceptors](https://togithub.com/mswjs/interceptors) to 0.13.5 ([#1127](https://togithub.com/mswjs/msw/issues/1127)) ([1b59ab7](https://togithub.com/mswjs/msw/commit/1b59ab76f37768f37c578b9b6370b90fefdd43b4))
### [`v0.38.1`](https://togithub.com/mswjs/msw/releases/tag/v0.38.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.38.0...v0.38.1)
##### Bug Fixes
- **handleRequest:** bypass request only if "x-msw-bypass" header equals "true" ([#1110](https://togithub.com/mswjs/msw/issues/1110)) ([1a7bc36](https://togithub.com/mswjs/msw/commit/1a7bc36d98e0fa0d0fa1c9da6d7dd40605f239ca))
### [`v0.38.0`](https://togithub.com/mswjs/msw/releases/tag/v0.38.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.8...v0.38.0)
##### Features
- update to [@mswjs/interceptors](https://togithub.com/mswjs/interceptors) 0.13.3 ([#1095](https://togithub.com/mswjs/msw/issues/1095)) ([e288d18](https://togithub.com/mswjs/msw/commit/e288d18d17026d6ba28a53f7af20c0694e276ae6)), closes [#1102](https://togithub.com/mswjs/msw/issues/1102)
- allow default behavior of `onUnhandledRequest` in a custom callback ([https://github.com/mswjs/msw/pull/1096](https://togithub.com/mswjs/msw/pull/1096)):
```js
worker.start({
onUnhandledRequest(request, print) {
// Ignore unhandled warnings/errors from asset requests.
if (request.url.href.includes('/assets/') {
return
}
// Otherwise, execute the default warning/error/ strategy.
print.warning() // or "print.error()"
}
})
```
### [`v0.36.8`](https://togithub.com/mswjs/msw/releases/tag/v0.36.8)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.7...v0.36.8)
##### Bug Fixes
- allow variables inference in GraphQLRequest ([#1081](https://togithub.com/mswjs/msw/issues/1081)) ([6e7ec28](https://togithub.com/mswjs/msw/commit/6e7ec2871f5f82fbf228b803df565286b1d4dbfc))
### [`v0.36.7`](https://togithub.com/mswjs/msw/releases/tag/v0.36.7)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.5...v0.36.7)
##### Bug Fixes
- update "[@mswjs/cookies](https://togithub.com/mswjs/cookies)" for safe `localStorage` access ([#1071](https://togithub.com/mswjs/msw/issues/1071)) ([99ae530](https://togithub.com/mswjs/msw/commit/99ae530b75b5f4ca416311ffd7658143e99575d1))
- update `node-fetch` to 2.6.7 to fix a security vulnerability ([#1072](https://togithub.com/mswjs/msw/issues/1072)) ([72a34f6](https://togithub.com/mswjs/msw/commit/72a34f673b2612aab5138a396440f8cd30ded820))
### [`v0.36.5`](https://togithub.com/mswjs/msw/releases/tag/v0.36.5)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.4...v0.36.5)
##### Bug Fixes
- parse request body with letter case `Content-Type` header value ([#1064](https://togithub.com/mswjs/msw/issues/1064)) ([7796418](https://togithub.com/mswjs/msw/commit/7796418cba8087d08b8a6bf476c2b272b6888607))
### [`v0.36.4`](https://togithub.com/mswjs/msw/releases/tag/v0.36.4)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.3...v0.36.4)
#### Bug fixes
- Fixes an issue that resulted in port numbers being treated as path parameters ([#1036](https://togithub.com/mswjs/msw/issues/1036), [#1028](https://togithub.com/mswjs/msw/issues/1028)).
### [`v0.36.3`](https://togithub.com/mswjs/msw/releases/tag/v0.36.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.2...v0.36.3)
### Bug fixes
- Fixes an issue that resulted in the CORS policy violation due to the library appending the `x-msw-request-id` request header ([#713](https://togithub.com/mswjs/msw/issues/713), [#1022](https://togithub.com/mswjs/msw/issues/1022), [#1024](https://togithub.com/mswjs/msw/issues/1024)).
#### Internal
- No longer sets the `x-msw-request-id` header on the request ([#1024](https://togithub.com/mswjs/msw/issues/1024)). Relies on the `request.id` set by the interceptors (Node.js) or the `requestId` generated by the worker (browser).
### [`v0.36.2`](https://togithub.com/mswjs/msw/releases/tag/v0.36.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.1...v0.36.2)
#### Bug fixes
- Fixes an issue that resulted in the "TypeError: expected.toLowerCase() is not a function" exception when using the `rest.all()` request handler ([#1020](https://togithub.com/mswjs/msw/issues/1020), [#1021](https://togithub.com/mswjs/msw/issues/1021)).
### [`v0.36.1`](https://togithub.com/mswjs/msw/releases/tag/v0.36.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.0...v0.36.1)
#### Bug fixes
- Fixes an issue that resulted in the "SyntaxError: Invalid group specified name" exception in Safari ([#1018](https://togithub.com/mswjs/msw/issues/1018), [#1019](https://togithub.com/mswjs/msw/issues/1019) ).
### [`v0.36.0`](https://togithub.com/mswjs/msw/releases/tag/v0.36.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.35.0...v0.36.0)
##### Breaking changes
- Uses [path-to-regexp](https://www.npmjs.com/package/path-to-regexp) for URL matching ([#691](https://togithub.com/mswjs/msw/issues/691), [#888](https://togithub.com/mswjs/msw/issues/888)). This makes the path matching experience identical to such in ExpressJS, and enabled various new features:
- Optional path segments (`/foo/bar?`);
- Repeating groups (`/foo/bar+`).
- Request path parameters are now annotated as ambiguous `string | string[]` ([#999](https://togithub.com/mswjs/msw/issues/999)).
- The `RequestParams` generic now follows the `RequestBodyType` generic, changing its order ([#999](https://togithub.com/mswjs/msw/issues/999)):
```ts
rest.post() {}
```
- Removes the `RequestParams` type ([#999](https://togithub.com/mswjs/msw/issues/999)). Please use the `PathParams` type instead.
```diff
- import { RequestParams } from 'msw'
+ import { PathParams } from 'msw'
```
- Relative requests are now resolved against `document.baseURI` (previously `location.origin`) in a browser-like environments ([#1007](https://togithub.com/mswjs/msw/issues/1007), [#1008](https://togithub.com/mswjs/msw/issues/1008)).
##### Features
- Adds a new `rest.all()` request handler ([#896](https://togithub.com/mswjs/msw/issues/896)). This handler captures all REST API requests regardless of method.
```js
import { rest } from 'msw'
rest.all('/api/*', (req, res, ctx) => {
// Intercepts all requests to "/api/*"
// regardless of their method.
})
```
- Supports encoded request path components ([#980](https://togithub.com/mswjs/msw/issues/980)).
- Supports mocking GraphQL extensions ([#981](https://togithub.com/mswjs/msw/issues/981)).
```js
graphql.query('GetUser', (req, res, ctx) => {
return res(
ctx.extensions({
message: 'Mocked extension',
tracking: { version: '1.2.3' }
})
)
})
```
- Exports `SetupWorkerApi` and `SetupServerApi` from the browser and Node.js modules respectively ([#994](https://togithub.com/mswjs/msw/issues/994)).
##### Bug fixes
- Specifies `typescript` as a `peerDependency` to control supported TypeScript versions ([#985](https://togithub.com/mswjs/msw/issues/985)).
- Fixes an issue that resulted in `graphql.operation` handler producing a warning unable to intercept anonymous operations ([#918](https://togithub.com/mswjs/msw/issues/918), [#904](https://togithub.com/mswjs/msw/issues/904)).
- Locks `inquirer` dependency version to 8.1.5 to propagate the fix for the `Unexpected token “?”` issue when using MSW CLI ([#917](https://togithub.com/mswjs/msw/issues/917)).
- Fixes an issue that resulted in the `TypeError: Failed to execute 'XXX' on 'Response': body stream already read` error when reading the original response body in the fallback mode ([https://github.com/mswjs/interceptors/pull/152](https://togithub.com/mswjs/interceptors/pull/152)).
##### Internal
- Lists `@mswjs/cookies` and `@mswjs/interceptors` as external packages so that their updates propagate to you automatically upon new installations of `msw`.
- Updates dependencies.
### [`v0.35.0`](https://togithub.com/mswjs/msw/compare/v0.34.0...v0.35.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.34.0...v0.35.0)
### [`v0.34.0`](https://togithub.com/mswjs/msw/compare/v0.33.3...v0.34.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.33.3...v0.34.0)
### [`v0.33.3`](https://togithub.com/mswjs/msw/compare/v0.33.2...v0.33.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.33.2...v0.33.3)
### [`v0.33.2`](https://togithub.com/mswjs/msw/compare/v0.33.1...v0.33.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.33.1...v0.33.2)
### [`v0.33.1`](https://togithub.com/mswjs/msw/compare/v0.33.0...v0.33.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.33.0...v0.33.1)
### [`v0.33.0`](https://togithub.com/mswjs/msw/compare/v0.32.3...v0.33.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.32.3...v0.33.0)
### [`v0.32.3`](https://togithub.com/mswjs/msw/compare/v0.32.2...v0.32.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.32.2...v0.32.3)
### [`v0.32.2`](https://togithub.com/mswjs/msw/compare/v0.32.1...v0.32.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.32.1...v0.32.2)
### [`v0.32.1`](https://togithub.com/mswjs/msw/compare/v0.32.0...v0.32.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.32.0...v0.32.1)
### [`v0.32.0`](https://togithub.com/mswjs/msw/compare/v0.31.0...v0.32.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.31.0...v0.32.0)
### [`v0.31.0`](https://togithub.com/mswjs/msw/compare/v0.30.1...v0.31.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.30.1...v0.31.0)
### [`v0.30.1`](https://togithub.com/mswjs/msw/compare/v0.30.0...v0.30.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.30.0...v0.30.1)
### [`v0.30.0`](https://togithub.com/mswjs/msw/compare/v0.29.0...v0.30.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.29.0...v0.30.0)
### [`v0.29.0`](https://togithub.com/mswjs/msw/compare/v0.28.2...v0.29.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.28.2...v0.29.0)
### [`v0.28.2`](https://togithub.com/mswjs/msw/releases/tag/v0.28.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.28.1...v0.28.2)
##### Bug fixes
- Fixes an issue when `req.params` was `undefined` in case when request path had no parameters present ([#682](https://togithub.com/mswjs/msw/issues/682), [#684](https://togithub.com/mswjs/msw/issues/684)). The `req.params` value is always an object, regardless if you have path parameters defined.
### [`v0.28.1`](https://togithub.com/mswjs/msw/releases/tag/v0.28.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.28.0...v0.28.1)
##### Bug fixes
- Fixes the issue that resulted in the "Cannot read property 'id' of undefined" in iframe scenarios ([#643](https://togithub.com/mswjs/msw/issues/643), [#645](https://togithub.com/mswjs/msw/issues/645)).
- Fixes the issue when making an explicit return in a handler considered the request unhandled in Node.js ([#655](https://togithub.com/mswjs/msw/issues/655), [#672](https://togithub.com/mswjs/msw/issues/672)).
- Fixes the issue that resulted in a multipart form data not being parsed correctly given extra spaces or the lack of such in the `Content-Type` header ([#671](https://togithub.com/mswjs/msw/issues/671)).
### [`v0.28.0`](https://togithub.com/mswjs/msw/releases/tag/v0.28.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.27.2...v0.28.0)
##### Breaking changes
- The `response` instance in the life-cycle events now handles `response.headers` as the `Headers` instance ([#660](https://togithub.com/mswjs/msw/issues/660)).
```diff
server.on('response:bypass', (res) => {
- res.headers['content-type']
+ res.headers.get('content-type')
})
```
- Calling `setupServer` no longer applies request interception immediately. Instead, it's applied when called `server.listen()` ([#660](https://togithub.com/mswjs/msw/issues/660)).
##### Bug fixes
- Fixes the order of events in the intercepted `XMLHttpRequest` in Node.js ([https://github.com/mswjs/interceptors/pull/102](https://togithub.com/mswjs/interceptors/pull/102)).
- Fixes an issue that resulted in the "TypeError \[ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"" exception when using MSW with `superagent` ([#632](https://togithub.com/mswjs/msw/issues/632)).
##### Internal
- Updates dependencies ([@mswjs/interceptors](https://togithub.com/mswjs/interceptors), headers-utils).
### [`v0.27.2`](https://togithub.com/mswjs/msw/releases/tag/v0.27.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.27.1...v0.27.2)
##### Bug fixes
- Fixes a backward-compatibility issue of the `DropFirstInTuple` type used internally in `compose.ts` ([#658](https://togithub.com/mswjs/msw/issues/658)).
- Fixes an issue in IE11 when retrieving a stack trace of a handler would throw an exception ([#647](https://togithub.com/mswjs/msw/issues/647)).
- Fixes an issue when a stream in a response body would cause a response timeout ([#602](https://togithub.com/mswjs/msw/issues/602)).
- Fixes an issue when a cookie retrieval would cause a Fast Refresh to break in Next.js ([#649](https://togithub.com/mswjs/msw/issues/649)).
### [`v0.27.1`](https://togithub.com/mswjs/msw/releases/tag/v0.27.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.27.0...v0.27.1)
#### Changes
- Exports the `RestHandler` class publicly.
#### Bug fixes
- Fixes an issue that caused a `Uncaught ReferenceError: process is not defined` exception when calling `worker.start()` ([#609](https://togithub.com/mswjs/msw/issues/609), [#629](https://togithub.com/mswjs/msw/issues/629)).
- Fixes an issue that caused a TypeScript violation in the ` PickLastInTuple ` type ([#615](https://togithub.com/mswjs/msw/issues/615), [#627](https://togithub.com/mswjs/msw/issues/627)).
- Fixes an issue that caused an `TypeError: Object.fromEntries is not a function` error when running MSW in Node.js v10 ([#625](https://togithub.com/mswjs/msw/issues/625), [#633](https://togithub.com/mswjs/msw/issues/633)).
#### Internals
- **Updates to `typescript@4.2.2`**
### [`v0.27.0`](https://togithub.com/mswjs/msw/releases/tag/v0.27.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.26.2...v0.27.0)
#### Breaking changes
- The Promise returned by `worker.start()` will now reject in the case of any errors during the worker registration ([#607](https://togithub.com/mswjs/msw/issues/607)).
- The library no longer exports the following TypeScript declarations:
- `RestRequestType`, use `RestRequest` instead.
- `GraphQLMockedRequest`, use `GraphQLRequest` instead.
- `GraphQLMockedContext`, use `GraphQLContext` instead.
- `GraphQLRequestPayload`, use `GraphQLRequestBody` instead.
- `GraphQLRequestParsedResult`, use `ParsedGraphQLRequest` instead.
- `GraphQLResponseResolver`
- The values of the `MockedRequest` type no longer have the `params` key ([#561](https://togithub.com/mswjs/msw/issues/561)). Please use the `RestRequest` type to annotate REST API requests instead.
#### Features
- **Supports automatic worker script updates** ([#606](https://togithub.com/mswjs/msw/issues/606)). Respects the `msw.workerDirectory` property in your package.json:
```json
{
"msw": {
"workerDirectory": "public"
}
}
```
Starting from this release, whenever you install `msw`, it will try to locate the `msw.workerDirectory` property in your package.json and copy the relevant worker script (`mockServiceWorker.js`) to that directory.
Whenever running `msw init` now, you will be prompted to save your public directory choice to package.json.
- When running `msw init` you can pass the ` —save `option to automatically save the public directory in your package.json for future worker updates ([#606](https://togithub.com/mswjs/msw/issues/606)). You can alternatively use `--no-save` to bail out this step.
- **Intercepts requests originating from an iframe** ([#589](https://togithub.com/mswjs/msw/issues/589)).
- Adds virtual cookie store to ensure the persistency of cookies received from the same domains across multiple requests ([#435](https://togithub.com/mswjs/msw/issues/435), [#469](https://togithub.com/mswjs/msw/issues/469)).
#### Bug fixes
- Fixes an issue when a request body type generic had no effect on the response composition chain validation.
- Fixes an issue when a 204 response threw an exception when the library emitted its `response:*` life-cycle events ([#570](https://togithub.com/mswjs/msw/issues/570)).
#### Internal
- **Rebuilds the Request Handler API from ground-up** ([#561](https://togithub.com/mswjs/msw/issues/561)). Does not introduce any breaking changes in how you use the handlers.
- Fixes the auto-imports of the library’s methods suggested by IDE ([#598](https://togithub.com/mswjs/msw/issues/598)).
- Updates the dependencies.
### [`v0.26.2`](https://togithub.com/mswjs/msw/releases/tag/v0.26.2)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.26.1...v0.26.2)
##### Bug fixes
- Fixes an issue that resulted in GraphQL request handlers not annotating the mocked response structure based on the given generic type ([#587](https://togithub.com/mswjs/msw/issues/587)).
- Fixes an issue when a one-time request handler (`res.once`) affected multiple matching requests made in parallel ([#583](https://togithub.com/mswjs/msw/issues/583)).
- Properly exports the renamed `OnUnhandledRequest` type as the new `UnhandledRequestStrategy` type ([#577](https://togithub.com/mswjs/msw/issues/577)).
### [`v0.26.1`](https://togithub.com/mswjs/msw/releases/tag/v0.26.1)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.26.0...v0.26.1)
##### Features
- `onUnhandledRequest` option will now suggest similar request handlers based on the URL/operation name similarity ([#560](https://togithub.com/mswjs/msw/issues/560)).
##### Bug fixes
- Fixes an issue that resulted in a 202 status response throwing an exception when the library attempted to re-create its `Response` instance for the `response:*` life-cycle event ([#570](https://togithub.com/mswjs/msw/issues/570)).
- Fixes an issue when a request handler stack trace wasn't handled properly on Windows machines ([#566](https://togithub.com/mswjs/msw/issues/566)).
- Fixes an issue when using the `onUnhandledRequest: "error"` option resulted in a thrown exception being gracefully handled by Axios ([#544](https://togithub.com/mswjs/msw/issues/544)). The `"error"` value now prints to `stderr` directly instead of throwing an exception. An original request-related exception will become visible now as well.
### [`v0.26.0`](https://togithub.com/mswjs/msw/releases/tag/v0.26.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.25.0...v0.26.0)
> This release introduces changes to the `mockServiceWorker.js` file. **Please follow the instructions in the browser to update the worker file.** Thank you.
##### Features
- Adds support for GraphQL upload and multipart data operations ([#215](https://togithub.com/mswjs/msw/issues/215), [#543](https://togithub.com/mswjs/msw/issues/543)).
- Adds delay modes: “real” and “infinite” ([#538](https://togithub.com/mswjs/msw/issues/538)). Supports infinite loading.
```js
ctx.delay() // random realistic response time
ctx.delay('real') // the same as `ctx.delay()`
ctx.delay('infinite') // infinite response time
ctx.delay(50) // explicit response delay (50ms)
```
- Displays `[MSW] Mocking disabled` message when calling `worker.stop()`. ([#485](https://togithub.com/mswjs/msw/issues/485), [#493](https://togithub.com/mswjs/msw/issues/493)).
##### Bug fixes
- Fixes an issue that resulted in the`Failed to construct 'Response': The status provided (0) is outside the range [200, 599].` exception caused by an opaque response on the page ([#529](https://togithub.com/mswjs/msw/issues/529), [#564](https://togithub.com/mswjs/msw/issues/564)). MSW will now skip opaque responses during the life-cycle events handling. **You will not get the `response:bypass` invoked upon an opaque response.**
- Fixes an issue that resulted in an exception being thrown when handling subsequent requests in Safari ([#558](https://togithub.com/mswjs/msw/issues/558), [#565](https://togithub.com/mswjs/msw/issues/565)).
- Fixes an issue when the `ExecutionResult` of `graphql` was not compatible with `ctx.data` and `ctx.errors` utilities ([#522](https://togithub.com/mswjs/msw/issues/522), [#542](https://togithub.com/mswjs/msw/issues/542)).
- Fixes an issue that resulted in the MSW worker handling unrelated message event originating from other tools ([#551](https://togithub.com/mswjs/msw/issues/551)).
##### Internal
- Updates dependencies to their latest versions.
- Consistently uses `self` instead of `this` in the worker script ([#568](https://togithub.com/mswjs/msw/issues/568)).
- Ensures that MSW doesn’t handle events originating from unrelated workers ([#551](https://togithub.com/mswjs/msw/issues/551)).
### [`v0.25.0`](https://togithub.com/mswjs/msw/releases/tag/v0.25.0)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.24.4...v0.25.0)
##### Features
- Adds Life-cycle events API ([#482](https://togithub.com/mswjs/msw/issues/482), [docs](https://mswjs.io/docs/extensions/life-cycle-events)).
### [`v0.24.4`](https://togithub.com/mswjs/msw/releases/tag/v0.24.4)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.24.3...v0.24.4)
#### Features
- Exports the `RestContext` type interface for public consumption ([#524](https://togithub.com/mswjs/msw/issues/524)).
### [`v0.24.3`](https://togithub.com/mswjs/msw/releases/tag/v0.24.3)
[Compare Source](https://togithub.com/mswjs/msw/compare/v0.24.2...v0.24.3)
##### Features
- Publishes the library in IIFE format, allowing to use it from a ` Githubissues.
Githubissues is a development platform for aggregating issues.
This PR contains the following updates:
0.0.0-fetch.rc-20
->2.0.0
Release Notes
mswjs/msw (msw)
### [`v2.0.0`](https://togithub.com/mswjs/msw/releases/tag/v2.0.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.3.2...v2.0.0) #### v2.0.0 (2023-10-23) > \[!IMPORTANT] > **This release is a BREAKING CHANGE**. Please follow the [Migration guidelines](https://mswjs.io/docs/migrations/1.x-to-2.x) to upgrade. This release took a lot of effort to make, and I expect a bit of that effort on your part while upgrading. Most of the changes are mechanical, and a simple Find/Replace All will get you a long way. For the rest of it, you will learn how to handle requests and responses using the standard JavaScript API. Thank you! #### Breaking changes - **Drops support for Node.js 16**. Please upgrade to Node.js 18 or later to use the global Fetch API. - **Drops support for TypeScript `< 4.7`.** - All browser-side exports, like `setupWorker`, `SetupWorkerApi`, etc., must be imported from `msw/browser` now. - Renames the `rest` object to `http` (`rest.get` -> `http.get`). - Response resolver call signature is no longer `(req, res, ctx) => res()` but instead `({ request }) => new Response()`. - The following exports are removed due to no longer being needed: - `response` - `context` and related exports (`defaultContext`, `restContext`, `graphqlContext`). - `compose` and `createResponseComposition` - `res.once()` is removed in favor of the `{ once: boolean }` option on the request handler. - Replaces the `.printHandlers()` method with `.listHandlers()`. - Removes the `NetworkError` class in favor of the standard `Response.error()`. - Moves request error handling from the worker thread to the client thread. - Changes the call signature of the Life-cycle Events API to accept a single object argument. - Uses `crypto.randomUUID()` instead of `Math.random()` in the worker. - **For the full list of changes and detailed instructions on how to upgrade please see the [Migration guidelines](docs/migrations/1.x-to-2.x).** #### Features - **Adopts Fetch API primitives**. Represent intercepted requests and mocked responses as `Request` and `Response` instances respectively. - **Supports Node.js v18**. - Supports `ReadableStream` as a mocked response body. - Supports reading the intercepted request body as `FormData`. - Supports `FormData` as a mocked response body. - Uses `File` polyfill in Node.js. - Supports XMLHttpRequest “upload” events when responding with a mocked stream response. - Allows mocking a network error once using the `{ once: true }` request handler option. - Makes the `RequestHandler` API public. #### Bug fixes - Fixes the issue where the request body couldn’t be properly read as `FormData`. - Fixes a set of issues related to response patching when using the `FormData` response body. - Fixes the issue where `URLSearchParams` as the request body couldn’t be read. - Fixes the issue where a bypassed request’s `referrerPolicy` was reset to a different value than the original. - Fixes the wrong order of `XMLHttpRequest` events and `readyState` changes. - Fixes the issue when reading an XMLHttpRequest body of `responseType` equal to `"arraybuffer"` as an incorrect buffer (previously, always assumed to be a string). - Fixes the order of `XMLHttpRequest` events when the request fails. - Keeps XMLHttpRequest `status` equal to 0 until the request actually resolves. - Fixes the issue when the `onload` event callback was called twice for `XMLHttpRequest`. - Various improvements in Node.js network behavior compliance. [@dbritto-dev](https://togithub.com/dbritto-dev) [@ddolcimascolo](https://togithub.com/ddolcimascolo) [@markwhitfeld](https://togithub.com/markwhitfeld) [@christoph-fricke](https://togithub.com/christoph-fricke) [@thepassle](https://togithub.com/thepassle) [@piotr-cz](https://togithub.com/piotr-cz) [@mattcosta7](https://togithub.com/mattcosta7) [@koddsson](https://togithub.com/koddsson) [@dkobierski](https://togithub.com/dkobierski) [@ricardocosta](https://togithub.com/ricardocosta) [@dxlbnl](https://togithub.com/dxlbnl) [@zkochan](https://togithub.com/zkochan) [@felipefreitag](https://togithub.com/felipefreitag) [@weyert](https://togithub.com/weyert) [@95th](https://togithub.com/95th) [@committomaster](https://togithub.com/committomaster) [@Xayer](https://togithub.com/Xayer) [@Kosai106](https://togithub.com/Kosai106) [@colinsullivan](https://togithub.com/colinsullivan) [@xmlking](https://togithub.com/xmlking) [@thw0rted](https://togithub.com/thw0rted) [@lee-reinhardt](https://togithub.com/lee-reinhardt) [@wKovacs64](https://togithub.com/wKovacs64) [@TeChn4K](https://togithub.com/TeChn4K) [@cmolina](https://togithub.com/cmolina) [@nickrttn](https://togithub.com/nickrttn) [@thomasbertet](https://togithub.com/thomasbertet) [@mscottnelson](https://togithub.com/mscottnelson) [@jonnedeprez](https://togithub.com/jonnedeprez) [@negabaro](https://togithub.com/negabaro) [@the-ult](https://togithub.com/the-ult) [@WesleyYue](https://togithub.com/WesleyYue) [@cwagner22](https://togithub.com/cwagner22) [@skvale](https://togithub.com/skvale) [@alawiii521](https://togithub.com/alawiii521) [@csantos1113](https://togithub.com/csantos1113) [@elliotgonzalez123](https://togithub.com/elliotgonzalez123) [@committomaster](https://togithub.com/committomaster) [@tsteckenborn](https://togithub.com/tsteckenborn) [@xxleyi](https://togithub.com/xxleyi) [@jonnedeprez](https://togithub.com/jonnedeprez) [@danny-does-stuff](https://togithub.com/danny-does-stuff) [@lemcii](https://togithub.com/lemcii) [@mattrodak](https://togithub.com/mattrodak) [@luisr-carrillo](https://togithub.com/luisr-carrillo) [@lee-reinhardt](https://togithub.com/lee-reinhardt) [@ealejandrootalvaro](https://togithub.com/ealejandrootalvaro) [@tomdglenn91](https://togithub.com/tomdglenn91) ### [`v1.3.2`](https://togithub.com/mswjs/msw/releases/tag/v1.3.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.3.1...v1.3.2) #### v1.3.2 (2023-10-01) ##### Bug Fixes - set minimal "graphql" version to 16.18.1 ([#1754](https://togithub.com/mswjs/msw/issues/1754)) ([`0a857f6`](https://togithub.com/mswjs/msw/commit/0a857f67b6e0883336a790633aa9bafc0b16c7cb)) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.3.1`](https://togithub.com/mswjs/msw/releases/tag/v1.3.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.3.0...v1.3.1) #### v1.3.1 (2023-09-13) ##### Bug Fixes - pin "headers-polyfill" to 3.2.5 ([#1736](https://togithub.com/mswjs/msw/issues/1736)) ([`2e53ae7`](https://togithub.com/mswjs/msw/commit/2e53ae73bd734c435ac447ca2b60cdaaebc1390b)) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.3.0`](https://togithub.com/mswjs/msw/releases/tag/v1.3.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.5...v1.3.0) #### v1.3.0 (2023-09-03) ##### Features - support TypeScript 5.2 ([#1711](https://togithub.com/mswjs/msw/issues/1711)) ([`2ca791e`](https://togithub.com/mswjs/msw/commit/2ca791e437256452f63b95cf5ef19c91c7ac0b9a)) [@chentsulin](https://togithub.com/chentsulin) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.2.5`](https://togithub.com/mswjs/msw/releases/tag/v1.2.5) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.4...v1.2.5) #### v1.2.5 (2023-08-28) ##### Bug Fixes - allow installs with any version of pnpm ([#1713](https://togithub.com/mswjs/msw/issues/1713)) ([`d35e851`](https://togithub.com/mswjs/msw/commit/d35e851faa3d75b58b8051084c50b7f02491df84)) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.2.4`](https://togithub.com/mswjs/msw/releases/tag/v1.2.4) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.3...v1.2.4) #### v1.2.4 (2023-08-25) ##### Bug Fixes - **dependency:** unpin the "chalk" dependency ([#1639](https://togithub.com/mswjs/msw/issues/1639)) ([`a93f63b`](https://togithub.com/mswjs/msw/commit/a93f63b345dc46548e42b71954b16b4a87d90fb8)) [@blowery](https://togithub.com/blowery) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.2.3`](https://togithub.com/mswjs/msw/releases/tag/v1.2.3) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.2...v1.2.3) #### v1.2.3 (2023-07-20) ##### Bug Fixes - clone Response before logging ([#1662](https://togithub.com/mswjs/msw/issues/1662)) ([`daa04af`](https://togithub.com/mswjs/msw/commit/daa04af4075b06607b81ed23bbe5ea09d56e8825)) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.2.2`](https://togithub.com/mswjs/msw/releases/tag/v1.2.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.1...v1.2.2) #### v1.2.2 (2023-06-09) ##### Bug Fixes - log `ReadableStream` responses as text/json ([#1622](https://togithub.com/mswjs/msw/issues/1622)) ([`4c7e952`](https://togithub.com/mswjs/msw/commit/4c7e952e69f1a82115fafa695ae39b3169486570)) [@esquevin](https://togithub.com/esquevin) [@kettanaito](https://togithub.com/kettanaito) - support typescript 5.1 as a peer dependency ([#1633](https://togithub.com/mswjs/msw/issues/1633)) ([`8e37d9c`](https://togithub.com/mswjs/msw/commit/8e37d9cbdef16bc6f5c1146a493bfced49657a5d)) [@gthb](https://togithub.com/gthb) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.2.1`](https://togithub.com/mswjs/msw/releases/tag/v1.2.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.2.0...v1.2.1) #### v1.2.1 (2023-03-24) ##### Bug Fixes - update dependencies to support ESM ([#1575](https://togithub.com/mswjs/msw/issues/1575)) ([`e7a6008`](https://togithub.com/mswjs/msw/commit/e7a60081526bd6f00ac17a62c424abf59976555b)) [@kettanaito](https://togithub.com/kettanaito) - update "headers-polyfill" to 3.1.2 to fix the ESM issue ([#1571](https://togithub.com/mswjs/msw/issues/1571)) ([`4f44f11`](https://togithub.com/mswjs/msw/commit/4f44f115e28d35ff137c7ccf886c0029399b5d30)) [@cstenglein](https://togithub.com/cstenglein) ### [`v1.2.0`](https://togithub.com/mswjs/msw/releases/tag/v1.2.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.1.1...v1.2.0) #### v1.2.0 (2023-03-22) ##### Features - add `operationName` to GraphQL request ([#1568](https://togithub.com/mswjs/msw/issues/1568)) ([`115b435`](https://togithub.com/mswjs/msw/commit/115b435aef089a3c4fe9a618d5756c9cb944fe13)) [@ligaz](https://togithub.com/ligaz) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.1.1`](https://togithub.com/mswjs/msw/releases/tag/v1.1.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.1.0...v1.1.1) #### v1.1.1 (2023-03-20) ##### Bug Fixes - **typescript:** support typescript 5.0 ([#1566](https://togithub.com/mswjs/msw/issues/1566)) ([`c0616d1`](https://togithub.com/mswjs/msw/commit/c0616d1473d168018ad8bba7194f8654a6ed153a)) [@mattcosta7](https://togithub.com/mattcosta7) ### [`v1.1.0`](https://togithub.com/mswjs/msw/releases/tag/v1.1.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.0.1...v1.1.0) ##### v1.1.0 (2023-02-24) ##### Features - support global fetch in Node.js ([#1543](https://togithub.com/mswjs/msw/issues/1543)) ([`049f21d`](https://togithub.com/mswjs/msw/commit/049f21df0e7c1b9811e083e83b7534cf0a06021a)) [@kettanaito](https://togithub.com/kettanaito) ##### Bug Fixes - return types of "setupWorker" and "setupServer" API ([#1540](https://togithub.com/mswjs/msw/issues/1540)) ([`78d1834`](https://togithub.com/mswjs/msw/commit/78d18344388d5e17cb71ae67f5d250ce139baf59)) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.0.1`](https://togithub.com/mswjs/msw/releases/tag/v1.0.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v1.0.0...v1.0.1) #### v1.0.1 (2023-02-10) ##### Bug Fixes - add "package.json" subpath export ([#1530](https://togithub.com/mswjs/msw/issues/1530)) ([`12a581f`](https://togithub.com/mswjs/msw/commit/12a581f480e3a2f9bdcda7874f98114c148c9d85)) [@iceu-bb](https://togithub.com/iceu-bb) [@kettanaito](https://togithub.com/kettanaito) ### [`v1.0.0`](https://togithub.com/mswjs/msw/releases/tag/v1.0.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.3...v1.0.0) #### v1.0.0 (2023-01-25) ##### ⚠️ BREAKING CHANGES - rename "SetupWorkerApi"/"SetupServerApi" types to "SetupWorker"/"SetupServer" ([#1478](https://togithub.com/mswjs/msw/issues/1478)) ([`4fde47e`](https://togithub.com/mswjs/msw/commit/4fde47ef00bbddc6fdea2b6bdb8ac77b1d398c33)) [@gduliscouet-ubitransport](https://togithub.com/gduliscouet-ubitransport) [@kettanaito](https://togithub.com/kettanaito) ##### Features - throw and suggest a URL polyfill for React Native ([#1520](https://togithub.com/mswjs/msw/issues/1520)) ([`b4ac829`](https://togithub.com/mswjs/msw/commit/b4ac82921d13bd539f1d53ec9c6345c91dc6637b)) [@kettanaito](https://togithub.com/kettanaito) ### [`v0.49.3`](https://togithub.com/mswjs/msw/releases/tag/v0.49.3) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.2...v0.49.3) #### v0.49.3 (2023-01-19) ##### Bug Fixes - use EventTarget-based event emitter ([#1522](https://togithub.com/mswjs/msw/issues/1522)) ([`6a94b8c`](https://togithub.com/mswjs/msw/commit/6a94b8c06d7a6fbc7be0c5224ba35f38888964b1)) [@chrisguttandin](https://togithub.com/chrisguttandin) ### [`v0.49.2`](https://togithub.com/mswjs/msw/releases/tag/v0.49.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.1...v0.49.2) ##### v0.49.2 (2022-12-13) ##### Bug Fixes - use `globalThis.fetch` in `ctx.fetch` utility ([#1490](https://togithub.com/mswjs/msw/issues/1490)) ([`42cdbc7`](https://togithub.com/mswjs/msw/commit/42cdbc79654d90b3edce747ea044513f2f964958)) [@Toxiapo](https://togithub.com/Toxiapo) [@kettanaito](https://togithub.com/kettanaito) ### [`v0.49.1`](https://togithub.com/mswjs/msw/releases/tag/v0.49.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.49.0...v0.49.1) #### v0.49.1 (2022-11-28) ##### Bug Fixes - **setupWorker:** resolve the TS4094 error ([#1477](https://togithub.com/mswjs/msw/issues/1477)) ([`c268796`](https://togithub.com/mswjs/msw/commit/c268796eb7a20a1b1f2959cdb1b256a36519a60d)) [@gduliscouet-ubitransport](https://togithub.com/gduliscouet-ubitransport) ### [`v0.49.0`](https://togithub.com/mswjs/msw/releases/tag/v0.49.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.3...v0.49.0) #### v0.49.0 (2022-11-19) ##### Features - support TypeScript 4.9, drop support for TypeScript 4.2, 4.3 ([#1467](https://togithub.com/mswjs/msw/issues/1467)) ([`af0277d`](https://togithub.com/mswjs/msw/commit/af0277da900e20c7fb270ddb46be20deb487aefc)) [@wtchnm](https://togithub.com/wtchnm) ### [`v0.48.3`](https://togithub.com/mswjs/msw/releases/tag/v0.48.3) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.2...v0.48.3) #### v0.48.3 (2022-11-15) ##### Bug Fixes - **SetupApi:** validate given request handlers ([#1460](https://togithub.com/mswjs/msw/issues/1460)) ([`a06a944`](https://togithub.com/mswjs/msw/commit/a06a9447d09d93a2a0a108cb27bc183e5bd4716d)) [@kettanaito](https://togithub.com/kettanaito) - inline `statuses` dependency during the build ([#1458](https://togithub.com/mswjs/msw/issues/1458)) ([`99d49f9`](https://togithub.com/mswjs/msw/commit/99d49f9b1ee71cdb945bd9ae3e78d89c23c2b74e)) [@mattcosta7](https://togithub.com/mattcosta7) [@kettanaito](https://togithub.com/kettanaito) ### [`v0.48.2`](https://togithub.com/mswjs/msw/releases/tag/v0.48.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.1...v0.48.2) #### v0.48.2 (2022-11-13) ##### Bug Fixes - resolve absolute worker url against the current path ([#1456](https://togithub.com/mswjs/msw/issues/1456)) ([`f8d15b4`](https://togithub.com/mswjs/msw/commit/f8d15b41a941613cd4868cf0e85d2d3aa075d067)) [@kettanaito](https://togithub.com/kettanaito) ### [`v0.48.1`](https://togithub.com/mswjs/msw/releases/tag/v0.48.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.48.0...v0.48.1) #### v0.48.1 (2022-11-10) ##### Bug Fixes - bufferUtils import path ([#1453](https://togithub.com/mswjs/msw/issues/1453)) ([`91b2902`](https://togithub.com/mswjs/msw/commit/91b2902ded79bea2d649057bd7858862ac91c4c4)) [@cksal0805](https://togithub.com/cksal0805) ### [`v0.48.0`](https://togithub.com/mswjs/msw/releases/tag/v0.48.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.4...v0.48.0) #### v0.48.0 (2022-11-08) ##### Features - add "SetupApi" base class ([#1445](https://togithub.com/mswjs/msw/issues/1445)) ([`85ba844`](https://togithub.com/mswjs/msw/commit/85ba8440f57d15e6ce948f2350488365e809dce5)) [@Toxiapo](https://togithub.com/Toxiapo) [@kettanaito](https://togithub.com/kettanaito) - do not interfere with shared workers ([#1448](https://togithub.com/mswjs/msw/issues/1448)) ([`670dda7`](https://togithub.com/mswjs/msw/commit/670dda7b97f6430418d6faf09698f9a1bca5cf07)) [@mucsi96](https://togithub.com/mucsi96) [@kettanaito](https://togithub.com/kettanaito) - makes the library esm-compatible ([#1399](https://togithub.com/mswjs/msw/issues/1399)) ([`41798eb`](https://togithub.com/mswjs/msw/commit/41798ebc695e04719e198a7867be6d80e053fd0e)) [@ivanhofer](https://togithub.com/ivanhofer) [@kettanaito](https://togithub.com/kettanaito) ### [`v0.47.4`](https://togithub.com/mswjs/msw/releases/tag/v0.47.4) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.3...v0.47.4) #### v0.47.4 (2022-10-04) ##### Bug Fixes - correctly link types in `package.json` `exports` field ([#1395](https://togithub.com/mswjs/msw/issues/1395)) ([`3902b8c`](https://togithub.com/mswjs/msw/commit/3902b8c216b2254beef7c35519cc2242b4535b22)) [@ivanhofer](https://togithub.com/ivanhofer) [@kettanaito](https://togithub.com/kettanaito) - include error stack in log when handling uncaught exceptions ([#1417](https://togithub.com/mswjs/msw/issues/1417)) ([`933a9d6`](https://togithub.com/mswjs/msw/commit/933a9d607f12cb0d510c40ce3572168a39f26566)) [@jkieboom](https://togithub.com/jkieboom) [@kettanaito](https://togithub.com/kettanaito) - remove duplicate response logging in the browser console ([#1418](https://togithub.com/mswjs/msw/issues/1418)) ([`78d155f`](https://togithub.com/mswjs/msw/commit/78d155fd46b7b711dfd6c70f62da96fbad5c55fa)) [@snaka](https://togithub.com/snaka) [@kettanaito](https://togithub.com/kettanaito) ### [`v0.47.3`](https://togithub.com/mswjs/msw/releases/tag/v0.47.3) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.2...v0.47.3) #### v0.47.3 (2022-09-15) ##### Bug Fixes - update "headers-polyfill" and "[@mswjs/interceptors](https://togithub.com/mswjs/interceptors)" to fix "/lib" issue ([#1407](https://togithub.com/mswjs/msw/issues/1407)) ([`41d8c08`](https://togithub.com/mswjs/msw/commit/41d8c0895e5ca7bf12da86a8a94b974e19b93d5d)) ### [`v0.47.2`](https://togithub.com/mswjs/msw/releases/tag/v0.47.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.1...v0.47.2) #### v0.47.2 (2022-09-13) ##### Bug Fixes - fix a typo in the "listHandlers" method jsdoc ([#1403](https://togithub.com/mswjs/msw/issues/1403)) ([`c90eafb`](https://togithub.com/mswjs/msw/commit/c90eafb5caf0d27b81eced6cae4d1a257a7757b6)) ### [`v0.47.1`](https://togithub.com/mswjs/msw/releases/tag/v0.47.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.47.0...v0.47.1) #### v0.47.1 (2022-09-10) ##### Bug Fixes - print response log only when response arrives ([#1392](https://togithub.com/mswjs/msw/issues/1392)) ([`638fad9`](https://togithub.com/mswjs/msw/commit/638fad9640885c0a85153c1b9ade61495d4295bb)) ### [`v0.47.0`](https://togithub.com/mswjs/msw/releases/tag/v0.47.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.46.1...v0.47.0) #### v0.47.0 (2022-09-04) ##### Features - add explicit `exports` map in package.json ([#1383](https://togithub.com/mswjs/msw/issues/1383)) ([`5e1c1a6`](https://togithub.com/mswjs/msw/commit/5e1c1a6a9ab4450073adf571d4b68978d177bf52)) ### [`v0.46.1`](https://togithub.com/mswjs/msw/releases/tag/v0.46.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.46.0...v0.46.1) #### v0.46.1 (2022-09-01) ##### Bug Fixes - **deps:** include "graphql" as a dependency ([#1381](https://togithub.com/mswjs/msw/issues/1381)) ([`8436515`](https://togithub.com/mswjs/msw/commit/8436515fd93e3f372205815b52ffc3a572da2690)) ### [`v0.46.0`](https://togithub.com/mswjs/msw/releases/tag/v0.46.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.45.0...v0.46.0) #### v0.46.0 (2022-08-31) ##### Features - fix a typo in the worker script ([`62f7c4d`](https://togithub.com/mswjs/msw/commit/62f7c4d885c73c7401af85ca2e5da2db9f2cf212)) - support typescript v4.8 ([#1375](https://togithub.com/mswjs/msw/issues/1375)) ([`631f629`](https://togithub.com/mswjs/msw/commit/631f6297979e0b398d1353963ad7b4166e53f40c)) - add "listHandlers" method to server and worker ([#1369](https://togithub.com/mswjs/msw/issues/1369)) ([`18f5778`](https://togithub.com/mswjs/msw/commit/18f57789f6ff620c0b1c2ee472673eb85d0575c9)) ```js server.listHandlers() worker.listHandlers() ``` ### [`v0.45.0`](https://togithub.com/mswjs/msw/releases/tag/v0.45.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.44.2...v0.45.0) #### v0.45.0 (2022-08-22) ##### Features - make GraphQL a peer dependency, support GraphQL v15.0 ([#1356](https://togithub.com/mswjs/msw/issues/1356)) ([`ca0e2e0`](https://togithub.com/mswjs/msw/commit/ca0e2e074d8156a6cbd212501e28130b9118f824)) ### [`v0.44.2`](https://togithub.com/mswjs/msw/releases/tag/v0.44.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.44.1...v0.44.2) #### v0.44.2 (2022-07-19) ##### Bug Fixes - transfer mocked response as ArrayBuffer to the worker ([#1337](https://togithub.com/mswjs/msw/issues/1337)) ([`95be5f8`](https://togithub.com/mswjs/msw/commit/95be5f8ac1c0f02b2d4b5e6e0dd02d2cf7342008)) ### [`v0.44.1`](https://togithub.com/mswjs/msw/releases/tag/v0.44.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.44.0...v0.44.1) #### v0.44.1 (2022-07-14) ##### Bug Fixes - super call stack overflow ([#1328](https://togithub.com/mswjs/msw/issues/1328)) ([`6a3f442`](https://togithub.com/mswjs/msw/commit/6a3f442bdea1d4ba615020ccece22a9e091e5f3c)) ### [`v0.44.0`](https://togithub.com/mswjs/msw/releases/tag/v0.44.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.43.1...v0.44.0) #### v0.44.0 (2022-07-13) ##### Breaking changes - `req.destination` default value is now `""` (empty string), previously `"document"`. - `req.redirect` default value is now `""follow"`, previously `"manual"`. - The library no longer exports the `parseIsomorphicRequest()` function ([#1316](https://togithub.com/mswjs/msw/issues/1316)). Please use `MockedRequest` class instead. ##### Features - adhere to [Fetch API "Request"](https://developer.mozilla.org/en-US/docs/Web/API/Request) in response resolver ([#1316](https://togithub.com/mswjs/msw/issues/1316), [@95th](https://togithub.com/95th)) ([`fc7f00c`](https://togithub.com/mswjs/msw/commit/fc7f00c96e79ad0be83cbaf7c82ceff23f0c4355)). This means the addition of a few properties on the `req` instance: - [`req.priority`](https://developer.mozilla.org/en-US/docs/Web/API/Request/priority), indicates a priority of request relatively to other requests (default `"auto"`); - [`req.text()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/text), reads the request body as plain text; - [`req.json()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/json), reads the request body as JSON; - [`req.arrayBuffer()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/arrayBuffer), reads the request body as `ArrayBuffer`; - [`req.clone()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/clone), clones a request instance (i.e. so its body could be read multiple times). - remove unnecessary stringification of worker-client messages ([#1320](https://togithub.com/mswjs/msw/issues/1320)) ([`6990c3a`](https://togithub.com/mswjs/msw/commit/6990c3a57a1f515fe977c2eaa7741005b885b8af)) ##### Deprecations - **`req.body` is deprecated**. Please use explicit request body reading methods: `req.text()`, `req.json()`, `req.arrayBuffer()` (other methods, like `req.formData()` are currently not supported). ```js rest.post('/user', async (req, res, ctx) => { const newUser = await req.json() }) ``` > `req.body` is still present for compatibility reasons but will be removed in the next releases. ### [`v0.43.1`](https://togithub.com/mswjs/msw/releases/tag/v0.43.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.43.0...v0.43.1) #### v0.43.1 (2022-07-07) ##### Bug Fixes - support multiple response cookies using "ctx.cookie()" ([#1311](https://togithub.com/mswjs/msw/issues/1311)) ([`66c3ad8`](https://togithub.com/mswjs/msw/commit/66c3ad888058f92db7dc94ad9d1c408a4ea9e14f)) ### [`v0.43.0`](https://togithub.com/mswjs/msw/releases/tag/v0.43.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.3...v0.43.0) #### v0.43.0 (2022-07-04) ##### Features - send mocked response body as ReadableStream to the worker ([#1288](https://togithub.com/mswjs/msw/issues/1288)) ([`78c7d7e`](https://togithub.com/mswjs/msw/commit/78c7d7eee84b961eb29b2591bd78f81e0c48deef)) ### [`v0.42.3`](https://togithub.com/mswjs/msw/releases/tag/v0.42.3) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.2...v0.42.3) #### v0.42.3 (2022-06-22) ##### Bug Fixes - apply response delay conditionally ([#1300](https://togithub.com/mswjs/msw/issues/1300)) ([`496154d`](https://togithub.com/mswjs/msw/commit/496154da7e76007977d0c5e937a79e0fc55ae34b)) ### [`v0.42.2`](https://togithub.com/mswjs/msw/releases/tag/v0.42.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.1...v0.42.2) #### v0.42.2 (2022-06-22) ##### Bug Fixes - **setupServer:** reference interceptors to support fast refresh ([#1299](https://togithub.com/mswjs/msw/issues/1299)) ([`72f0b25`](https://togithub.com/mswjs/msw/commit/72f0b2516bc2fd0372cd62fc54fcf1f4e0b46b7f)) ### [`v0.42.1`](https://togithub.com/mswjs/msw/releases/tag/v0.42.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.42.0...v0.42.1) #### v0.42.1 (2022-06-07) ##### Bug Fixes - add "ctx.field()" for GraphQL responses ([#1257](https://togithub.com/mswjs/msw/issues/1257)) ([`442f48d`](https://togithub.com/mswjs/msw/commit/442f48dd606fca8fa9156785fc0e85e9e9d48793)) ### [`v0.42.0`](https://togithub.com/mswjs/msw/releases/tag/v0.42.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.41.1...v0.42.0) #### v0.42.0 (2022-05-30) ##### Features - upgrade to [@mswjs/interceptors](https://togithub.com/mswjs/interceptors) 0.16 ([#1262](https://togithub.com/mswjs/msw/issues/1262)) ([`2176577`](https://togithub.com/mswjs/msw/commit/2176577bebda3b6e3a3f6027f4f0ebe2974af86a)) ##### Bug Fixes - remove "esm" build target ([#1263](https://togithub.com/mswjs/msw/issues/1263)) ([`61a755a`](https://togithub.com/mswjs/msw/commit/61a755a4b2672187847bfaf95f99b5f984c64854)) ### [`v0.41.1`](https://togithub.com/mswjs/msw/releases/tag/v0.41.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.41.0...v0.41.1) #### v0.41.1 (2022-05-27) ##### Bug Fixes - support typescript 4.7 ([#1256](https://togithub.com/mswjs/msw/issues/1256)) ([`b020270`](https://togithub.com/mswjs/msw/commit/b02027005969c70fd414df1d45def9ebed1a88c3)) ### [`v0.41.0`](https://togithub.com/mswjs/msw/releases/tag/v0.41.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.40.2...v0.41.0) #### v0.41.0 (2022-05-22) ##### Features - improve module formats (cjs, esm, iife) ([#1247](https://togithub.com/mswjs/msw/issues/1247)) ([`00e9c58`](https://togithub.com/mswjs/msw/commit/00e9c58c242d77fc5ce7966ce6e289b0a7e2cf0e)) ### [`v0.40.2`](https://togithub.com/mswjs/msw/releases/tag/v0.40.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.40.1...v0.40.2) #### v0.40.2 (2022-05-20) ##### Bug Fixes - support typescript 4.4.x, 4.5.x, 4.6.x ([#1245](https://togithub.com/mswjs/msw/issues/1245)) ([`5378416`](https://togithub.com/mswjs/msw/commit/5378416792be4f0d573149290f920e10ffdd2c61)) ### [`v0.40.1`](https://togithub.com/mswjs/msw/releases/tag/v0.40.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.40.0...v0.40.1) #### v0.40.1 (2022-05-19) ##### Bug Fixes - support typescript 4.3.x ([#1244](https://togithub.com/mswjs/msw/issues/1244)) ([`3bca5be`](https://togithub.com/mswjs/msw/commit/3bca5be178cf719b7776654b6875baba664af5af)) ### [`v0.40.0`](https://togithub.com/mswjs/msw/releases/tag/v0.40.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.39.2...v0.40.0) #### v0.40.0 (2022-05-17) ##### Breaking changes - Returning `undefined`, or early returns, from response resolvers, now does not perform request as-is, and is instead treated as a handler that didn't do anything. Please return [`req.passthrough()`](https://mswjs.io/docs/api/request/passthrough) if you wish to bypass a request. ```diff rest.get('/resource', (req, res, ctx) => { // I want to perform this intercepted request as-is. - return + return req.passthrough() }) ``` ##### Features - add "unhandledException" life-cycle event ([#1199](https://togithub.com/mswjs/msw/issues/1199)) ([`5c90799`](https://togithub.com/mswjs/msw/commit/5c9079904202bf968c0f7c3c8da0fa68173ce7b4)) - improve PathParams type to support interface ([#1219](https://togithub.com/mswjs/msw/issues/1219)) ([`b70266f`](https://togithub.com/mswjs/msw/commit/b70266f4da5baa94e746fa56d9cd02594304799d)) - rename "DefaultRequestBody" to "DefaultBodyType" ([`53aa3a1`](https://togithub.com/mswjs/msw/commit/53aa3a1c755685a56ae240ebc0f1fe2d3468527a)) - add "req.passthrough" ([#1204](https://togithub.com/mswjs/msw/issues/1204)) ([`4e1b1ad`](https://togithub.com/mswjs/msw/commit/4e1b1ad87a87240d7ff6ff9f07fee3521e23435d)) - add service worker scope and worker script URL to "Mocking enabled" message ([#1172](https://togithub.com/mswjs/msw/issues/1172)) ([`ab3d399`](https://togithub.com/mswjs/msw/commit/ab3d3996728985bc4d1c8c820eb91e9e5a3d9378)) - set "typescript" optional peer dependency to 4.2.x ([#985](https://togithub.com/mswjs/msw/issues/985)) ([`b1004a6`](https://togithub.com/mswjs/msw/commit/b1004a6d89bd737cb8784c937298120d95ce364e)) ##### Bug Fixes - **setupWorker:** warn on multiple "worker.start" and "worker.stop" calls ([#1238](https://togithub.com/mswjs/msw/issues/1238)) ([`cfe0709`](https://togithub.com/mswjs/msw/commit/cfe07099587827b8e482015e47ba2d1a49119cd2)) - remove console.log from "setRequestCookies" ([`6f7ed98`](https://togithub.com/mswjs/msw/commit/6f7ed98cfcbfc20c614c6f1e5b1fe0da9010ed62)) - set "credentials" to "same-origin" for "ClientRequest" ([#1159](https://togithub.com/mswjs/msw/issues/1159)) ([`c3cd80a`](https://togithub.com/mswjs/msw/commit/c3cd80a724eacae897a2d06fbec0eb9107be525c)) ### [`v0.39.2`](https://togithub.com/mswjs/msw/releases/tag/v0.39.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.39.1...v0.39.2) ##### Bug Fixes - **parseIsomorphicRequest:** bypassing cookies properly ([#1155](https://togithub.com/mswjs/msw/issues/1155)) ([755bc9d](https://togithub.com/mswjs/msw/commit/755bc9d57f6dc1a6cf2aa5285eb189f4cee66f43)) - set "credentials" to "same-origin" for "ClientRequest" ([#1159](https://togithub.com/mswjs/msw/issues/1159)) ([c3cd80a](https://togithub.com/mswjs/msw/commit/c3cd80a724eacae897a2d06fbec0eb9107be525c)) - set minimal supported Node.js version to 14 ([#1160](https://togithub.com/mswjs/msw/issues/1160)) ([d7ab139](https://togithub.com/mswjs/msw/commit/d7ab1399e986167ff036312ea59c978f419a9b72)) ### [`v0.39.1`](https://togithub.com/mswjs/msw/releases/tag/v0.39.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.39.0...v0.39.1) ##### Bug Fixes - add fallback for "\_defaultAgent" in ClientRequest ([#1152](https://togithub.com/mswjs/msw/issues/1152)) ([21fcbc5](https://togithub.com/mswjs/msw/commit/21fcbc5b75e66eab01193ebbc8876818c16d84dc)) ### [`v0.39.0`](https://togithub.com/mswjs/msw/releases/tag/v0.39.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.38.2...v0.39.0) ##### Breaking changes - require node 16 and higher ([#1136](https://togithub.com/mswjs/msw/issues/1136)) ([6f4895e](https://togithub.com/mswjs/msw/commit/6f4895e9a37d1ae0d6eaafb04e17afcdefc3c2d3)) ##### Bug Fixes - **setupWorker:** resolve the "start" promise after the worker has activated ([#1146](https://togithub.com/mswjs/msw/issues/1146)) ([f6e709c](https://togithub.com/mswjs/msw/commit/f6e709c3c7d1ac60f99cac6699e83565d8401cd0)) ### [`v0.38.2`](https://togithub.com/mswjs/msw/releases/tag/v0.38.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.38.1...v0.38.2) ##### Bug Fixes - update [@mswjs/interceptors](https://togithub.com/mswjs/interceptors) to 0.13.5 ([#1127](https://togithub.com/mswjs/msw/issues/1127)) ([1b59ab7](https://togithub.com/mswjs/msw/commit/1b59ab76f37768f37c578b9b6370b90fefdd43b4)) ### [`v0.38.1`](https://togithub.com/mswjs/msw/releases/tag/v0.38.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.38.0...v0.38.1) ##### Bug Fixes - **handleRequest:** bypass request only if "x-msw-bypass" header equals "true" ([#1110](https://togithub.com/mswjs/msw/issues/1110)) ([1a7bc36](https://togithub.com/mswjs/msw/commit/1a7bc36d98e0fa0d0fa1c9da6d7dd40605f239ca)) ### [`v0.38.0`](https://togithub.com/mswjs/msw/releases/tag/v0.38.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.8...v0.38.0) ##### Features - update to [@mswjs/interceptors](https://togithub.com/mswjs/interceptors) 0.13.3 ([#1095](https://togithub.com/mswjs/msw/issues/1095)) ([e288d18](https://togithub.com/mswjs/msw/commit/e288d18d17026d6ba28a53f7af20c0694e276ae6)), closes [#1102](https://togithub.com/mswjs/msw/issues/1102) - allow default behavior of `onUnhandledRequest` in a custom callback ([https://github.com/mswjs/msw/pull/1096](https://togithub.com/mswjs/msw/pull/1096)): ```js worker.start({ onUnhandledRequest(request, print) { // Ignore unhandled warnings/errors from asset requests. if (request.url.href.includes('/assets/') { return } // Otherwise, execute the default warning/error/ strategy. print.warning() // or "print.error()" } }) ``` ### [`v0.36.8`](https://togithub.com/mswjs/msw/releases/tag/v0.36.8) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.7...v0.36.8) ##### Bug Fixes - allow variables inference in GraphQLRequest ([#1081](https://togithub.com/mswjs/msw/issues/1081)) ([6e7ec28](https://togithub.com/mswjs/msw/commit/6e7ec2871f5f82fbf228b803df565286b1d4dbfc)) ### [`v0.36.7`](https://togithub.com/mswjs/msw/releases/tag/v0.36.7) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.5...v0.36.7) ##### Bug Fixes - update "[@mswjs/cookies](https://togithub.com/mswjs/cookies)" for safe `localStorage` access ([#1071](https://togithub.com/mswjs/msw/issues/1071)) ([99ae530](https://togithub.com/mswjs/msw/commit/99ae530b75b5f4ca416311ffd7658143e99575d1)) - update `node-fetch` to 2.6.7 to fix a security vulnerability ([#1072](https://togithub.com/mswjs/msw/issues/1072)) ([72a34f6](https://togithub.com/mswjs/msw/commit/72a34f673b2612aab5138a396440f8cd30ded820)) ### [`v0.36.5`](https://togithub.com/mswjs/msw/releases/tag/v0.36.5) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.4...v0.36.5) ##### Bug Fixes - parse request body with letter case `Content-Type` header value ([#1064](https://togithub.com/mswjs/msw/issues/1064)) ([7796418](https://togithub.com/mswjs/msw/commit/7796418cba8087d08b8a6bf476c2b272b6888607)) ### [`v0.36.4`](https://togithub.com/mswjs/msw/releases/tag/v0.36.4) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.3...v0.36.4) #### Bug fixes - Fixes an issue that resulted in port numbers being treated as path parameters ([#1036](https://togithub.com/mswjs/msw/issues/1036), [#1028](https://togithub.com/mswjs/msw/issues/1028)). ### [`v0.36.3`](https://togithub.com/mswjs/msw/releases/tag/v0.36.3) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.2...v0.36.3) ### Bug fixes - Fixes an issue that resulted in the CORS policy violation due to the library appending the `x-msw-request-id` request header ([#713](https://togithub.com/mswjs/msw/issues/713), [#1022](https://togithub.com/mswjs/msw/issues/1022), [#1024](https://togithub.com/mswjs/msw/issues/1024)). #### Internal - No longer sets the `x-msw-request-id` header on the request ([#1024](https://togithub.com/mswjs/msw/issues/1024)). Relies on the `request.id` set by the interceptors (Node.js) or the `requestId` generated by the worker (browser). ### [`v0.36.2`](https://togithub.com/mswjs/msw/releases/tag/v0.36.2) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.1...v0.36.2) #### Bug fixes - Fixes an issue that resulted in the "TypeError: expected.toLowerCase() is not a function" exception when using the `rest.all()` request handler ([#1020](https://togithub.com/mswjs/msw/issues/1020), [#1021](https://togithub.com/mswjs/msw/issues/1021)). ### [`v0.36.1`](https://togithub.com/mswjs/msw/releases/tag/v0.36.1) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.36.0...v0.36.1) #### Bug fixes - Fixes an issue that resulted in the "SyntaxError: Invalid group specified name" exception in Safari ([#1018](https://togithub.com/mswjs/msw/issues/1018), [#1019](https://togithub.com/mswjs/msw/issues/1019) ). ### [`v0.36.0`](https://togithub.com/mswjs/msw/releases/tag/v0.36.0) [Compare Source](https://togithub.com/mswjs/msw/compare/v0.35.0...v0.36.0) ##### Breaking changes - Uses [path-to-regexp](https://www.npmjs.com/package/path-to-regexp) for URL matching ([#691](https://togithub.com/mswjs/msw/issues/691), [#888](https://togithub.com/mswjs/msw/issues/888)). This makes the path matching experience identical to such in ExpressJS, and enabled various new features: - Optional path segments (`/foo/bar?`); - Repeating groups (`/foo/bar+`). - Request path parameters are now annotated as ambiguous `string | string[]` ([#999](https://togithub.com/mswjs/msw/issues/999)). - The `RequestParams` generic now follows the `RequestBodyType` generic, changing its order ([#999](https://togithub.com/mswjs/msw/issues/999)): ```ts rest.post