@askrjs/askr 0.0.57 → 0.0.59

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 (31) hide show
  1. package/dist/actions/index.js +1 -1
  2. package/dist/benchmark.js +6 -6
  3. package/dist/boot/index.js +1 -1
  4. package/dist/{boot-BaFSlNg6.js → boot-BFz3Cwc3.js} +14 -21
  5. package/dist/{cleanup-DScKZG2i.js → cleanup-Br2t23wI.js} +1 -1
  6. package/dist/{component-internal-NdN_bJ2-.js → component-internal-S_ILK7MY.js} +3 -24
  7. package/dist/{component-lifecycle-C7lnU9Bt.js → component-lifecycle-DFyfmw6H.js} +31 -1
  8. package/dist/control/index.js +1 -1
  9. package/dist/{control-BJmonrpE.js → control-09vfq-H_.js} +2 -2
  10. package/dist/data/index.js +1 -1
  11. package/dist/{data-0sDU9_HU.js → data-DBuZBv-V.js} +1 -1
  12. package/dist/{deferred-C-mkQ9J1.js → deferred-DaOJ2Wbe.js} +72 -5
  13. package/dist/{for-internal-cNhKHMBB.js → for-internal-DDiDGhR2.js} +2 -2
  14. package/dist/foundations/index.js +1 -1
  15. package/dist/foundations/state/index.js +1 -1
  16. package/dist/foundations/structures/index.js +1 -1
  17. package/dist/index.js +5 -5
  18. package/dist/{lifecycle-operations-BR8-AOly.js → lifecycle-operations-OLgdNomp.js} +1 -1
  19. package/dist/{navigate-Nh4ibPyt.js → navigate-zzFcn4zk.js} +10 -62
  20. package/dist/{portal-C47xkwXj.js → portal-CH-lRprN.js} +1 -1
  21. package/dist/{renderer-CCvnNMna.js → renderer-BxEuzC3X.js} +6 -21
  22. package/dist/{resource-operation-CUAUBhUB.js → resource-operation-BrvPPJDO.js} +3 -3
  23. package/dist/resources/index.js +2 -2
  24. package/dist/router/index.d.ts +5 -2
  25. package/dist/router/index.js +2 -2
  26. package/dist/ssg/index.js +2 -2
  27. package/dist/ssr/index.js +1 -1
  28. package/dist/{ssr-rvWGTg-y.js → ssr-DPN09YB2.js} +6 -5
  29. package/dist/{state-DPl8lffD.js → state-zZmOu_06.js} +2 -0
  30. package/dist/{verify-hydration-BfINbTwe.js → verify-hydration-DB_huX_v.js} +1 -1
  31. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { d as getCurrentAppRenderRuntime } from "../component-scope-CC3cojX9.js";
2
2
  import { r as getCurrentRenderData } from "../render-context-Clw3rFiO.js";
3
- import { t as state } from "../state-DPl8lffD.js";
3
+ import { t as state } from "../state-zZmOu_06.js";
4
4
  import { jsx, jsxs } from "../jsx-runtime.js";
5
5
  import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-SJ1BSUvk.js";
6
6
  //#region src/actions/runtime.ts
package/dist/benchmark.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { r as flushRuntimeScheduler } from "./access-Bg4RJNC8.js";
2
- import { t as installRendererBridge } from "./renderer-CCvnNMna.js";
3
- import { t as state } from "./state-DPl8lffD.js";
2
+ import { t as installRendererBridge } from "./renderer-BxEuzC3X.js";
3
+ import { t as state } from "./state-zZmOu_06.js";
4
4
  import { t as selector } from "./selector-DafVYzV4.js";
5
5
  import { jsx, jsxs } from "./jsx-runtime.js";
6
- import { i as For } from "./control-BJmonrpE.js";
7
- import { t as createIsland } from "./boot-BaFSlNg6.js";
6
+ import { i as For } from "./control-09vfq-H_.js";
7
+ import { t as createIsland } from "./boot-BFz3Cwc3.js";
8
8
  //#region src/bench/components/benchmark-row.tsx
