@askrjs/askr 0.2.4 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/access-CEA2pOry.js +1046 -0
  3. package/dist/actions/index.d.ts +16 -2
  4. package/dist/actions/index.js +5 -5
  5. package/dist/{activity-FirwPXA_.js → activity-oy2YFTFF.js} +10 -16
  6. package/dist/benchmark.js +8 -9
  7. package/dist/boot/index.d.ts +19 -9
  8. package/dist/boot/index.js +1 -1
  9. package/dist/{boot-tWyF6121.js → boot-DLplW9h4.js} +700 -441
  10. package/dist/capabilities-Bbf0mlp9.js +42 -0
  11. package/dist/components/index.d.ts +11 -8
  12. package/dist/components/index.js +1 -1
  13. package/dist/{compose-ref-Bfaf4kUC.js → compose-ref-v0qGlHoN.js} +7 -1
  14. package/dist/control/index.d.ts +20 -2
  15. package/dist/control/index.js +1 -1
  16. package/dist/{control-C-wSaq9V.js → control-BR_mrX__.js} +4 -4
  17. package/dist/core.d.ts +163 -0
  18. package/dist/csp-nonce-BfFWcd0w.js +173 -0
  19. package/dist/data/index.d.ts +74 -2
  20. package/dist/data/index.js +3 -3
  21. package/dist/{data-ghKopAbp.js → data-2edW0jhF.js} +108 -122
  22. package/dist/{data-runtime-7t_Y0iv3.js → data-runtime-CxoY98lX.js} +22 -15
  23. package/dist/{deferred-CxjWCkIn.js → deferred-CbgNhf67.js} +5 -5
  24. package/dist/dom-renderer.d.ts +77 -0
  25. package/dist/domains/actions.d.ts +70 -0
  26. package/dist/domains/component.d.ts +119 -0
  27. package/dist/domains/context.d.ts +73 -0
  28. package/dist/domains/control.d.ts +328 -0
  29. package/dist/domains/data.d.ts +461 -0
  30. package/dist/domains/diagnostics.d.ts +21 -0
  31. package/dist/domains/lifecycle.d.ts +112 -0
  32. package/dist/domains/refs.d.ts +18 -0
  33. package/dist/domains/renderer.d.ts +127 -0
  34. package/dist/domains/routing.d.ts +501 -0
  35. package/dist/domains/scheduler.d.ts +79 -0
  36. package/dist/domains/server.d.ts +112 -0
  37. package/dist/domains/state.d.ts +129 -0
  38. package/dist/domains/telemetry.d.ts +29 -0
  39. package/dist/eager-control.d.ts +8 -0
  40. package/dist/{effect-CNwstBBD.js → effect-C3Zsc1k6.js} +14 -41
  41. package/dist/{types-DWVrKn9N.d.ts → elements.d.ts} +79 -42
  42. package/dist/{for-internal-DyBHfKJA.js → for-state-BDykeOJL.js} +598 -494
  43. package/dist/foundations/icon/index.d.ts +67 -16
  44. package/dist/foundations/icon/index.js +1 -1
  45. package/dist/foundations/index.d.ts +26 -3
  46. package/dist/foundations/index.js +1 -1
  47. package/dist/foundations/interactions/index.d.ts +73 -34
  48. package/dist/foundations/interactions/index.js +1 -1
  49. package/dist/foundations/state/index.d.ts +12 -5
  50. package/dist/foundations/state/index.js +1 -1
  51. package/dist/foundations/structures/index.d.ts +44 -3
  52. package/dist/foundations/structures/index.js +1 -1
  53. package/dist/foundations/utilities/index.d.ts +34 -3
  54. package/dist/foundations/utilities/index.js +1 -1
  55. package/dist/fx/index.d.ts +72 -25
  56. package/dist/fx/index.js +8 -8
  57. package/dist/index.d.ts +121 -4
  58. package/dist/index.js +316 -47
  59. package/dist/{component-internal-C4hKKQBF.js → instance-VAFYVJOa.js} +495 -283
  60. package/dist/{interactions-D102JxBR.js → interactions-CTeACdT_.js} +1 -1
  61. package/dist/jsx-dev-runtime.d.ts +51 -11
  62. package/dist/jsx-globals.d.ts +2 -0
  63. package/dist/jsx-runtime-CPJXAOBF.js +43 -0
  64. package/dist/jsx-runtime.d.ts +17 -3
  65. package/dist/jsx-runtime.js +2 -42
  66. package/dist/jsx.d.ts +108 -0
  67. package/dist/{manifest-D6rfj_jC.js → manifest-D1P3UNWV.js} +4 -9
  68. package/dist/{navigate-ZZu1IV0B.js → navigate-prC5V8XV.js} +125 -472
  69. package/dist/{navigate-F4sHgWbw.d.ts → navigation.d.ts} +8 -8
  70. package/dist/{readable-Di1fzSwm.js → notify-DxxuDPeY.js} +96 -34
  71. package/dist/{query-registry-Bua3cDyb.js → query-registry-LrYpQsDJ.js} +1 -1
  72. package/dist/{compose-ref-DOJHoW5X.d.ts → refs.d.ts} +11 -7
  73. package/dist/{ssr-Doog-AfJ.js → render-resolved-BC0W7_5b.js} +165 -558
  74. package/dist/{renderer-Cl23O0hV.js → renderer-CT0HeY58.js} +6825 -5692
  75. package/dist/{resolution-ClD-K7Lz.js → resolution-3DskUkjG.js} +189 -180
  76. package/dist/{resource-operation-Vz1S5h2k.js → resource-18-sFRl9.js} +98 -58
  77. package/dist/resources/index.d.ts +64 -12
  78. package/dist/resources/index.js +214 -8
  79. package/dist/route-activity.d.ts +21 -0
  80. package/dist/{route-matching-Bo6UqG-5.js → route-matching-CUzZ31gT.js} +68 -82
  81. package/dist/router/index.d.ts +378 -79
  82. package/dist/router/index.js +9 -9
  83. package/dist/router-internal-7nuNEHfG.js +36 -0
  84. package/dist/scope-Cq_iYbTR.js +403 -0
  85. package/dist/{selector-CsKuomw0.js → selector-BSPVkjKP.js} +26 -27
  86. package/dist/{shared-CYBH3F8I.js → shared-kU8yvryp.js} +3 -6
  87. package/dist/{snapshot-source-BB42xgwb.js → snapshot-source-An4iKajG.js} +1 -1
  88. package/dist/ssg/index.d.ts +51 -15
  89. package/dist/ssg/index.js +269 -209
  90. package/dist/ssr/index.d.ts +121 -68
  91. package/dist/ssr/index.js +2 -1
  92. package/dist/ssr-CiNm6Vzl.js +393 -0
  93. package/dist/{ssr-DSHd_Q9K.js → ssr-EPjwJH5R.js} +5 -1
  94. package/dist/{state-BGJgYSyQ.js → state-BXJfudq1.js} +10 -15
  95. package/dist/{structures-DFyK5AdQ.js → structures-CjEzfj4h.js} +37 -57
  96. package/dist/{index-CTpMmzgN.d.ts → structures.d.ts} +57 -36
  97. package/dist/testing/index.d.ts +123 -24
  98. package/dist/testing/index.js +24 -61
  99. package/dist/timer-C7uqnJVt.js +85 -0
  100. package/dist/{index-B1gu0_m0.d.ts → utilities.d.ts} +24 -13
  101. package/dist/{verify-hydration-BZPJ_kYa.js → verify-hydration-ikaxotf7.js} +8 -5
  102. package/package.json +12 -14
  103. package/dist/access-BucjYZcX.js +0 -509
  104. package/dist/activity-DooIuxQO.d.ts +0 -14
  105. package/dist/benchmark.d.ts +0 -26
  106. package/dist/cleanup-TXSsApEl.js +0 -535
  107. package/dist/component-cleanup-jdbgjkT1.js +0 -143
  108. package/dist/component-scope-4I3yEMkb.js +0 -195
  109. package/dist/control-Cxag1yqV.d.ts +0 -8
  110. package/dist/csp-nonce-9NFUb7hJ.js +0 -72
  111. package/dist/css-BuPaTOfe.js +0 -70
  112. package/dist/fastlane-BKZduiBQ.js +0 -166
  113. package/dist/index-Dgjbo2gU.d.ts +0 -1456
  114. package/dist/jsx-runtime-Cg7GqY1S.d.ts +0 -2
  115. package/dist/jsx-runtime-gVIaTPw0.d.ts +0 -38
  116. package/dist/lifecycle-batch-63aXFf2S.js +0 -253
  117. package/dist/lifecycle-operations-Q0k3EFnG.js +0 -287
