@askrjs/askr 0.0.65 → 0.0.67

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 (72) hide show
  1. package/dist/actions/index.d.ts +1 -1
  2. package/dist/actions/index.js +1 -1
  3. package/dist/{authoring-CXMPffwN.js → authoring-uaJ556aG.js} +2 -2
  4. package/dist/benchmark.d.ts +1 -0
  5. package/dist/benchmark.js +7 -7
  6. package/dist/boot/index.d.ts +7 -6
  7. package/dist/boot/index.js +1 -1
  8. package/dist/{boot-OnYuVVfg.js → boot-DjTa12LD.js} +15 -13
  9. package/dist/{cleanup-B6KovDZZ.js → cleanup-B0kFA4Fv.js} +3 -2
  10. package/dist/component-cleanup-1ZFoLLHt.js +141 -0
  11. package/dist/{component-internal-CbALfPGD.js → component-internal-CPjM4n8M.js} +23 -3
  12. package/dist/components/index.d.ts +1 -2
  13. package/dist/control/index.d.ts +1 -1
  14. package/dist/control/index.js +1 -1
  15. package/dist/{control-B5xu8v4m.d.ts → control-BjYBlytA.d.ts} +0 -1
  16. package/dist/{control-KVP6LMEQ.js → control-CA45Yvvu.js} +3 -3
  17. package/dist/{control-CMzFPMjr.d.ts → control-DO-iBEtV.d.ts} +0 -1
  18. package/dist/{csp-nonce-C-8E85El.js → csp-nonce-HGZ0vbqT.js} +1 -1
  19. package/dist/data/index.js +1 -1
  20. package/dist/{data-DvYo_dHd.js → data-DHt_zO1G.js} +2 -2
  21. package/dist/{deferred-B71c2eio.js → deferred-zHtUheIQ.js} +29 -27
  22. package/dist/{effect-D_4zf_wy.js → effect-CFUzIpqX.js} +1 -1
  23. package/dist/fastlane-BTcFCMnm.js +147 -0
  24. package/dist/{for-internal-B2rBq6yB.js → for-internal-BtK9Htl0.js} +4 -3
  25. package/dist/foundations/icon/index.d.ts +3 -21
  26. package/dist/foundations/index.d.ts +1 -1
  27. package/dist/foundations/index.js +1 -1
  28. package/dist/foundations/interactions/index.d.ts +31 -26
  29. package/dist/foundations/state/index.d.ts +1 -2
  30. package/dist/foundations/state/index.js +1 -1
  31. package/dist/foundations/structures/index.d.ts +1 -1
  32. package/dist/foundations/structures/index.js +1 -1
  33. package/dist/fx/index.d.ts +0 -1
  34. package/dist/{index-NKPpdRh9.d.ts → index-BFnTM1a8.d.ts} +2 -1
  35. package/dist/{index-Bjm0__Rr.d.ts → index-DSClfSoC.d.ts} +3 -7
  36. package/dist/{index-Byqjltu2.d.ts → index-Dh6ZF9yW.d.ts} +1 -2
  37. package/dist/{index-PgRn5wmg.d.ts → index-DjusBb1I.d.ts} +45 -5
  38. package/dist/index.d.ts +4 -4
  39. package/dist/index.js +8 -8
  40. package/dist/jsx-dev-runtime.d.ts +2 -1
  41. package/dist/jsx-runtime-X2SX2y8V.d.ts +2 -0
  42. package/dist/{jsx-runtime-iTU73uwP.d.ts → jsx-runtime-aYZ8zb4q.d.ts} +2 -1
  43. package/dist/jsx-runtime.d.ts +1 -1
  44. package/dist/{component-lifecycle-DEMPihoZ.js → lifecycle-batch-COgl8jMS.js} +3 -160
  45. package/dist/{lifecycle-operations-Dj5lK1K7.js → lifecycle-operations-SlPEK68H.js} +1 -1
  46. package/dist/{navigate-DTZ2SM8_.js → navigate-CJySBpA9.js} +12 -56
  47. package/dist/navigate-CV-RDqYP.d.ts +20 -0
  48. package/dist/{portal-D2tPWNrC.js → portal-D7TC986A.js} +3 -2
  49. package/dist/{fastlane-C8PYPotF.js → readable-BYSoWJSv.js} +2 -146
  50. package/dist/{renderer-aUD-acDe.js → renderer-Dwkk68c5.js} +25 -12
  51. package/dist/{resource-operation-Dz2Nxi1q.js → resource-operation-BJiLoLYZ.js} +3 -3
  52. package/dist/resources/index.d.ts +0 -1
  53. package/dist/resources/index.js +2 -2
  54. package/dist/{route-matching-C93To416.js → route-matching-DLBWDeXX.js} +2 -4
  55. package/dist/router/index.d.ts +21 -16
  56. package/dist/router/index.js +45 -3
  57. package/dist/{router-eRoaj11J.d.ts → router-C0XQA62W.d.ts} +8 -5
  58. package/dist/{selector-pApF_lGd.js → selector-DueeR6Oz.js} +1 -1
  59. package/dist/ssg/index.d.ts +22 -11
  60. package/dist/ssg/index.js +3 -3
  61. package/dist/ssr/index.d.ts +6 -5
  62. package/dist/ssr/index.js +1 -1
  63. package/dist/{ssr-C0hzqhY8.js → ssr-vE-KUgDV.js} +13 -21
  64. package/dist/{state-Cc5HumQ0.js → state-CVuQVjvK.js} +2 -1
  65. package/dist/testing/index.d.ts +1 -2
  66. package/dist/testing/index.js +2 -2
  67. package/dist/types-DEhT-Nrv.d.ts +63 -0
  68. package/dist/{verify-hydration-BdKE9Hi8.js → verify-hydration-ChyEiBAn.js} +1 -1
  69. package/package.json +1 -1
  70. package/dist/jsx-runtime-BVVgDSdq.d.ts +0 -1
  71. package/dist/navigate-BVDCzOuB.d.ts +0 -34
  72. package/dist/types-4k3RFEaC.d.ts +0 -19
