@askrjs/askr 0.0.66 → 0.0.68

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 (70) hide show
  1. package/dist/actions/index.d.ts +1 -1
  2. package/dist/actions/index.js +1 -1
  3. package/dist/{authoring-Di8MInO-.js → authoring-uaJ556aG.js} +1 -1
  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-B4UZumvB.js → boot-C8UOxI4f.js} +10 -9
  9. package/dist/{cleanup-B6KovDZZ.js → cleanup-UyStxIHG.js} +22 -8
  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-Eh9bCVGH.js → deferred-zHtUheIQ.js} +4 -4
  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-CV-RDqYP.d.ts +20 -0
  47. package/dist/{navigate-QMRcR581.js → navigate-DpR-cML9.js} +9 -50
  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-bZ0315dE.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/router/index.d.ts +20 -15
  55. package/dist/router/index.js +45 -3
  56. package/dist/{router-4EhVGcma.d.ts → router-C0XQA62W.d.ts} +3 -4
  57. package/dist/{selector-pApF_lGd.js → selector-DueeR6Oz.js} +1 -1
  58. package/dist/ssg/index.d.ts +22 -11
  59. package/dist/ssg/index.js +3 -3
  60. package/dist/ssr/index.d.ts +6 -5
  61. package/dist/ssr/index.js +1 -1
  62. package/dist/{ssr-Y8Pq8riM.js → ssr-vE-KUgDV.js} +8 -7
  63. package/dist/{state-Cc5HumQ0.js → state-CVuQVjvK.js} +2 -1
  64. package/dist/testing/index.d.ts +1 -2
  65. package/dist/types-DEhT-Nrv.d.ts +63 -0
  66. package/dist/{verify-hydration-BcZXRU-q.js → verify-hydration-ChyEiBAn.js} +1 -1
  67. package/package.json +1 -1
  68. package/dist/jsx-runtime-BVVgDSdq.d.ts +0 -1
  69. package/dist/navigate-BVDCzOuB.d.ts +0 -34
  70. 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,5 +1,5 @@
1
1
  import { f as getCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
2
- import { T as getExecutionModel, x as createRouteHandler } from "./deferred-Eh9bCVGH.js";
2
+ import { T as getExecutionModel, x as createRouteHandler } from "./deferred-zHtUheIQ.js";
3
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
@@ -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-bZ0315dE.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-B4UZumvB.js";
6
+ import { i as For } from "./control-CA45Yvvu.js";
7
+ import { t as createIsland } from "./boot-C8UOxI4f.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.66",
67
- buildLabel: "0.0.66-local"
66
+ packageVersion: "0.0.68",
67
+ buildLabel: "0.0.68-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-4EhVGcma.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-B4UZumvB.js";
1
+ import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-C8UOxI4f.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, v as pageRenderEnvelope, w as assertExecutionModel } from "./deferred-Eh9bCVGH.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-bZ0315dE.js";
7
+ import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-UyStxIHG.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
14
  import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-DLBWDeXX.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-QMRcR581.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-DpR-cML9.js";
15
16
  import "./ssr-CbQO5xd3.js";
16
17
  //#region src/boot/hydration.ts
17
18
  const DEFERRED_PAYLOAD = "__askr_deferred__";
@@ -583,7 +584,7 @@ async function hydrateSPA(config) {
583
584
  cspNonce: config.cspNonce
584
585
  }));