@@ -1,2 +1,16 @@
1
- import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-Dgjbo2gU.js";
2
- export { ActionDescriptor, ActionForm, ActionStatus, ActionValidationError, action, defineAction };
1
+ import {
2
+ action,
3
+ ActionValidationError,
4
+ ActionForm,
5
+ defineAction,
6
+ ActionStatus,
7
+ ActionDescriptor,
8
+ } from '../core.js';
9
+ export {
10
+ ActionDescriptor,
11
+ ActionForm,
12
+ ActionStatus,
13
+ ActionValidationError,
14
+ action,
15
+ defineAction,
16
+ };
@@ -1,9 +1,9 @@
1
- import { d as getCurrentAppRenderRuntime } from "../component-scope-4I3yEMkb.js";
1
+ import { d as getCurrentAppRenderRuntime } from "../scope-Cq_iYbTR.js";
2
2
  import { r as getCurrentRenderData } from "../render-context-B7ohlh6t.js";
3
- import { t as state } from "../state-BGJgYSyQ.js";
4
- import { jsx, jsxs } from "../jsx-runtime.js";
5
- import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-7t_Y0iv3.js";
6
- import { r as isCurrentAsyncGeneration } from "../shared-CYBH3F8I.js";
3
+ import { t as state } from "../state-BXJfudq1.js";
4
+ import { r as jsxs, t as jsx } from "../jsx-runtime-CPJXAOBF.js";
5
+ import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-CxoY98lX.js";
6
+ import { r as isCurrentAsyncGeneration } from "../shared-kU8yvryp.js";
7
7
  //#region src/actions/runtime.ts
