@askrjs/askr 0.0.84 → 0.0.86
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/dist/{access-ePqdQqkV.js → access-Dpfoi4cA.js} +7 -1
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +3 -3
- package/dist/{activity-pySy9t7Y.d.ts → activity-B1I5HJQI.d.ts} +1 -1
- package/dist/{activity-CZiPgZy0.js → activity-BvgvaMZA.js} +53 -16
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +3 -3
- package/dist/boot/index.js +1 -1
- package/dist/{boot-D28lesMw.js → boot-CViTpUiB.js} +22 -20
- package/dist/{cleanup-ARiXproi.js → cleanup-c837KVij.js} +16 -6
- package/dist/{component-cleanup-Bug5tSiG.js → component-cleanup-BUfUleGZ.js} +2 -2
- package/dist/{component-internal-Bw4Mf9fd.js → component-internal-DcrLymUJ.js} +5 -5
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-Y8F73Uln.d.ts → control-DhUZU4_V.d.ts} +2 -1
- package/dist/{control-nrS65oG3.js → control-oLADku43.js} +4 -4
- package/dist/{csp-nonce-ZTlD_EnK.js → csp-nonce-Bc52OIVc.js} +19 -2
- package/dist/data/index.js +3 -3
- package/dist/{data-BRS5woEh.js → data-DGrD3-qA.js} +5 -5
- package/dist/{data-runtime-D68YOo9L.js → data-runtime-Ck3tJDDQ.js} +1 -1
- package/dist/default-portal-runtime-DvMvWJVp.js +20 -0
- package/dist/{authoring-DQPG0VAm.js → deferred-nleQtdfY.js} +85 -5
- package/dist/{effect-B487asyz.js → effect-lnxQIpJG.js} +2 -2
- package/dist/{fastlane-BOr4lSLl.js → fastlane-CrfB3QG0.js} +2 -2
- package/dist/{for-internal-DjpV8ioj.js → for-internal-B_mnQhan.js} +18 -6
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +1 -2
- package/dist/foundations/state/index.d.ts +1 -1
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +2 -2
- package/dist/foundations/structures/index.js +2 -3
- package/dist/fx/index.js +1 -1
- package/dist/{index-BApH3laU.d.ts → index-DflhL1h8.d.ts} +20 -16
- package/dist/{index-_UN08Pg1.d.ts → index-pIgGaXvS.d.ts} +19 -3
- package/dist/{index-DUXXZ31H.d.ts → index-r-nt13FE.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -12
- package/dist/{lifecycle-batch-CFI4NKpJ.js → lifecycle-batch-Dfpid9-A.js} +39 -20
- package/dist/{lifecycle-operations-KYOIcM5R.js → lifecycle-operations-BrYrBsXY.js} +1 -1
- package/dist/manifest-D1P9uTlz.js +53 -0
- package/dist/{navigate-Dr3cjOSz.js → navigate-BwAPbpCb.js} +17 -16
- package/dist/{navigate-CgVIrrSs.d.ts → navigate-NyIjQUwI.d.ts} +1 -1
- package/dist/{query-registry-BL6rjGsO.js → query-registry-CPW_6nwF.js} +1 -1
- package/dist/{readable-_GQGe_St.js → readable-B5NtV7V0.js} +1 -1
- package/dist/render-context-D0Hoj9dW.js +161 -0
- package/dist/{renderer-B9j5IV1q.js → renderer-D9DL9R2D.js} +58 -17
- package/dist/{deferred-oqtAJ4iH.js → resolution-YHwi4Bav.js} +234 -222
- package/dist/resource-operation-ys6eDoRJ.js +304 -0
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +5 -5
- package/dist/{route-matching-IfQZmqkN.js → route-matching-DqULzZtC.js} +46 -277
- package/dist/router/index.d.ts +12 -10
- package/dist/router/index.js +10 -7
- package/dist/{selector-DJ1-N1K-.js → selector-Ck_Pp9av.js} +2 -2
- package/dist/ssg/index.d.ts +9 -3
- package/dist/ssg/index.js +31 -15
- package/dist/ssr/index.d.ts +7 -3
- package/dist/ssr/index.js +2 -2
- package/dist/{ssr-CtC4lChT.js → ssr-B98593qJ.js} +53 -27
- package/dist/ssr-DSHd_Q9K.js +25 -0
- package/dist/{state-BzIMC6-i.js → state-DCjONcHK.js} +4 -3
- package/dist/{portal-pHBoqwYd.js → structures-DsOm-clq.js} +236 -7
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +4 -4
- package/dist/{verify-hydration-BguOSco9.js → verify-hydration-ww1dgwea.js} +5 -4
- package/package.json +2 -2
- package/dist/render-context-D-DFk2WN.js +0 -73
- package/dist/ssr-CbQO5xd3.js +0 -12
- package/dist/structures-D3vO-WMN.js +0 -221
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane } from "./access-
|
|
2
|
-
import { m as withFineGrainedReadTracking } from "./readable-
|
|
1
|
+
import { t as enqueueRuntimeLane } from "./access-Dpfoi4cA.js";
|
|
2
|
+
import { m as withFineGrainedReadTracking } from "./readable-B5NtV7V0.js";
|
|
3
3
|
//#region src/runtime/effect.ts
|
|
4
4
|
const SOURCE_EFFECTS = Symbol("askr.source-effects");
|
|
5
5
|
const effectSources = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as isDevelopmentEnvironment, l as runRuntimeWithSyncProgress, o as getRuntimeRenderer, u as setRuntimeBulkCommitProbe } from "./access-
|
|
1
|
+
import { b as isDevelopmentEnvironment, l as runRuntimeWithSyncProgress, o as getRuntimeRenderer, u as setRuntimeBulkCommitProbe } from "./access-Dpfoi4cA.js";
|
|
2
2
|
import { i as isFragmentType } from "./jsx-C3IECePB.js";
|
|
3
|
-
import { i as finalizeReadableSubscriptions } from "./readable-
|
|
3
|
+
import { i as finalizeReadableSubscriptions } from "./readable-B5NtV7V0.js";
|
|
4
4
|
//#region src/runtime/dev-namespace.ts
|
|
5
5
|
/**
|
|
6
6
|
* Set a value in the dev namespace (no-op in production).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as _isDOMElement } from "./vnode-D24p6IW2.js";
|
|
2
|
-
import { b as isDevelopmentEnvironment, o as getRuntimeRenderer, v as logger } from "./access-
|
|
3
|
-
import { _ as rebaseVNodeTreeWithContextFrame, m as haveEquivalentContextFrames, n as createComponentInstance, s as renderScopedComponent } from "./component-internal-Bw4Mf9fd.js";
|
|
4
|
-
import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-_GQGe_St.js";
|
|
2
|
+
import { b as isDevelopmentEnvironment, o as getRuntimeRenderer, v as logger } from "./access-Dpfoi4cA.js";
|
|
5
3
|
import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
|
|
6
|
-
import {
|
|
7
|
-
import { o as
|
|
4
|
+
import { _ as rebaseVNodeTreeWithContextFrame, m as haveEquivalentContextFrames, n as createComponentInstance, s as renderScopedComponent } from "./component-internal-DcrLymUJ.js";
|
|
5
|
+
import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
|
|
6
|
+
import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
|
|
7
|
+
import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-Dfpid9-A.js";
|
|
8
8
|
//#region src/runtime/child-scope.ts
|
|
9
9
|
const EMPTY_CHILD_SCOPE_PROPS = {};
|
|
10
10
|
const childScopesByInstance = /* @__PURE__ */ new WeakMap();
|
|
@@ -604,6 +604,18 @@ const REACTIVE_FOR_ITEM_PROXY_HANDLER = {
|
|
|
604
604
|
metadata.wholeItemRead = true;
|
|
605
605
|
recordReadableRead(getWholeItemSignal(metadata));
|
|
606
606
|
return Object.getPrototypeOf(Object(metadata.currentItem));
|
|
607
|
+
},
|
|
608
|
+
set(target, prop, value) {
|
|
609
|
+
if (!(prop in target) && typeof prop !== "symbol" && isDevelopmentEnvironment()) {
|
|
610
|
+
const metadata = getReactiveForItemState(target);
|
|
611
|
+
if (prop in Object(metadata.currentItem)) logger.warn(`[Askr] Assigning to "${String(prop)}" on a <For> item shadows a property from the source data - it will not update when the source item changes and does not trigger a re-render. Use a different property name for cached/derived per-row values, or a state() cell for values that should be reactive.`);
|
|
612
|
+
}
|
|
613
|
+
return Reflect.defineProperty(target, prop, {
|
|
614
|
+
value,
|
|
615
|
+
writable: true,
|
|
616
|
+
enumerable: true,
|
|
617
|
+
configurable: true
|
|
618
|
+
});
|
|
607
619
|
}
|
|
608
620
|
};
|
|
609
621
|
const recordBenchEvent = (_event) => {};
|
|
@@ -1172,7 +1184,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
1172
1184
|
const key = byFn(newArray[i], i);
|
|
1173
1185
|
if (key === orderedKeys[i]) {
|
|
1174
1186
|
const existing = items.get(key);
|
|
1175
|
-
if (existing && existing.item !== item) {
|
|
1187
|
+
if (existing && (existing.item !== item || existing.scope.needsDomUpdate)) {
|
|
1176
1188
|
canUseSwapPath = false;
|
|
1177
1189
|
break;
|
|
1178
1190
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { r as JSXElement } from "../jsx-Dvr2SGRG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { c as DefaultPortal, d as definePortal, f as Presence, h as SlotProps, l as Portal, m as Slot, p as PresenceProps, u as PortalProps, v as LayoutComponent, y as layout } from "../index-DflhL1h8.js";
|
|
3
3
|
export { DefaultPortal, type JSXElement, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, definePortal, layout };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { a as layout, i as
|
|
2
|
-
import { i as definePortal, n as Portal, t as DefaultPortal } from "../portal-pHBoqwYd.js";
|
|
1
|
+
import { a as definePortal, c as layout, i as Portal, o as Presence, r as DefaultPortal, s as Slot } from "../structures-DsOm-clq.js";
|
|
3
2
|
export { DefaultPortal, Portal, Presence, Slot, definePortal, layout };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v as State } from "../../control-DhUZU4_V.js";
|
|
2
2
|
//#region src/foundations/state/controllable.d.ts
|
|
3
3
|
declare function isControlled<T>(value: T | undefined): value is T;
|
|
4
4
|
declare function resolveControllable<T>(value: T | undefined, defaultValue: T): {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { r as JSXElement } from "../../jsx-Dvr2SGRG.js";
|
|
2
|
-
import { _ as
|
|
3
|
-
export { type Collection, type CollectionItem, DefaultPortal, type JSXElement, type Layer, type LayerManager, type LayerOptions, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, createCollection, createLayer, definePortal, layout };
|
|
2
|
+
import { _ as isElement, a as Collection, c as DefaultPortal, d as definePortal, f as Presence, g as cloneElement, h as SlotProps, i as createLayer, l as Portal, m as Slot, n as LayerManager, o as CollectionItem, p as PresenceProps, r as LayerOptions, s as createCollection, t as Layer, u as PortalProps, v as LayoutComponent, y as layout } from "../../index-DflhL1h8.js";
|
|
3
|
+
export { type Collection, type CollectionItem, DefaultPortal, type JSXElement, type Layer, type LayerManager, type LayerOptions, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, cloneElement, createCollection, createLayer, definePortal, isElement, layout };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { a as layout, i as
|
|
2
|
-
|
|
3
|
-
export { DefaultPortal, Portal, Presence, Slot, createCollection, createLayer, definePortal, layout };
|
|
1
|
+
import { a as definePortal, c as layout, i as Portal, l as cloneElement, n as createCollection, o as Presence, r as DefaultPortal, s as Slot, t as createLayer, u as isElement } from "../../structures-DsOm-clq.js";
|
|
2
|
+
export { DefaultPortal, Portal, Presence, Slot, cloneElement, createCollection, createLayer, definePortal, isElement, layout };
|
package/dist/fx/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as scheduleEventHandler, n as enqueueRuntimeTask, v as logger } from "../access-
|
|
1
|
+
import { h as scheduleEventHandler, n as enqueueRuntimeTask, v as logger } from "../access-Dpfoi4cA.js";
|
|
2
2
|
import { f as getCurrentComponentInstance } from "../component-scope-DzJEbYGE.js";
|
|
3
3
|
//#region src/fx/timing.ts
|
|
4
4
|
/**
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { u as RenderableChild } from "./control-
|
|
1
|
+
import { u as RenderableChild } from "./control-DhUZU4_V.js";
|
|
2
2
|
import { r as JSXElement } from "./jsx-Dvr2SGRG.js";
|
|
3
3
|
import "./types-C9YcqVpk.js";
|
|
4
|
-
//#region src/runtime/portal.d.ts
|
|
5
|
-
interface Portal<T extends RenderableChild = RenderableChild> {
|
|
6
|
-
(): T | JSXElement | null | undefined;
|
|
7
|
-
render(props: {
|
|
8
|
-
children?: T;
|
|
9
|
-
}): unknown;
|
|
10
|
-
}
|
|
11
|
-
interface PortalProps {
|
|
12
|
-
children?: RenderableChild;
|
|
13
|
-
}
|
|
14
|
-
declare function definePortal<T extends RenderableChild = RenderableChild>(): Portal<T>;
|
|
15
|
-
declare const DefaultPortal: Portal<RenderableChild>;
|
|
16
|
-
declare function Portal(props: PortalProps): JSXElement | null;
|
|
17
|
-
//#endregion
|
|
18
4
|
//#region src/foundations/structures/layout.d.ts
|
|
19
5
|
/**
|
|
20
6
|
* Layout helper.
|
|
@@ -44,6 +30,10 @@ type LayoutComponent<P = object> = (props: P & {
|
|
|
44
30
|
}) => unknown;
|
|
45
31
|
declare function layout<P = object>(Layout: LayoutComponent<P>): (children?: RenderableChild, props?: P) => unknown;
|
|
46
32
|
//#endregion
|
|
33
|
+
//#region src/jsx/utils.d.ts
|
|
34
|
+
declare function isElement(value: unknown): value is JSXElement;
|
|
35
|
+
declare function cloneElement(element: JSXElement, props: Record<string, unknown>): JSXElement;
|
|
36
|
+
//#endregion
|
|
47
37
|
//#region src/foundations/structures/slot.d.ts
|
|
48
38
|
type SlotProps = {
|
|
49
39
|
asChild: true;
|
|
@@ -105,6 +95,20 @@ interface PresenceProps {
|
|
|
105
95
|
*/
|
|
106
96
|
declare function Presence({ present, children }: PresenceProps): JSXElement | null;
|
|
107
97
|
//#endregion
|
|
98
|
+
//#region src/runtime/portal.d.ts
|
|
99
|
+
interface Portal<T extends RenderableChild = RenderableChild> {
|
|
100
|
+
(): T | JSXElement | null | undefined;
|
|
101
|
+
render(props: {
|
|
102
|
+
children?: T;
|
|
103
|
+
}): unknown;
|
|
104
|
+
}
|
|
105
|
+
interface PortalProps {
|
|
106
|
+
children?: RenderableChild;
|
|
107
|
+
}
|
|
108
|
+
declare function definePortal<T extends RenderableChild = RenderableChild>(): Portal<T>;
|
|
109
|
+
declare const DefaultPortal: Portal<RenderableChild>;
|
|
110
|
+
declare function Portal(props: PortalProps): JSXElement | null;
|
|
111
|
+
//#endregion
|
|
108
112
|
//#region src/foundations/structures/collection.d.ts
|
|
109
113
|
/**
|
|
110
114
|
* createCollection
|
|
@@ -276,4 +280,4 @@ declare function createLayer(): LayerManager;
|
|
|
276
280
|
* }
|
|
277
281
|
*/
|
|
278
282
|
//#endregion
|
|
279
|
-
export {
|
|
283
|
+
export { isElement as _, Collection as a, DefaultPortal as c, definePortal as d, Presence as f, cloneElement as g, SlotProps as h, createLayer as i, Portal as l, Slot as m, LayerManager as n, CollectionItem as o, PresenceProps as p, LayerOptions as r, createCollection as s, Layer as t, PortalProps as u, LayoutComponent as v, layout as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ComponentInstance, i as ReadableSource, n as ChildScope, o as Scope, r as DOMRange, u as RenderableChild
|
|
1
|
+
import { a as ComponentInstance, b as StateTuple, i as ReadableSource, n as ChildScope, o as Scope, r as DOMRange, u as RenderableChild } from "./control-DhUZU4_V.js";
|
|
2
2
|
import { r as JSXElement } from "./jsx-Dvr2SGRG.js";
|
|
3
3
|
import { t as Scheduler } from "./scheduler-CmLO4Dfm.js";
|
|
4
4
|
import { D as QueryPrefetchContext, _ as CoreTelemetry } from "./index-5S-fi2xy.js";
|
|
@@ -158,10 +158,20 @@ type RouteMetaSource<TParams extends RouteParams = RouteParams> = RouteMeta | ((
|
|
|
158
158
|
* - `title`: page title hint used by SSG and document-meta integrations
|
|
159
159
|
* - `namespace`: MFE namespace key for grouped route management
|
|
160
160
|
*/
|
|
161
|
-
interface RouteOptions<TParams extends RouteParams = RouteParams, TSearchSchema extends ObjectSchema<RouteSearch> | undefined = ObjectSchema<RouteSearch> | undefined> extends CommonAccessOptions {
|
|
161
|
+
interface RouteOptions<TParams extends RouteParams = RouteParams, TSearchSchema extends ObjectSchema<RouteSearch> | undefined = ObjectSchema<RouteSearch> | undefined, TLoaderData = unknown, TDehydratedData = TLoaderData> extends CommonAccessOptions {
|
|
162
162
|
loader?: (context: RouteContext<TParams> & {
|
|
163
163
|
request?: Request;
|
|
164
|
-
}) =>
|
|
164
|
+
}) => TLoaderData | PromiseLike<TLoaderData>;
|
|
165
|
+
/**
|
|
166
|
+
* Select the loader data transported to the browser for initial hydration.
|
|
167
|
+
*
|
|
168
|
+
* Server rendering still receives the complete loader value. The selector
|
|
169
|
+
* must be synchronous; client navigations rerun the loader and receive its
|
|
170
|
+
* complete result.
|
|
171
|
+
*/
|
|
172
|
+
dehydrate?: (data: TLoaderData, context: RouteContext<TParams> & {
|
|
173
|
+
request?: Request;
|
|
174
|
+
}) => TDehydratedData extends PromiseLike<unknown> ? never : TDehydratedData;
|
|
165
175
|
preload?: (context: RouteContext<TParams> & {
|
|
166
176
|
request?: Request;
|
|
167
177
|
data: QueryPrefetchContext;
|
|
@@ -199,6 +209,8 @@ interface RouteRef<TParams extends RouteParams = RouteParams, TSearch = RouteSea
|
|
|
199
209
|
readonly path: string;
|
|
200
210
|
/** @internal Executable schema retained for destination validation. */
|
|
201
211
|
readonly searchSchema?: ObjectSchema<TSearch & RouteSearch>;
|
|
212
|
+
/** @internal Public mount point captured by createRouteRegistry(). */
|
|
213
|
+
readonly basePath?: string;
|
|
202
214
|
readonly __params?: TParams;
|
|
203
215
|
readonly __search?: TSearch;
|
|
204
216
|
}
|
|
@@ -239,6 +251,8 @@ interface PageScopeRecord {
|
|
|
239
251
|
}
|
|
240
252
|
interface RouteRegistryOptions {
|
|
241
253
|
auth?: RouteAuthOptions;
|
|
254
|
+
/** Public pathname prefix for applications mounted below the origin root. */
|
|
255
|
+
basePath?: string;
|
|
242
256
|
}
|
|
243
257
|
type RouteDefinition = () => void;
|
|
244
258
|
interface RouteRequestOptions {
|
|
@@ -314,6 +328,8 @@ interface RouteRecord {
|
|
|
314
328
|
interface RouteManifest {
|
|
315
329
|
records: RouteRecord[];
|
|
316
330
|
auth?: RouteAuthOptions;
|
|
331
|
+
/** Normalized public pathname prefix. Empty and root mounts omit it. */
|
|
332
|
+
basePath?: string;
|
|
317
333
|
}
|
|
318
334
|
declare const routeRegistryBrand: unique symbol;
|
|
319
335
|
interface RouteHandler<TParams extends RouteParams = RouteParams> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as VNode, t as ForEachSource, u as RenderableChild } from "./control-
|
|
1
|
+
import { d as VNode, t as ForEachSource, u as RenderableChild } from "./control-DhUZU4_V.js";
|
|
2
2
|
import { r as JSXElement } from "./jsx-Dvr2SGRG.js";
|
|
3
3
|
//#region src/control/shared.d.ts
|
|
4
4
|
type BoundaryChild = RenderableChild;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as StateTuple, c as readScope, o as Scope, s as defineScope, v as State, x as state, y as StateSetter } from "./control-DhUZU4_V.js";
|
|
2
2
|
import { s as Props, t as Fragment } from "./jsx-Dvr2SGRG.js";
|
|
3
|
-
import { $ as cspNonce, Q as CspNonceScope, at as AskrRuntimeOptions, c as createRef, ct as createRuntime, d as registerSSRStyle, et as Selector, it as AskrRuntime, lt as getDefaultRuntime, nt as Derived, ot as RuntimeKeyedReorderDecision, rt as derive, s as Ref, st as RuntimeRendererHost, tt as selector, ut as getSignal } from "./index-
|
|
4
|
-
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-
|
|
3
|
+
import { $ as cspNonce, Q as CspNonceScope, at as AskrRuntimeOptions, c as createRef, ct as createRuntime, d as registerSSRStyle, et as Selector, it as AskrRuntime, lt as getDefaultRuntime, nt as Derived, ot as RuntimeKeyedReorderDecision, rt as derive, s as Ref, st as RuntimeRendererHost, tt as selector, ut as getSignal } from "./index-pIgGaXvS.js";
|
|
4
|
+
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-r-nt13FE.js";
|
|
5
5
|
import { A as ServerQueryHandler, D as QueryPrefetchContext, T as QueryDefinition, a as defineServerQueries, c as prefetchQuery, h as createQuery, i as defineQuery, l as serveQuery, o as dehydrateDataRuntime, s as hydrateDataRuntime, v as DataRuntime } from "./index-5S-fi2xy.js";
|
|
6
6
|
import { i as jsxs, n as jsx } from "./jsx-runtime-Cr1jspx9.js";
|
|
7
7
|
export { AskrRuntime, type AskrRuntimeOptions, Case, type CaseProps, CspNonceScope, type DataRuntime, type Derived, For, type ForProps, Fragment, Match, type MatchProps, type Props, type QueryDefinition, type QueryPrefetchContext, type Ref, type RuntimeKeyedReorderDecision, type RuntimeRendererHost, type Scope, type Selector, type ServerQueryHandler, Show, type ShowProps, type State, type StateSetter, type StateTuple, createQuery, createRef, createRuntime, cspNonce, defineQuery, defineScope, defineServerQueries, dehydrateDataRuntime, derive, getDefaultRuntime, getSignal, hydrateDataRuntime, jsx, jsxs, prefetchQuery, readScope, registerSSRStyle, selector, serveQuery, state };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as getRuntimeFlushVersion, d as AskrRuntime, m as getDefaultRuntime, p as createRuntime, t as enqueueRuntimeLane } from "./access-
|
|
2
|
-
import { n as Fragment } from "./jsx-C3IECePB.js";
|
|
3
|
-
import { g as readScope, u as defineScope } from "./component-internal-Bw4Mf9fd.js";
|
|
4
|
-
import { f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-_GQGe_St.js";
|
|
1
|
+
import { a as getRuntimeFlushVersion, d as AskrRuntime, m as getDefaultRuntime, p as createRuntime, t as enqueueRuntimeLane } from "./access-Dpfoi4cA.js";
|
|
5
2
|
import { g as getSignal, i as claimHookIndex, p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
|
|
3
|
+
import { n as Fragment } from "./jsx-C3IECePB.js";
|
|
4
|
+
import { g as readScope, u as defineScope } from "./component-internal-DcrLymUJ.js";
|
|
5
|
+
import { f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
|
|
6
6
|
import { n as isSnapshotSource } from "./snapshot-source-BB42xgwb.js";
|
|
7
|
-
import { t as installRendererBridge } from "./renderer-
|
|
8
|
-
import {
|
|
9
|
-
import { t as state } from "./state-
|
|
10
|
-
import { t as selector } from "./selector-
|
|
11
|
-
import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-
|
|
12
|
-
import { i as For, n as Match, r as Show, t as Case } from "./control-
|
|
7
|
+
import { t as installRendererBridge } from "./renderer-D9DL9R2D.js";
|
|
8
|
+
import { c as registerSSRStyle } from "./render-context-D0Hoj9dW.js";
|
|
9
|
+
import { t as state } from "./state-DCjONcHK.js";
|
|
10
|
+
import { t as selector } from "./selector-Ck_Pp9av.js";
|
|
11
|
+
import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-Bc52OIVc.js";
|
|
12
|
+
import { i as For, n as Match, r as Show, t as Case } from "./control-oLADku43.js";
|
|
13
13
|
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
14
|
-
import { t as createQuery } from "./data-
|
|
15
|
-
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-
|
|
14
|
+
import { t as createQuery } from "./data-DGrD3-qA.js";
|
|
15
|
+
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-CPW_6nwF.js";
|
|
16
16
|
//#region src/runtime/derive.ts
|
|
17
17
|
const deriveCells = /* @__PURE__ */ new WeakMap();
|
|
18
18
|
const dirtyDerivedCells = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as logger } from "./access-
|
|
2
|
-
import { a as finalizeReadableSubscriptionsFromSnapshot } from "./readable-
|
|
1
|
+
import { v as logger } from "./access-Dpfoi4cA.js";
|
|
2
|
+
import { a as finalizeReadableSubscriptionsFromSnapshot } from "./readable-B5NtV7V0.js";
|
|
3
3
|
//#region src/common/promise.ts
|
|
4
4
|
function isPromiseLike(value) {
|
|
5
5
|
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
@@ -53,6 +53,41 @@ function executeCommittedLifecycleOperations(instance, wasFirstMount) {
|
|
|
53
53
|
if (errors.length > 0) throw new AggregateError(errors, `Committed lifecycle operations failed for ${instance.id}`);
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
|
+
//#region src/runtime/inline-render-snapshot.ts
|
|
57
|
+
function createInlineRenderSnapshot(instance) {
|
|
58
|
+
return {
|
|
59
|
+
instance,
|
|
60
|
+
props: instance.props,
|
|
61
|
+
ownerFrame: instance.ownerFrame,
|
|
62
|
+
portalScope: instance.portalScope,
|
|
63
|
+
parentInstance: instance.parentInstance,
|
|
64
|
+
isRoot: instance.isRoot,
|
|
65
|
+
vnodeParentGeneration: instance._vnodeParentGeneration,
|
|
66
|
+
vnodeOwner: instance._vnodeOwner,
|
|
67
|
+
vnodeParent: instance._vnodeParent,
|
|
68
|
+
hasVNodeKey: "_vnodeKey" in instance,
|
|
69
|
+
vnodeKey: instance._vnodeKey,
|
|
70
|
+
vnodePosition: instance._vnodePosition,
|
|
71
|
+
wrapperDepth: instance._wrapperDepth,
|
|
72
|
+
cleanupStrict: instance.cleanupStrict
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function restoreInlineRenderSnapshot(snapshot) {
|
|
76
|
+
snapshot.instance.props = snapshot.props;
|
|
77
|
+
snapshot.instance.ownerFrame = snapshot.ownerFrame;
|
|
78
|
+
snapshot.instance.portalScope = snapshot.portalScope;
|
|
79
|
+
snapshot.instance.parentInstance = snapshot.parentInstance;
|
|
80
|
+
snapshot.instance.isRoot = snapshot.isRoot;
|
|
81
|
+
snapshot.instance._vnodeParentGeneration = snapshot.vnodeParentGeneration;
|
|
82
|
+
snapshot.instance._vnodeOwner = snapshot.vnodeOwner;
|
|
83
|
+
snapshot.instance._vnodeParent = snapshot.vnodeParent;
|
|
84
|
+
if (snapshot.hasVNodeKey) snapshot.instance._vnodeKey = snapshot.vnodeKey;
|
|
85
|
+
else delete snapshot.instance._vnodeKey;
|
|
86
|
+
snapshot.instance._vnodePosition = snapshot.vnodePosition;
|
|
87
|
+
snapshot.instance._wrapperDepth = snapshot.wrapperDepth;
|
|
88
|
+
snapshot.instance.cleanupStrict = snapshot.cleanupStrict;
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
56
91
|
//#region src/runtime/lifecycle-batch.ts
|
|
57
92
|
let currentLifecycleCommitBatch = null;
|
|
58
93
|
const pendingLifecycleCommitErrors = [];
|
|
@@ -150,15 +185,7 @@ function enqueueInlineRenderSnapshot(batch, snapshot) {
|
|
|
150
185
|
}
|
|
151
186
|
function captureInlineRenderSnapshot(instance) {
|
|
152
187
|
if (!currentLifecycleCommitBatch?.active) return;
|
|
153
|
-
enqueueInlineRenderSnapshot(currentLifecycleCommitBatch,
|
|
154
|
-
instance,
|
|
155
|
-
props: instance.props,
|
|
156
|
-
ownerFrame: instance.ownerFrame,
|
|
157
|
-
portalScope: instance.portalScope,
|
|
158
|
-
parentInstance: instance.parentInstance,
|
|
159
|
-
isRoot: instance.isRoot,
|
|
160
|
-
vnodeParentGeneration: instance._vnodeParentGeneration
|
|
161
|
-
});
|
|
188
|
+
enqueueInlineRenderSnapshot(currentLifecycleCommitBatch, createInlineRenderSnapshot(instance));
|
|
162
189
|
}
|
|
163
190
|
function finalizeInlineReadSubscriptions(instance, token, pendingReadSources, pendingReadSourceVersions) {
|
|
164
191
|
if ((!pendingReadSources || pendingReadSources.size === 0) && (!instance._lastReadSources || instance._lastReadSources.size === 0)) return;
|
|
@@ -216,15 +243,7 @@ function discardLifecycleCommitBatch(batch) {
|
|
|
216
243
|
} catch (error) {
|
|
217
244
|
logger.error("[Askr] transaction rollback failed:", error);
|
|
218
245
|
}
|
|
219
|
-
for (let index = batch.renderSnapshots.length - 1; index >= 0; index -= 1)
|
|
220
|
-
const snapshot = batch.renderSnapshots[index];
|
|
221
|
-
snapshot.instance.props = snapshot.props;
|
|
222
|
-
snapshot.instance.ownerFrame = snapshot.ownerFrame;
|
|
223
|
-
snapshot.instance.portalScope = snapshot.portalScope;
|
|
224
|
-
snapshot.instance.parentInstance = snapshot.parentInstance;
|
|
225
|
-
snapshot.instance.isRoot = snapshot.isRoot;
|
|
226
|
-
snapshot.instance._vnodeParentGeneration = snapshot.vnodeParentGeneration;
|
|
227
|
-
}
|
|
246
|
+
for (let index = batch.renderSnapshots.length - 1; index >= 0; index -= 1) restoreInlineRenderSnapshot(batch.renderSnapshots[index]);
|
|
228
247
|
for (const entry of batch.entries) {
|
|
229
248
|
if (entry.wasFirstMount) entry.instance.mountOperations = void 0;
|
|
230
249
|
discardCommitOperations(entry.instance);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as registerCommitOperation } from "./component-internal-Bw4Mf9fd.js";
|
|
2
1
|
import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
|
|
2
|
+
import { a as registerCommitOperation } from "./component-internal-DcrLymUJ.js";
|
|
3
3
|
import { t as isRouteActivityActive } from "./route-activity-CNJfpwx-.js";
|
|
4
4
|
//#region src/runtime/lifecycle-operations.ts
|
|
5
5
|
function normalizePredicates(predicates) {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { A as getDefaultRouteBasePath, B as setDefaultRouteBasePath, F as insertRecordSorted, M as getRouteRecords, R as restoreRouteState, V as snapshotRouteState, _ as clearRouteState, h as addRouteToStores, j as getRouteList, k as getDefaultRouteAuthOptions, s as normalizeRouteBasePath, z as setDefaultRouteAuthOptions } from "./route-matching-DqULzZtC.js";
|
|
2
|
+
//#region src/runtime/execution-model.ts
|
|
3
|
+
const EXECUTION_MODEL_KEY = Symbol.for("__ASKR_EXECUTION_MODEL__");
|
|
4
|
+
function getExecutionModel() {
|
|
5
|
+
return globalThis[EXECUTION_MODEL_KEY];
|
|
6
|
+
}
|
|
7
|
+
function assertExecutionModel(model) {
|
|
8
|
+
const g = globalThis;
|
|
9
|
+
const cur = g[EXECUTION_MODEL_KEY];
|
|
10
|
+
if (cur && cur !== model) throw new Error(`[Askr] mixing execution models is not allowed (current: ${cur}, attempted: ${model}). Choose exactly one: createSPA, createSSR, or createIslands.`);
|
|
11
|
+
if (!cur) g[EXECUTION_MODEL_KEY] = model;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/router/manifest.ts
|
|
15
|
+
function createRouteManifest() {
|
|
16
|
+
const auth = getDefaultRouteAuthOptions();
|
|
17
|
+
return {
|
|
18
|
+
records: [...getRouteRecords()],
|
|
19
|
+
...auth ? { auth } : {},
|
|
20
|
+
...getDefaultRouteBasePath() ? { basePath: getDefaultRouteBasePath() } : {}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function _applyManifest(manifest) {
|
|
24
|
+
setDefaultRouteAuthOptions(manifest.auth);
|
|
25
|
+
setDefaultRouteBasePath(normalizeRouteBasePath(manifest.basePath));
|
|
26
|
+
for (const record of manifest.records) {
|
|
27
|
+
insertRecordSorted(record);
|
|
28
|
+
addRouteToStores({
|
|
29
|
+
path: record.path,
|
|
30
|
+
handler: record.handler,
|
|
31
|
+
namespace: record.options.namespace,
|
|
32
|
+
..."fallbackPrefix" in record && typeof record.fallbackPrefix === "string" ? { fallbackPrefix: record.fallbackPrefix } : {}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function createRouteRegistry(definition, options = {}) {
|
|
37
|
+
const previous = snapshotRouteState();
|
|
38
|
+
clearRouteState();
|
|
39
|
+
try {
|
|
40
|
+
setDefaultRouteAuthOptions(options.auth);
|
|
41
|
+
setDefaultRouteBasePath(normalizeRouteBasePath(options.basePath));
|
|
42
|
+
definition();
|
|
43
|
+
const manifest = createRouteManifest();
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
manifest,
|
|
46
|
+
routes: getRouteList()
|
|
47
|
+
});
|
|
48
|
+
} finally {
|
|
49
|
+
restoreRouteState(previous);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { getExecutionModel as i, createRouteRegistry as n, assertExecutionModel as r, _applyManifest as t };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-
|
|
1
|
+
import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-Dpfoi4cA.js";
|
|
2
2
|
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
3
|
-
import { r as executeComponent } from "./component-internal-
|
|
4
|
-
import { t as cleanupReadableSubscriptionSources } from "./readable-
|
|
5
|
-
import { n as cleanupComponentGeneration, t as cleanupComponent } from "./component-cleanup-
|
|
6
|
-
import { i as drainLifecycleCommitErrors, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-
|
|
7
|
-
import { _ as teardownNodeSubtree } from "./cleanup-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { r as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
3
|
+
import { r as executeComponent } from "./component-internal-DcrLymUJ.js";
|
|
4
|
+
import { t as cleanupReadableSubscriptionSources } from "./readable-B5NtV7V0.js";
|
|
5
|
+
import { n as cleanupComponentGeneration, t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
|
|
6
|
+
import { i as drainLifecycleCommitErrors, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-Dfpid9-A.js";
|
|
7
|
+
import { _ as teardownNodeSubtree } from "./cleanup-c837KVij.js";
|
|
8
|
+
import { t as CspNonceScope } from "./csp-nonce-Bc52OIVc.js";
|
|
9
|
+
import { I as lockRouteRegistration, o as addRouteBasePath, r as computeRouteActivityMatches, y as getActiveRouteBasePath } from "./route-matching-DqULzZtC.js";
|
|
10
|
+
import { a as resolveRouteRequest, i as hasRouteRenderData, n as getRouteRenderContext, r as getRouteRenderData, u as withoutRouteHydrationMetadata } from "./resolution-YHwi4Bav.js";
|
|
11
|
+
import { a as clearStagedAppRenderRouteLocation, i as syncCurrentRouteSnapshot, o as createAppRenderRuntime, s as stageAppRenderRouteLocation } from "./activity-BvgvaMZA.js";
|
|
12
|
+
import { r as getDefaultPortalHost, t as clearRegisteredDefaultPortalForInstance } from "./default-portal-runtime-DvMvWJVp.js";
|
|
13
13
|
//#region src/router/navigation-registry.ts
|
|
14
14
|
let currentInstance = null;
|
|
15
15
|
let currentPathname = "/";
|
|
@@ -423,7 +423,7 @@ function wrapRootRouteHandler(componentFn, cspNonce) {
|
|
|
423
423
|
if (isPromiseLike(out)) throw new Error("Async components are not supported. Components must return synchronously.");
|
|
424
424
|
const portalVNode = {
|
|
425
425
|
$$typeof: ELEMENT_TYPE,
|
|
426
|
-
type:
|
|
426
|
+
type: getDefaultPortalHost(),
|
|
427
427
|
props: { __askrAutoDefaultPortal: true },
|
|
428
428
|
key: "__default_portal"
|
|
429
429
|
};
|
|
@@ -671,7 +671,7 @@ function cleanupDeferredRouteInstance(deferred) {
|
|
|
671
671
|
}
|
|
672
672
|
function remountResolvedRoute(instance, resolved, pathname, href, existingSnapshot) {
|
|
673
673
|
const deferredCleanup = existingSnapshot ?? captureDeferredRouteCleanup(instance);
|
|
674
|
-
|
|
674
|
+
clearRegisteredDefaultPortalForInstance(instance);
|
|
675
675
|
instance.fn = wrapRootRouteHandler(bindResolvedRouteHandler(resolved), instance._cspNonce);
|
|
676
676
|
instance.props = {};
|
|
677
677
|
instance._ownershipGeneration = {};
|
|
@@ -722,7 +722,7 @@ function getResolvedRouteHandler(resolved) {
|
|
|
722
722
|
function updateRouteRuntime(instance, resolved, href) {
|
|
723
723
|
const current = instance._appRenderRuntime;
|
|
724
724
|
const runtime = createAppRenderRuntime({
|
|
725
|
-
framework: current?.framework,
|
|
725
|
+
framework: withoutRouteHydrationMetadata(current?.framework),
|
|
726
726
|
route: resolved?.kind === "render" ? getRouteRenderData(resolved) : void 0,
|
|
727
727
|
hasRoute: resolved?.kind === "render" && hasRouteRenderData(resolved)
|
|
728
728
|
});
|
|
@@ -992,8 +992,9 @@ let navigationInitialized = false;
|
|
|
992
992
|
configureNavigationRegistryHost({ cancelRouteRequests });
|
|
993
993
|
function navigate(path, options = {}) {
|
|
994
994
|
if (typeof window === "undefined") return;
|
|
995
|
-
const
|
|
996
|
-
|
|
995
|
+
const targetPath = addRouteBasePath(path, getActiveRouteBasePath());
|
|
996
|
+
const initialTarget = parseTargetUrl(targetPath);
|
|
997
|
+
navigateWithRedirectState(targetPath, options, {
|
|
997
998
|
redirects: 0,
|
|
998
999
|
visited: /* @__PURE__ */ new Set([`${initialTarget.pathname}${initialTarget.search}${initialTarget.hash}`])
|
|
999
1000
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getDefaultDataRuntime, t as createDataRuntime } from "./data-runtime-
|
|
1
|
+
import { i as getDefaultDataRuntime, t as createDataRuntime } from "./data-runtime-Ck3tJDDQ.js";
|
|
2
2
|
//#region src/common/telemetry.ts
|
|
3
3
|
function withTelemetry(span, fields, work) {
|
|
4
4
|
return span ? span(fields, work) : work();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as enqueueRuntimeTask, s as markRuntimeReactivePropsDirtySource } from "./access-
|
|
1
|
+
import { n as enqueueRuntimeTask, s as markRuntimeReactivePropsDirtySource } from "./access-Dpfoi4cA.js";
|
|
2
2
|
import { p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
|
|
3
3
|
//#region src/runtime/readable.ts
|
|
4
4
|
const DEVELOPMENT_BUILD_ENABLED = false;
|