@jasonshimmy/vite-plugin-cer-app 0.20.4 → 0.20.5

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/commits.txt +1 -1
  3. package/dist/plugin/virtual/routes.d.ts.map +1 -1
  4. package/dist/plugin/virtual/routes.js +11 -0
  5. package/dist/plugin/virtual/routes.js.map +1 -1
  6. package/dist/runtime/app-template.d.ts +1 -1
  7. package/dist/runtime/app-template.d.ts.map +1 -1
  8. package/dist/runtime/app-template.js +48 -21
  9. package/dist/runtime/app-template.js.map +1 -1
  10. package/dist/runtime/composables/use-page-data.d.ts +0 -41
  11. package/dist/runtime/composables/use-page-data.d.ts.map +1 -1
  12. package/dist/runtime/composables/use-page-data.js +44 -20
  13. package/dist/runtime/composables/use-page-data.js.map +1 -1
  14. package/dist/runtime/entry-client-template.d.ts +1 -1
  15. package/dist/runtime/entry-client-template.d.ts.map +1 -1
  16. package/dist/runtime/entry-client-template.js +10 -0
  17. package/dist/runtime/entry-client-template.js.map +1 -1
  18. package/dist/runtime/entry-server-template.d.ts +1 -1
  19. package/dist/runtime/entry-server-template.d.ts.map +1 -1
  20. package/dist/runtime/entry-server-template.js +22 -7
  21. package/dist/runtime/entry-server-template.js.map +1 -1
  22. package/e2e/cypress/e2e/group-meta.cy.ts +5 -2
  23. package/package.json +1 -1
  24. package/src/__tests__/plugin/entry-server-template.test.ts +7 -2
  25. package/src/__tests__/plugin/virtual/routes.test.ts +26 -0
  26. package/src/__tests__/runtime/app-template.test.ts +25 -13
  27. package/src/__tests__/runtime/entry-client-template.test.ts +7 -1
  28. package/src/__tests__/runtime/use-page-data.test.ts +178 -1
  29. package/src/plugin/virtual/routes.ts +11 -0
  30. package/src/runtime/app-template.ts +48 -21
  31. package/src/runtime/composables/use-page-data.ts +50 -20
  32. package/src/runtime/entry-client-template.ts +10 -0
  33. package/src/runtime/entry-server-template.ts +22 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
+ ## [v0.20.5] - 2026-04-12
5
+
6
+ - fix: enhance hydration handling and data caching in usePageData and routing middleware (305ae7f)
7
+
4
8
  ## [v0.20.4] - 2026-04-11
5
9
 
6
10
  - fix: enhance SSR and SSG support with improved data handling and dev mode configurations (d1783af)