8
8
  const emptyFramework = Object.freeze({});
9
9
  /** @internal Read Askr-owned state from the current application root. */
@@ -1,9 +1,10 @@
1
- import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-4I3yEMkb.js";
2
- import { a as registerCommitOperation } from "./component-internal-C4hKKQBF.js";
3
- import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-Di1fzSwm.js";
1
+ import { a as registerCommitOperation } from "./instance-VAFYVJOa.js";
2
+ import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./scope-Cq_iYbTR.js";
3
+ import { a as ownComponentCleanup, i as isServerComponent, n as getComponentLifecycleSlot } from "./capabilities-Bbf0mlp9.js";
4
+ import { t as notifyReadableSource, v as recordReadableRead } from "./notify-DxxuDPeY.js";
4
5
  import { n as getActiveRenderContext } from "./render-context-B7ohlh6t.js";
5
6
  import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
6
- import { b as getActiveRoutes, c as removeRouteBasePath, d as deepFreeze, f as makeQuery, n as computeMatchesFromRoutes, p as parseLocation, y as getActiveRouteBasePath } from "./route-matching-Bo6UqG-5.js";
7
+ import { b as getActiveRouteBasePath, c as removeRouteBasePath, d as deepFreeze, f as makeQuery, n as computeMatchesFromRoutes, p as parseLocation, x as getActiveRoutes } from "./route-matching-CUzZ31gT.js";
7
8
  //#region src/common/app-render-runtime.ts
