@serwist/next 9.0.0-preview.0 → 9.0.0-preview.10
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.d.ts.map +1 -1
- package/dist/index.js +33 -710
- package/dist/index.worker.d.ts +2 -3
- package/dist/index.worker.d.ts.map +1 -1
- package/dist/index.worker.js +176 -178
- package/dist/internal-types.d.ts +1 -1
- package/dist/internal-types.d.ts.map +1 -1
- package/dist/sw-entry.js +5 -5
- package/dist/worker/constants.d.ts +6 -0
- package/dist/worker/constants.d.ts.map +1 -0
- package/dist/worker/defaultCache.d.ts +14 -2
- package/dist/worker/defaultCache.d.ts.map +1 -1
- package/package.json +21 -14
- package/src/index.ts +27 -21
- package/src/index.worker.ts +2 -3
- package/src/internal-types.ts +1 -1
- package/src/sw-entry.ts +5 -5
- package/src/worker/constants.ts +5 -0
- package/src/worker/defaultCache.ts +175 -152
- package/dist/worker/definePageRuntimeCaching.d.ts +0 -16
- package/dist/worker/definePageRuntimeCaching.d.ts.map +0 -1
- package/src/worker/definePageRuntimeCaching.ts +0 -36
package/dist/index.worker.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
+
import { PAGES_CACHE_NAME } from "./worker/constants.js";
|
|
1
2
|
import { defaultCache } from "./worker/defaultCache.js";
|
|
2
|
-
|
|
3
|
-
export { defaultCache, definePageRuntimeCaching };
|
|
4
|
-
export type { DefinePageRuntimeCachingOptions, PageRuntimeCaching };
|
|
3
|
+
export { defaultCache, PAGES_CACHE_NAME };
|
|
5
4
|
//# sourceMappingURL=index.worker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/index.worker.js
CHANGED
|
@@ -1,171 +1,162 @@
|
|
|
1
|
-
|
|
1
|
+
import { ExpirationPlugin } from '@serwist/expiration';
|
|
2
|
+
import { RangeRequestsPlugin } from '@serwist/range-requests';
|
|
3
|
+
import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from '@serwist/strategies';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/ const definePageRuntimeCaching = ({ rscPrefetch, rsc, html })=>{
|
|
8
|
-
const pageRcs = [
|
|
9
|
-
rscPrefetch,
|
|
10
|
-
rsc,
|
|
11
|
-
html
|
|
12
|
-
];
|
|
13
|
-
if (pageRcs[0]) {
|
|
14
|
-
if (!pageRcs[0].options) pageRcs[0].options = {};
|
|
15
|
-
pageRcs[0].options.cacheName = "pages-rsc-prefetch";
|
|
16
|
-
}
|
|
17
|
-
if (pageRcs[1]) {
|
|
18
|
-
if (!pageRcs[1].options) pageRcs[1].options = {};
|
|
19
|
-
pageRcs[1].options.cacheName = "pages-rsc";
|
|
20
|
-
}
|
|
21
|
-
if (pageRcs[2]) {
|
|
22
|
-
if (!pageRcs[2].options) pageRcs[2].options = {};
|
|
23
|
-
pageRcs[2].options.cacheName = "pages";
|
|
24
|
-
}
|
|
25
|
-
return pageRcs.filter(nonNullable);
|
|
5
|
+
const PAGES_CACHE_NAME = {
|
|
6
|
+
rscPrefetch: "pages-rsc-prefetch",
|
|
7
|
+
rsc: "pages-rsc",
|
|
8
|
+
html: "pages"
|
|
26
9
|
};
|
|
27
10
|
|
|
28
|
-
// Serwist RuntimeCaching config: https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.RuntimeCachingEntry
|
|
29
11
|
const defaultCache = [
|
|
30
12
|
{
|
|
31
|
-
|
|
32
|
-
handler:
|
|
33
|
-
options: {
|
|
13
|
+
matcher: /^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,
|
|
14
|
+
handler: new CacheFirst({
|
|
34
15
|
cacheName: "google-fonts-webfonts",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
plugins: [
|
|
17
|
+
new ExpirationPlugin({
|
|
18
|
+
maxEntries: 4,
|
|
19
|
+
maxAgeSeconds: 365 * 24 * 60 * 60
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
})
|
|
40
23
|
},
|
|
41
24
|
{
|
|
42
|
-
|
|
43
|
-
handler:
|
|
44
|
-
options: {
|
|
25
|
+
matcher: /^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,
|
|
26
|
+
handler: new StaleWhileRevalidate({
|
|
45
27
|
cacheName: "google-fonts-stylesheets",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
28
|
+
plugins: [
|
|
29
|
+
new ExpirationPlugin({
|
|
30
|
+
maxEntries: 4,
|
|
31
|
+
maxAgeSeconds: 7 * 24 * 60 * 60
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
})
|
|
51
35
|
},
|
|
52
36
|
{
|
|
53
|
-
|
|
54
|
-
handler:
|
|
55
|
-
options: {
|
|
37
|
+
matcher: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
|
|
38
|
+
handler: new StaleWhileRevalidate({
|
|
56
39
|
cacheName: "static-font-assets",
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
plugins: [
|
|
41
|
+
new ExpirationPlugin({
|
|
42
|
+
maxEntries: 4,
|
|
43
|
+
maxAgeSeconds: 7 * 24 * 60 * 60
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
})
|
|
62
47
|
},
|
|
63
48
|
{
|
|
64
|
-
|
|
65
|
-
handler:
|
|
66
|
-
options: {
|
|
49
|
+
matcher: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
|
|
50
|
+
handler: new StaleWhileRevalidate({
|
|
67
51
|
cacheName: "static-image-assets",
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
52
|
+
plugins: [
|
|
53
|
+
new ExpirationPlugin({
|
|
54
|
+
maxEntries: 64,
|
|
55
|
+
maxAgeSeconds: 30 * 24 * 60 * 60
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
})
|
|
73
59
|
},
|
|
74
60
|
{
|
|
75
|
-
|
|
76
|
-
handler:
|
|
77
|
-
options: {
|
|
61
|
+
matcher: /\/_next\/static.+\.js$/i,
|
|
62
|
+
handler: new CacheFirst({
|
|
78
63
|
cacheName: "next-static-js-assets",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
plugins: [
|
|
65
|
+
new ExpirationPlugin({
|
|
66
|
+
maxEntries: 64,
|
|
67
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
})
|
|
84
71
|
},
|
|
85
72
|
{
|
|
86
|
-
|
|
87
|
-
handler:
|
|
88
|
-
options: {
|
|
73
|
+
matcher: /\/_next\/image\?url=.+$/i,
|
|
74
|
+
handler: new StaleWhileRevalidate({
|
|
89
75
|
cacheName: "next-image",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
76
|
+
plugins: [
|
|
77
|
+
new ExpirationPlugin({
|
|
78
|
+
maxEntries: 64,
|
|
79
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
})
|
|
95
83
|
},
|
|
96
84
|
{
|
|
97
|
-
|
|
98
|
-
handler:
|
|
99
|
-
options: {
|
|
100
|
-
rangeRequests: true,
|
|
85
|
+
matcher: /\.(?:mp3|wav|ogg)$/i,
|
|
86
|
+
handler: new CacheFirst({
|
|
101
87
|
cacheName: "static-audio-assets",
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
88
|
+
plugins: [
|
|
89
|
+
new ExpirationPlugin({
|
|
90
|
+
maxEntries: 32,
|
|
91
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
92
|
+
}),
|
|
93
|
+
new RangeRequestsPlugin()
|
|
94
|
+
]
|
|
95
|
+
})
|
|
107
96
|
},
|
|
108
97
|
{
|
|
109
|
-
|
|
110
|
-
handler:
|
|
111
|
-
options: {
|
|
112
|
-
rangeRequests: true,
|
|
98
|
+
matcher: /\.(?:mp4|webm)$/i,
|
|
99
|
+
handler: new CacheFirst({
|
|
113
100
|
cacheName: "static-video-assets",
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
plugins: [
|
|
102
|
+
new ExpirationPlugin({
|
|
103
|
+
maxEntries: 32,
|
|
104
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
105
|
+
}),
|
|
106
|
+
new RangeRequestsPlugin()
|
|
107
|
+
]
|
|
108
|
+
})
|
|
119
109
|
},
|
|
120
110
|
{
|
|
121
|
-
|
|
122
|
-
handler:
|
|
123
|
-
options: {
|
|
111
|
+
matcher: /\.(?:js)$/i,
|
|
112
|
+
handler: new StaleWhileRevalidate({
|
|
124
113
|
cacheName: "static-js-assets",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
114
|
+
plugins: [
|
|
115
|
+
new ExpirationPlugin({
|
|
116
|
+
maxEntries: 48,
|
|
117
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
})
|
|
130
121
|
},
|
|
131
122
|
{
|
|
132
|
-
|
|
133
|
-
handler:
|
|
134
|
-
options: {
|
|
123
|
+
matcher: /\.(?:css|less)$/i,
|
|
124
|
+
handler: new StaleWhileRevalidate({
|
|
135
125
|
cacheName: "static-style-assets",
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
126
|
+
plugins: [
|
|
127
|
+
new ExpirationPlugin({
|
|
128
|
+
maxEntries: 32,
|
|
129
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})
|
|
141
133
|
},
|
|
142
134
|
{
|
|
143
|
-
|
|
144
|
-
handler:
|
|
145
|
-
options: {
|
|
135
|
+
matcher: /\/_next\/data\/.+\/.+\.json$/i,
|
|
136
|
+
handler: new NetworkFirst({
|
|
146
137
|
cacheName: "next-data",
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
138
|
+
plugins: [
|
|
139
|
+
new ExpirationPlugin({
|
|
140
|
+
maxEntries: 32,
|
|
141
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
})
|
|
152
145
|
},
|
|
153
146
|
{
|
|
154
|
-
|
|
155
|
-
handler:
|
|
156
|
-
options: {
|
|
147
|
+
matcher: /\.(?:json|xml|csv)$/i,
|
|
148
|
+
handler: new NetworkFirst({
|
|
157
149
|
cacheName: "static-data-assets",
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
150
|
+
plugins: [
|
|
151
|
+
new ExpirationPlugin({
|
|
152
|
+
maxEntries: 32,
|
|
153
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})
|
|
163
157
|
},
|
|
164
158
|
{
|
|
165
|
-
|
|
166
|
-
// Exclude /api/auth/callback/* to fix OAuth workflow in Safari without having an impact on other environments
|
|
167
|
-
// The above route is the default for next-auth, you may need to change it if your OAuth workflow has a different callback route
|
|
168
|
-
// Issue: https://github.com/shadowwalker/next-pwa/issues/131#issuecomment-821894809
|
|
159
|
+
matcher: ({ sameOrigin, url: { pathname } })=>{
|
|
169
160
|
if (!sameOrigin || pathname.startsWith("/api/auth/callback")) {
|
|
170
161
|
return false;
|
|
171
162
|
}
|
|
@@ -174,72 +165,79 @@ const defaultCache = [
|
|
|
174
165
|
}
|
|
175
166
|
return false;
|
|
176
167
|
},
|
|
177
|
-
handler: "NetworkFirst",
|
|
178
168
|
method: "GET",
|
|
179
|
-
|
|
169
|
+
handler: new NetworkFirst({
|
|
180
170
|
cacheName: "apis",
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
plugins: [
|
|
172
|
+
new ExpirationPlugin({
|
|
173
|
+
maxEntries: 16,
|
|
174
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
175
|
+
})
|
|
176
|
+
],
|
|
185
177
|
networkTimeoutSeconds: 10
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
178
|
+
})
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
matcher: ({ request, url: { pathname }, sameOrigin })=>request.headers.get("RSC") === "1" && request.headers.get("Next-Router-Prefetch") === "1" && sameOrigin && !pathname.startsWith("/api/"),
|
|
182
|
+
handler: new NetworkFirst({
|
|
183
|
+
cacheName: PAGES_CACHE_NAME.rscPrefetch,
|
|
184
|
+
plugins: [
|
|
185
|
+
new ExpirationPlugin({
|
|
194
186
|
maxEntries: 32,
|
|
195
187
|
maxAgeSeconds: 24 * 60 * 60
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
})
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
matcher: ({ request, url: { pathname }, sameOrigin })=>request.headers.get("RSC") === "1" && sameOrigin && !pathname.startsWith("/api/"),
|
|
194
|
+
handler: new NetworkFirst({
|
|
195
|
+
cacheName: PAGES_CACHE_NAME.rsc,
|
|
196
|
+
plugins: [
|
|
197
|
+
new ExpirationPlugin({
|
|
204
198
|
maxEntries: 32,
|
|
205
199
|
maxAgeSeconds: 24 * 60 * 60
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
})
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
matcher: ({ request, url: { pathname }, sameOrigin })=>request.headers.get("Content-Type")?.includes("text/html") && sameOrigin && !pathname.startsWith("/api/"),
|
|
206
|
+
handler: new NetworkFirst({
|
|
207
|
+
cacheName: PAGES_CACHE_NAME.html,
|
|
208
|
+
plugins: [
|
|
209
|
+
new ExpirationPlugin({
|
|
214
210
|
maxEntries: 32,
|
|
215
211
|
maxAgeSeconds: 24 * 60 * 60
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
}
|
|
212
|
+
})
|
|
213
|
+
]
|
|
214
|
+
})
|
|
215
|
+
},
|
|
220
216
|
{
|
|
221
|
-
|
|
222
|
-
handler:
|
|
223
|
-
options: {
|
|
217
|
+
matcher: ({ url: { pathname }, sameOrigin })=>sameOrigin && !pathname.startsWith("/api/"),
|
|
218
|
+
handler: new NetworkFirst({
|
|
224
219
|
cacheName: "others",
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
220
|
+
plugins: [
|
|
221
|
+
new ExpirationPlugin({
|
|
222
|
+
maxEntries: 32,
|
|
223
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
224
|
+
})
|
|
225
|
+
]
|
|
226
|
+
})
|
|
230
227
|
},
|
|
231
228
|
{
|
|
232
|
-
|
|
233
|
-
handler:
|
|
234
|
-
options: {
|
|
229
|
+
matcher: ({ sameOrigin })=>!sameOrigin,
|
|
230
|
+
handler: new NetworkFirst({
|
|
235
231
|
cacheName: "cross-origin",
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
plugins: [
|
|
233
|
+
new ExpirationPlugin({
|
|
234
|
+
maxEntries: 32,
|
|
235
|
+
maxAgeSeconds: 60 * 60
|
|
236
|
+
})
|
|
237
|
+
],
|
|
240
238
|
networkTimeoutSeconds: 10
|
|
241
|
-
}
|
|
239
|
+
})
|
|
242
240
|
}
|
|
243
241
|
];
|
|
244
242
|
|
|
245
|
-
export {
|
|
243
|
+
export { PAGES_CACHE_NAME, defaultCache };
|
package/dist/internal-types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type SerwistNextOptionsKey = "self.__SERWIST_SW_ENTRY";
|
|
|
3
3
|
export interface SerwistNextOptions {
|
|
4
4
|
sw: string;
|
|
5
5
|
scope: string;
|
|
6
|
-
|
|
6
|
+
cacheOnNavigation: boolean;
|
|
7
7
|
register: boolean;
|
|
8
8
|
reloadOnOnline: boolean;
|
|
9
9
|
swEntryWorker: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["../src/internal-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["../src/internal-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;CAC1B"}
|
package/dist/sw-entry.js
CHANGED
|
@@ -11,8 +11,8 @@ if (typeof window !== "undefined" && "serviceWorker" in navigator && typeof cach
|
|
|
11
11
|
if (self.__SERWIST_SW_ENTRY.register) {
|
|
12
12
|
window.serwist.register();
|
|
13
13
|
}
|
|
14
|
-
if (self.__SERWIST_SW_ENTRY.
|
|
15
|
-
const
|
|
14
|
+
if (self.__SERWIST_SW_ENTRY.cacheOnNavigation) {
|
|
15
|
+
const cacheOnNavigation = async (url)=>{
|
|
16
16
|
if (!window.navigator.onLine || !url) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
@@ -24,15 +24,15 @@ if (typeof window !== "undefined" && "serviceWorker" in navigator && typeof cach
|
|
|
24
24
|
const pushState = history.pushState;
|
|
25
25
|
history.pushState = (...args)=>{
|
|
26
26
|
pushState.apply(history, args);
|
|
27
|
-
|
|
27
|
+
cacheOnNavigation(args[2]);
|
|
28
28
|
};
|
|
29
29
|
const replaceState = history.replaceState;
|
|
30
30
|
history.replaceState = (...args)=>{
|
|
31
31
|
replaceState.apply(history, args);
|
|
32
|
-
|
|
32
|
+
cacheOnNavigation(args[2]);
|
|
33
33
|
};
|
|
34
34
|
window.addEventListener("online", ()=>{
|
|
35
|
-
|
|
35
|
+
cacheOnNavigation(window.location.pathname);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
if (self.__SERWIST_SW_ENTRY.reloadOnOnline) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/worker/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const defaultCache:
|
|
1
|
+
import { CacheFirst, NetworkFirst } from "@serwist/strategies";
|
|
2
|
+
export declare const defaultCache: ({
|
|
3
|
+
matcher: RegExp;
|
|
4
|
+
handler: CacheFirst;
|
|
5
|
+
method?: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
matcher: ({ sameOrigin, url: { pathname } }: import("@serwist/core").RouteMatchCallbackOptions) => boolean;
|
|
8
|
+
method: "GET";
|
|
9
|
+
handler: NetworkFirst;
|
|
10
|
+
} | {
|
|
11
|
+
matcher: ({ request, url: { pathname }, sameOrigin }: import("@serwist/core").RouteMatchCallbackOptions) => boolean | undefined;
|
|
12
|
+
handler: NetworkFirst;
|
|
13
|
+
method?: undefined;
|
|
14
|
+
})[];
|
|
3
15
|
//# sourceMappingURL=defaultCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultCache.d.ts","sourceRoot":"","sources":["../../src/worker/defaultCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultCache.d.ts","sourceRoot":"","sources":["../../src/worker/defaultCache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAwB,MAAM,qBAAqB,CAAC;AAMrF,eAAO,MAAM,YAAY;;;;;;;;;;;;IA6OG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/next",
|
|
3
|
-
"version": "9.0.0-preview.
|
|
3
|
+
"version": "9.0.0-preview.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Next.js application.",
|
|
6
6
|
"files": [
|
|
@@ -12,8 +12,13 @@
|
|
|
12
12
|
"serwistjs",
|
|
13
13
|
"sw",
|
|
14
14
|
"service worker",
|
|
15
|
+
"progressive web apps",
|
|
15
16
|
"web",
|
|
16
|
-
"service-worker"
|
|
17
|
+
"service-worker",
|
|
18
|
+
"progressive-web-apps",
|
|
19
|
+
"next",
|
|
20
|
+
"next.js",
|
|
21
|
+
"pwa"
|
|
17
22
|
],
|
|
18
23
|
"engines": {
|
|
19
24
|
"node": ">=18.0.0"
|
|
@@ -50,32 +55,34 @@
|
|
|
50
55
|
"./package.json": "./package.json"
|
|
51
56
|
},
|
|
52
57
|
"dependencies": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"@serwist/build": "9.0.0-preview.
|
|
56
|
-
"@serwist/core": "9.0.0-preview.
|
|
57
|
-
"@serwist/
|
|
58
|
-
"@serwist/
|
|
58
|
+
"chalk": "5.3.0",
|
|
59
|
+
"glob": "10.3.10",
|
|
60
|
+
"@serwist/build": "9.0.0-preview.10",
|
|
61
|
+
"@serwist/core": "9.0.0-preview.10",
|
|
62
|
+
"@serwist/expiration": "9.0.0-preview.10",
|
|
63
|
+
"@serwist/range-requests": "9.0.0-preview.10",
|
|
64
|
+
"@serwist/strategies": "9.0.0-preview.10",
|
|
65
|
+
"@serwist/webpack-plugin": "9.0.0-preview.10",
|
|
66
|
+
"@serwist/window": "9.0.0-preview.10"
|
|
59
67
|
},
|
|
60
68
|
"devDependencies": {
|
|
61
69
|
"@types/node": "20.11.16",
|
|
62
|
-
"chalk": "5.3.0",
|
|
63
70
|
"next": "14.1.0",
|
|
64
71
|
"react": "18.2.0",
|
|
65
72
|
"react-dom": "18.2.0",
|
|
66
73
|
"rollup": "4.9.6",
|
|
67
74
|
"type-fest": "4.10.2",
|
|
68
|
-
"typescript": "5.4.0-dev.
|
|
75
|
+
"typescript": "5.4.0-dev.20240206",
|
|
69
76
|
"webpack": "5.90.1",
|
|
70
|
-
"@serwist/constants": "9.0.0-preview.
|
|
71
|
-
"@serwist/sw": "9.0.0-preview.
|
|
72
|
-
"@serwist/utils": "9.0.0-preview.
|
|
77
|
+
"@serwist/constants": "9.0.0-preview.10",
|
|
78
|
+
"@serwist/sw": "9.0.0-preview.10",
|
|
79
|
+
"@serwist/utils": "9.0.0-preview.10"
|
|
73
80
|
},
|
|
74
81
|
"peerDependencies": {
|
|
75
82
|
"next": ">=14.0.0",
|
|
76
83
|
"typescript": ">=5.0.0",
|
|
77
84
|
"webpack": ">=5.9.0",
|
|
78
|
-
"@serwist/sw": "9.0.0-preview.
|
|
85
|
+
"@serwist/sw": "9.0.0-preview.10"
|
|
79
86
|
},
|
|
80
87
|
"peerDependenciesMeta": {
|
|
81
88
|
"@serwist/sw": {
|