package/commits.txt CHANGED
@@ -1 +1 @@
1
- - fix: enhance SSR and SSG support with improved data handling and dev mode configurations (d1783af)
1
+ - fix: enhance hydration handling and data caching in usePageData and routing middleware (305ae7f)
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/plugin/virtual/routes.ts"],"names":[],"mappings":"AAmPA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,QAAQ,GAAG,uBAAuB,GAAG,WAAW,CAAA;CAC3D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAsOzG"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/plugin/virtual/routes.ts"],"names":[],"mappings":"AAmPA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,QAAQ,GAAG,uBAAuB,GAAG,WAAW,CAAA;CAC3D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAiPzG"}
@@ -397,6 +397,17 @@ export async function generateRoutesCode(pagesDir, i18n) {
397
397
  // so we never need to eagerly import the page module just to read meta.
398
398
  const mwLiteral = JSON.stringify(mw);
399
399
  mwChainBody = (` beforeEnter: async (to, from) => {\n` +
400
+ ` const _hydrationEntry = (globalThis).__CER_HYDRATION_ENTRY__\n` +
401
+ ` if (\n` +
402
+ ` _hydrationEntry &&\n` +
403
+ ` from.path === to.path &&\n` +
404
+ ` JSON.stringify(from.params ?? {}) === JSON.stringify(to.params ?? {}) &&\n` +
405
+ ` _hydrationEntry.path === to.path &&\n` +
406
+ ` JSON.stringify(_hydrationEntry.query ?? {}) === JSON.stringify(to.query ?? {})\n` +
407
+ ` ) {\n` +
408
+ ` delete (globalThis).__CER_HYDRATION_ENTRY__\n` +
409
+ ` return true\n` +
410
+ ` }\n` +
400
411
  ` const { middleware } = await import('virtual:cer-middleware')\n` +
401
412
  ` const _names = ${mwLiteral}\n` +
402
413
  ` let _idx = 0\n` +
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/plugin/virtual/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE9D;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;IAC3D,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IACrB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IACtB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,mB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C,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACf,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACd,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;IACnC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * automatically receive the latest bootstrap code on plugin update.
6
6
  * This file is gitignored and should never be edited directly.
7
7
  */
8
- export declare const APP_ENTRY_TEMPLATE = "// AUTO-GENERATED by @jasonshimmy/vite-plugin-cer-app \u2014 do not edit.\n// Regenerated automatically on every dev server start and build.\n\nimport '@jasonshimmy/custom-elements-runtime/css'\nimport 'virtual:cer-jit-css'\nimport routes from 'virtual:cer-routes'\nimport layouts from 'virtual:cer-layouts'\nimport plugins from 'virtual:cer-plugins'\nimport { hasLoading, loadingTag } from 'virtual:cer-loading'\nimport { hasError, errorTag } from 'virtual:cer-error'\nimport { runtimeConfig } from 'virtual:cer-app-config'\nimport {\n component,\n ref,\n provide,\n useOnConnected,\n useOnDisconnected,\n registerBuiltinComponents,\n} from '@jasonshimmy/custom-elements-runtime'\nimport { initRouter } from '@jasonshimmy/custom-elements-runtime/router'\nimport { enableJITCSS } from '@jasonshimmy/custom-elements-runtime/jit-css'\nimport { initRuntimeConfig } from '@jasonshimmy/vite-plugin-cer-app/composables'\n\nregisterBuiltinComponents()\nenableJITCSS()\ninitRuntimeConfig(runtimeConfig)\n\nconst router = initRouter({ routes })\n\n// Expose the router globally so useRoute() and navigateTo() can access it\n// from any composable without circular imports.\n;(globalThis).__cerRouter = router\n\n// \u2500\u2500\u2500 Page loader state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Holds the pre-loaded page tag and loader-derived attrs for the current route.\n// Set by _loadPageForPath before every navigation so cer-layout-view can render\n// the page element directly with the correct attributes (enabling useProps()).\nlet _currentPageTag = null\nlet _currentPageAttrs = {}\n// The pathname this tag was loaded for \u2014 used to detect router-internal\n// redirects (e.g. middleware returning '/login') so cer-layout-view falls\n// back to <router-view> when the current route differs from what was pre-loaded.\nlet _currentPagePath = null\n\n// Pre-loads the page module for `path`, calls its loader if present, and\n// stores the results so cer-layout-view can pass them as element attributes.\nasync function _loadPageForPath(path) {\n try {\n const url = new URL(path, 'http://x')\n const query = Object.fromEntries(url.searchParams)\n const matched = router.matchRoute(url.pathname)\n const route = matched?.route\n if (!route?.load) {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = url.pathname\n return\n }\n const mod = await route.load()\n _currentPageTag = mod.default ?? null\n _currentPagePath = url.pathname\n const params = matched.params ?? {}\n let loaderAttrs = { ...params }\n if (typeof mod.loader === 'function') {\n try {\n const data = await mod.loader({ params, query })\n if (data !== undefined && data !== null) {\n // Make loader data available via usePageData() for this navigation.\n ;(globalThis).__CER_DATA__ = data\n // Merge primitive values as element attributes so useProps() works.\n const primitives = Object.fromEntries(\n Object.entries(data).filter(([, v]) => v !== null && v !== undefined && typeof v !== 'object' && typeof v !== 'function')\n )\n loaderAttrs = { ...loaderAttrs, ...primitives }\n }\n } catch (err) {\n // Loader errors are surfaced through currentError so the error boundary\n // (app/error.ts) can display a meaningful message \u2014 consistent with how\n // the server-side handler behaves when a loader throws.\n currentError.value = err instanceof Error ? err.message : String(err)\n }\n }\n _currentPageAttrs = loaderAttrs\n } catch {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = null\n }\n}\n\n// \u2500\u2500\u2500 Navigation state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst isNavigating = ref(false)\nconst currentError = ref(null)\n\nconst resetError = () => {\n currentError.value = null\n void router.replace(router.getCurrent().path)\n}\n;(globalThis).resetError = resetError\n\nconst _push = router.push.bind(router)\nconst _replace = router.replace.bind(router)\n\nrouter.push = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n // Clear stale loader data from the previous route before loading the new one.\n // If the new route has no loader, __CER_DATA__ stays undefined so usePageData()\n // correctly returns null instead of leaking the previous page's data.\n delete (globalThis).__CER_DATA__\n await _loadPageForPath(path)\n await _push(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\nrouter.replace = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n // Clear stale loader data from the previous route before loading the new one.\n delete (globalThis).__CER_DATA__\n await _loadPageForPath(path)\n await _replace(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\n// \u2500\u2500\u2500 Plugins \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Collect plugin-provided values so cer-layout-view can forward them into\n// the component context tree via the real provide() hook (which inject() walks).\n// Declared BEFORE component('cer-layout-view') to avoid a temporal dead zone\n// ReferenceError: customElements.define() upgrades existing DOM elements\n// synchronously, calling the render function immediately.\nconst _pluginProvides = new Map()\n// Expose plugin provides globally so page components can read them synchronously\n// regardless of render order.\n;(globalThis).__cerPluginProvides = _pluginProvides\n\n// \u2500\u2500\u2500 <cer-layout-view> \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// True until the initial page module has loaded and _replace has been called.\n// While true, cer-layout-view renders a <slot> so the SSR/SSG pre-rendered\n// light-DOM content stays visible and no FOUC occurs during the hydration gap.\n// Declared here (before component()) because customElements.define() upgrades\n// existing DOM elements synchronously, so the render function reads this ref\n// on the very first call \u2014 before _doHydrate has a chance to run.\nconst _cerHydrating = ref(true)\n\ncomponent('cer-layout-view', () => {\n // Forward plugin-provided values into the component context so inject() in\n // any descendant component can resolve them by walking up the DOM tree.\n for (const [key, value] of _pluginProvides) {\n provide(key, value)\n }\n\n const current = ref(router.getCurrent())\n let unsub\n\n useOnConnected(() => {\n // Any router navigation (including the initial _replace in _doHydrate) will\n // arrive here. If we are still in the hydration gap when a navigation fires\n // (e.g. a redirect or user interaction before _doHydrate finishes), drop the\n // slot immediately so the live render takes over.\n unsub = router.subscribe((s) => {\n if (_cerHydrating.value) _cerHydrating.value = false\n current.value = s\n })\n })\n useOnDisconnected(() => { unsub?.(); unsub = undefined })\n\n // While the initial page module is being loaded, keep the SSR/SSG\n // pre-rendered light-DOM content visible by forwarding it through a <slot>.\n // This prevents the intermediate blank state that occurs when the shadow DOM\n // renders layout-default with an empty <router-view> before the page chunk\n // has arrived. In SPA mode (no pre-rendered content) the slot is empty, which\n // is no worse than the current router-view behaviour.\n if (_cerHydrating.value) {\n return { tag: 'slot', props: {}, children: [] }\n }\n\n const matched = router.matchRoute(current.value.path)\n const routeMeta = matched?.route?.meta\n\n if (currentError.value !== null) {\n const routeErrorTag = routeMeta?.errorTag ?? null\n const effectiveErrorTag = routeErrorTag ?? (hasError ? errorTag : null)\n if (effectiveErrorTag) {\n return { tag: effectiveErrorTag, props: { attrs: { error: String(currentError.value) } }, children: [] }\n }\n return { tag: 'div', props: { attrs: { style: 'padding:2rem;font-family:monospace' } }, children: String(currentError.value) }\n }\n\n if (isNavigating.value && hasLoading && loadingTag) {\n return { tag: loadingTag, props: {}, children: [] }\n }\n\n // Render the page component directly when a pre-loaded tag is available AND\n // the loaded path matches the current route. The path guard detects\n // router-internal redirects (e.g. middleware returning '/login'): when the\n // router redirects to a different path, _currentPagePath won't match\n // current.value.path and we fall back to <router-view> so the correct page\n // is rendered without stale pre-loaded state.\n const _useDirectRender = _currentPageTag && _currentPagePath === current.value.path\n const pageVnode = _useDirectRender\n ? { tag: _currentPageTag, props: { attrs: _currentPageAttrs }, children: [] }\n : { tag: 'router-view', props: {}, children: [] }\n\n // Support nested layout chains: meta.layoutChain = ['default', 'admin']\n // renders <layout-default><layout-admin><page/></layout-admin></layout-default>\n const chain = routeMeta?.layoutChain\n ? routeMeta.layoutChain\n : [routeMeta?.layout ?? 'default']\n\n // Build nested vnodes from innermost to outermost.\n let vnode = pageVnode\n for (let i = chain.length - 1; i >= 0; i--) {\n const tag = layouts[chain[i]]\n if (tag) vnode = { tag, props: {}, children: [vnode] }\n }\n return vnode\n})\n\nfor (const plugin of plugins) {\n if (plugin && typeof plugin.setup === 'function') {\n await plugin.setup({\n router,\n provide: (key, value) => { _pluginProvides.set(key, value) },\n config: {},\n })\n }\n}\n\n// \u2500\u2500\u2500 Pre-load initial route + hydration strategy \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Download the current page's route chunk AFTER plugins run so that\n// cer-layout-view's first render (which calls provide()) completes before\n// page components are defined and their renders are scheduled. This ensures\n// inject() in child components can find values stored by provide().\n//\n// meta.hydrate controls WHEN the initial page activates:\n// 'load' \u2014 immediately (default)\n// 'idle' \u2014 deferred until requestIdleCallback (browser idle)\n// 'visible' \u2014 deferred until cer-layout-view enters the viewport\n// 'none' \u2014 never: SSR HTML stays as-is, no JS activation\n\nif (typeof window !== 'undefined') {\n const _initMatch = router.matchRoute(window.location.pathname)\n const _hydrateStrategy = _initMatch?.route?.meta?.hydrate ?? 'load'\n\n if (_hydrateStrategy === 'none') {\n // Static HTML only \u2014 leave SSR output untouched, clean up data immediately.\n delete (globalThis).__CER_DATA__\n } else {\n const _doHydrate = async () => {\n const _initPath = window.location.pathname + window.location.search + window.location.hash\n // Pre-load the page module and run the loader so cer-layout-view renders\n // the page tag directly with loader attrs (enables useProps() on hydration).\n await _loadPageForPath(_initPath)\n // Only activate the initial route if the URL hasn't changed while we were\n // loading the module asynchronously (e.g. a test or plugin navigated away\n // before _doHydrate finished). Calling _replace with a stale path would\n // override any navigation that happened during the async gap.\n const _currentPath = window.location.pathname + window.location.search + window.location.hash\n // Drop the hydration slot cover unconditionally: the page module is loaded\n // and cer-layout-view must switch from the <slot> to live rendering whether\n // or not a redirect changed the path during loading.\n _cerHydrating.value = false\n if (_currentPath === _initPath) {\n // Use the original (unwrapped) replace so isNavigating stays false during\n // the initial paint \u2014 the loading component must not flash over pre-rendered content.\n await _replace(_initPath)\n }\n // Defer the data cleanup by one microtask so that cer-layout-view's reactive\n // re-render \u2014 scheduled via queueMicrotask by the reactive system when the\n // router fires its subscribers during _replace \u2014 can still read __CER_DATA__.\n // Clearing synchronously here would remove the data before the queued render\n // runs, causing usePageData() to return null on the initial page load.\n // Subsequent navigations via router.push / router.replace each delete\n // __CER_DATA__ themselves before calling _loadPageForPath, so this deferred\n // cleanup only matters for the very first hydration render.\n queueMicrotask(() => { delete (globalThis).__CER_DATA__ })\n }\n\n if (_hydrateStrategy === 'idle') {\n // Defer until the browser has finished higher-priority work.\n if (typeof requestIdleCallback !== 'undefined') {\n requestIdleCallback(() => { void _doHydrate() })\n } else {\n // Safari / older environments fallback.\n setTimeout(() => { void _doHydrate() }, 1)\n }\n } else if (_hydrateStrategy === 'visible') {\n // Defer until cer-layout-view (or body as fallback) enters the viewport.\n const _el = document.querySelector('cer-layout-view') ?? document.body\n const _io = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) { _io.disconnect(); void _doHydrate() }\n })\n _io.observe(_el)\n } else {\n // 'load' \u2014 hydrate immediately (default behaviour).\n await _doHydrate()\n }\n }\n}\n\nexport { router }\n";
8
+ export declare const APP_ENTRY_TEMPLATE = "// AUTO-GENERATED by @jasonshimmy/vite-plugin-cer-app \u2014 do not edit.\n// Regenerated automatically on every dev server start and build.\n\nimport '@jasonshimmy/custom-elements-runtime/css'\nimport 'virtual:cer-jit-css'\nimport routes from 'virtual:cer-routes'\nimport layouts from 'virtual:cer-layouts'\nimport plugins from 'virtual:cer-plugins'\nimport { hasLoading, loadingTag } from 'virtual:cer-loading'\nimport { hasError, errorTag } from 'virtual:cer-error'\nimport { runtimeConfig } from 'virtual:cer-app-config'\nimport {\n component,\n ref,\n provide,\n useOnConnected,\n useOnDisconnected,\n registerBuiltinComponents,\n} from '@jasonshimmy/custom-elements-runtime'\nimport { initRouter } from '@jasonshimmy/custom-elements-runtime/router'\nimport { enableJITCSS } from '@jasonshimmy/custom-elements-runtime/jit-css'\nimport { initRuntimeConfig } from '@jasonshimmy/vite-plugin-cer-app/composables'\n\nregisterBuiltinComponents()\nenableJITCSS()\ninitRuntimeConfig(runtimeConfig)\n\nconst router = initRouter({ routes })\n\n// Expose the router globally so useRoute() and navigateTo() can access it\n// from any composable without circular imports.\n;(globalThis).__cerRouter = router\n\n// \u2500\u2500\u2500 Page loader state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Holds the pre-loaded page tag and loader-derived attrs for the current route.\n// Set by _loadPageForPath before every navigation so cer-layout-view can render\n// the page element directly with the correct attributes (enabling useProps()).\nlet _currentPageTag = null\nlet _currentPageAttrs = {}\n// The pathname this tag was loaded for \u2014 used to detect router-internal\n// redirects (e.g. middleware returning '/login') so cer-layout-view falls\n// back to <router-view> when the current route differs from what was pre-loaded.\nlet _currentPagePath = null\n\nfunction _toLoaderAttrs(data) {\n if (data === undefined || data === null || typeof data !== 'object') return {}\n return Object.fromEntries(\n Object.entries(data).filter(([, v]) => v !== null && v !== undefined && typeof v !== 'object' && typeof v !== 'function')\n )\n}\n\n// Pre-loads the page module for `path`, calls its loader if present, and\n// stores the results so cer-layout-view can pass them as element attributes.\nasync function _loadPageForPath(path, options = {}) {\n try {\n const url = new URL(path, 'http://x')\n const query = Object.fromEntries(url.searchParams)\n const { runLoader = true, initialData } = options ?? {}\n const matched = router.matchRoute(url.pathname)\n const route = matched?.route\n if (!route?.load) {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = url.pathname\n return\n }\n const mod = await route.load()\n _currentPageTag = mod.default ?? null\n _currentPagePath = url.pathname\n const params = matched.params ?? {}\n let loaderAttrs = { ...params }\n let loaderData = initialData\n if (typeof mod.loader === 'function' && runLoader) {\n try {\n const data = await mod.loader({ params, query })\n if (data !== undefined && data !== null) {\n loaderData = data\n // Make loader data available via usePageData() for this navigation.\n ;(globalThis).__CER_DATA__ = data\n }\n } catch (err) {\n // Loader errors are surfaced through currentError so the error boundary\n // (app/error.ts) can display a meaningful message \u2014 consistent with how\n // the server-side handler behaves when a loader throws.\n currentError.value = err instanceof Error ? err.message : String(err)\n }\n }\n // For the very first hydration pass in SSR/SSG we already have the server's\n // loader payload in globalThis.__CER_DATA__ / window.__CER_DATA__. Reuse it\n // instead of re-running the loader on the client, then derive primitive attrs\n // from that payload so useProps() stays consistent with usePageData().\n loaderAttrs = { ...loaderAttrs, ..._toLoaderAttrs(loaderData) }\n _currentPageAttrs = loaderAttrs\n } catch {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = null\n }\n}\n\n// \u2500\u2500\u2500 Navigation state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst isNavigating = ref(false)\nconst currentError = ref(null)\n\nconst resetError = () => {\n currentError.value = null\n void router.replace(router.getCurrent().path)\n}\n;(globalThis).resetError = resetError\n\nconst _push = router.push.bind(router)\nconst _replace = router.replace.bind(router)\n\nrouter.push = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n // Clear stale loader data from the previous route before loading the new one.\n // If the new route has no loader, __CER_DATA__ stays undefined so usePageData()\n // correctly returns null instead of leaking the previous page's data.\n delete (globalThis).__CER_DATA__\n await _loadPageForPath(path)\n await _push(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\nrouter.replace = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n // Clear stale loader data from the previous route before loading the new one.\n delete (globalThis).__CER_DATA__\n await _loadPageForPath(path)\n await _replace(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\n// \u2500\u2500\u2500 Plugins \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Collect plugin-provided values so cer-layout-view can forward them into\n// the component context tree via the real provide() hook (which inject() walks).\n// Declared BEFORE component('cer-layout-view') to avoid a temporal dead zone\n// ReferenceError: customElements.define() upgrades existing DOM elements\n// synchronously, calling the render function immediately.\nconst _pluginProvides = new Map()\n// Expose plugin provides globally so page components can read them synchronously\n// regardless of render order.\n;(globalThis).__cerPluginProvides = _pluginProvides\n\n// \u2500\u2500\u2500 <cer-layout-view> \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// True until the initial page module has loaded and _replace has been called.\n// While true, cer-layout-view renders a <slot> so the SSR/SSG pre-rendered\n// light-DOM content stays visible and no FOUC occurs during the hydration gap.\n// Declared here (before component()) because customElements.define() upgrades\n// existing DOM elements synchronously, so the render function reads this ref\n// on the very first call \u2014 before _doHydrate has a chance to run.\nconst _cerHydrating = ref(true)\n\ncomponent('cer-layout-view', () => {\n // Forward plugin-provided values into the component context so inject() in\n // any descendant component can resolve them by walking up the DOM tree.\n for (const [key, value] of _pluginProvides) {\n provide(key, value)\n }\n\n const current = ref(router.getCurrent())\n let unsub\n let _sawInitialRouteState = false\n\n useOnConnected(() => {\n // store.subscribe() synchronously pushes the current route once on\n // subscription. That initial callback is not a real navigation and must not\n // tear down the SSR slot before _doHydrate has pre-loaded the page.\n // Subsequent callbacks are real navigations (including the initial _replace\n // in _doHydrate), so if they arrive during the hydration gap we drop the\n // slot immediately and let the live render take over.\n unsub = router.subscribe((s) => {\n const _isInitialSubscribePush = !_sawInitialRouteState\n _sawInitialRouteState = true\n if (_isInitialSubscribePush) {\n current.value = s\n return\n }\n if (_cerHydrating.value) _cerHydrating.value = false\n current.value = s\n })\n })\n useOnDisconnected(() => { unsub?.(); unsub = undefined })\n\n // While the initial page module is being loaded, keep the SSR/SSG\n // pre-rendered light-DOM content visible by forwarding it through a <slot>.\n // This prevents the intermediate blank state that occurs when the shadow DOM\n // renders layout-default with an empty <router-view> before the page chunk\n // has arrived. In SPA mode (no pre-rendered content) the slot is empty, which\n // is no worse than the current router-view behaviour.\n if (_cerHydrating.value) {\n return { tag: 'slot', props: {}, children: [] }\n }\n\n const matched = router.matchRoute(current.value.path)\n const routeMeta = matched?.route?.meta\n\n if (currentError.value !== null) {\n const routeErrorTag = routeMeta?.errorTag ?? null\n const effectiveErrorTag = routeErrorTag ?? (hasError ? errorTag : null)\n if (effectiveErrorTag) {\n return { tag: effectiveErrorTag, props: { attrs: { error: String(currentError.value) } }, children: [] }\n }\n return { tag: 'div', props: { attrs: { style: 'padding:2rem;font-family:monospace' } }, children: String(currentError.value) }\n }\n\n if (isNavigating.value && hasLoading && loadingTag) {\n return { tag: loadingTag, props: {}, children: [] }\n }\n\n // Render the page component directly when a pre-loaded tag is available AND\n // the loaded path matches the current route. The path guard detects\n // router-internal redirects (e.g. middleware returning '/login'): when the\n // router redirects to a different path, _currentPagePath won't match\n // current.value.path and we fall back to <router-view> so the correct page\n // is rendered without stale pre-loaded state.\n const _useDirectRender = _currentPageTag && _currentPagePath === current.value.path\n const pageVnode = _useDirectRender\n ? { tag: _currentPageTag, props: { attrs: _currentPageAttrs }, children: [] }\n : { tag: 'router-view', props: {}, children: [] }\n\n // Support nested layout chains: meta.layoutChain = ['default', 'admin']\n // renders <layout-default><layout-admin><page/></layout-admin></layout-default>\n const chain = routeMeta?.layoutChain\n ? routeMeta.layoutChain\n : [routeMeta?.layout ?? 'default']\n\n // Build nested vnodes from innermost to outermost.\n let vnode = pageVnode\n for (let i = chain.length - 1; i >= 0; i--) {\n const tag = layouts[chain[i]]\n if (tag) vnode = { tag, props: {}, children: [vnode] }\n }\n return vnode\n})\n\nfor (const plugin of plugins) {\n if (plugin && typeof plugin.setup === 'function') {\n await plugin.setup({\n router,\n provide: (key, value) => { _pluginProvides.set(key, value) },\n config: {},\n })\n }\n}\n\n// \u2500\u2500\u2500 Pre-load initial route + hydration strategy \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Download the current page's route chunk AFTER plugins run so that\n// cer-layout-view's first render (which calls provide()) completes before\n// page components are defined and their renders are scheduled. This ensures\n// inject() in child components can find values stored by provide().\n//\n// meta.hydrate controls WHEN the initial page activates:\n// 'load' \u2014 immediately (default)\n// 'idle' \u2014 deferred until requestIdleCallback (browser idle)\n// 'visible' \u2014 deferred until cer-layout-view enters the viewport\n// 'none' \u2014 never: SSR HTML stays as-is, no JS activation\n\nif (typeof window !== 'undefined') {\n const _initMatch = router.matchRoute(window.location.pathname)\n const _hydrateStrategy = _initMatch?.route?.meta?.hydrate ?? 'load'\n\n if (_hydrateStrategy === 'none') {\n // Static HTML only \u2014 leave SSR output untouched, clean up data immediately.\n delete (globalThis).__CER_DATA__\n } else {\n const _doHydrate = async () => {\n const _initPath = window.location.pathname + window.location.search + window.location.hash\n const _hasInitialLoaderData = Object.prototype.hasOwnProperty.call(globalThis, '__CER_DATA__')\n // Pre-load the page module and run the loader so cer-layout-view renders\n // the page tag directly with loader attrs (enables useProps() on hydration).\n await _loadPageForPath(\n _initPath,\n _hasInitialLoaderData\n ? { runLoader: false, initialData: (globalThis).__CER_DATA__ }\n : undefined,\n )\n // Only activate the initial route if the URL hasn't changed while we were\n // loading the module asynchronously (e.g. a test or plugin navigated away\n // before _doHydrate finished). Calling _replace with a stale path would\n // override any navigation that happened during the async gap.\n const _currentPath = window.location.pathname + window.location.search + window.location.hash\n // Drop the hydration slot cover unconditionally: the page module is loaded\n // and cer-layout-view must switch from the <slot> to live rendering whether\n // or not a redirect changed the path during loading.\n _cerHydrating.value = false\n if (_currentPath === _initPath) {\n // Use the original (unwrapped) replace so isNavigating stays false during\n // the initial paint \u2014 the loading component must not flash over pre-rendered content.\n await _replace(_initPath)\n }\n // The client entry marks the already-rendered entry URL so generated\n // route middleware can skip the browser router's startup replay once.\n // Clear any leftover flag after the first hydrated route commits so later\n // navigations always run middleware normally.\n queueMicrotask(() => { delete (globalThis).__CER_HYDRATION_ENTRY__ })\n // Keep the initial route's SSR data available after hydration.\n // Browser engines do not all upgrade and re-render custom elements with\n // identical timing, so deleting __CER_DATA__ here can cause a later\n // hydration render to fall back to the client-only path. The next real\n // router.push/router.replace clears __CER_DATA__ before loading the new\n // route, so stale page data still does not leak across navigations.\n }\n\n if (_hydrateStrategy === 'idle') {\n // Defer until the browser has finished higher-priority work.\n if (typeof requestIdleCallback !== 'undefined') {\n requestIdleCallback(() => { void _doHydrate() })\n } else {\n // Safari / older environments fallback.\n setTimeout(() => { void _doHydrate() }, 1)\n }\n } else if (_hydrateStrategy === 'visible') {\n // Defer until cer-layout-view (or body as fallback) enters the viewport.\n const _el = document.querySelector('cer-layout-view') ?? document.body\n const _io = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) { _io.disconnect(); void _doHydrate() }\n })\n _io.observe(_el)\n } else {\n // 'load' \u2014 hydrate immediately (default behaviour).\n await _doHydrate()\n }\n }\n}\n\nexport { router }\n";
9
9
  //# sourceMappingURL=app-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-template.d.ts","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,k6dA4T9B,CAAA"}
1
+ {"version":3,"file":"app-template.d.ts","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,omgBAuV9B,CAAA"}
@@ -50,12 +50,20 @@ let _currentPageAttrs = {}
50
50
  // back to <router-view> when the current route differs from what was pre-loaded.
51
51
  let _currentPagePath = null
52
52
 
53
+ function _toLoaderAttrs(data) {
54
+ if (data === undefined || data === null || typeof data !== 'object') return {}
55
+ return Object.fromEntries(
56
+ Object.entries(data).filter(([, v]) => v !== null && v !== undefined && typeof v !== 'object' && typeof v !== 'function')
57
+ )
58
+ }
59
+
53
60
  // Pre-loads the page module for \`path\`, calls its loader if present, and
54
61
  // stores the results so cer-layout-view can pass them as element attributes.
55
- async function _loadPageForPath(path) {
62
+ async function _loadPageForPath(path, options = {}) {
56
63
  try {
57
64
  const url = new URL(path, 'http://x')
58
65
  const query = Object.fromEntries(url.searchParams)
66
+ const { runLoader = true, initialData } = options ?? {}
59
67
  const matched = router.matchRoute(url.pathname)
60
68
  const route = matched?.route
61
69
  if (!route?.load) {
@@ -69,17 +77,14 @@ async function _loadPageForPath(path) {
69
77
  _currentPagePath = url.pathname
70
78
  const params = matched.params ?? {}
71
79
  let loaderAttrs = { ...params }
72
- if (typeof mod.loader === 'function') {
80
+ let loaderData = initialData
81
+ if (typeof mod.loader === 'function' && runLoader) {
73
82
  try {
74
83
  const data = await mod.loader({ params, query })
75
84
  if (data !== undefined && data !== null) {
85
+ loaderData = data
76
86
  // Make loader data available via usePageData() for this navigation.
77
87
  ;(globalThis).__CER_DATA__ = data
78
- // Merge primitive values as element attributes so useProps() works.
79
- const primitives = Object.fromEntries(
80
- Object.entries(data).filter(([, v]) => v !== null && v !== undefined && typeof v !== 'object' && typeof v !== 'function')
81
- )
82
- loaderAttrs = { ...loaderAttrs, ...primitives }
83
88
  }
84
89
  } catch (err) {
85
90
  // Loader errors are surfaced through currentError so the error boundary
@@ -88,6 +93,11 @@ async function _loadPageForPath(path) {
88
93
  currentError.value = err instanceof Error ? err.message : String(err)
89
94
  }
90
95
  }
96
+ // For the very first hydration pass in SSR/SSG we already have the server's
97
+ // loader payload in globalThis.__CER_DATA__ / window.__CER_DATA__. Reuse it
98
+ // instead of re-running the loader on the client, then derive primitive attrs
99
+ // from that payload so useProps() stays consistent with usePageData().
100
+ loaderAttrs = { ...loaderAttrs, ..._toLoaderAttrs(loaderData) }
91
101
  _currentPageAttrs = loaderAttrs
92
102
  } catch {
93
103
  _currentPageTag = null
@@ -173,13 +183,22 @@ component('cer-layout-view', () => {
173
183
 
174
184
  const current = ref(router.getCurrent())
175
185
  let unsub
186
+ let _sawInitialRouteState = false
176
187
 
177
188
  useOnConnected(() => {
178
- // Any router navigation (including the initial _replace in _doHydrate) will
179
- // arrive here. If we are still in the hydration gap when a navigation fires
180
- // (e.g. a redirect or user interaction before _doHydrate finishes), drop the
181
- // slot immediately so the live render takes over.
189
+ // store.subscribe() synchronously pushes the current route once on
190
+ // subscription. That initial callback is not a real navigation and must not
191
+ // tear down the SSR slot before _doHydrate has pre-loaded the page.
192
+ // Subsequent callbacks are real navigations (including the initial _replace
193
+ // in _doHydrate), so if they arrive during the hydration gap we drop the
194
+ // slot immediately and let the live render take over.
182
195
  unsub = router.subscribe((s) => {
196
+ const _isInitialSubscribePush = !_sawInitialRouteState
197
+ _sawInitialRouteState = true
198
+ if (_isInitialSubscribePush) {
199
+ current.value = s
200
+ return
201
+ }
183
202
  if (_cerHydrating.value) _cerHydrating.value = false
184
203
  current.value = s
185
204
  })
@@ -270,9 +289,15 @@ if (typeof window !== 'undefined') {
270
289
  } else {
271
290
  const _doHydrate = async () => {
272
291
  const _initPath = window.location.pathname + window.location.search + window.location.hash
292
+ const _hasInitialLoaderData = Object.prototype.hasOwnProperty.call(globalThis, '__CER_DATA__')
273
293
  // Pre-load the page module and run the loader so cer-layout-view renders
274
294
  // the page tag directly with loader attrs (enables useProps() on hydration).
275
- await _loadPageForPath(_initPath)
295
+ await _loadPageForPath(
296
+ _initPath,
297
+ _hasInitialLoaderData
298
+ ? { runLoader: false, initialData: (globalThis).__CER_DATA__ }
299
+ : undefined,
300
+ )
276
301
  // Only activate the initial route if the URL hasn't changed while we were
277
302
  // loading the module asynchronously (e.g. a test or plugin navigated away
278
303
  // before _doHydrate finished). Calling _replace with a stale path would
@@ -287,15 +312,17 @@ if (typeof window !== 'undefined') {
287
312
  // the initial paint — the loading component must not flash over pre-rendered content.
288
313
  await _replace(_initPath)
289
314
  }
290
- // Defer the data cleanup by one microtask so that cer-layout-view's reactive
291
- // re-render scheduled via queueMicrotask by the reactive system when the
292
- // router fires its subscribers during _replace can still read __CER_DATA__.
293
- // Clearing synchronously here would remove the data before the queued render
294
- // runs, causing usePageData() to return null on the initial page load.
295
- // Subsequent navigations via router.push / router.replace each delete
296
- // __CER_DATA__ themselves before calling _loadPageForPath, so this deferred
297
- // cleanup only matters for the very first hydration render.
298
- queueMicrotask(() => { delete (globalThis).__CER_DATA__ })
315
+ // The client entry marks the already-rendered entry URL so generated
316
+ // route middleware can skip the browser router's startup replay once.
317
+ // Clear any leftover flag after the first hydrated route commits so later
318
+ // navigations always run middleware normally.
319
+ queueMicrotask(() => { delete (globalThis).__CER_HYDRATION_ENTRY__ })
320
+ // Keep the initial route's SSR data available after hydration.
321
+ // Browser engines do not all upgrade and re-render custom elements with
322
+ // identical timing, so deleting __CER_DATA__ here can cause a later
323
+ // hydration render to fall back to the client-only path. The next real
324
+ // router.push/router.replace clears __CER_DATA__ before loading the new
325
+ // route, so stale page data still does not leak across navigations.
299
326
  }
300
327
 
301
328
  if (_hydrateStrategy === 'idle') {
@@ -1 +1 @@
1
- {"version":3,"file":"app-template.js","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4TjC,CAAA"}
1
+ {"version":3,"file":"app-template.js","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuVjC,CAAA"}
@@ -1,43 +1,2 @@
1
- /**
2
- * usePageData — reads SSR-injected loader data for the current page.
3
- *
4
- * During SSR/SSG the server calls the matched route's `loader()` function
5
- * and makes the result available in two ways:
6
- *
7
- * 1. **Server render pass** — the data is stored in a per-request
8
- * `AsyncLocalStorage` context (set via `_cerDataStore.enterWith(data)`
9
- * in the entry-server template). `usePageData()` reads this store so the
10
- * component renders with real data in the initial SSR/SSG HTML.
11
- *
12
- * 2. **Client hydration** — the server also serializes the data as
13
- * `window.__CER_DATA__` in the page `<head>`. On first component
14
- * instantiation `usePageData()` returns that value so the client
15
- * starts with the correct state without an extra network round-trip.
16
- *
17
- * The client-side value is cleared via `queueMicrotask` in `_doHydrate`
18
- * (app-template) after the initial router navigation completes — deferred by
19
- * one microtask so the queued reactive re-render can still read the data
20
- * before it is removed. Subsequent navigations via `router.push` / `router.replace`
21
- * each clear `__CER_DATA__` synchronously before loading the next page's data.
22
- *
23
- * @returns The serialized loader result, or `null` if no SSR data is present.
24
- *
25
- * @example
26
- * ```ts
27
- * component('page-blog-slug', () => {
28
- * const ssrData = usePageData<{ title: string; body: string }>()
29
- * const title = ref(ssrData?.title ?? '')
30
- * const body = ref(ssrData?.body ?? '')
31
- *
32
- * useOnConnected(() => {
33
- * if (ssrData) return // already hydrated from SSR — skip fetch
34
- * fetch(`/api/posts/${props.slug}`).then(r => r.json()).then(post => {
35
- * title.value = post.title
36
- * body.value = post.body
37
- * })
38
- * })
39
- * })
40
- * ```
41
- */
42
1
  export declare function usePageData<T = unknown>(): T | null;
43
2
  //# sourceMappingURL=use-page-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-page-data.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/use-page-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,OAAO,KAAK,CAAC,GAAG,IAAI,CAqBnD"}
1
+ {"version":3,"file":"use-page-data.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/use-page-data.ts"],"names":[],"mappings":"AAgDA,wBAAgB,WAAW,CAAC,CAAC,GAAG,OAAO,KAAK,CAAC,GAAG,IAAI,CA4CnD"}
@@ -5,20 +5,22 @@
5
5
  * and makes the result available in two ways:
6
6
  *
7
7
  * 1. **Server render pass** — the data is stored in a per-request
8
- * `AsyncLocalStorage` context (set via `_cerDataStore.enterWith(data)`
9
- * in the entry-server template). `usePageData()` reads this store so the
10
- * component renders with real data in the initial SSR/SSG HTML.
8
+ * `AsyncLocalStorage` context (set via `_cerDataStore.run(data, ...)` in the
9
+ * entry-server template). `usePageData()` reads this store so the component
10
+ * renders with real data in the initial SSR/SSG HTML.
11
11
  *
12
12
  * 2. **Client hydration** — the server also serializes the data as
13
- * `window.__CER_DATA__` in the page `<head>`. On first component
14
- * instantiation `usePageData()` returns that value so the client
15
- * starts with the correct state without an extra network round-trip.
13
+ * `window.__CER_DATA__` in the page `<head>`. On first component render
14
+ * `usePageData()` returns that value, caches it on the component context, and
15
+ * returns the same cached value on all subsequent re-renders of that component
16
+ * instance. The data remains available for the initial hydrated route until
17
+ * the next client-side navigation clears it before loading new page data.
16
18
  *
17
- * The client-side value is cleared via `queueMicrotask` in `_doHydrate`
18
- * (app-template) after the initial router navigation completes deferred by
19
- * one microtask so the queued reactive re-render can still read the data
20
- * before it is removed. Subsequent navigations via `router.push` / `router.replace`
21
- * each clear `__CER_DATA__` synchronously before loading the next page's data.
19
+ * **Why caching is necessary**: the render function passed to `component()` is
20
+ * called on every re-render (it is the render function, not a setup function).
21
+ * Without caching, `usePageData()` could return `null` on later re-renders if a
22
+ * browser upgrades or re-renders the hydrated page after the initial read,
23
+ * flip the `ssrData` guard from truthy null, and re-trigger client-side fetches.
22
24
  *
23
25
  * @returns The serialized loader result, or `null` if no SSR data is present.
24
26
  *
@@ -39,6 +41,9 @@
39
41
  * })
40
42
  * ```
41
43
  */
44
+ import { getCurrentComponentContext } from '@jasonshimmy/custom-elements-runtime';
45
+ // Key used to cache the page data on the component context object across re-renders.
46
+ const _PAGE_DATA_KEY = '_cerPageData';
42
47
  export function usePageData() {
43
48
  const g = globalThis;
44
49
  // Server-side: read from the per-request AsyncLocalStorage context.
@@ -50,15 +55,34 @@ export function usePageData() {
50
55
  if (ssrData !== undefined && ssrData !== null)
51
56
  return ssrData;
52
57
  }
53
- // Client-side: read from window.__CER_DATA__ captured by the client entry.
54
- // Do NOT clear here — the data is cleared by app-template.ts after the
55
- // initial router.replace() completes. This ensures both the pre-rendered
56
- // element (upgraded during component registration) and the new element
57
- // created by router.replace() can both access the SSR data without a
58
- // race where the first read consumes it before the second can use it.
58
+ // Client-side: check the component context cache first.
59
+ // getCurrentComponentContext() returns the context object for the component
60
+ // whose renderFn is currently executing (set by the component() runtime
61
+ // before calling renderFn). Caching on the context ensures the same value is
62
+ // returned on every re-render of the same element instance even if the
63
+ // browser performs a later hydration-time re-render.
64
+ const ctx = getCurrentComponentContext();
65
+ if (ctx) {
66
+ if (_PAGE_DATA_KEY in ctx) {
67
+ return ctx[_PAGE_DATA_KEY];
68
+ }
69
+ }
70
+ // Read the raw value from the global set by the server-rendered <script> tag.
59
71
  const data = g['__CER_DATA__'];
60
- if (data === undefined || data === null)
61
- return null;
62
- return data;
72
+ const result = (data === undefined || data === null) ? null : data;
73
+ // Cache on the component context so subsequent re-renders of this element
74
+ // instance return the same value without reading __CER_DATA__ again.
75
+ // Use Object.defineProperty to bypass the reactive Proxy set-trap on context,
76
+ // which would otherwise schedule a spurious re-render (and risk an infinite loop)
77
+ // every time we first cache the value.
78
+ if (ctx) {
79
+ Object.defineProperty(ctx, _PAGE_DATA_KEY, {
80
+ value: result,
81
+ writable: false,
82
+ enumerable: false,
83
+ configurable: true,
84
+ });
85
+ }
86
+ return result;
63
87
  }
64
88
  //# sourceMappingURL=use-page-data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-page-data.js","sourceRoot":"","sources":["../../../src/runtime/composables/use-page-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,GAAG,UAAqC,CAAA;IAE/C,oEAAoE;IACpE,6EAA6E;IAC7E,s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,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,cAAc,IAAI,GAAG,EAAE,CAAC;YAC1B,OAAO,GAAG,CAAC,cAAc,CAAa,CAAA;QACxC,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,MAAM,IAAI,GAAG,CAAC,CAAC,cAAc,CAAyB,CAAA;IACtD,MAAM,MAAM,GAAa,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAE5E,0EAA0E;IAC1E,qEAAqE;IACrE,8EAA8E;IAC9E,kFAAkF;IAClF,uCAAuC;IACvC,IAAI,GAAG,EAAE,CAAC;QACR,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE;YACzC,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;SACnB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -4,5 +4,5 @@
4
4
  * This is the browser-side entry point for SSR/SSG modes.
5
5
  * It hydrates the server-rendered HTML and activates client-side routing.
6
6
  */
7
- export declare const ENTRY_CLIENT_TEMPLATE = "// Client-side entry \u2014 hydrates SSR output\n\n// Capture SSR loader data before any scripts clear it.\n// usePageData() reads from this global; it is cleared after the first read\n// so subsequent client-side navigations don't reuse stale data.\nif (typeof window !== 'undefined' && window.__CER_DATA__) {\n (globalThis).__CER_DATA__ = window.__CER_DATA__\n}\n\n// Capture useFetch() data pre-fetched on the server.\n// Keys are consumed on first read; subsequent navigations fetch fresh.\nif (typeof window !== 'undefined' && window.__CER_FETCH_DATA__) {\n (globalThis).__CER_FETCH_DATA__ = window.__CER_FETCH_DATA__\n}\n\n// Capture the authenticated user injected by the SSR handler.\n// useAuth() reads this on the client instead of re-reading the cookie.\nif (typeof window !== 'undefined' && window.__CER_AUTH_USER__) {\n (globalThis).__CER_AUTH_USER__ = window.__CER_AUTH_USER__\n}\n\nimport './app.js'\n";
7
+ export declare const ENTRY_CLIENT_TEMPLATE = "// Client-side entry \u2014 hydrates SSR output\n\n// Mark the already-rendered entry URL so plugin-generated route middleware can\n// skip replaying guards once during hydration. This is cleared by the app\n// bootstrap after the initial hydrated route commits.\nif (typeof window !== 'undefined') {\n (globalThis).__CER_HYDRATION_ENTRY__ = {\n path: window.location.pathname,\n query: Object.fromEntries(new URLSearchParams(window.location.search)),\n }\n}\n\n// Capture SSR loader data before any scripts clear it.\n// usePageData() reads from this global; it is cleared after the first read\n// so subsequent client-side navigations don't reuse stale data.\nif (typeof window !== 'undefined' && window.__CER_DATA__) {\n (globalThis).__CER_DATA__ = window.__CER_DATA__\n}\n\n// Capture useFetch() data pre-fetched on the server.\n// Keys are consumed on first read; subsequent navigations fetch fresh.\nif (typeof window !== 'undefined' && window.__CER_FETCH_DATA__) {\n (globalThis).__CER_FETCH_DATA__ = window.__CER_FETCH_DATA__\n}\n\n// Capture the authenticated user injected by the SSR handler.\n// useAuth() reads this on the client instead of re-reading the cookie.\nif (typeof window !== 'undefined' && window.__CER_AUTH_USER__) {\n (globalThis).__CER_AUTH_USER__ = window.__CER_AUTH_USER__\n}\n\nimport './app.js'\n";
8
8
  //# sourceMappingURL=entry-client-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry-client-template.d.ts","sourceRoot":"","sources":["../../src/runtime/entry-client-template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,45BAsBjC,CAAA"}
1
+ {"version":3,"file":"entry-client-template.d.ts","sourceRoot":"","sources":["../../src/runtime/entry-client-template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+zCAgCjC,CAAA"}
@@ -6,6 +6,16 @@
6
6
  */
7
7
  export const ENTRY_CLIENT_TEMPLATE = `// Client-side entry — hydrates SSR output
8
8
 
9
+ // Mark the already-rendered entry URL so plugin-generated route middleware can
10
+ // skip replaying guards once during hydration. This is cleared by the app
11
+ // bootstrap after the initial hydrated route commits.
12
+ if (typeof window !== 'undefined') {
13
+ (globalThis).__CER_HYDRATION_ENTRY__ = {
14
+ path: window.location.pathname,
15
+ query: Object.fromEntries(new URLSearchParams(window.location.search)),
16
+ }
17
+ }
18
+
9
19
  // Capture SSR loader data before any scripts clear it.
10
20
  // usePageData() reads from this global; it is cleared after the first read
11
21
  // so subsequent client-side navigations don't reuse stale data.
@@ -1 +1 @@
1
- {"version":3,"file":"entry-client-template.js","sourceRoot":"","sources":["../../src/runtime/entry-client-template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsBpC,CAAA"}
1
+ {"version":3,"file":"entry-client-template.js","sourceRoot":"","sources":["../../src/runtime/entry-client-template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCpC,CAAA"}