8
9
  const stagedRouteLocations = /* @__PURE__ */ new WeakMap();
9
10
  function createAppRenderRuntime(input = {}) {
@@ -39,10 +40,7 @@ function onRouteChange(fn, options = {}) {
39
40
  if (!instance) return;
40
41
  const route = currentRoute();
41
42
  const index = claimHookIndex(instance, "route-change");
42
- const slots = instance.lifecycleSlots ??= [];
43
- const existing = slots[index];
44
- if (existing && existing.kind !== "route-change") throw new Error(`onRouteChange() lifecycle order violation: slot ${index} already belongs to ${existing.kind}(). Keep lifecycle primitives in a stable top-level order.`);
45
- const slot = existing ?? {
43
+ const slot = getComponentLifecycleSlot(instance, index, "route-change", () => ({
46
44
  kind: "route-change",
47
45
  previous: null,
48
46
  pending: null,
@@ -50,14 +48,12 @@ function onRouteChange(fn, options = {}) {
50
48
  cleanupRegistered: false,
51
49
  callback: fn,
52
50
  immediate: options.immediate === true
53
- };
54
- slots[index] = slot;
51
+ }), "onRouteChange");
55
52
  slot.pending = route;
56
53
  slot.callback = fn;
57
54
  slot.immediate = options.immediate === true;
58
55
  if (!slot.cleanupRegistered) {
59
- instance.cleanupFns ??= [];
60
- instance.cleanupFns.push(() => {
56
+ ownComponentCleanup(instance, () => {
61
57
  slot.cleanup?.();
62
58
  slot.cleanup = null;
63
59
  });
@@ -133,9 +129,7 @@ function setCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
133
129
  currentRouteSnapshot = buildRouteSnapshot(pathname, search, hash);
134
130
  syncRouteActivitySnapshot(currentRouteSnapshot.path, activityMatches ?? currentRouteSnapshot.matches);
135
131
  const instance = getCurrentComponentInstance();
136
- markReadableDerivedSubscribersDirty(currentRouteSource);
137
- markReactivePropsDirtySource(currentRouteSource);
138
- notifyReadableReaders(currentRouteSource, instance);
132
+ notifyReadableSource(currentRouteSource, { skipInstance: instance });
139
133
  }
140
134
  function readCurrentRouteLocation() {
141
135
  const renderContext = getActiveRenderContext();
@@ -196,7 +190,7 @@ function readCurrentRouteSnapshot() {
196
190
  function currentRoute() {
197
191
  const instance = getCurrentComponentInstance();
198
192
  if (!instance) throw new Error("currentRoute() can only be called during component render execution. Call currentRoute() from inside your component function.");
199
- if (typeof window === "undefined" || instance.ssr) return readCurrentRouteSnapshot();
193
+ if (typeof window === "undefined" || isServerComponent(instance)) return readCurrentRouteSnapshot();
200
194
  recordReadableRead(currentRouteSource);
201
195
  return readCurrentRouteSnapshot();
202
196
  }
package/dist/benchmark.js CHANGED
@@ -1,10 +1,9 @@
1
- import { r as flushRuntimeScheduler } from "./access-BucjYZcX.js";
2
- import { t as state } from "./state-BGJgYSyQ.js";
3
- import { t as selector } from "./selector-CsKuomw0.js";
4
- import { t as installRendererBridge } from "./renderer-Cl23O0hV.js";
5
- import { i as For } from "./control-C-wSaq9V.js";
6
- import { jsx, jsxs } from "./jsx-runtime.js";
7
- import { t as createIsland } from "./boot-tWyF6121.js";
1
+ import { r as flushRuntimeScheduler } from "./access-CEA2pOry.js";
2
+ import { t as state } from "./state-BXJfudq1.js";
3
+ import { t as selector } from "./selector-BSPVkjKP.js";
4
+ import { i as For } from "./control-BR_mrX__.js";
5
+ import { r as jsxs, t as jsx } from "./jsx-runtime-CPJXAOBF.js";
6
+ import { r as createIsland, s as installRendererBridge } from "./boot-DLplW9h4.js";
8
7
  //#region src/bench/components/benchmark-row.tsx
9
8
  function BenchmarkRow({ item, isSelected, onSelect, onRemove }) {
10
9
  return /* @__PURE__ */ jsxs("tr", {
@@ -63,8 +62,8 @@ function BenchmarkTable({ rows, isSelected, onSelect, onRemove }) {
63
62
  installRendererBridge();
64
63
  const benchmarkMetadata = {
65
64
  packageName: "@askrjs/askr",
66
- packageVersion: "0.2.4",
67
- buildLabel: "0.2.4-local"
65
+ packageVersion: "0.3.1",
66
+ buildLabel: "0.3.1-local"
68
67
  };
69
68
  function getBenchmarkMetadata() {
70
69
  return { ...benchmarkMetadata };
@@ -1,6 +1,10 @@
1
- import { Et as RouteAuthOptions, Kt as RouteRegistry, Sn as ComponentFunction, tn as DataRuntime } from "../index-Dgjbo2gU.js";
2
- import { a as ScrollRestorationOptions } from "../navigate-F4sHgWbw.js";
3
- //#region src/boot/types.d.ts
1
+ import {
2
+ RouteAuthOptions,
3
+ RouteRegistry,
4
+ ComponentFunction,
5
+ DataRuntime,
6
+ } from '../core.js';
7
+ import { ScrollRestorationOptions } from '../navigation.js';
4
8
  /** Configuration for {@link createIsland}: mounts one component onto existing DOM. */
5
9
  type IslandConfig = {
6
10
  root: Element | string;
@@ -48,8 +52,6 @@ type HydrateSPAConfig = BootRouteSource & {
48
52
  skipSelectors?: string[];
49
53
  };
50
54
  };
51
- //#endregion
52
- //#region src/boot/root-lifecycle.d.ts
53
55
  /**
54
56
  * Tear down the app mounted at `root`: runs its cleanup callbacks, clears
55
57
  * route state if it was the last routed root, and removes bookkeeping for
@@ -58,8 +60,6 @@ type HydrateSPAConfig = BootRouteSource & {
58
60
  declare function cleanupApp(root: Element | string): void;
59
61
  /** Check whether an app instance is currently mounted at `root`. */
60
62
  declare function hasApp(root: Element | string): boolean;
61
- //#endregion
62
- //#region src/boot/index.d.ts
63
63
  /**
64
64
  * createIsland: Enhances existing DOM (no router, mounts once)
65
65
  */
@@ -83,5 +83,15 @@ declare function createSPA(config: SPAConfig): Promise<void>;
83
83
  * hydrateSPA: Hydrate server-rendered HTML with an explicit route registry.
84
84
  */
85
85
  declare function hydrateSPA(config: HydrateSPAConfig): Promise<void>;
86
- //#endregion
87
- export { type HydrateSPAConfig, type IslandConfig, type IslandsConfig, type SPAConfig, cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
86
+ export {
87
+ type HydrateSPAConfig,
88
+ type IslandConfig,
89
+ type IslandsConfig,
90
+ type SPAConfig,
91
+ cleanupApp,
92
+ createIsland,
93
+ createIslands,
94
+ createSPA,
95
+ hasApp,
96
+ hydrateSPA,
97
+ };
@@ -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-tWyF6121.js";
1
+ import { a as cleanupApp, i as createIslands, n as createSPA, o as hasApp, r as createIsland, t as hydrateSPA } from "../boot-DLplW9h4.js";
2
2
  export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };