veryfront 0.1.716 → 0.1.720
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/html/hydration-script-builder/templates/router.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/router.js +11 -2
- 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":"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,cA+qB3B,CAAC"}
|
|
@@ -42,6 +42,11 @@ export const getRouterScript = () => `
|
|
|
42
42
|
const log = DEBUG ? console.log.bind(console, '[Veryfront]') : () => {};
|
|
43
43
|
const logError = console.error.bind(console, '[Veryfront]');
|
|
44
44
|
|
|
45
|
+
function logBackgroundFetchFailure(reason, path, error) {
|
|
46
|
+
const message = error?.message ?? String(error);
|
|
47
|
+
log(reason + ' failed:', path, message);
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
function getDocumentNonce() {
|
|
46
51
|
const element = document.querySelector('script[nonce], style[nonce], link[nonce]');
|
|
47
52
|
if (!element) return undefined;
|
|
@@ -290,7 +295,9 @@ export const getRouterScript = () => `
|
|
|
290
295
|
const cached = getCachedPageData(path);
|
|
291
296
|
if (cached) {
|
|
292
297
|
log('Using cached page data:', path);
|
|
293
|
-
fetchPageDataFresh(path, null).catch(() => {
|
|
298
|
+
fetchPageDataFresh(path, null).catch((error) => {
|
|
299
|
+
logBackgroundFetchFailure('Stale page data refresh', path, error);
|
|
300
|
+
});
|
|
294
301
|
return cached;
|
|
295
302
|
}
|
|
296
303
|
|
|
@@ -299,7 +306,9 @@ export const getRouterScript = () => `
|
|
|
299
306
|
|
|
300
307
|
async function fetchPageDataForPrefetch(path) {
|
|
301
308
|
if (getCachedPageData(path)) return;
|
|
302
|
-
return fetchPageDataFresh(path, null).catch(() => {
|
|
309
|
+
return fetchPageDataFresh(path, null).catch((error) => {
|
|
310
|
+
logBackgroundFetchFailure('Page data prefetch', path, error);
|
|
311
|
+
});
|
|
303
312
|
}
|
|
304
313
|
|
|
305
314
|
// ============================================
|