Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [msw](https://mswjs.io) ([source](https://togithub.com/mswjs/msw)) | [`^1.2.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/msw/1.2.2/2.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/msw/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/msw/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/msw/1.2.2/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/msw/1.2.2/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>mswjs/msw (msw)</summary> ### [`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) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
- Loading branch information