veryfront 0.1.842 → 0.1.844
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/esm/deno.js +1 -1
- package/esm/src/cache/keys/utils.d.ts.map +1 -1
- package/esm/src/cache/keys/utils.js +17 -2
- package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/router.js +12 -6
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/src/cache/keys/utils.ts"],"names":[],"mappings":"AAAA;;;;;;kFAMkF;AASlF,OAAO,EAAiC,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAI3F,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAcP;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAcrD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAkB1D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAwBzB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,GAAG,GAAG,eAAe,EAC1B,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM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E,MAAM,EAAE,CAAC,CAE7E;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,YAAY,GAAE,OAAc,GAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAU1E;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAW1D"}
|
|
@@ -117,8 +117,7 @@ export function sanitizeQueryParamsForCacheKey(url, options) {
|
|
|
117
117
|
const filtered = filterQueryParams(params, options);
|
|
118
118
|
if (filtered.length === 0)
|
|
119
119
|
return "";
|
|
120
|
-
|
|
121
|
-
const sorted = filtered.sort(([leftKey, leftValue], [rightKey, rightValue]) => leftKey === rightKey ? leftValue.localeCompare(rightValue) : leftKey.localeCompare(rightKey));
|
|
120
|
+
const sorted = sortQueryParamsForCacheKey(filtered);
|
|
122
121
|
// Build sanitized string using allowed characters:
|
|
123
122
|
// - Use hyphen (-) instead of equals (=)
|
|
124
123
|
// - Use underscore (_) instead of ampersand (&)
|
|
@@ -132,6 +131,22 @@ export function sanitizeQueryParamsForCacheKey(url, options) {
|
|
|
132
131
|
.join("_");
|
|
133
132
|
return sanitized;
|
|
134
133
|
}
|
|
134
|
+
function sortQueryParamsForCacheKey(entries) {
|
|
135
|
+
const grouped = new Map();
|
|
136
|
+
for (const entry of entries) {
|
|
137
|
+
const [key] = entry;
|
|
138
|
+
const group = grouped.get(key);
|
|
139
|
+
if (group) {
|
|
140
|
+
group.push(entry);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
grouped.set(key, [entry]);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return [...grouped.keys()]
|
|
147
|
+
.sort((leftKey, rightKey) => leftKey.localeCompare(rightKey))
|
|
148
|
+
.flatMap((key) => grouped.get(key));
|
|
149
|
+
}
|
|
135
150
|
function encodeCacheKeySegment(value) {
|
|
136
151
|
return Array.from(value, (char) => {
|
|
137
152
|
if (/^[a-zA-Z0-9_.-]$/.test(char))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAy0B3B,CAAC"}
|
|
@@ -354,15 +354,21 @@ export const getRouterScript = () => `
|
|
|
354
354
|
return data;
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
+
function startPageDataFetch(path, signal, options = {}) {
|
|
358
|
+
const request = fetchPageDataFresh(path, signal, options).finally(() => {
|
|
359
|
+
if (pendingPageDataFetches.get(path) === request) {
|
|
360
|
+
pendingPageDataFetches.delete(path);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
pendingPageDataFetches.set(path, request);
|
|
364
|
+
return request;
|
|
365
|
+
}
|
|
366
|
+
|
|
357
367
|
function fetchPageDataDeduped(path) {
|
|
358
368
|
const pending = pendingPageDataFetches.get(path);
|
|
359
369
|
if (pending) return pending;
|
|
360
370
|
|
|
361
|
-
|
|
362
|
-
pendingPageDataFetches.delete(path);
|
|
363
|
-
});
|
|
364
|
-
pendingPageDataFetches.set(path, refreshPromise);
|
|
365
|
-
return refreshPromise;
|
|
371
|
+
return startPageDataFetch(path, null);
|
|
366
372
|
}
|
|
367
373
|
|
|
368
374
|
function refreshPageDataInBackground(path) {
|
|
@@ -394,7 +400,7 @@ export const getRouterScript = () => `
|
|
|
394
400
|
return handlePageDataVersionMismatch(path, data);
|
|
395
401
|
}
|
|
396
402
|
|
|
397
|
-
return
|
|
403
|
+
return startPageDataFetch(path, signal, {
|
|
398
404
|
triggerReloadOnVersionMismatch: true,
|
|
399
405
|
recordRouteTiming: true,
|
|
400
406
|
timingSource: 'network'
|