mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-09-17 09:32:39 +03:00
fix(deps): update dependency msw to ^2.11.2 (#1905)
* fix(deps): update dependency msw to ^2.11.2 * Update --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nathan Bierema <nbierema@gmail.com>
This commit is contained in:
parent
4e44c2ca50
commit
8308db6832
|
@ -19,7 +19,7 @@
|
||||||
"@redux-devtools/dock-monitor": "workspace:^",
|
"@redux-devtools/dock-monitor": "workspace:^",
|
||||||
"@redux-devtools/rtk-query-monitor": "workspace:^",
|
"@redux-devtools/rtk-query-monitor": "workspace:^",
|
||||||
"@reduxjs/toolkit": "^2.9.0",
|
"@reduxjs/toolkit": "^2.9.0",
|
||||||
"msw": "^2.10.2",
|
"msw": "^2.11.2",
|
||||||
"react": "^19.1.1",
|
"react": "^19.1.1",
|
||||||
"react-dom": "^19.1.1",
|
"react-dom": "^19.1.1",
|
||||||
"react-icons": "^5.5.0",
|
"react-icons": "^5.5.0",
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
* - Please do NOT modify this file.
|
* - Please do NOT modify this file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const PACKAGE_VERSION = '2.10.2'
|
const PACKAGE_VERSION = '2.11.2'
|
||||||
const INTEGRITY_CHECKSUM = 'f5825c521429caf22a4dd13b66e243af'
|
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
|
||||||
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
||||||
const activeClientIds = new Set()
|
const activeClientIds = new Set()
|
||||||
|
|
||||||
|
@ -71,11 +71,6 @@ addEventListener('message', async function (event) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'MOCK_DEACTIVATE': {
|
|
||||||
activeClientIds.delete(clientId)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'CLIENT_CLOSED': {
|
case 'CLIENT_CLOSED': {
|
||||||
activeClientIds.delete(clientId)
|
activeClientIds.delete(clientId)
|
||||||
|
|
||||||
|
@ -94,6 +89,8 @@ addEventListener('message', async function (event) {
|
||||||
})
|
})
|
||||||
|
|
||||||
addEventListener('fetch', function (event) {
|
addEventListener('fetch', function (event) {
|
||||||
|
const requestInterceptedAt = Date.now()
|
||||||
|
|
||||||
// Bypass navigation requests.
|
// Bypass navigation requests.
|
||||||
if (event.request.mode === 'navigate') {
|
if (event.request.mode === 'navigate') {
|
||||||
return
|
return
|
||||||
|
@ -110,23 +107,29 @@ addEventListener('fetch', function (event) {
|
||||||
|
|
||||||
// Bypass all requests when there are no active clients.
|
// Bypass all requests when there are no active clients.
|
||||||
// Prevents the self-unregistered worked from handling requests
|
// Prevents the self-unregistered worked from handling requests
|
||||||
// after it's been deleted (still remains active until the next reload).
|
// after it's been terminated (still remains active until the next reload).
|
||||||
if (activeClientIds.size === 0) {
|
if (activeClientIds.size === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestId = crypto.randomUUID()
|
const requestId = crypto.randomUUID()
|
||||||
event.respondWith(handleRequest(event, requestId))
|
event.respondWith(handleRequest(event, requestId, requestInterceptedAt))
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {FetchEvent} event
|
* @param {FetchEvent} event
|
||||||
* @param {string} requestId
|
* @param {string} requestId
|
||||||
|
* @param {number} requestInterceptedAt
|
||||||
*/
|
*/
|
||||||
async function handleRequest(event, requestId) {
|
async function handleRequest(event, requestId, requestInterceptedAt) {
|
||||||
const client = await resolveMainClient(event)
|
const client = await resolveMainClient(event)
|
||||||
const requestCloneForEvents = event.request.clone()
|
const requestCloneForEvents = event.request.clone()
|
||||||
const response = await getResponse(event, client, requestId)
|
const response = await getResponse(
|
||||||
|
event,
|
||||||
|
client,
|
||||||
|
requestId,
|
||||||
|
requestInterceptedAt,
|
||||||
|
)
|
||||||
|
|
||||||
// Send back the response clone for the "response:*" life-cycle events.
|
// Send back the response clone for the "response:*" life-cycle events.
|
||||||
// Ensure MSW is active and ready to handle the message, otherwise
|
// Ensure MSW is active and ready to handle the message, otherwise
|
||||||
|
@ -204,7 +207,7 @@ async function resolveMainClient(event) {
|
||||||
* @param {string} requestId
|
* @param {string} requestId
|
||||||
* @returns {Promise<Response>}
|
* @returns {Promise<Response>}
|
||||||
*/
|
*/
|
||||||
async function getResponse(event, client, requestId) {
|
async function getResponse(event, client, requestId, requestInterceptedAt) {
|
||||||
// Clone the request because it might've been already used
|
// Clone the request because it might've been already used
|
||||||
// (i.e. its body has been read and sent to the client).
|
// (i.e. its body has been read and sent to the client).
|
||||||
const requestClone = event.request.clone()
|
const requestClone = event.request.clone()
|
||||||
|
@ -255,6 +258,7 @@ async function getResponse(event, client, requestId) {
|
||||||
type: 'REQUEST',
|
type: 'REQUEST',
|
||||||
payload: {
|
payload: {
|
||||||
id: requestId,
|
id: requestId,
|
||||||
|
interceptedAt: requestInterceptedAt,
|
||||||
...serializedRequest,
|
...serializedRequest,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -2066,7 +2066,7 @@ importers:
|
||||||
specifier: ^2.9.0
|
specifier: ^2.9.0
|
||||||
version: 2.9.0(react-redux@9.2.0(@types/react@19.1.13)(react@19.1.1)(redux@5.0.1))(react@19.1.1)
|
version: 2.9.0(react-redux@9.2.0(@types/react@19.1.13)(react@19.1.1)(redux@5.0.1))(react@19.1.1)
|
||||||
msw:
|
msw:
|
||||||
specifier: ^2.10.2
|
specifier: ^2.11.2
|
||||||
version: 2.11.2(@types/node@22.18.3)(typescript@5.9.2)
|
version: 2.11.2(@types/node@22.18.3)(typescript@5.9.2)
|
||||||
react:
|
react:
|
||||||
specifier: ^19.1.1
|
specifier: ^19.1.1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user