bosia 0.8.0 → 0.8.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/package.json
CHANGED
|
@@ -97,6 +97,11 @@ export function consumePrefetch(path: string): any | null {
|
|
|
97
97
|
|
|
98
98
|
/** Prefetches data for a path and stores in cache. No-op if already cached/in-flight. */
|
|
99
99
|
export async function prefetchPath(path: string): Promise<void> {
|
|
100
|
+
// Warm the route's +loading.svelte chunk alongside its data, so the skeleton
|
|
101
|
+
// paints instantly on click instead of cold-importing after the old page lingers.
|
|
102
|
+
const warmMatch = findMatch(clientRoutes, new URL(path, window.location.origin).pathname);
|
|
103
|
+
(warmMatch?.route as { loading?: (() => Promise<unknown>) | null } | undefined)?.loading?.();
|
|
104
|
+
|
|
100
105
|
const existing = prefetchCache.get(path);
|
|
101
106
|
if (existing && Date.now() - existing.ts <= 30_000) return;
|
|
102
107
|
if (existing) prefetchCache.delete(path);
|