@serwist/next 9.1.0 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.worker.d.ts.map +1 -1
- package/dist/index.worker.js +12 -9
- package/package.json +7 -7
- package/src/index.worker.ts +14 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAkQlC,CAAC"}
|
package/dist/index.worker.js
CHANGED
|
@@ -170,15 +170,13 @@ const defaultCache = process.env.NODE_ENV !== "production" ? [
|
|
|
170
170
|
})
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
|
-
matcher:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return false;
|
|
181
|
-
},
|
|
173
|
+
matcher: /\/api\/auth\/.*/,
|
|
174
|
+
handler: new NetworkOnly({
|
|
175
|
+
networkTimeoutSeconds: 10
|
|
176
|
+
})
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
matcher: ({ sameOrigin, url: { pathname } })=>sameOrigin && pathname.startsWith("/api/"),
|
|
182
180
|
method: "GET",
|
|
183
181
|
handler: new NetworkFirst({
|
|
184
182
|
cacheName: "apis",
|
|
@@ -252,6 +250,11 @@ const defaultCache = process.env.NODE_ENV !== "production" ? [
|
|
|
252
250
|
],
|
|
253
251
|
networkTimeoutSeconds: 10
|
|
254
252
|
})
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
matcher: /.*/i,
|
|
256
|
+
method: "GET",
|
|
257
|
+
handler: new NetworkOnly()
|
|
255
258
|
}
|
|
256
259
|
];
|
|
257
260
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/next",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Next.js application.",
|
|
6
6
|
"files": [
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"chalk": "5.4.1",
|
|
66
66
|
"glob": "10.4.5",
|
|
67
67
|
"zod": "4.0.5",
|
|
68
|
-
"@serwist/build": "9.1.
|
|
69
|
-
"@serwist/webpack-plugin": "9.1.
|
|
70
|
-
"@serwist/window": "9.1.
|
|
71
|
-
"serwist": "9.1.
|
|
68
|
+
"@serwist/build": "9.1.1",
|
|
69
|
+
"@serwist/webpack-plugin": "9.1.1",
|
|
70
|
+
"@serwist/window": "9.1.1",
|
|
71
|
+
"serwist": "9.1.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@types/node": "24.0.14",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"type-fest": "4.41.0",
|
|
80
80
|
"typescript": "5.8.3",
|
|
81
81
|
"webpack": "5.100.2",
|
|
82
|
-
"@serwist/configs": "9.1.
|
|
83
|
-
"@serwist/utils": "9.1.
|
|
82
|
+
"@serwist/configs": "9.1.1",
|
|
83
|
+
"@serwist/utils": "9.1.1"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"next": ">=14.0.0",
|
package/src/index.worker.ts
CHANGED
|
@@ -181,24 +181,15 @@ export const defaultCache: RuntimeCaching[] =
|
|
|
181
181
|
}),
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
//
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return false;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (pathname.startsWith("/api/")) {
|
|
197
|
-
return true;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return false;
|
|
201
|
-
},
|
|
184
|
+
// Exclude /api/auth/* to fix auth callback
|
|
185
|
+
// https://github.com/serwist/serwist/discussions/28
|
|
186
|
+
matcher: /\/api\/auth\/.*/,
|
|
187
|
+
handler: new NetworkOnly({
|
|
188
|
+
networkTimeoutSeconds: 10, // fallback to cache if API does not response within 10 seconds
|
|
189
|
+
}),
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
matcher: ({ sameOrigin, url: { pathname } }) => sameOrigin && pathname.startsWith("/api/"),
|
|
202
193
|
method: "GET",
|
|
203
194
|
handler: new NetworkFirst({
|
|
204
195
|
cacheName: "apis",
|
|
@@ -275,4 +266,9 @@ export const defaultCache: RuntimeCaching[] =
|
|
|
275
266
|
networkTimeoutSeconds: 10,
|
|
276
267
|
}),
|
|
277
268
|
},
|
|
269
|
+
{
|
|
270
|
+
matcher: /.*/i,
|
|
271
|
+
method: "GET",
|
|
272
|
+
handler: new NetworkOnly(),
|
|
273
|
+
},
|
|
278
274
|
];
|