@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.
- package/CHANGELOG.md +30 -0
- package/dist/access-CEA2pOry.js +1046 -0
- package/dist/actions/index.d.ts +16 -2
- package/dist/actions/index.js +5 -5
- package/dist/{activity-FirwPXA_.js → activity-oy2YFTFF.js} +10 -16
- package/dist/benchmark.js +8 -9
- package/dist/boot/index.d.ts +19 -9
- package/dist/boot/index.js +1 -1
- package/dist/{boot-tWyF6121.js → boot-DLplW9h4.js} +700 -441
- package/dist/capabilities-Bbf0mlp9.js +42 -0
- package/dist/components/index.d.ts +11 -8
- package/dist/components/index.js +1 -1
- package/dist/{compose-ref-Bfaf4kUC.js → compose-ref-v0qGlHoN.js} +7 -1
- package/dist/control/index.d.ts +20 -2
- package/dist/control/index.js +1 -1
- package/dist/{control-C-wSaq9V.js → control-BR_mrX__.js} +4 -4
- package/dist/core.d.ts +163 -0
- package/dist/csp-nonce-BfFWcd0w.js +173 -0
- package/dist/data/index.d.ts +74 -2
- package/dist/data/index.js +3 -3
- package/dist/{data-ghKopAbp.js → data-2edW0jhF.js} +108 -122
- package/dist/{data-runtime-7t_Y0iv3.js → data-runtime-CxoY98lX.js} +22 -15
- package/dist/{deferred-CxjWCkIn.js → deferred-CbgNhf67.js} +5 -5
- package/dist/dom-renderer.d.ts +77 -0
- package/dist/domains/actions.d.ts +70 -0
- package/dist/domains/component.d.ts +119 -0
- package/dist/domains/context.d.ts +73 -0
- package/dist/domains/control.d.ts +328 -0
- package/dist/domains/data.d.ts +461 -0
- package/dist/domains/diagnostics.d.ts +21 -0
- package/dist/domains/lifecycle.d.ts +112 -0
- package/dist/domains/refs.d.ts +18 -0
- package/dist/domains/renderer.d.ts +127 -0
- package/dist/domains/routing.d.ts +501 -0
- package/dist/domains/scheduler.d.ts +79 -0
- package/dist/domains/server.d.ts +112 -0
- package/dist/domains/state.d.ts +129 -0
- package/dist/domains/telemetry.d.ts +29 -0
- package/dist/eager-control.d.ts +8 -0
- package/dist/{effect-CNwstBBD.js → effect-C3Zsc1k6.js} +14 -41
- package/dist/{types-DWVrKn9N.d.ts → elements.d.ts} +79 -42
- package/dist/{for-internal-DyBHfKJA.js → for-state-BDykeOJL.js} +598 -494
- package/dist/foundations/icon/index.d.ts +67 -16
- package/dist/foundations/icon/index.js +1 -1
- package/dist/foundations/index.d.ts +26 -3
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +73 -34
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.d.ts +12 -5
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +44 -3
- package/dist/foundations/structures/index.js +1 -1
- package/dist/foundations/utilities/index.d.ts +34 -3
- package/dist/foundations/utilities/index.js +1 -1
- package/dist/fx/index.d.ts +72 -25
- package/dist/fx/index.js +8 -8
- package/dist/index.d.ts +121 -4
- package/dist/index.js +316 -47
- package/dist/{component-internal-C4hKKQBF.js → instance-VAFYVJOa.js} +495 -283
- package/dist/{interactions-D102JxBR.js → interactions-CTeACdT_.js} +1 -1
- package/dist/jsx-dev-runtime.d.ts +51 -11
- package/dist/jsx-globals.d.ts +2 -0
- package/dist/jsx-runtime-CPJXAOBF.js +43 -0
- package/dist/jsx-runtime.d.ts +17 -3
- package/dist/jsx-runtime.js +2 -42
- package/dist/jsx.d.ts +108 -0
- package/dist/{manifest-D6rfj_jC.js → manifest-D1P3UNWV.js} +4 -9
- package/dist/{navigate-ZZu1IV0B.js → navigate-prC5V8XV.js} +125 -472
- package/dist/{navigate-F4sHgWbw.d.ts → navigation.d.ts} +8 -8
- package/dist/{readable-Di1fzSwm.js → notify-DxxuDPeY.js} +96 -34
- package/dist/{query-registry-Bua3cDyb.js → query-registry-LrYpQsDJ.js} +1 -1
- package/dist/{compose-ref-DOJHoW5X.d.ts → refs.d.ts} +11 -7
- package/dist/{ssr-Doog-AfJ.js → render-resolved-BC0W7_5b.js} +165 -558
- package/dist/{renderer-Cl23O0hV.js → renderer-CT0HeY58.js} +6825 -5692
- package/dist/{resolution-ClD-K7Lz.js → resolution-3DskUkjG.js} +189 -180
- package/dist/{resource-operation-Vz1S5h2k.js → resource-18-sFRl9.js} +98 -58
- package/dist/resources/index.d.ts +64 -12
- package/dist/resources/index.js +214 -8
- package/dist/route-activity.d.ts +21 -0
- package/dist/{route-matching-Bo6UqG-5.js → route-matching-CUzZ31gT.js} +68 -82
- package/dist/router/index.d.ts +378 -79
- package/dist/router/index.js +9 -9
- package/dist/router-internal-7nuNEHfG.js +36 -0
- package/dist/scope-Cq_iYbTR.js +403 -0
- package/dist/{selector-CsKuomw0.js → selector-BSPVkjKP.js} +26 -27
- package/dist/{shared-CYBH3F8I.js → shared-kU8yvryp.js} +3 -6
- package/dist/{snapshot-source-BB42xgwb.js → snapshot-source-An4iKajG.js} +1 -1
- package/dist/ssg/index.d.ts +51 -15
- package/dist/ssg/index.js +269 -209
- package/dist/ssr/index.d.ts +121 -68
- package/dist/ssr/index.js +2 -1
- package/dist/ssr-CiNm6Vzl.js +393 -0
- package/dist/{ssr-DSHd_Q9K.js → ssr-EPjwJH5R.js} +5 -1
- package/dist/{state-BGJgYSyQ.js → state-BXJfudq1.js} +10 -15
- package/dist/{structures-DFyK5AdQ.js → structures-CjEzfj4h.js} +37 -57
- package/dist/{index-CTpMmzgN.d.ts → structures.d.ts} +57 -36
- package/dist/testing/index.d.ts +123 -24
- package/dist/testing/index.js +24 -61
- package/dist/timer-C7uqnJVt.js +85 -0
- package/dist/{index-B1gu0_m0.d.ts → utilities.d.ts} +24 -13
- package/dist/{verify-hydration-BZPJ_kYa.js → verify-hydration-ikaxotf7.js} +8 -5
- package/package.json +12 -14
- package/dist/access-BucjYZcX.js +0 -509
- package/dist/activity-DooIuxQO.d.ts +0 -14
- package/dist/benchmark.d.ts +0 -26
- package/dist/cleanup-TXSsApEl.js +0 -535
- package/dist/component-cleanup-jdbgjkT1.js +0 -143
- package/dist/component-scope-4I3yEMkb.js +0 -195
- package/dist/control-Cxag1yqV.d.ts +0 -8
- package/dist/csp-nonce-9NFUb7hJ.js +0 -72
- package/dist/css-BuPaTOfe.js +0 -70
- package/dist/fastlane-BKZduiBQ.js +0 -166
- package/dist/index-Dgjbo2gU.d.ts +0 -1456
- package/dist/jsx-runtime-Cg7GqY1S.d.ts +0 -2
- package/dist/jsx-runtime-gVIaTPw0.d.ts +0 -38
- package/dist/lifecycle-batch-63aXFf2S.js +0 -253
- package/dist/lifecycle-operations-Q0k3EFnG.js +0 -287
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
+
};
|
package/dist/actions/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { d as getCurrentAppRenderRuntime } from "../
|
|
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-
|
|
4
|
-
import {
|
|
5
|
-
import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-
|
|
6
|
-
import { r as isCurrentAsyncGeneration } from "../shared-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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-
|
|
2
|
-
import { t as state } from "./state-
|
|
3
|
-
import { t as selector } from "./selector-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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.
|
|
67
|
-
buildLabel: "0.
|
|
65
|
+
packageVersion: "0.3.1",
|
|
66
|
+
buildLabel: "0.3.1-local"
|
|
68
67
|
};
|
|
69
68
|
function getBenchmarkMetadata() {
|
|
70
69
|
return { ...benchmarkMetadata };
|
package/dist/boot/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
87
|
-
|
|
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
|
+
};
|
package/dist/boot/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as cleanupApp, i as
|
|
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 };
|