585
586
  if (shouldVerifyHydrationMarkup(config)) {
586
- const { verifyHydrationSyncForUrl } = await import("./verify-hydration-BcZXRU-q.js");
587
+ const { verifyHydrationSyncForUrl } = await import("./verify-hydration-ChyEiBAn.js");
587
588
  if (!verifyHydrationSyncForUrl({
588
589
  root: rootElement,
589
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
@@ -40,6 +41,11 @@ const delegatedHandlerFallback = /* @__PURE__ */ new WeakMap();
40
41
  function getDelegatedHandlerStore(element) {
41
42
  return element[DELEGATED_HANDLERS] ?? delegatedHandlerFallback.get(element);
42
43
  }
44
+ function isElementNode(node) {
45
+ if (!node || typeof node !== "object") return false;
46
+ if (typeof Element !== "undefined") return node instanceof Element;
47
+ return node.nodeType === 1;
48
+ }
43
49
  function setDelegatedHandlerStore(element, store) {
44
50
  const host = element;
45
51
  try {
@@ -86,12 +92,21 @@ function attachDelegatedListener(container, element, eventName, handler, origina
86
92
  let containerListener = containerListeners.get(eventName);
87
93
  if (!containerListener) {
88
94
  const delegatedHandler = (e) => {
89
- const target = e.target;
90
- if (!target) return;
91
95
  runRuntimeHandlerScope(() => {
92
- let current = target;
93
- while (current && current !== container) {
94
- const store = getDelegatedHandlerStore(current);
96
+ const path = [];
97
+ if (typeof e.composedPath === "function") path.push(...e.composedPath());
98
+ else {
99
+ let node = e.target;
100
+ while (node) {
101
+ path.push(node);
102
+ if (node === container) break;
103
+ node = isElementNode(node) ? node.parentNode : node.parentNode;
104
+ }
105
+ }
106
+ for (const node of path) {
107
+ if (node === container) break;
108
+ if (!isElementNode(node)) continue;
109
+ const store = getDelegatedHandlerStore(node);
95
110
  const entry = !store ? void 0 : store instanceof Map ? store.get(eventName) : store.eventName === eventName ? store : void 0;
96
111
  if (entry) try {
97
112
  entry.handler(e);
@@ -99,7 +114,6 @@ function attachDelegatedListener(container, element, eventName, handler, origina
99
114
  logger.error("[Askr] Delegated event error:", error);
100
115
  }
101
116
  if (e.cancelBubble) break;
102
- current = current.parentElement;
103
117
  }
104
118
  }, "sync");
105
119
  };
@@ -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,10 +1,10 @@
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
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
@@ -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();
@@ -0,0 +1,147 @@
1
+ import { b as isDevelopmentEnvironment, l as runRuntimeWithSyncProgress, o as getRuntimeRenderer, u as setRuntimeBulkCommitProbe } from "./access-ePqdQqkV.js";
2
+ import { n as Fragment } from "./jsx-CUpRxrLH.js";
3
+ import { i as finalizeReadableSubscriptions } from "./readable-BYSoWJSv.js";
4
+ //#region src/runtime/dev-namespace.ts
5
+ /**
6
+ * Set a value in the dev namespace (no-op in production).
7
+ */
8
+ const setDevValue = () => {};
9
+ /**
10
+ * Increment a counter in the dev namespace (no-op in production).
11
+ * Safely handles non-number values by resetting to 1.
12
+ */
13
+ const incDevCounter = () => {};
14
+ //#endregion
15
+ //#region src/runtime/fastlane.ts
16
+ let _bulkCommitActive = false;
17
+ let _appliedParents = null;
18
+ function enterBulkCommit() {
19
+ _bulkCommitActive = true;
20
+ _appliedParents = /* @__PURE__ */ new WeakSet();
21
+ }
22
+ function exitBulkCommit() {
23
+ _bulkCommitActive = false;
24
+ _appliedParents = null;
25
+ }
26
+ function isBulkCommitActive() {
27
+ return _bulkCommitActive;
28
+ }
29
+ function markFastPathApplied(parent) {
30
+ if (!_appliedParents) return;
31
+ try {
32
+ _appliedParents.add(parent);
33
+ } catch (e) {}
34
+ }
35
+ function finalizeReadSubscriptions(instance) {
36
+ finalizeReadableSubscriptions(instance);
37
+ }
38
+ /**
39
+ * Attempt to execute a runtime fast-lane for a single component's synchronous
40
+ * render result. Returns true if the fast-lane was used and commit was done.
41
+ *
42
+ * Preconditions (checked conservatively):
43
+ * - The render result is an intrinsic element root with keyed children
44
+ * - The renderer's fast-path heuristics indicate to use the fast-path
45
+ * - No mount operations are pending on the component instance
46
+ * - No child vnodes are component functions (avoid async/component mounts)
47
+ */
48
+ function unwrapFragmentForFastPath(vnode) {
49
+ if (!vnode || typeof vnode !== "object" || !("type" in vnode)) return vnode;
50
+ const v = vnode;
51
+ if (typeof v.type === "symbol" && (v.type === Fragment || String(v.type) === "Symbol(askr.fragment)")) {
52
+ const children = v.props?.children ?? v.children;
53
+ if (Array.isArray(children) && children.length > 0) {
54
+ for (const child of children) if (child && typeof child === "object" && "type" in child) {
55
+ if (typeof child.type === "string") return child;
56
+ }
57
+ }
58
+ }
59
+ return vnode;
60
+ }
61
+ function classifyUpdate(instance, result) {
62
+ const unwrappedResult = unwrapFragmentForFastPath(result);
63
+ if (!unwrappedResult || typeof unwrappedResult !== "object" || !("type" in unwrappedResult)) return {
64
+ useFastPath: false,
65
+ reason: "not-vnode"
66
+ };
67
+ const vnode = unwrappedResult;
68
+ if (vnode == null || typeof vnode.type !== "string") return {
69
+ useFastPath: false,
70
+ reason: "not-intrinsic"
71
+ };
72
+ const parent = instance.target;
73
+ if (!parent) return {
74
+ useFastPath: false,
75
+ reason: "no-root"
76
+ };
77
+ const firstChild = parent.children[0];
78
+ if (!firstChild) return {
79
+ useFastPath: false,
80
+ reason: "no-first-child"
81
+ };
82
+ if (firstChild.tagName.toLowerCase() !== String(vnode.type).toLowerCase()) return {
83
+ useFastPath: false,
84
+ reason: "root-tag-mismatch"
85
+ };
86
+ const children = vnode.props?.children ?? vnode.children;
87
+ if (!Array.isArray(children)) return {
88
+ useFastPath: false,
89
+ reason: "no-children-array"
90
+ };
91
+ for (const c of children) if (typeof c === "object" && c !== null && "type" in c && typeof c.type === "function") return {
92
+ useFastPath: false,
93
+ reason: "component-child-present"
94
+ };
95
+ if ((instance.mountOperations?.length ?? 0) > 0) return {
96
+ useFastPath: false,
97
+ reason: "pending-mounts"
98
+ };
99
+ if ((instance.commitOperations?.length ?? 0) > 0) return {
100
+ useFastPath: false,
101
+ reason: "pending-lifecycle-commits"
102
+ };
103
+ const renderer = getRuntimeRenderer();
104
+ try {
105
+ renderer.populateKeyMapForElement(firstChild);
106
+ } catch {}
107
+ const oldKeyMap = renderer.getKeyMapForElement(firstChild);
108
+ const decision = renderer.isKeyedReorderFastPathEligible(firstChild, children, oldKeyMap);
109
+ if (!decision.useFastPath || decision.totalKeyed < 128) return {
110
+ ...decision,
111
+ useFastPath: false,
112
+ reason: "renderer-declined"
113
+ };
114
+ return {
115
+ ...decision,
116
+ useFastPath: true
117
+ };
118
+ }
119
+ function commitReorderOnly(instance, result) {
120
+ const renderer = getRuntimeRenderer();
121
+ enterBulkCommit();
122
+ try {
123
+ runRuntimeWithSyncProgress(() => {
124
+ renderer.evaluate(result, instance.target);
125
+ try {
126
+ finalizeReadSubscriptions(instance);
127
+ } catch (e) {
128
+ if (isDevelopmentEnvironment()) throw e;
129
+ }
130
+ });
131
+ return true;
132
+ } finally {
133
+ exitBulkCommit();
134
+ }
135
+ }
136
+ function tryRuntimeFastLaneSync(instance, result) {
137
+ if (!classifyUpdate(instance, result).useFastPath) return false;
138
+ try {
139
+ return commitReorderOnly(instance, result);
140
+ } catch (err) {
141
+ if (isDevelopmentEnvironment()) throw err;
142
+ return false;
143
+ }
144
+ }
145
+ setRuntimeBulkCommitProbe(isBulkCommitActive);
146
+ //#endregion
147
+ export { setDevValue as a, incDevCounter as i, markFastPathApplied as n, tryRuntimeFastLaneSync as r, isBulkCommitActive as t };