@@ -1,2 +1,2 @@
1
- import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-Bjm0__Rr.js";
1
+ import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-DSClfSoC.js";
2
2
  export { ActionDescriptor, ActionForm, ActionStatus, ActionValidationError, action, defineAction };
@@ -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-Cc5HumQ0.js";
3
+ import { t as state } from "../state-CVuQVjvK.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
@@ -1,6 +1,6 @@
1
1
  import { f as getCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
2
- import { T as getExecutionModel, x as createRouteHandler } from "./deferred-B71c2eio.js";
3
- import { A as insertRecordSorted, C as getCurrentPathPrefix, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, O as hasActivePageScope, R as parseSegments, S as getCurrentPageScope, _ as getCurrentInheritedAuthRequirements, b as getCurrentLayoutChain, f as addRouteToStores, p as assertRouteRegistrationUnlocked, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-C93To416.js";
2
+ import { T as getExecutionModel, x as createRouteHandler } from "./deferred-zHtUheIQ.js";
3
+ import { A as insertRecordSorted, C as getCurrentPathPrefix, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, O as hasActivePageScope, R as parseSegments, S as getCurrentPageScope, _ as getCurrentInheritedAuthRequirements, b as getCurrentLayoutChain, f as addRouteToStores, p as assertRouteRegistrationUnlocked, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-DLBWDeXX.js";
4
4
  import { allOf } from "@askrjs/auth";
5
5
  //#region src/router/access.ts
6
6
  function compileNodePolicies(node) {
@@ -1,3 +1,4 @@
1
+ import "./jsx-runtime-X2SX2y8V.js";
1
2
  //#region src/bench/components/benchmark-row.d.ts
2
3
  interface BenchmarkRowData {
3
4
  id: number;
package/dist/benchmark.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { r as flushRuntimeScheduler } from "./access-ePqdQqkV.js";
2
- import { t as installRendererBridge } from "./renderer-aUD-acDe.js";
3
- import { t as state } from "./state-Cc5HumQ0.js";
4
- import { t as selector } from "./selector-pApF_lGd.js";
2
+ import { t as installRendererBridge } from "./renderer-Dwkk68c5.js";
3
+ import { t as state } from "./state-CVuQVjvK.js";
4
+ import { t as selector } from "./selector-DueeR6Oz.js";
5
5
  import { jsx, jsxs } from "./jsx-runtime.js";
6
- import { i as For } from "./control-KVP6LMEQ.js";
7
- import { t as createIsland } from "./boot-OnYuVVfg.js";
6
+ import { i as For } from "./control-CA45Yvvu.js";
7
+ import { t as createIsland } from "./boot-DjTa12LD.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.65",
67
- buildLabel: "0.0.65-local"
66
+ packageVersion: "0.0.67",
67
+ buildLabel: "0.0.67-local"
68
68
  };
69
69
  function getBenchmarkMetadata() {
70
70
  return { ...benchmarkMetadata };
@@ -1,8 +1,7 @@
1
- import { s as ComponentFunction } from "../control-CMzFPMjr.js";
1
+ import { s as ComponentFunction } from "../control-DO-iBEtV.js";
2
2
  import { v as DataRuntime } from "../index-Bki2rqcr.js";
3
- import { N as RouteRegistry, p as RouteAuthOptions } from "../router-eRoaj11J.js";
4
- import { d as ScrollRestorationOptions } from "../navigate-BVDCzOuB.js";
5
-
3
+ import { N as RouteRegistry, p as RouteAuthOptions } from "../router-C0XQA62W.js";
4
+ import { a as ScrollRestorationOptions } from "../navigate-CV-RDqYP.js";
6
5
  //#region src/boot/types.d.ts
7
6
  type IslandConfig = {
8
7
  root: Element | string;
@@ -20,7 +19,8 @@ type BootRouteSource = {
20
19
  };
21
20
  type SPAConfig = BootRouteSource & {
22
21
  root: Element | string;
23
- cspNonce?: string; /** Pass a route registry built via `createRouteRegistry(() => { ... })`. */
22
+ cspNonce?: string;
23
+ /** Pass a route registry built via `createRouteRegistry(() => { ... })`. */
24
24
  auth?: RouteAuthOptions;
25
25
  scrollRestoration?: boolean | ScrollRestorationOptions;
26
26
  cleanupStrict?: boolean;
@@ -29,7 +29,8 @@ type SPAConfig = BootRouteSource & {
29
29
  type HydrateSPAConfig = BootRouteSource & {
30
30
  root: Element | string;
31
31
  cspNonce?: string;
32
- dataRuntime?: DataRuntime; /** Pass the same explicit route registry used for the server render. */
32
+ dataRuntime?: DataRuntime;
33
+ /** Pass the same explicit route registry used for the server render. */
33
34
  auth?: RouteAuthOptions;
34
35
  scrollRestoration?: boolean | ScrollRestorationOptions;
35
36
  cleanupStrict?: boolean;
@@ -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-OnYuVVfg.js";
1
+ import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-DjTa12LD.js";
2
2
  export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
@@ -1,17 +1,18 @@
1
1
  import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.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-CbALfPGD.js";
4
- import { h as cleanupComponent, m as isPromiseLike } from "./component-lifecycle-DEMPihoZ.js";
5
- import { a as withIntrinsicHydrationAdoption, i as registerDeferredHydrationBoundary, n as activateHydrationBoundary$1, o as setStaticChildSlotsCacheEnabled, r as clearDeferredHydrationBoundaries, t as installRendererBridge } from "./renderer-aUD-acDe.js";
6
- import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-B6KovDZZ.js";
7
- import { c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData, w as assertExecutionModel, y as pageRenderEnvelope } from "./deferred-B71c2eio.js";
3
+ import { n as createComponentInstance, r as executeComponent } from "./component-internal-CPjM4n8M.js";
4
+ import { t as cleanupComponent } from "./component-cleanup-1ZFoLLHt.js";
5
+ import { p as isPromiseLike } from "./lifecycle-batch-COgl8jMS.js";
6
+ import { a as withIntrinsicHydrationAdoption, i as registerDeferredHydrationBoundary, n as activateHydrationBoundary$1, o as setStaticChildSlotsCacheEnabled, r as clearDeferredHydrationBoundaries, t as installRendererBridge } from "./renderer-Dwkk68c5.js";
7
+ import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-B0kFA4Fv.js";
8
+ import { c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData, v as pageRenderEnvelope, w as assertExecutionModel } from "./deferred-zHtUheIQ.js";
8
9
  import { a as startHydrationRenderPhase, s as stopHydrationRenderPhase } from "./render-context-Clw3rFiO.js";
9
- import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-D2tPWNrC.js";
10
- import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-C-8E85El.js";
10
+ import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-D7TC986A.js";
11
+ import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-HGZ0vbqT.js";
11
12
  import { i as getDefaultDataRuntime } from "./data-runtime-SJ1BSUvk.js";
12
13
  import { a as hydrateDataRuntime } from "./query-registry-CQIT4mXr.js";
13
- import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-C93To416.js";
14
- import { a as resolveRouteMeta, c as registerAppInstance, d as setServerLocation, f as createAppRenderRuntime, i as reconcileRouteMeta, l as unregisterAppInstance, s as configureScrollRestoration, t as initializeNavigation } from "./navigate-DTZ2SM8_.js";
14
+ import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-DLBWDeXX.js";
15
+ import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation, v as setServerLocation, y as createAppRenderRuntime } from "./navigate-CJySBpA9.js";
15
16
  import "./ssr-CbQO5xd3.js";
16
17
  //#region src/boot/hydration.ts
17
18
  const DEFERRED_PAYLOAD = "__askr_deferred__";
@@ -408,11 +409,12 @@ async function resolveInitialRoute(auth, source) {
408
409
  for (let redirects = 0; redirects <= MAX_INITIAL_ROUTE_REDIRECTS; redirects++) {
409
410
  if (visited.has(href)) throw new Error(`[Askr] Route redirect cycle detected at ${href}.`);
410
411
  visited.add(href);
411
- const resolved = source?.registry ? await resolveRouteRequest(href, {
412
- manifest: source.registry.manifest,
412
+ if (!source?.registry) throw new TypeError("resolveInitialRoute requires a route registry.");
413
+ const resolved = await resolveRouteRequest(href, {
414
+ registry: source.registry,
413
415
  auth,
414
416
  load: source.load
415
- }) : await resolveRouteRequest(href, { auth });
417
+ });
416
418
  if (typeof window === "undefined" || !resolved || resolved.kind !== "redirect") return {
417
419
  path,
418
420
  href,
@@ -582,7 +584,7 @@ async function hydrateSPA(config) {
582
584
  cspNonce: config.cspNonce
583
585
  }));
584
586
  if (shouldVerifyHydrationMarkup(config)) {
585
- const { verifyHydrationSyncForUrl } = await import("./verify-hydration-BdKE9Hi8.js");
587
+ const { verifyHydrationSyncForUrl } = await import("./verify-hydration-ChyEiBAn.js");
586
588
  if (!verifyHydrationSyncForUrl({
587
589
  root: rootElement,
588
590
  url: currentUrl,
@@ -1,6 +1,7 @@
1
1
  import { c as runRuntimeHandlerScope, v as logger } from "./access-ePqdQqkV.js";
2
- import "./fastlane-C8PYPotF.js";
3
- import { f as registerLifecycleTransaction, h as cleanupComponent } from "./component-lifecycle-DEMPihoZ.js";
2
+ import "./fastlane-BTcFCMnm.js";
3
+ import { t as cleanupComponent } from "./component-cleanup-1ZFoLLHt.js";
4
+ import { u as registerLifecycleTransaction } from "./lifecycle-batch-COgl8jMS.js";
4
5
  //#region src/runtime/events.ts
5
6
  /**
6
7
  * Event delegation system for Askr
@@ -0,0 +1,141 @@
1
+ import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
2
+ import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-BYSoWJSv.js";
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
33
+ //#region src/runtime/component-cleanup.ts
34
+ /**
35
+ * Component cleanup and owned child-scope bookkeeping.
36
+ */
37
+ /**
38
+ * Dispose an inactive ownership generation without swapping it back onto the
39
+ * component instance that now represents a different live route.
40
+ */
41
+ function cleanupComponentGeneration(instance, generation) {
42
+ const savedScope = clearCurrentComponentScope();
43
+ try {
44
+ const cleanupErrors = instance.cleanupStrict ? [] : void 0;
45
+ const recordCleanupError = (message, err) => {
46
+ if (cleanupErrors) cleanupErrors.push(err);
47
+ else if (isDevelopmentEnvironment()) logger.warn(message, err);
48
+ };
49
+ const ownedChildScopes = generation.ownedChildScopes;
50
+ if (ownedChildScopes && ownedChildScopes.size > 0) {
51
+ for (const scope of ownedChildScopes) try {
52
+ scope.dispose();
53
+ } catch (err) {
54
+ recordCleanupError("[Askr] child scope cleanup threw:", err);
55
+ }
56
+ ownedChildScopes.clear();
57
+ }
58
+ try {
59
+ cleanupReadableSubscriptionSources(instance, generation.readSources, generation.ownershipGeneration);
60
+ } catch (err) {
61
+ recordCleanupError("[Askr] readable subscription cleanup threw:", err);
62
+ }
63
+ const cleanupFns = generation.cleanupFns;
64
+ generation.cleanupFns = void 0;
65
+ if (cleanupFns) for (const cleanup of cleanupFns) try {
66
+ cleanup();
67
+ } catch (err) {
68
+ recordCleanupError("[Askr] cleanup function threw:", err);
69
+ }
70
+ try {
71
+ if (generation.abortController && !generation.abortController.signal.aborted) generation.abortController.abort();
72
+ } catch (err) {
73
+ recordCleanupError("[Askr] abort controller cleanup threw:", err);
74
+ }
75
+ generation.abortController = null;
76
+ if (cleanupErrors && cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, `Cleanup failed for component ${instance.id}`);
77
+ } finally {
78
+ restoreCurrentComponentScope(savedScope);
79
+ }
80
+ }
81
+ /**
82
+ * Clean up component resources on unmount or route changes.
83
+ */
84
+ function cleanupComponent(instance) {
85
+ const savedScope = clearCurrentComponentScope();
86
+ try {
87
+ warnUnusedStateReads(instance);
88
+ const cleanupErrors = instance.cleanupStrict ? [] : void 0;
89
+ const recordCleanupError = (message, err) => {
90
+ if (cleanupErrors) cleanupErrors.push(err);
91
+ else if (isDevelopmentEnvironment()) logger.warn(message, err);
92
+ };
93
+ const ownedChildScopes = instance._ownedChildScopes;
94
+ if (ownedChildScopes && ownedChildScopes.size > 0) {
95
+ instance._ownedChildScopes = /* @__PURE__ */ new Set();
96
+ for (const scope of ownedChildScopes) try {
97
+ scope.dispose();
98
+ } catch (err) {
99
+ recordCleanupError("[Askr] child scope cleanup threw:", err);
100
+ }
101
+ }
102
+ const cleanupFns = instance.cleanupFns;
103
+ instance.cleanupFns = void 0;
104
+ if (cleanupFns) for (const cleanup of cleanupFns) try {
105
+ cleanup();
106
+ } catch (err) {
107
+ recordCleanupError("[Askr] cleanup function threw:", err);
108
+ }
109
+ try {
110
+ cleanupReadableSubscriptions(instance);
111
+ } catch (err) {
112
+ recordCleanupError("[Askr] readable subscription cleanup threw:", err);
113
+ }
114
+ try {
115
+ if (instance.abortController && !instance.abortController.signal.aborted) instance.abortController.abort();
116
+ } catch (err) {
117
+ recordCleanupError("[Askr] abort controller cleanup threw:", err);
118
+ }
119
+ instance.abortController = null;
120
+ instance.lifecycleGeneration++;
121
+ instance.evaluationGeneration++;
122
+ instance.mountOperations = void 0;
123
+ instance.commitOperations = void 0;
124
+ instance.lifecycleSlots = void 0;
125
+ instance.hasPendingUpdate = false;
126
+ instance.notifyUpdate = null;
127
+ instance._placeholder = void 0;
128
+ instance.mounted = false;
129
+ if (cleanupErrors && cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, `Cleanup failed for component ${instance.id}`);
130
+ } finally {
131
+ restoreCurrentComponentScope(savedScope);
132
+ }
133
+ }
134
+ function registerOwnedChildScope(instance, scope) {
135
+ (instance._ownedChildScopes ??= /* @__PURE__ */ new Set()).add(scope);
136
+ }
137
+ function unregisterOwnedChildScope(instance, scope) {
138
+ instance._ownedChildScopes?.delete(scope);
139
+ }
140
+ //#endregion
141
+ export { unregisterOwnedChildScope as i, cleanupComponentGeneration as n, registerOwnedChildScope as r, cleanupComponent as t };
@@ -1,9 +1,10 @@
1
1
  import { r as markEagerControlPrimitive } from "./control-DhFRTIoE.js";
2
2
  import { b as isDevelopmentEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
3
- import { r as tryRuntimeFastLaneSync, s as finalizeReadableSubscriptions } from "./fastlane-C8PYPotF.js";
3
+ import { r as tryRuntimeFastLaneSync, t as isBulkCommitActive } from "./fastlane-BTcFCMnm.js";
4
4
  import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
5
+ import { i as finalizeReadableSubscriptions } from "./readable-BYSoWJSv.js";
5
6
  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-DEMPihoZ.js";
7
+ import { a as enqueueLifecycleCommitForInstance, d as discardCommitOperations, f as executeCommittedLifecycleOperations, n as captureInlineRenderSnapshot$1, o as finalizeInlineReadSubscriptions, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-COgl8jMS.js";
7
8
  //#region src/runtime/context.ts
8
9
  const ROOT_EXECUTION_FRAME = {
9
10
  parent: null,
@@ -233,6 +234,25 @@ function getCurrentContextFrame() {
233
234
  return currentContextFrame;
234
235
  }
235
236
  //#endregion
237
+ //#region src/runtime/component-lifecycle.ts
238
+ function registerCommitOperationForInstance(instance, operation) {
239
+ if (instance) {
240
+ if (isBulkCommitActive()) {
241
+ if (isDevelopmentEnvironment()) throw new Error("registerCommitOperation called during bulk commit fast-lane");
242
+ return;
243
+ }
244
+ (instance.commitOperations ??= []).push(operation);
245
+ }
246
+ }
247
+ function commitLifecycleForInstance(instance, wasFirstMount) {
248
+ if ((instance.mountOperations?.length ?? 0) === 0 && (instance.commitOperations?.length ?? 0) === 0) return;
249
+ if (enqueueLifecycleCommitForInstance(instance, wasFirstMount)) return;
250
+ executeCommittedLifecycleOperations(instance, wasFirstMount);
251
+ }
252
+ function commitRenderedComponent$1(instance) {
253
+ if (instance.mounted && (instance.commitOperations?.length ?? 0) > 0) commitLifecycleForInstance(instance, false);
254
+ }
255
+ //#endregion
236
256
  //#region src/runtime/component-commit.ts
237
257
  function runScheduledComponent(instance, host) {
238
258
  const ownershipGeneration = instance._ownershipGeneration;
@@ -595,4 +615,4 @@ function warnInstanceOnce(instance, key, message) {
595
615
  logger.warn(message);
596
616
  }
597
617
  //#endregion
598
- 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 };
618
+ export { withContext as _, registerCommitOperation as a, registerCommitOperationForInstance 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 };
@@ -1,6 +1,5 @@
1
- import { l as VNode } from "../control-CMzFPMjr.js";
1
+ import { l as VNode } from "../control-DO-iBEtV.js";
2
2
  import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
3
-
4
3
  //#region src/common/error-boundary.d.ts
5
4
  type ErrorBoundaryContent = VNode | readonly VNode[];
6
5
  type ErrorBoundaryFallbackValue = ErrorBoundaryContent | Node;
@@ -1,2 +1,2 @@
1
- import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-Byqjltu2.js";
1
+ import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-Dh6ZF9yW.js";
2
2
  export { Case, type CaseProps, For, type ForProps, Match, type MatchProps, Show, type ShowProps };
@@ -1,2 +1,2 @@
1
- import { i as For, n as Match, r as Show, t as Case } from "../control-KVP6LMEQ.js";
1
+ import { i as For, n as Match, r as Show, t as Case } from "../control-CA45Yvvu.js";
2
2
  export { Case, For, Match, Show };
@@ -1,5 +1,4 @@
1
1
  import { s as Props } from "./jsx-Dvr2SGRG.js";
2
-
3
2
  //#region src/common/control.d.ts
4
3
  declare const EAGER_CONTROL_PRIMITIVE: unique symbol;
5
4
  type EagerControlPrimitive<P extends Props = Props> = ((props: P) => unknown) & {
@@ -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-ePqdQqkV.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-B2rBq6yB.js";
5
- import { t as createFineGrainedEffect } from "./effect-D_4zf_wy.js";
6
- import { t as state } from "./state-Cc5HumQ0.js";
4
+ import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-BtK9Htl0.js";
5
+ import { t as createFineGrainedEffect } from "./effect-CFUzIpqX.js";
6
+ import { t as state } from "./state-CVuQVjvK.js";
7
7
  //#region src/control/shared.ts
8
8
  function normalizeBoundaryChild(value) {
9
9
  if (Array.isArray(value)) {
@@ -1,5 +1,4 @@
1
1
  import { i as JSXElementType, r as JSXElement, s as Props } from "./jsx-Dvr2SGRG.js";
2
-
3
2
  //#region src/runtime/state.d.ts
4
3
  /**
5
4
  * State value holder - callable to read, has set method to update
@@ -1,4 +1,4 @@
1
- import { l as defineScope, m as readScope } from "./component-internal-CbALfPGD.js";
1
+ import { h as readScope, u as defineScope } from "./component-internal-CPjM4n8M.js";
2
2
  //#region src/common/router-internal.ts
3
3
  const ROUTE_ROOT_COMPONENT = Symbol.for("askr.route-root-component");
4
4
  //#endregion
@@ -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-DvYo_dHd.js";
2
+ import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-DHt_zO1G.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 };
@@ -1,8 +1,8 @@
1
1
  import { n as enqueueRuntimeTask, v as logger } from "./access-ePqdQqkV.js";
2
- import { f as notifyReadableReaders, l as markReactivePropsDirtySource, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-C8PYPotF.js";
2
+ import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.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-Dj5lK1K7.js";
5
+ import { c as windowFocused, i as routeActive, n as documentVisible, s as timer } from "./lifecycle-operations-SlPEK68H.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,12 @@
1
1
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
2
- import { l as defineScope, m as readScope } from "./component-internal-CbALfPGD.js";
2
+ import { h as readScope, u as defineScope } from "./component-internal-CPjM4n8M.js";
3
3
  import { d as getCurrentAppRenderRuntime } from "./component-scope-CC3cojX9.js";
4
- import { m as isPromiseLike } from "./component-lifecycle-DEMPihoZ.js";
4
+ import { p as isPromiseLike } from "./lifecycle-batch-COgl8jMS.js";
5
5
  import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render-context-Clw3rFiO.js";
6
- import { t as resource } from "./resource-operation-Dz2Nxi1q.js";
7
- import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-C-8E85El.js";
6
+ import { t as resource } from "./resource-operation-BJiLoLYZ.js";
7
+ import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-HGZ0vbqT.js";
8
8
  import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-CQIT4mXr.js";
9
- import { A as insertRecordSorted, D as getRouteRecords, E as getRouteList, F as snapshotRouteState, N as restoreRouteState, P as setDefaultRouteAuthOptions, T as getDefaultRouteAuthOptions, f as addRouteToStores, h as getActiveRouteAuthOptions, i as getMatchingRouteRecord, m as clearRouteState, o as buildRouteContext, s as buildRouteContextBase } from "./route-matching-C93To416.js";
9
+ import { A as insertRecordSorted, D as getRouteRecords, E as getRouteList, F as snapshotRouteState, N as restoreRouteState, P as setDefaultRouteAuthOptions, T as getDefaultRouteAuthOptions, f as addRouteToStores, h as getActiveRouteAuthOptions, i as getMatchingRouteRecord, m as clearRouteState, o as buildRouteContext, s as buildRouteContextBase } from "./route-matching-DLBWDeXX.js";
10
10
  //#region src/runtime/execution-model.ts
11
11
  const EXECUTION_MODEL_KEY = Symbol.for("__ASKR_EXECUTION_MODEL__");
12
12
  function getExecutionModel() {
@@ -116,6 +116,24 @@ function getRenderHandler(record) {
116
116
  return record.renderHandler ?? createRouteHandler(record.component, record.pageChain, record.layoutChain, true);
117
117
  }
118
118
  //#endregion
119
+ //#region src/router/auth.ts
120
+ let clientAuth = Object.freeze({
121
+ authenticated: false,
122
+ principal: null,
123
+ session: null,
124
+ tenant: null
125
+ });
126
+ /** Return the identity resolved for the route currently being rendered. */
127
+ function currentAuth() {
128
+ return getActiveRenderContext()?.authContext ?? clientAuth;
129
+ }
130
+ /** @internal Updated atomically with route resolution. */
131
+ function setCurrentAuth(context) {
132
+ clientAuth = context;
133
+ const render = getActiveRenderContext();
134
+ if (render) render.authContext = context;
135
+ }
136
+ //#endregion
119
137
  //#region src/common/page-render-envelope.ts
120
138
  const PAGE_RENDER_ENVELOPE_VERSION = 1;
121
139
  function ownedRecord(value) {
@@ -153,24 +171,6 @@ function isEmptyPageRenderEnvelope(value) {
153
171
  return value.route === void 0 && Object.keys(value.resources).length === 0 && Object.keys(value.framework).length === 0;
154
172
  }
155
173
  //#endregion
156
- //#region src/router/auth.ts
157
- let clientAuth = Object.freeze({
158
- authenticated: false,
159
- principal: null,
160
- session: null,
161
- tenant: null
162
- });
163
- /** Return the identity resolved for the route currently being rendered. */
164
- function currentAuth() {
165
- return getActiveRenderContext()?.authContext ?? clientAuth;
166
- }
167
- /** @internal Updated atomically with route resolution. */
168
- function setCurrentAuth(context) {
169
- clientAuth = context;
170
- const render = getActiveRenderContext();
171
- if (render) render.authContext = context;
172
- }
173
- //#endregion
174
174
  //#region src/router/resolution.ts
175
175
  const anonymous = () => ({
176
176
  authenticated: false,
@@ -300,13 +300,15 @@ function resolveMatchedRoute(record, params, context, authOptions, request, tele
300
300
  const decision = record.options.auth(context.auth);
301
301
  return isPromiseLike(decision) ? Promise.resolve(decision).then(continueResolution) : continueResolution(decision);
302
302
  }
303
- function resolveRouteRequest(target, options = {}) {
303
+ function resolveRouteRequest(target, options) {
304
+ if (!options?.registry) throw new TypeError("resolveRouteRequest requires options.registry.");
304
305
  return withTelemetry(options.telemetry?.routeMatch, {}, () => {
305
- const match = getMatchingRouteRecord(target, options.manifest?.records ?? getRouteRecords());
306
+ const records = options.registry.manifest.records;
307
+ const match = getMatchingRouteRecord(target, records);
306
308
  if (!match) return null;
307
309
  const mode = options.mode ?? getDefaultRouteMode();
308
310
  const signal = options.signal ?? getActiveRenderContext()?.signal ?? new AbortController().signal;
309
- const authOptions = getActiveRouteAuthOptions(options.auth ?? options.manifest?.auth);
311
+ const authOptions = getActiveRouteAuthOptions(options.auth ?? options.registry.manifest.auth);
310
312
  const base = buildRouteContextBase(target, match.params, {
311
313
  mode,
312
314
  signal
@@ -491,4 +493,4 @@ function Resolve(props) {
491
493
  return props.children(result.value);
492
494
  }
493
495
  //#endregion
494
- export { lazy as C, getRenderHandler as S, getExecutionModel as T, isEmptyPageRenderEnvelope as _, resolveDeferredValues as a, Outlet as b, _applyManifest as c, getRouteRenderContext as d, getRouteRenderData as f, createPageRenderEnvelope as g, currentAuth as h, isDeferred as i, createRouteRegistry as l, resolveRouteRequest as m, Resolve as n, reviveDeferredValue as o, hasRouteRenderData as p, defer as r, routeData as s, DEFERRED_BOUNDARY as t, bindResolvedRouteData as u, isPageRenderEnvelope as v, assertExecutionModel as w, createRouteHandler as x, pageRenderEnvelope as y };
496
+ export { lazy as C, getRenderHandler as S, getExecutionModel as T, isPageRenderEnvelope as _, resolveDeferredValues as a, Outlet as b, _applyManifest as c, getRouteRenderContext as d, getRouteRenderData as f, isEmptyPageRenderEnvelope as g, createPageRenderEnvelope as h, isDeferred as i, createRouteRegistry as l, resolveRouteRequest as m, Resolve as n, reviveDeferredValue as o, hasRouteRenderData as p, defer as r, routeData as s, DEFERRED_BOUNDARY as t, bindResolvedRouteData as u, pageRenderEnvelope as v, assertExecutionModel as w, createRouteHandler as x, currentAuth as y };
@@ -1,5 +1,5 @@
1
1
  import { t as enqueueRuntimeLane } from "./access-ePqdQqkV.js";
2
- import { _ as withFineGrainedReadTracking } from "./fastlane-C8PYPotF.js";
2
+ import { m as withFineGrainedReadTracking } from "./readable-BYSoWJSv.js";
3
3
  //#region src/runtime/effect.ts
4
4
  const SOURCE_EFFECTS = Symbol("askr.source-effects");
5
5
  const effectSources = /* @__PURE__ */ new WeakMap();