9
9
  function BenchmarkRow({ item, isSelected, onSelect, onRemove }) {
10
10
  return /* @__PURE__ */ jsxs("tr", {
@@ -63,8 +63,8 @@ function BenchmarkTable({ rows, isSelected, onSelect, onRemove }) {
63
63
  installRendererBridge();
64
64
  const benchmarkMetadata = {
65
65
  packageName: "@askrjs/askr",
66
- packageVersion: "0.0.57",
67
- buildLabel: "0.0.57-local"
66
+ packageVersion: "0.0.59",
67
+ buildLabel: "0.0.59-local"
68
68
  };
69
69
  function getBenchmarkMetadata() {
70
70
  return { ...benchmarkMetadata };
@@ -1,2 +1,2 @@
1
- import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-BaFSlNg6.js";
1
+ import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-BFz3Cwc3.js";
2
2
  export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
@@ -1,16 +1,16 @@
1
1
  import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-Bg4RJNC8.js";
2
2
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
3
- import { n as createComponentInstance, r as executeComponent } from "./component-internal-NdN_bJ2-.js";
4
- import { h as cleanupComponent, m as isPromiseLike } from "./component-lifecycle-C7lnU9Bt.js";
5
- import { a as withIntrinsicHydrationAdoption, i as registerDeferredHydrationBoundary, n as activateHydrationBoundary$1, o as setStaticChildSlotsCacheEnabled, r as clearDeferredHydrationBoundaries, t as installRendererBridge } from "./renderer-CCvnNMna.js";
6
- import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-DScKZG2i.js";
7
- import { D as assertExecutionModel, E as route, a as resolveRouteMeta, b as createAppRenderRuntime, c as registerAppInstance, d as clearRoutes, g as _snapshotRouteSourceLazy, h as _snapshotLazy, i as reconcileRouteMeta, l as unregisterAppInstance, m as _drainLazy, s as configureScrollRestoration, t as initializeNavigation, u as _applyManifest, y as setServerLocation } from "./navigate-Nh4ibPyt.js";
3
+ import { n as createComponentInstance, r as executeComponent } from "./component-internal-S_ILK7MY.js";
4
+ import { h as cleanupComponent, m as isPromiseLike } from "./component-lifecycle-DFyfmw6H.js";
5
+ import { a as withIntrinsicHydrationAdoption, i as registerDeferredHydrationBoundary, n as activateHydrationBoundary$1, o as setStaticChildSlotsCacheEnabled, r as clearDeferredHydrationBoundaries, t as installRendererBridge } from "./renderer-BxEuzC3X.js";
6
+ import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-Br2t23wI.js";
7
+ import { C as assertExecutionModel, S as route, a as resolveRouteMeta, c as registerAppInstance, d as clearRoutes, g as createAppRenderRuntime, h as setServerLocation, i as reconcileRouteMeta, l as unregisterAppInstance, s as configureScrollRestoration, t as initializeNavigation, u as _applyManifest } from "./navigate-zzFcn4zk.js";
8
8
  import { a as startHydrationRenderPhase, s as stopHydrationRenderPhase } from "./render-context-Clw3rFiO.js";
9
- import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-C47xkwXj.js";
9
+ import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-CH-lRprN.js";
10
10
  import { i as getDefaultDataRuntime } from "./data-runtime-SJ1BSUvk.js";
11
11
  import { a as hydrateDataRuntime } from "./query-registry-CQIT4mXr.js";
12
12
  import { a as resolveRouteFromRoutes, d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes } from "./route-matching-vJpvLVbX.js";
13
- import { _ as pageRenderEnvelope, d as hasRouteRenderData, f as resolveRouteRequest, l as getRouteRenderContext, o as reviveDeferredValue, u as getRouteRenderData } from "./deferred-C-mkQ9J1.js";
13
+ import { _ as pageRenderEnvelope, d as hasRouteRenderData, f as resolveRouteRequest, l as getRouteRenderContext, o as reviveDeferredValue, u as getRouteRenderData, x as _preloadRouteHandler } from "./deferred-DaOJ2Wbe.js";
14
14
  import "./ssr-CbQO5xd3.js";
15
15
  //#region src/boot/hydration.ts
16
16
  const DEFERRED_PAYLOAD = "__askr_deferred__";
@@ -404,13 +404,16 @@ async function resolveInitialRoute(auth, source) {
404
404
  manifest: source.manifest,
405
405
  auth,
406
406
  load: source.load
407
- }) : source?.routes ? (() => {
407
+ }) : source?.routes ? await (() => {
408
408
  const match = resolveRouteFromRoutes(path, source.routes);
409
- return match ? {
409
+ if (!match) return null;
410
+ const lazyImport = _preloadRouteHandler(match.handler);
411
+ const result = {
410
412
  kind: "render",
411
413
  handler: match.handler,
412
414
  params: match.params
413
- } : null;
415
+ };
416
+ return lazyImport ? lazyImport.then(() => result) : result;
414
417
  })() : await resolveRouteRequest(href, { auth });
415
418
  if (typeof window === "undefined" || !resolved || resolved.kind !== "redirect") return {
416
419
  path,
@@ -477,10 +480,6 @@ async function createSPA(config) {
477
480
  if (!hasManifest && !hasRoutes) throw new Error("createSPA requires a route manifest or route table. Pass `manifest: getManifest()` or `routes: getRoutes()`. If you are enhancing existing HTML, use createIsland instead.");
478
481
  const rootElement = resolveRootElement(config.root);
479
482
  if (!rootElement) throw new Error(`Root element not found: ${config.root}`);
480
- const pendingLazyAtBoot = [..._snapshotLazy(), ..._snapshotRouteSourceLazy({
481
- registry: config.registry,
482
- manifest
483
- })];
484
483
  configureScrollRestoration(config.scrollRestoration);
485
484
  clearRoutes();
486
485
  if (hasManifest) _applyManifest(manifest);
@@ -493,7 +492,6 @@ async function createSPA(config) {
493
492
  auth: routeAuth
494
493
  };
495
494
  _setActiveRouteAuthOptions(routeAuth);
496
- await _drainLazy(pendingLazyAtBoot);
497
495
  if (isProductionEnvironment()) lockRouteRegistration();
498
496
  const { path, resolved } = await resolveInitialRoute(routeAuth, {
499
497
  manifest: activeManifest,
@@ -554,10 +552,6 @@ async function hydrateSPA(config) {
554
552
  const hydrationQueryCache = hydrationRenderData?.resources;
555
553
  if (hydrationQueryCache) hydrateDataRuntime(config.dataRuntime ?? getDefaultDataRuntime(), hydrationQueryCache);
556
554
  const hydrationRenderDataForApp = hydrationRenderData;
557
- const pendingLazyAtHydrationBoot = [..._snapshotLazy(), ..._snapshotRouteSourceLazy({
558
- registry: config.registry,
559
- manifest
560
- })];
561
555
  configureScrollRestoration(config.scrollRestoration);
562
556
  clearRoutes();
563
557
  if (hasManifest) _applyManifest(manifest);
@@ -575,7 +569,6 @@ async function hydrateSPA(config) {
575
569
  })
576
570
  };
577
571
  _setActiveRouteAuthOptions(routeAuth);
578
- await _drainLazy(pendingLazyAtHydrationBoot);
579
572
  const { path, href: currentUrl, resolved } = await resolveInitialRoute(routeAuth, {
580
573
  manifest: activeManifest,
581
574
  routes: hasManifest ? void 0 : routeTable,
@@ -601,7 +594,7 @@ async function hydrateSPA(config) {
601
594
  handler: r.handler,
602
595
  namespace: r.options.namespace
603
596
  })) : routeTable;
604
- const { verifyHydrationSyncForUrl } = await import("./verify-hydration-BfINbTwe.js");
597
+ const { verifyHydrationSyncForUrl } = await import("./verify-hydration-DB_huX_v.js");
605
598
  if (!verifyHydrationSyncForUrl({
606
599
  root: rootElement,
607
600
  url: currentUrl,
@@ -1,6 +1,6 @@
1
1
  import { c as runRuntimeHandlerScope, v as logger } from "./access-Bg4RJNC8.js";
2
2
  import "./fastlane-Dw8SOBr9.js";
3
- import { f as registerLifecycleTransaction, h as cleanupComponent } from "./component-lifecycle-C7lnU9Bt.js";
3
+ import { f as registerLifecycleTransaction, h as cleanupComponent } from "./component-lifecycle-DFyfmw6H.js";
4
4
  //#region src/runtime/events.ts
5
5
  /**
6
6
  * Event delegation system for Askr
@@ -3,7 +3,7 @@ import { b as isDevelopmentEnvironment, n as enqueueRuntimeTask, o as getRuntime
3
3
  import { r as tryRuntimeFastLaneSync, s as finalizeReadableSubscriptions } from "./fastlane-Dw8SOBr9.js";
4
4
  import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
5
5
  import { C as restoreRenderScopedComponent, S as restoreInlineRenderTracking, _ as getSignalForInstance, b as restoreDomCommitScope, c as enterDomCommitScope, f as getCurrentComponentInstance, l as enterRenderScopedComponent, m as getCurrentPortalScope, n as captureInlineComponentScope, o as clearRenderTracking, p as getCurrentInstance, r as captureInlineRenderTracking, s as enterComponentExecutionScope, t as beginRenderTracking, u as exitComponentExecutionScope, v as resetRenderState, x as restoreInlineComponentScope } from "./component-scope-CC3cojX9.js";
6
- import { a as captureInlineRenderSnapshot$1, c as finalizeInlineReadSubscriptions, i as beginLifecycleCommitBatch, l as flushLifecycleCommitBatch, m as isPromiseLike, n as commitRenderedComponent$1, o as discardLifecycleCommitBatch, p as discardCommitOperations, r as registerCommitOperationForInstance, t as commitLifecycleForInstance } from "./component-lifecycle-C7lnU9Bt.js";
6
+ import { a as captureInlineRenderSnapshot$1, c as finalizeInlineReadSubscriptions, i as beginLifecycleCommitBatch, l as flushLifecycleCommitBatch, m as isPromiseLike, n as commitRenderedComponent$1, o as discardLifecycleCommitBatch, p as discardCommitOperations, r as registerCommitOperationForInstance, t as commitLifecycleForInstance } from "./component-lifecycle-DFyfmw6H.js";
7
7
  //#region src/runtime/context.ts
8
8
  const ROOT_EXECUTION_FRAME = {
9
9
  parent: null,
@@ -248,10 +248,7 @@ function runScheduledComponent(instance, host) {
248
248
  }
249
249
  if (isPromiseLike(result)) throw new Error("Async components are not supported. Components must be synchronous.");
250
250
  try {
251
- if (tryRuntimeFastLaneSync(instance, result)) {
252
- host.warnUnusedStateReads(instance);
253
- return;
254
- }
251
+ if (tryRuntimeFastLaneSync(instance, result)) return;
255
252
  } catch (err) {
256
253
  if (isDevelopmentEnvironment()) throw err;
257
254
  }
@@ -267,7 +264,6 @@ function runScheduledComponent(instance, host) {
267
264
  function commitPlaceholderReplacement(instance, result, host) {
268
265
  if (result === null || result === void 0) {
269
266
  host.finalizeReadSubscriptions(instance);
270
- host.warnUnusedStateReads(instance);
271
267
  host.commitRenderedComponent(instance);
272
268
  return;
273
269
  }
@@ -303,7 +299,6 @@ function commitPlaceholderReplacement(instance, result, host) {
303
299
  }
304
300
  instance._placeholder = void 0;
305
301
  host.finalizeReadSubscriptions(instance);
306
- host.warnUnusedStateReads(instance);
307
302
  host.commitRenderedComponent(instance);
308
303
  flushLifecycleCommitBatch(lifecycleBatch);
309
304
  } finally {
@@ -342,7 +337,6 @@ function commitToTarget(instance, result, host) {
342
337
  restoreDomCommitScope(oldInstance);
343
338
  }
344
339
  host.finalizeReadSubscriptions(instance);
345
- host.warnUnusedStateReads(instance);
346
340
  instance.mounted = true;
347
341
  commitLifecycleForInstance(instance, wasFirstMount);
348
342
  flushLifecycleCommitBatch(lifecycleBatch);
@@ -400,7 +394,6 @@ function ensurePendingRunTask(instance) {
400
394
  runScheduledComponent(instance, {
401
395
  execute: executeComponentSync,
402
396
  finalizeReadSubscriptions,
403
- warnUnusedStateReads,
404
397
  commitRenderedComponent
405
398
  });
406
399
  };
@@ -539,20 +532,6 @@ function renderComponentInline(instance) {
539
532
  restoreInlineComponentScope(scopeSnapshot);
540
533
  }
541
534
  }
542
- function warnUnusedStateReads(instance) {
543
- const stateValues = instance.stateValues;
544
- if (!stateValues) return;
545
- for (let i = 0; i < stateValues.length; i++) {
546
- const state = stateValues[i];
547
- const hasCommittedUsage = (state?._readers?.size ?? 0) > 0 || (state?._derivedSubscribers?.size ?? 0) > 0;
548
- if (state && !state._hasBeenRead && !state._hasEverBeenRead && !hasCommittedUsage) try {
549
- const name = instance.fn?.name || "<anonymous>";
550
- warnInstanceOnce(instance, `unused-state:${i}`, `[askr] Unused state variable detected in ${name} at index ${i}. State should be read during render or removed.`);
551
- } catch {
552
- warnInstanceOnce(instance, `unused-state:${i}`, `[askr] Unused state variable detected. State should be read during render or removed.`);
553
- }
554
- }
555
- }
556
535
  function executeComponentSync(instance) {
557
536
  resetRenderState(instance);
558
537
  const savedPortalScope = enterComponentExecutionScope(instance);
@@ -603,4 +582,4 @@ function warnInstanceOnce(instance, key, message) {
603
582
  logger.warn(message);
604
583
  }
605
584
  //#endregion
606
- export { withContext as _, registerCommitOperation as a, warnUnusedStateReads as c, getCurrentContextFrame as d, getExecutionContextFrame as f, withAsyncResourceContext as g, readScope as h, mountInstanceInline as i, callWithContext as l, markVNodeTreeWithContextFrame as m, createComponentInstance as n, renderComponentInline as o, getVNodeContextFrame as p, executeComponent as r, renderScopedComponent as s, captureInlineRenderSnapshot as t, defineScope as u };
585
+ export { registerCommitOperation as a, callWithContext as c, getExecutionContextFrame as d, getVNodeContextFrame as f, withContext as g, withAsyncResourceContext as h, mountInstanceInline as i, defineScope as l, readScope as m, createComponentInstance as n, renderComponentInline as o, markVNodeTreeWithContextFrame as p, executeComponent as r, renderScopedComponent as s, captureInlineRenderSnapshot as t, getCurrentContextFrame as u };
@@ -1,6 +1,35 @@
1
- import { b as isDevelopmentEnvironment, v as logger } from "./access-Bg4RJNC8.js";
1
+ import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-Bg4RJNC8.js";
2
2
  import { a as cleanupReadableSubscriptions, c as finalizeReadableSubscriptionsFromSnapshot, i as cleanupReadableSubscriptionSources, t as isBulkCommitActive } from "./fastlane-Dw8SOBr9.js";
3
3
  import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-CC3cojX9.js";
4
+ //#region src/runtime/state-diagnostics.ts
5
+ /**
6
+ * Report state cells that were never read during a component's completed
7
+ * lifetime. A branch that has not rendered yet is not evidence that its state
8
+ * is unused, so this diagnostic belongs at unmount rather than every commit.
9
+ */
10
+ function warnUnusedStateReads(instance) {
11
+ if (isProductionEnvironment() || !instance.mounted) return;
12
+ const stateValues = instance.stateValues;
13
+ if (!stateValues) return;
14
+ for (let i = 0; i < stateValues.length; i++) {
15
+ const state = stateValues[i];
16
+ const diagnosticEligible = state?._unusedStateDiagnosticEligible;
17
+ const hasCommittedUsage = (state?._readers?.size ?? 0) > 0 || (state?._derivedSubscribers?.size ?? 0) > 0;
18
+ if (state && diagnosticEligible !== false && !state._hasEverBeenRead && !hasCommittedUsage) {
19
+ const warnings = instance.devWarningsEmitted ??= /* @__PURE__ */ new Set();
20
+ const key = `unused-state:${i}`;
21
+ if (warnings.has(key)) continue;
22
+ warnings.add(key);
23
+ try {
24
+ const name = instance.fn?.name || "<anonymous>";
25
+ logger.warn(`[askr] Unused state variable detected in ${name} at index ${i}. State should be read during render or removed.`);
26
+ } catch {
27
+ logger.warn("[askr] Unused state variable detected. State should be read during render or removed.");
28
+ }
29
+ }
30
+ }
31
+ }
32
+ //#endregion
4
33
  //#region src/runtime/component-cleanup.ts
5
34
  /**
6
35
  * Component cleanup and owned child-scope bookkeeping.
@@ -55,6 +84,7 @@ function cleanupComponentGeneration(instance, generation) {
55
84
  function cleanupComponent(instance) {
56
85
  const savedScope = clearCurrentComponentScope();
57
86
  try {
87
+ warnUnusedStateReads(instance);
58
88
  const cleanupErrors = instance.cleanupStrict ? [] : void 0;
59
89
  const recordCleanupError = (message, err) => {
60
90
  if (cleanupErrors) cleanupErrors.push(err);
@@ -1,2 +1,2 @@
1
- import { i as For, n as Match, r as Show, t as Case } from "../control-BJmonrpE.js";
1
+ import { i as For, n as Match, r as Show, t as Case } from "../control-09vfq-H_.js";
2
2
  export { Case, For, Match, Show };
@@ -1,9 +1,9 @@
1
1
  import { r as markEagerControlPrimitive, t as __CONTROL_BOUNDARY__ } from "./control-DhFRTIoE.js";
2
2
  import { b as isDevelopmentEnvironment } from "./access-Bg4RJNC8.js";
3
3
  import { n as Fragment } from "./jsx-CUpRxrLH.js";
4
- import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-cNhKHMBB.js";
4
+ import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-DDiDGhR2.js";
5
5
  import { t as createFineGrainedEffect } from "./effect-BwnIvLah.js";
6
- import { t as state } from "./state-DPl8lffD.js";
6
+ import { t as state } from "./state-zZmOu_06.js";
7
7
  //#region src/control/shared.ts
8
8
  function normalizeBoundaryChild(value) {
9
9
  if (Array.isArray(value)) {
@@ -1,4 +1,4 @@
1
1
  import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-SJ1BSUvk.js";
2
- import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-0sDU9_HU.js";
2
+ import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-DBuZBv-V.js";
3
3
  import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery, t as createQueryPrefetchContext } from "../query-registry-CQIT4mXr.js";
4
4
  export { createDataRuntime, createMutation, createQuery, createQueryPrefetchContext, defineQuery, defineServerQueries, dehydrateDataRuntime, getDefaultDataRuntime, hydrateDataRuntime, invalidate, invalidateOnInterval, prefetchQuery, queryScope, serveQuery };
@@ -2,7 +2,7 @@ import { n as enqueueRuntimeTask, v as logger } from "./access-Bg4RJNC8.js";
2
2
  import { f as notifyReadableReaders, l as markReactivePropsDirtySource, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-Dw8SOBr9.js";
3
3
  import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-CC3cojX9.js";
4
4
  import { n as getActiveRenderContext } from "./render-context-Clw3rFiO.js";
5
- import { c as windowFocused, i as routeActive, n as documentVisible, s as timer } from "./lifecycle-operations-BR8-AOly.js";
5
+ import { c as windowFocused, i as routeActive, n as documentVisible, s as timer } from "./lifecycle-operations-OLgdNomp.js";
6
6
  import { a as getMutationSlotStore, c as resolveDataRuntimeState, i as getDefaultDataRuntime, n as ensureMutationCleanup, o as getQuerySlotStore, r as ensureQueryCleanup, s as invalidateQueriesForRuntime } from "./data-runtime-SJ1BSUvk.js";
7
7
  //#region src/data/query-key.ts
8
8
  function serializeQueryKeyNumber(part) {
@@ -1,12 +1,68 @@
1
1
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
2
- import { h as readScope, u as defineScope } from "./component-internal-NdN_bJ2-.js";
2
+ import { l as defineScope, m as readScope } from "./component-internal-S_ILK7MY.js";
3
3
  import { d as getCurrentAppRenderRuntime } from "./component-scope-CC3cojX9.js";
4
- import { m as isPromiseLike } from "./component-lifecycle-C7lnU9Bt.js";
4
+ import { m as isPromiseLike } from "./component-lifecycle-DFyfmw6H.js";
5
5
  import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render-context-Clw3rFiO.js";
6
- import { t as resource } from "./resource-operation-CUAUBhUB.js";
6
+ import { t as resource } from "./resource-operation-BrvPPJDO.js";
7
7
  import { t as ROUTE_ROOT_COMPONENT } from "./router-internal-BC0w1_xk.js";
8
8
  import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-CQIT4mXr.js";
9
9
  import { E as getRouteRecords, h as getActiveRouteAuthOptions, i as getMatchingRouteRecord, o as buildRouteContext, s as buildRouteContextBase } from "./route-matching-vJpvLVbX.js";
10
+ //#region src/router/lazy.ts
11
+ const pendingLazy = /* @__PURE__ */ new Set();
12
+ const lazyStates = /* @__PURE__ */ new WeakMap();
13
+ const handlerLazyComponents = /* @__PURE__ */ new WeakMap();
14
+ function startLazyLoad(state) {
15
+ if (state.promise) return state.promise;
16
+ let promise;
17
+ promise = Promise.resolve().then(state.factory).then((mod) => {
18
+ state.resolved = typeof mod === "function" ? mod : mod.default;
19
+ }, (err) => {
20
+ state.loadError = err;
21
+ }).finally(() => {
22
+ pendingLazy.delete(promise);
23
+ });
24
+ state.promise = promise;
25
+ pendingLazy.add(promise);
26
+ return promise;
27
+ }
28
+ function lazy(factory) {
29
+ const state = {
30
+ factory,
31
+ promise: null,
32
+ resolved: null,
33
+ loadError: null
34
+ };
35
+ const component = ((params) => {
36
+ if (state.loadError) throw state.loadError;
37
+ if (!state.resolved) throw new Error("lazy() component used before it was resolved. Matched routes load automatically; call component.preload() for explicit preloading.");
38
+ return state.resolved(params);
39
+ });
40
+ Object.defineProperty(component, "preload", { value: () => startLazyLoad(state) });
41
+ lazyStates.set(component, state);
42
+ return component;
43
+ }
44
+ function _preloadRouteRecord(record) {
45
+ const imports = [
46
+ record.component,
47
+ ...record.pageChain.map((scope) => scope.component),
48
+ ...record.layoutChain.map((scope) => scope.component)
49
+ ].flatMap((component) => {
50
+ const state = lazyStates.get(component);
51
+ return state ? [startLazyLoad(state)] : [];
52
+ });
53
+ return imports.length > 0 ? Promise.all(imports).then(() => void 0) : null;
54
+ }
55
+ function _associateLazyHandler(handler, components) {
56
+ handlerLazyComponents.set(handler, components);
57
+ }
58
+ function _preloadRouteHandler(handler) {
59
+ const imports = (handlerLazyComponents.get(handler) ?? []).flatMap((component) => {
60
+ const state = lazyStates.get(component);
61
+ return state ? [startLazyLoad(state)] : [];
62
+ });
63
+ return imports.length > 0 ? Promise.all(imports).then(() => void 0) : null;
64
+ }
65
+ //#endregion
10
66
  //#region src/router/rendering.ts
11
67
  const outletScope = defineScope(null);
12
68
  function Outlet() {
@@ -35,7 +91,7 @@ function createRouteComponentVNode(component, params, routeRoot = false) {
35
91
  };
36
92
  }
37
93
  function createRouteHandler(component, pageChain, layoutChain, deferComponents = false) {
38
- return (params) => {
94
+ const handler = (params) => {
39
95
  let content = deferComponents ? createRouteComponentVNode(component, params, true) : component(params);
40
96
  content = applyPageChain(pageChain, params, content, deferComponents);
41
97
  for (let i = layoutChain.length - 1; i >= 0; i--) {
@@ -44,6 +100,12 @@ function createRouteHandler(component, pageChain, layoutChain, deferComponents =
44
100
  }
45
101
  return content;
46
102
  };
103
+ _associateLazyHandler(handler, [
104
+ component,
105
+ ...pageChain.map((scope) => scope.component),
106
+ ...layoutChain.map((scope) => scope.component)
107
+ ]);
108
+ return handler;
47
109
  }
48
110
  function getRenderHandler(record) {
49
111
  return record.renderHandler ?? createRouteHandler(record.component, record.pageChain, record.layoutChain, true);
@@ -151,6 +213,11 @@ function hasRouteRenderData(result) {
151
213
  return routeRenderData.has(result);
152
214
  }
153
215
  function buildRenderResult(record, params, context, request, telemetry, load) {
216
+ const lazyImport = _preloadRouteRecord(record);
217
+ if (lazyImport) return lazyImport.then(() => buildLoadedRenderResult(record, params, context, request, telemetry, load));
218
+ return buildLoadedRenderResult(record, params, context, request, telemetry, load);
219
+ }
220
+ function buildLoadedRenderResult(record, params, context, request, telemetry, load) {
154
221
  const renderHandler = getRenderHandler(record);
155
222
  const loader = context.mode !== "ssg" && load ? record.options?.loader : void 0;
156
223
  const preload = record.options?.preload;
@@ -383,4 +450,4 @@ function Resolve(props) {
383
450
  return props.children(result.value);
384
451
  }
385
452
  //#endregion
386
- export { pageRenderEnvelope as _, resolveDeferredValues as a, getRenderHandler as b, bindResolvedRouteData as c, hasRouteRenderData as d, resolveRouteRequest as f, isPageRenderEnvelope as g, isEmptyPageRenderEnvelope as h, isDeferred as i, getRouteRenderContext as l, createPageRenderEnvelope as m, Resolve as n, reviveDeferredValue as o, currentAuth as p, defer as r, routeData as s, DEFERRED_BOUNDARY as t, getRouteRenderData as u, Outlet as v, createRouteHandler as y };
453
+ export { lazy as S, pageRenderEnvelope as _, resolveDeferredValues as a, getRenderHandler as b, bindResolvedRouteData as c, hasRouteRenderData as d, resolveRouteRequest as f, isPageRenderEnvelope as g, isEmptyPageRenderEnvelope as h, isDeferred as i, getRouteRenderContext as l, createPageRenderEnvelope as m, Resolve as n, reviveDeferredValue as o, currentAuth as p, defer as r, routeData as s, DEFERRED_BOUNDARY as t, getRouteRenderData as u, Outlet as v, _preloadRouteHandler as x, createRouteHandler as y };
@@ -1,9 +1,9 @@
1
1
  import { n as _isDOMElement } from "./vnode-D24p6IW2.js";
2
2
  import { b as isDevelopmentEnvironment, o as getRuntimeRenderer, v as logger } from "./access-Bg4RJNC8.js";
3
3
  import { f as notifyReadableReaders, l as markReactivePropsDirtySource, m as shouldCoalesceFineGrainedItemReads, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-Dw8SOBr9.js";
4
- import { n as createComponentInstance, s as renderScopedComponent } from "./component-internal-NdN_bJ2-.js";
4
+ import { n as createComponentInstance, s as renderScopedComponent } from "./component-internal-S_ILK7MY.js";
5
5
  import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
6
- import { _ as registerOwnedChildScope, c as finalizeInlineReadSubscriptions, f as registerLifecycleTransaction, h as cleanupComponent, v as unregisterOwnedChildScope } from "./component-lifecycle-C7lnU9Bt.js";
6
+ import { _ as registerOwnedChildScope, c as finalizeInlineReadSubscriptions, f as registerLifecycleTransaction, h as cleanupComponent, v as unregisterOwnedChildScope } from "./component-lifecycle-DFyfmw6H.js";
7
7
  //#region src/runtime/child-scope.ts
8
8
  const EMPTY_CHILD_SCOPE_PROPS = {};
9
9
  const childScopesByInstance = /* @__PURE__ */ new WeakMap();
@@ -1,3 +1,3 @@
1
- import { i as definePortal, n as Portal, t as DefaultPortal } from "../portal-C47xkwXj.js";
1
+ import { i as definePortal, n as Portal, t as DefaultPortal } from "../portal-CH-lRprN.js";
2
2
  import { a as layout, i as Slot, r as Presence } from "../structures-DUB3HchX.js";
3
3
  export { DefaultPortal, Portal, Presence, Slot, definePortal, layout };
@@ -1,4 +1,4 @@
1
- import { t as state } from "../../state-DPl8lffD.js";
1
+ import { t as state } from "../../state-zZmOu_06.js";
2
2
  //#region src/foundations/state/controllable.ts
3
3
  /**
4
4
  * controllable
@@ -1,3 +1,3 @@
1
- import { i as definePortal, n as Portal, t as DefaultPortal } from "../../portal-C47xkwXj.js";
1
+ import { i as definePortal, n as Portal, t as DefaultPortal } from "../../portal-CH-lRprN.js";
2
2
  import { a as layout, i as Slot, n as createCollection, r as Presence, t as createLayer } from "../../structures-DUB3HchX.js";
3
3
  export { DefaultPortal, Portal, Presence, Slot, createCollection, createLayer, definePortal, layout };
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { a as getRuntimeFlushVersion, d as AskrRuntime, m as getDefaultRuntime, p as createRuntime, t as enqueueRuntimeLane } from "./access-Bg4RJNC8.js";
2
2
  import { f as notifyReadableReaders, g as withDerivedReadTracking, h as syncDerivedDependencySubscriptions, l as markReactivePropsDirtySource, o as clearDerivedDependencySubscriptions, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-Dw8SOBr9.js";
3
3
  import { n as Fragment } from "./jsx-CUpRxrLH.js";
4
- import { h as readScope, u as defineScope } from "./component-internal-NdN_bJ2-.js";
4
+ import { l as defineScope, m as readScope } from "./component-internal-S_ILK7MY.js";
5
5
  import { g as getSignal, i as claimHookIndex, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
6
6
  import { n as isSnapshotSource } from "./snapshot-source-BB42xgwb.js";
7
- import { t as installRendererBridge } from "./renderer-CCvnNMna.js";
8
- import { t as state } from "./state-DPl8lffD.js";
7
+ import { t as installRendererBridge } from "./renderer-BxEuzC3X.js";
8
+ import { t as state } from "./state-zZmOu_06.js";
9
9
  import { t as selector } from "./selector-DafVYzV4.js";
10
10
  import { jsx, jsxs } from "./jsx-runtime.js";
11
- import { i as For, n as Match, r as Show, t as Case } from "./control-BJmonrpE.js";
12
- import { t as createQuery } from "./data-0sDU9_HU.js";
11
+ import { i as For, n as Match, r as Show, t as Case } from "./control-09vfq-H_.js";
12
+ import { t as createQuery } from "./data-DBuZBv-V.js";
13
13
  import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-CQIT4mXr.js";
14
14
  //#region src/runtime/derive.ts
15
15
  const deriveCells = /* @__PURE__ */ new WeakMap();
@@ -1,4 +1,4 @@
1
- import { a as registerCommitOperation } from "./component-internal-NdN_bJ2-.js";
1
+ import { a as registerCommitOperation } from "./component-internal-S_ILK7MY.js";
2
2
  import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-CC3cojX9.js";
3
3
  import { t as isRouteActivityActive } from "./route-activity-CNJfpwx-.js";
4
4
  //#region src/runtime/lifecycle-operations.ts
@@ -1,15 +1,15 @@
1
1
  import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-Bg4RJNC8.js";
2
2
  import { f as notifyReadableReaders, i as cleanupReadableSubscriptionSources, l as markReactivePropsDirtySource, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-Dw8SOBr9.js";
3
3
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
4
- import { r as executeComponent } from "./component-internal-NdN_bJ2-.js";
4
+ import { r as executeComponent } from "./component-internal-S_ILK7MY.js";
5
5
  import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
6
- import { g as cleanupComponentGeneration, h as cleanupComponent, i as beginLifecycleCommitBatch, l as flushLifecycleCommitBatch, m as isPromiseLike, o as discardLifecycleCommitBatch, s as drainLifecycleCommitErrors } from "./component-lifecycle-C7lnU9Bt.js";
7
- import { _ as teardownNodeSubtree } from "./cleanup-DScKZG2i.js";
6
+ import { g as cleanupComponentGeneration, h as cleanupComponent, i as beginLifecycleCommitBatch, l as flushLifecycleCommitBatch, m as isPromiseLike, o as discardLifecycleCommitBatch, s as drainLifecycleCommitErrors } from "./component-lifecycle-DFyfmw6H.js";
7
+ import { _ as teardownNodeSubtree } from "./cleanup-Br2t23wI.js";
8
8
  import { n as getActiveRenderContext } from "./render-context-Clw3rFiO.js";
9
9
  import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
10
- import { r as clearDefaultPortalForInstance, t as DefaultPortal } from "./portal-C47xkwXj.js";
10
+ import { r as clearDefaultPortalForInstance, t as DefaultPortal } from "./portal-CH-lRprN.js";
11
11
  import { A as insertRecordSorted, C as getCurrentPathPrefix, D as getRoutes, E as getRouteRecords, F as snapshotRouteState, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, N as restoreRouteState, O as hasActivePageScope, P as setDefaultRouteAuthOptions, R as parseSegments, S as getCurrentPageScope, T as getDefaultRouteAuthOptions, _ as getCurrentInheritedAuthRequirements, a as resolveRouteFromRoutes, b as getCurrentLayoutChain, c as deepFreeze, f as addRouteToStores, g as getActiveRoutes, j as lockRouteRegistration, l as makeQuery, m as clearRouteState, n as computeMatchesFromRoutes, p as assertRouteRegistrationUnlocked, r as computeRouteActivityMatches, u as parseLocation, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-vJpvLVbX.js";
12
- import { d as hasRouteRenderData, f as resolveRouteRequest, l as getRouteRenderContext, u as getRouteRenderData, y as createRouteHandler } from "./deferred-C-mkQ9J1.js";
12
+ import { d as hasRouteRenderData, f as resolveRouteRequest, l as getRouteRenderContext, u as getRouteRenderData, x as _preloadRouteHandler, y as createRouteHandler } from "./deferred-DaOJ2Wbe.js";
13
13
  import { allOf } from "@askrjs/auth";
14
14
  //#region src/runtime/execution-model.ts
15
15
  const EXECUTION_MODEL_KEY = Symbol.for("__ASKR_EXECUTION_MODEL__");
@@ -316,55 +316,6 @@ function syncCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
316
316
  setCurrentRouteSnapshot(pathname, search, hash, activityMatches);
317
317
  }
318
318
  //#endregion
319
- //#region src/router/lazy.ts
320
- const pendingLazy = /* @__PURE__ */ new Set();
321
- const registryLazyImports = /* @__PURE__ */ new WeakMap();
322
- const manifestLazyImports = /* @__PURE__ */ new WeakMap();
323
- function lazy(factory) {
324
- let resolved = null;
325
- let loadError = null;
326
- const promise = factory().then((mod) => {
327
- resolved = typeof mod === "function" ? mod : mod.default;
328
- pendingLazy.delete(promise);
329
- }, (err) => {
330
- loadError = err;
331
- pendingLazy.delete(promise);
332
- });
333
- pendingLazy.add(promise);
334
- return ((params) => {
335
- if (loadError) throw loadError;
336
- if (!resolved) throw new Error("lazy() component used before it was resolved. Await createSPA() / hydrateSPA() to ensure all chunks load first.");
337
- return resolved(params);
338
- });
339
- }
340
- function _snapshotLazy() {
341
- return [...pendingLazy];
342
- }
343
- function _snapshotRouteSourceLazy(source) {
344
- const imports = /* @__PURE__ */ new Set();
345
- if (source.registry) for (const lazyImport of registryLazyImports.get(source.registry) ?? []) imports.add(lazyImport);
346
- const manifest = source.manifest ?? source.registry?.manifest;
347
- if (manifest) for (const lazyImport of manifestLazyImports.get(manifest) ?? []) imports.add(lazyImport);
348
- return [...imports];
349
- }
350
- function _drainLazy(additionalPending = []) {
351
- const combined = /* @__PURE__ */ new Set([...additionalPending, ...pendingLazy]);
352
- if (combined.size === 0) return Promise.resolve();
353
- return Promise.allSettled(combined).then(() => void 0);
354
- }
355
- function associateRouteSourceLazy(registry, manifest, lazyImports) {
356
- if (lazyImports.length === 0) return;
357
- registryLazyImports.set(registry, lazyImports);
358
- manifestLazyImports.set(manifest, lazyImports);
359
- }
360
- function clearPendingLazy() {
361
- pendingLazy.clear();
362
- }
363
- function restorePendingLazy(lazyImports) {
364
- pendingLazy.clear();
365
- for (const lazyImport of lazyImports) pendingLazy.add(lazyImport);
366
- }
367
- //#endregion
368
319
  //#region src/router/manifest.ts
369
320
  function getManifest() {
370
321
  const auth = getDefaultRouteAuthOptions();
@@ -387,24 +338,19 @@ function _applyManifest(manifest) {
387
338
  }
388
339
  function clearRoutes() {
389
340
  clearRouteState();
390
- clearPendingLazy();
391
341
  }
392
342
  function createRouteRegistry(definition, options = {}) {
393
343
  const previous = snapshotRouteState();
394
- const previousLazy = _snapshotLazy();
395
344
  clearRoutes();
396
345
  try {
397
346
  registerRoutes(definition, options);
398
347
  const manifest = getManifest();
399
- const registry = Object.freeze({
348
+ return Object.freeze({
400
349
  manifest,
401
350
  routes: getRoutes()
402
351
  });
403
- associateRouteSourceLazy(registry, manifest, _snapshotLazy());
404
- return registry;
405
352
  } finally {
406
353
  restoreRouteState(previous);
407
- restorePendingLazy(previousLazy);
408
354
  }
409
355
  }
410
356
  //#endregion
@@ -1051,11 +997,13 @@ function resolveAppRouteRequest(app, pathname, href, signal) {
1051
997
  if (app.routes) {
1052
998
  const resolved = resolveRouteFromRoutes(pathname, app.routes);
1053
999
  if (!resolved) return null;
1054
- return {
1000
+ const result = {
1055
1001
  kind: "render",
1056
1002
  handler: resolved.handler,
1057
1003
  params: resolved.params
1058
1004
  };
1005
+ const lazyImport = _preloadRouteHandler(resolved.handler);
1006
+ return lazyImport ? lazyImport.then(() => result) : result;
1059
1007
  }
1060
1008
  return resolveRouteRequest(href, {
1061
1009
  auth: app.auth,
@@ -1446,4 +1394,4 @@ function initializeNavigation() {
1446
1394
  window.addEventListener("popstate", handlePopState);
1447
1395
  }
1448
1396
  //#endregion
1449
- export { index as C, assertExecutionModel as D, route as E, group as S, registerRoutes as T, lazy as _, resolveRouteMeta as a, createAppRenderRuntime as b, registerAppInstance as c, clearRoutes as d, createRouteRegistry as f, _snapshotRouteSourceLazy as g, _snapshotLazy as h, reconcileRouteMeta as i, unregisterAppInstance as l, _drainLazy as m, navigate as n, serializeRouteMeta as o, getManifest as p, updateRouteQuery as r, configureScrollRestoration as s, initializeNavigation as t, _applyManifest as u, currentRoute as v, page as w, fallback as x, setServerLocation as y };
1397
+ export { assertExecutionModel as C, route as S, fallback as _, resolveRouteMeta as a, page as b, registerAppInstance as c, clearRoutes as d, createRouteRegistry as f, createAppRenderRuntime as g, setServerLocation as h, reconcileRouteMeta as i, unregisterAppInstance as l, currentRoute as m, navigate as n, serializeRouteMeta as o, getManifest as p, updateRouteQuery as r, configureScrollRestoration as s, initializeNavigation as t, _applyManifest as u, group as v, registerRoutes as x, index as y };
@@ -1,7 +1,7 @@
1
1
  import { o as getRuntimeRenderer } from "./access-Bg4RJNC8.js";
2
2
  import { f as notifyReadableReaders, l as markReactivePropsDirtySource, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-Dw8SOBr9.js";
3
3
  import { f as getCurrentComponentInstance, m as getCurrentPortalScope } from "./component-scope-CC3cojX9.js";
4
- import { f as registerLifecycleTransaction, h as cleanupComponent, u as getCurrentLifecycleCommitBatch } from "./component-lifecycle-C7lnU9Bt.js";
4
+ import { f as registerLifecycleTransaction, h as cleanupComponent, u as getCurrentLifecycleCommitBatch } from "./component-lifecycle-DFyfmw6H.js";
5
5
  //#region src/runtime/portal.ts
6
6
  function createPortalSlot() {
7
7
  let currentValue;
@@ -3,12 +3,12 @@ import { n as _isDOMElement, t as __ERROR_BOUNDARY__ } from "./vnode-D24p6IW2.js
3
3
  import { b as isDevelopmentEnvironment, c as runRuntimeHandlerScope, f as configureRuntimeRenderer, i as getDefaultRuntimeInstance, n as enqueueRuntimeTask, v as logger, y as getRuntimeEnv } from "./access-Bg4RJNC8.js";
4
4
  import { n as markFastPathApplied, t as isBulkCommitActive } from "./fastlane-Dw8SOBr9.js";
5
5
  import { n as Fragment, r as STATIC_CHILDREN } from "./jsx-CUpRxrLH.js";
6
- import { _ as withContext, c as warnUnusedStateReads, d as getCurrentContextFrame, i as mountInstanceInline, m as markVNodeTreeWithContextFrame, n as createComponentInstance, o as renderComponentInline, p as getVNodeContextFrame, t as captureInlineRenderSnapshot } from "./component-internal-NdN_bJ2-.js";
6
+ import { f as getVNodeContextFrame, g as withContext, i as mountInstanceInline, n as createComponentInstance, o as renderComponentInline, p as markVNodeTreeWithContextFrame, t as captureInlineRenderSnapshot, u as getCurrentContextFrame } from "./component-internal-S_ILK7MY.js";
7
7
  import { b as restoreDomCommitScope, c as enterDomCommitScope, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
8
- import { d as registerLifecycleRollback, f as registerLifecycleTransaction, h as cleanupComponent, i as beginLifecycleCommitBatch, l as flushLifecycleCommitBatch, m as isPromiseLike, o as discardLifecycleCommitBatch, u as getCurrentLifecycleCommitBatch } from "./component-lifecycle-C7lnU9Bt.js";
9
- import { _ as createChildScope, a as registerForStateTransaction, c as captureForFallbackTransactionSnapshot, d as clearCaseDomUpdateState, f as clearShowDomUpdateState, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, l as captureForItemTransactionSnapshot, n as clearForDomUpdateState, o as rollbackForStateTransaction, t as beginForStateTransaction, v as disposeChildScope, y as rerenderChildScope } from "./for-internal-cNhKHMBB.js";
8
+ import { d as registerLifecycleRollback, f as registerLifecycleTransaction, h as cleanupComponent, i as beginLifecycleCommitBatch, l as flushLifecycleCommitBatch, m as isPromiseLike, o as discardLifecycleCommitBatch, u as getCurrentLifecycleCommitBatch } from "./component-lifecycle-DFyfmw6H.js";
9
+ import { _ as createChildScope, a as registerForStateTransaction, c as captureForFallbackTransactionSnapshot, d as clearCaseDomUpdateState, f as clearShowDomUpdateState, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, l as captureForItemTransactionSnapshot, n as clearForDomUpdateState, o as rollbackForStateTransaction, t as beginForStateTransaction, v as disposeChildScope, y as rerenderChildScope } from "./for-internal-DDiDGhR2.js";
10
10
  import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-BwnIvLah.js";
11
- import { C as getDelegatedHandlersForElement, D as updateDelegatedListener, E as removeDelegatedListener, S as getDelegatedHandlerForElement, T as isEventDelegationEnabled, _ as teardownNodeSubtree, a as elementReactivePropsCleanup, b as addFreshDelegatedListener, c as forEachElementReactivePropCleanup, d as removeAllListeners, f as removeElementReactiveProps, g as setFreshElementReactivePropCleanup, h as setDirectElementReactivePropCleanup, i as elementListeners, l as getElementReactivePropCleanupSize, m as replaceElementRefBookkeeping, n as cleanupInstanceIfPresent, o as elementRefs, p as removeElementRef, r as cleanupInstancesUnder, s as forEachDescendantNode, t as REACTIVE_CHILDREN_KEY, u as getElementReactivePropsCleanupMap, v as updateElementRef, w as isDelegatedEvent, x as clearDelegatedHandlersForElement, y as addDelegatedListener } from "./cleanup-DScKZG2i.js";
11
+ import { C as getDelegatedHandlersForElement, D as updateDelegatedListener, E as removeDelegatedListener, S as getDelegatedHandlerForElement, T as isEventDelegationEnabled, _ as teardownNodeSubtree, a as elementReactivePropsCleanup, b as addFreshDelegatedListener, c as forEachElementReactivePropCleanup, d as removeAllListeners, f as removeElementReactiveProps, g as setFreshElementReactivePropCleanup, h as setDirectElementReactivePropCleanup, i as elementListeners, l as getElementReactivePropCleanupSize, m as replaceElementRefBookkeeping, n as cleanupInstanceIfPresent, o as elementRefs, p as removeElementRef, r as cleanupInstancesUnder, s as forEachDescendantNode, t as REACTIVE_CHILDREN_KEY, u as getElementReactivePropsCleanupMap, v as updateElementRef, w as isDelegatedEvent, x as clearDelegatedHandlersForElement, y as addDelegatedListener } from "./cleanup-Br2t23wI.js";
12
12
  import { t as getPublicAttributeName } from "./attr-names-CjhzmHOn.js";
13
13
  import { t as ROUTE_ROOT_COMPONENT } from "./router-internal-BC0w1_xk.js";
14
14
  //#region src/runtime/error-boundary.ts
@@ -5030,7 +5030,6 @@ function resolveHostNestedComponentResult(host, retainedInstance, result, snapsh
5030
5030
  const nextResult = withContext(nestedSnapshot ?? null, () => renderComponentInline(nestedInstance));
5031
5031
  if (isPromiseLike(nextResult)) throw new Error("Async components are not supported. Components must return synchronously.");
5032
5032
  retainedInstances.add(nestedInstance);
5033
- warnUnusedStateReads(nestedInstance);
5034
5033
  activeSnapshot = nestedSnapshot ?? null;
5035
5034
  currentResult = markVNodeTreeWithContextFrame(nextResult, activeSnapshot);
5036
5035
  depth += 1;
@@ -5071,7 +5070,6 @@ function resolveWrapperHostResult(host, result, snapshot, retainedInstances) {
5071
5070
  const nextResult = withContext(nestedSnapshot ?? null, () => renderComponentInline(nestedInstance));
5072
5071
  if (isPromiseLike(nextResult)) throw new Error("Async components are not supported. Components must return synchronously.");
5073
5072
  retainedInstances.add(nestedInstance);
5074
- warnUnusedStateReads(nestedInstance);
5075
5073
  activeSnapshot = nestedSnapshot ?? null;
5076
5074
  currentResult = nextResult;
5077
5075
  depth += 1;
@@ -5111,7 +5109,6 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
5111
5109
  });
5112
5110
  mountInstanceInline(hydrationInstance, existingHost);
5113
5111
  itemInstanceHydrationComplete(existingHost);
5114
- warnUnusedStateReads(hydrationInstance);
5115
5112
  return existingHost;
5116
5113
  }
5117
5114
  const resolvedResult = resolveHostNestedComponentResult(existingHost, hydrationInstance, scopedResult, snapshot ?? null, liveRetainedInstances);
@@ -5122,15 +5119,12 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
5122
5119
  });
5123
5120
  mountInstanceInline(hydrationInstance, existingHost);
5124
5121
  itemInstanceHydrationComplete(existingHost);
5125
- warnUnusedStateReads(hydrationInstance);
5126
5122
  return existingHost;
5127
5123
  }
5128
- const nextDom = replacement.replace(() => materializeComponentResultNode(hydrationInstance, scopedResult, parentNamespace), (replacement) => {
5124
+ return replacement.replace(() => materializeComponentResultNode(hydrationInstance, scopedResult, parentNamespace), (replacement) => {
5129
5125
  if (replacement instanceof Element) materializeKey(replacement, node, props);
5130
5126
  retainReplacementOwnerChain(replacement, hydrationInstance, liveRetainedInstances);
5131
5127
  });
5132
- warnUnusedStateReads(hydrationInstance);
5133
- return nextDom;
5134
5128
  } catch (error) {
5135
5129
  restoreVNodeComponentInstance(node, previousVNodeInstance);
5136
5130
  if (!hydrationInstance.mounted) cleanupProvisionalComponentInstance(hydrationInstance);
@@ -5154,7 +5148,6 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
5154
5148
  if (existingHost instanceof Element && existingHost.__ASKR_WRAPPER_HOST) {
5155
5149
  const wrapperResult = resolveWrapperHostResult(existingHost, scopedResult, snapshot ?? null, liveRetainedInstances);
5156
5150
  domHost.updateElementChildren(existingHost, normalizeComponentChildren(wrapperResult));
5157
- warnUnusedStateReads(existingInstance);
5158
5151
  return existingHost;
5159
5152
  }
5160
5153
  if (existingHost instanceof Element && scopedResult && typeof scopedResult === "object" && "type" in scopedResult && typeof scopedResult.type === "string" && tagNamesEqualIgnoreCase$1(existingHost.tagName, scopedResult.type)) {
@@ -5162,7 +5155,6 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
5162
5155
  domHost.updateElementFromVnode(existingHost, inheritComponentKey(scopedResult, node), true, forceChildrenUpdate || existingInstance.mounted === false);
5163
5156
  materializeKey(existingHost, node, props);
5164
5157
  });
5165
- warnUnusedStateReads(existingInstance);
5166
5158
  return existingHost;
5167
5159
  }
5168
5160
  const resolvedResult = resolveHostNestedComponentResult(existingHost, existingInstance, scopedResult, snapshot ?? null, liveRetainedInstances);
@@ -5172,7 +5164,6 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
5172
5164
  instance.target = null;
5173
5165
  instance._placeholder = existingHost;
5174
5166
  }
5175
- warnUnusedStateReads(existingInstance);
5176
5167
  return existingHost;
5177
5168
  }
5178
5169
  if (existingHost instanceof Element && _isDOMElement(resolvedResult) && typeof resolvedResult.type === "string" && tagNamesEqualIgnoreCase$1(existingHost.tagName, resolvedResult.type)) {
@@ -5180,15 +5171,12 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
5180
5171
  domHost.updateElementFromVnode(existingHost, inheritComponentKey(resolvedResult, node), true, forceChildrenUpdate || existingInstance.mounted === false);
5181
5172
  materializeKey(existingHost, node, props);
5182
5173
  });
5183
- warnUnusedStateReads(existingInstance);
5184
5174
  return existingHost;
5185
5175
  }
5186
- const nextDom = replacement.replace(() => materializeComponentResultNode(existingInstance, scopedResult, parentNamespace), (replacement) => {
5176
+ return replacement.replace(() => materializeComponentResultNode(existingInstance, scopedResult, parentNamespace), (replacement) => {
5187
5177
  if (replacement instanceof Element) materializeKey(replacement, node, props);
5188
5178
  retainReplacementOwnerChain(replacement, existingInstance, liveRetainedInstances);
5189
5179
  });
5190
- warnUnusedStateReads(existingInstance);
5191
- return nextDom;
5192
5180
  }
5193
5181
  function retainReplacementOwnerChain(host, owner, retainedInstances) {
5194
5182
  const componentHost = host;
@@ -5229,7 +5217,6 @@ function createComponentElement(node, type, props, parentNamespace) {
5229
5217
  if (isPromiseLike(result)) throw new Error("Async components are not supported. Components must return synchronously.");
5230
5218
  const scopedResult = markVNodeTreeWithContextFrame(result, snapshot ?? null);
5231
5219
  const dom = snapshot ? withContext(snapshot, () => materializeComponentResultNode(childInstance, scopedResult, parentNamespace)) : materializeComponentResultNode(childInstance, scopedResult, parentNamespace);
5232
- warnUnusedStateReads(childInstance);
5233
5220
  if (dom instanceof Element) materializeFreshKey(dom, node, props);
5234
5221
  return dom;
5235
5222
  } catch (error) {
@@ -5375,8 +5362,6 @@ function tryPatchStableForDirtyItem(scope) {
5375
5362
  const nextIntrinsic = resolveStableIntrinsicPatchVNode(scope.dom, scope.vnode);
5376
5363
  if (!nextIntrinsic) return false;
5377
5364
  const didPatch = patchStableIntrinsicElement(scope.dom, nextIntrinsic);
5378
- const existingInstance = scope.dom.__ASKR_INSTANCE;
5379
- if (didPatch && existingInstance) warnUnusedStateReads(existingInstance);
5380
5365
  if (didPatch);
5381
5366
  return didPatch;
5382
5367
  }
@@ -1,10 +1,10 @@
1
1
  import { t as enqueueRuntimeLane, v as logger } from "./access-Bg4RJNC8.js";
2
- import { d as getCurrentContextFrame, g as withAsyncResourceContext } from "./component-internal-NdN_bJ2-.js";
2
+ import { h as withAsyncResourceContext, u as getCurrentContextFrame } from "./component-internal-S_ILK7MY.js";
3
3
  import { f as getCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
4
- import { m as isPromiseLike, r as registerCommitOperationForInstance } from "./component-lifecycle-C7lnU9Bt.js";
4
+ import { m as isPromiseLike, r as registerCommitOperationForInstance } from "./component-lifecycle-DFyfmw6H.js";
5
5
  import { t as brandSnapshotSource } from "./snapshot-source-BB42xgwb.js";
6
6
  import { i as getNextRenderKey, l as throwSSRDataMissing, n as getActiveRenderContext, r as getCurrentRenderData, u as SSRDataMissingError } from "./render-context-Clw3rFiO.js";
7
- import { t as state } from "./state-DPl8lffD.js";
7
+ import { t as state } from "./state-zZmOu_06.js";
8
8
  //#region src/runtime/resource-cell.ts
9
9
  /**
10
10
  * Pure, component-agnostic ResourceCell state machine.
@@ -1,4 +1,4 @@
1
1
  import { g as getSignal } from "../component-scope-CC3cojX9.js";
2
- import { t as resource } from "../resource-operation-CUAUBhUB.js";
3
- import { a as stream, c as windowFocused, i as routeActive, n as documentVisible, o as task, r as on, s as timer, t as capture } from "../lifecycle-operations-BR8-AOly.js";
2
+ import { t as resource } from "../resource-operation-BrvPPJDO.js";
3
+ import { a as stream, c as windowFocused, i as routeActive, n as documentVisible, o as task, r as on, s as timer, t as capture } from "../lifecycle-operations-OLgdNomp.js";
4
4
  export { capture, documentVisible, getSignal, on, resource, routeActive, stream, task, timer, windowFocused };
@@ -44,9 +44,12 @@ declare function createRouteRegistry(definition: RouteDefinition, options?: Regi
44
44
  declare function getRoutes(): Route[];
45
45
  //#endregion
46
46
  //#region src/router/lazy.d.ts
47
+ type LazyRouteComponent<TComponent extends AnyRouteComponent> = TComponent & {
48
+ preload(): Promise<void>;
49
+ };
47
50
  declare function lazy<TComponent extends AnyRouteComponent>(factory: () => Promise<{
48
51
  default: TComponent;
49
- } | TComponent>): TComponent;
52
+ } | TComponent>): LazyRouteComponent<TComponent>;
50
53
  //#endregion
51
54
  //#region src/router/rendering.d.ts
52
55
  declare function Outlet(): JSXElement;
@@ -163,4 +166,4 @@ declare function Link({
163
166
  ...rest
164
167
  }: LinkProps): JSXElement;
165
168
  //#endregion
166
- export { type AccessDecision, type AccessDenyDecision, type AccessRedirectDecision, type AuthContext, type AuthRequirement, type Deferred, type DeferredState, type GroupHelperOptions, type HistoryScrollBehavior, type LayoutScopeRecord, Link, type LinkProps, type NavigateOptions, type NavigationScrollBehavior, Outlet, type PageHelperOptions, type PageScopeRecord, type ParsedSegment, type RegisterRoutesOptions, Resolve, type ResolveProps, type Route, type RouteAuthOptions, type RouteAuthResolver, type RouteComponent, type RouteContext, type RouteDefinition, type RouteDestination, type RouteHandler, type RouteManifest, type RouteMatch, type RouteMeta, type RouteMetaSource, type RouteMode, type RouteOptions, type RouteParams, type RoutePathParams, type RoutePolicy, type RouteQuery, type RouteQueryParamInput, type RouteQueryParamValue, type RouteQueryUpdater, type RouteQueryUpdates, type RouteRecord, type RouteRef, type RouteRegistry, type RouteRenderResult, type RouteRequestOptions, type RouteRequestResult, type RouteSearch, type RouteSearchValue, type RouteSnapshot, type ScrollRestorationOptions, type UpdateRouteQueryOptions, allow, clearRoutes, createRouteRegistry, currentAuth, currentRoute, defer, deny, fallback, forbidden, getManifest, getRoutes, group, index, isDeferred, lazy, navigate, notFound, page, reconcileRouteMeta, redirect, registerRoutes, resolveDeferredValues, resolveRouteMeta, resolveRouteRequest, route, routeData, serializeRouteMeta, to$1 as to, unauthorized, updateRouteQuery };
169
+ export { type AccessDecision, type AccessDenyDecision, type AccessRedirectDecision, type AuthContext, type AuthRequirement, type Deferred, type DeferredState, type GroupHelperOptions, type HistoryScrollBehavior, type LayoutScopeRecord, type LazyRouteComponent, Link, type LinkProps, type NavigateOptions, type NavigationScrollBehavior, Outlet, type PageHelperOptions, type PageScopeRecord, type ParsedSegment, type RegisterRoutesOptions, Resolve, type ResolveProps, type Route, type RouteAuthOptions, type RouteAuthResolver, type RouteComponent, type RouteContext, type RouteDefinition, type RouteDestination, type RouteHandler, type RouteManifest, type RouteMatch, type RouteMeta, type RouteMetaSource, type RouteMode, type RouteOptions, type RouteParams, type RoutePathParams, type RoutePolicy, type RouteQuery, type RouteQueryParamInput, type RouteQueryParamValue, type RouteQueryUpdater, type RouteQueryUpdates, type RouteRecord, type RouteRef, type RouteRegistry, type RouteRenderResult, type RouteRequestOptions, type RouteRequestResult, type RouteSearch, type RouteSearchValue, type RouteSnapshot, type ScrollRestorationOptions, type UpdateRouteQueryOptions, allow, clearRoutes, createRouteRegistry, currentAuth, currentRoute, defer, deny, fallback, forbidden, getManifest, getRoutes, group, index, isDeferred, lazy, navigate, notFound, page, reconcileRouteMeta, redirect, registerRoutes, resolveDeferredValues, resolveRouteMeta, resolveRouteRequest, route, routeData, serializeRouteMeta, to$1 as to, unauthorized, updateRouteQuery };
@@ -1,7 +1,7 @@
1
- import { C as index, E as route, S as group, T as registerRoutes, _ as lazy, a as resolveRouteMeta, d as clearRoutes, f as createRouteRegistry, i as reconcileRouteMeta, n as navigate, o as serializeRouteMeta, p as getManifest, r as updateRouteQuery, v as currentRoute, w as page, x as fallback } from "../navigate-Nh4ibPyt.js";
1
+ import { S as route, _ as fallback, a as resolveRouteMeta, b as page, d as clearRoutes, f as createRouteRegistry, i as reconcileRouteMeta, m as currentRoute, n as navigate, o as serializeRouteMeta, p as getManifest, r as updateRouteQuery, v as group, x as registerRoutes, y as index } from "../navigate-zzFcn4zk.js";
2
2
  import { jsx } from "../jsx-runtime.js";
3
3
  import { D as getRoutes } from "../route-matching-vJpvLVbX.js";
4
- import { a as resolveDeferredValues, f as resolveRouteRequest, i as isDeferred, n as Resolve, p as currentAuth, r as defer, s as routeData, v as Outlet } from "../deferred-C-mkQ9J1.js";
4
+ import { S as lazy, a as resolveDeferredValues, f as resolveRouteRequest, i as isDeferred, n as Resolve, p as currentAuth, r as defer, s as routeData, v as Outlet } from "../deferred-DaOJ2Wbe.js";
5
5
  import { o as mergeProps } from "../compose-ref-Cc_YkUpM.js";
6
6
  import { t as applyInteractionPolicy } from "../interactions-w7gQN4ha.js";
7
7
  //#region src/router/policy.ts
package/dist/ssg/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "../access-Bg4RJNC8.js";
2
- import { a as resolveDeferredValues, b as getRenderHandler, c as bindResolvedRouteData } from "../deferred-C-mkQ9J1.js";
2
+ import { a as resolveDeferredValues, b as getRenderHandler, c as bindResolvedRouteData } from "../deferred-DaOJ2Wbe.js";
3
3
  import { n as renderDocument } from "../ssr-CbQO5xd3.js";
4
- import { n as renderToString } from "../ssr-rvWGTg-y.js";
4
+ import { n as renderToString } from "../ssr-DPN09YB2.js";
5
5
  import * as fs from "node:fs/promises";
6
6
  import * as pathModule from "node:path";
7
7
  import * as os from "node:os";
package/dist/ssr/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { u as SSRDataMissingError } from "../render-context-Clw3rFiO.js";
2
- import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-rvWGTg-y.js";
2
+ import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-DPN09YB2.js";
3
3
  export { SSRDataMissingError, createRenderContext, getRenderContext, renderResolvedToStringSync, renderRouteRequest, renderRouteRequestToString, renderToStream, renderToString, renderToStringSync, resolveRequest, withRenderContext, withRenderContextAsync };
@@ -2,17 +2,17 @@ import { t as __CONTROL_BOUNDARY__ } from "./control-DhFRTIoE.js";
2
2
  import { t as __ERROR_BOUNDARY__ } from "./vnode-D24p6IW2.js";
3
3
  import { v as logger } from "./access-Bg4RJNC8.js";
4
4
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
5
- import { f as getExecutionContextFrame, l as callWithContext, m as markVNodeTreeWithContextFrame, n as createComponentInstance, p as getVNodeContextFrame } from "./component-internal-NdN_bJ2-.js";
5
+ import { c as callWithContext, d as getExecutionContextFrame, f as getVNodeContextFrame, n as createComponentInstance, p as markVNodeTreeWithContextFrame } from "./component-internal-S_ILK7MY.js";
6
6
  import { f as getCurrentComponentInstance, w as setCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
7
- import { h as cleanupComponent, m as isPromiseLike } from "./component-lifecycle-C7lnU9Bt.js";
8
- import { g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, o as rollbackForStateTransaction, r as commitForStateTransaction } from "./for-internal-cNhKHMBB.js";
7
+ import { h as cleanupComponent, m as isPromiseLike } from "./component-lifecycle-DFyfmw6H.js";
8
+ import { g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, o as rollbackForStateTransaction, r as commitForStateTransaction } from "./for-internal-DDiDGhR2.js";
9
9
  import { c as stopRenderPhase$1, o as startRenderPhase$1, t as configureRenderContextProvider, u as SSRDataMissingError } from "./render-context-Clw3rFiO.js";
10
- import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-C47xkwXj.js";
10
+ import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-CH-lRprN.js";
11
11
  import { t as getPublicAttributeName } from "./attr-names-CjhzmHOn.js";
12
12
  import { t as createDataRuntime } from "./data-runtime-SJ1BSUvk.js";
13
13
  import { c as withTelemetry, i as dehydrateDataRuntime, t as createQueryPrefetchContext } from "./query-registry-CQIT4mXr.js";
14
14
  import { a as resolveRouteFromRoutes, t as _resolveRouteMatchFromRoutes } from "./route-matching-vJpvLVbX.js";
15
- import { f as resolveRouteRequest, g as isPageRenderEnvelope, h as isEmptyPageRenderEnvelope, i as isDeferred, m as createPageRenderEnvelope, t as DEFERRED_BOUNDARY } from "./deferred-C-mkQ9J1.js";
15
+ import { f as resolveRouteRequest, g as isPageRenderEnvelope, h as isEmptyPageRenderEnvelope, i as isDeferred, m as createPageRenderEnvelope, t as DEFERRED_BOUNDARY, x as _preloadRouteHandler } from "./deferred-DaOJ2Wbe.js";
16
16
  import { n as renderDocument, t as SSR_RENDER_DATA_ATTR } from "./ssr-CbQO5xd3.js";
17
17
  //#region src/ssr/escape.ts
18
18
  /**
@@ -501,6 +501,7 @@ async function resolveRequest(opts) {
501
501
  if (!routes) throw new Error("resolveRequest requires a route manifest or route table.");
502
502
  const resolved = resolveRouteFromRoutes(new URL(url, "http://localhost").pathname, routes);
503
503
  if (!resolved) return null;
504
+ await _preloadRouteHandler(resolved.handler);
504
505
  return {
505
506
  kind: "render",
506
507
  handler: resolved.handler,
@@ -1,3 +1,4 @@
1
+ import { x as isProductionEnvironment } from "./access-Bg4RJNC8.js";
1
2
  import { f as notifyReadableReaders, l as markReactivePropsDirtySource, p as recordReadableRead, t as isBulkCommitActive, u as markReadableDerivedSubscribersDirty } from "./fastlane-Dw8SOBr9.js";
2
3
  import { i as claimHookIndex, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
3
4
  //#region src/runtime/state.ts
@@ -66,6 +67,7 @@ function createStateCell(initialValue, instance) {
66
67
  return value;
67
68
  }
68
69
  read._readers = readers;
70
+ read._unusedStateDiagnosticEligible = !isProductionEnvironment();
69
71
  read._owner = instance;
70
72
  read.set = (newValueOrUpdater) => {
71
73
  if (getCurrentInstance() !== null) throw new Error("[Askr] state.set() cannot be called during component render. State mutations during render break the actor model and cause infinite loops. Move state updates to event handlers or use conditional rendering instead.");
@@ -1,5 +1,5 @@
1
1
  import { t as SSR_RENDER_DATA_ATTR } from "./ssr-CbQO5xd3.js";
2
- import { a as renderResolvedToStringSync } from "./ssr-rvWGTg-y.js";
2
+ import { a as renderResolvedToStringSync } from "./ssr-DPN09YB2.js";
3
3
  //#region src/ssr/verify-hydration.ts
4
4
  function normalizeHydrationHtml(html) {
5
5
  const template = document.createElement("template");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askrjs/askr",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "description": "Actor-backed deterministic UI framework",
5
5
  "keywords": [
6
6
  "askr",