@askrjs/askr 0.4.0 → 0.4.2
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 +55 -1
- package/dist/actions/index.js +4 -4
- package/dist/benchmark.js +6 -6
- package/dist/boot/index.js +1 -1
- package/dist/{boot-DaoTYoCw.js → boot-DUJkrqGs.js} +79 -36
- package/dist/{browser-activity-CB8e-V4f.js → browser-activity-2r5gA1Cb.js} +6 -4
- package/dist/components/index.js +1 -1
- package/dist/{compose-ref-DWzdbxsD.js → compose-ref-ccRU59BM.js} +7 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-nfpT2fbK.js → control-hr3B0QaD.js} +4 -2
- package/dist/{csp-nonce-DwGw1A6Q.js → csp-nonce-D-XM_uuJ.js} +1 -1
- package/dist/data/index.js +3 -3
- package/dist/{data-BCwClJiF.js → data-BsnOUpQ6.js} +18 -8
- package/dist/{data-runtime-C1bFAlba.js → data-runtime-i-RD0Ffm.js} +1 -1
- package/dist/{deferred-bEEHHvic.js → deferred-nGZglpj6.js} +5 -5
- package/dist/{error-boundary-Bpwofwps.js → error-boundary-ChXoIFVl.js} +2 -2
- package/dist/foundations/index.js +2 -2
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.js +2 -2
- package/dist/foundations/utilities/index.js +1 -1
- package/dist/fx/index.js +2 -2
- package/dist/{hooks-BimKStr4.js → hooks-kjLigwDJ.js} +1 -1
- package/dist/index.js +5 -5
- package/dist/{instance-BAnfmXOR.js → instance-DL-YKrj6.js} +6 -2
- package/dist/{interactions-D2BoREb-.js → interactions-B_wfsDQg.js} +5 -1
- package/dist/{manifest-CW9gyNBY.js → manifest-BNupb86f.js} +1 -1
- package/dist/{navigate-CP_0Zy5U.js → navigate-DsfO12hB.js} +95 -79
- package/dist/{portal-DuOKfnLa.js → portal-LYf4cbHd.js} +3 -3
- package/dist/{query-registry-WMCN0BJL.js → query-registry-tzSiVrV_.js} +7 -2
- package/dist/{render-sync-IC5lMFpq.js → render-sync-Qz-9Hcqw.js} +187 -29
- package/dist/{resolution-Cx82-xjW.js → resolution-CF1BqHLm.js} +22 -8
- package/dist/{resource-CLjB7RBQ.js → resource-BhcaFqdB.js} +2 -2
- package/dist/resources/index.js +25 -27
- package/dist/router/index.js +8 -8
- package/dist/{scope-CwpVSHVf.js → scope-ila_zaId.js} +2 -2
- package/dist/ssg/index.js +43 -14
- package/dist/ssr/index.js +2 -2
- package/dist/{ssr-DoV-vJ-5.js → ssr-DPfdcq0e.js} +1 -1
- package/dist/{ssr-BJ8ug7zH.js → ssr-DueDLmhp.js} +6 -6
- package/dist/{state-DWO1KzkX.js → state-i9D4EtY6.js} +19 -1
- package/dist/{structures-D4dDMqHX.js → structures-CkehlOT3.js} +1 -1
- package/dist/testing/index.js +6 -6
- package/dist/{url-CnbfpX0K.js → url-C9xMpMMv.js} +6 -6
- package/dist/{verify-hydration-DpVaDnqz.js → verify-hydration-Jh5rnm_w.js} +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as state, i as selector, n as getSignal, t as derive } from "./state-
|
|
1
|
+
import { F as configureRenderDiagnostics } from "./instance-DL-YKrj6.js";
|
|
2
|
+
import { a as state, i as selector, n as getSignal, t as derive } from "./state-i9D4EtY6.js";
|
|
3
3
|
import { n as Fragment } from "./jsx-DRS-qjiN.js";
|
|
4
|
-
import { _ as RenderDepthError } from "./hooks-
|
|
5
|
-
import { r as readScope, t as defineScope } from "./scope-
|
|
6
|
-
import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-
|
|
4
|
+
import { _ as RenderDepthError } from "./hooks-kjLigwDJ.js";
|
|
5
|
+
import { r as readScope, t as defineScope } from "./scope-ila_zaId.js";
|
|
6
|
+
import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-D-XM_uuJ.js";
|
|
7
7
|
import { l as registerSSRStyle } from "./render-context-DGHnEveC.js";
|
|
8
8
|
import { i as jsxs, n as jsx, t as createElement } from "./jsx-runtime-C4idqHY0.js";
|
|
9
9
|
//#region src/ref.ts
|
|
@@ -251,6 +251,10 @@ function runWithOwner(owner, fn) {
|
|
|
251
251
|
currentOwner = previous;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
+
function throwCollected(errors, message) {
|
|
255
|
+
if (errors.length === 1) throw errors[0];
|
|
256
|
+
if (errors.length > 1) throw new AggregateError(errors, message);
|
|
257
|
+
}
|
|
254
258
|
//#endregion
|
|
255
259
|
//#region src/core/reactive/graph.ts
|
|
256
260
|
/**
|
|
@@ -476,7 +480,7 @@ var Computation = class Computation extends Owner {
|
|
|
476
480
|
if (!wasClean && !dropped) return;
|
|
477
481
|
this._dropped = false;
|
|
478
482
|
if (this._schedule) this._schedule(this);
|
|
479
|
-
if (!wasClean) return;
|
|
483
|
+
if (!wasClean && !dropped) return;
|
|
480
484
|
const observers = this._observers;
|
|
481
485
|
if (observers) for (const observer of observers) observer._mark(CHECK);
|
|
482
486
|
}
|
|
@@ -985,4 +989,4 @@ function getRenderHost() {
|
|
|
985
989
|
return renderHost;
|
|
986
990
|
}
|
|
987
991
|
//#endregion
|
|
988
|
-
export { untrack as A, schedule as C, isTracking as D, getTrackingComputation as E,
|
|
992
|
+
export { untrack as A, schedule as C, isTracking as D, getTrackingComputation as E, configureRenderDiagnostics as F, logger as I, isDevelopmentEnvironment as L, getOwner as M, runWithOwner as N, notifySource as O, throwCollected as P, isProductionEnvironment as R, queueTask as S, Signal as T, batch as _, getCurrentInstance as a, getFlushVersion as b, setRenderHost as c, recordUndo as d, rewindJournal as f, outsideRendering as g, isRendering as h, getContextEpoch as i, Owner as j, trackSource as k, createRenderJournal as l, withRenderJournal as m, HookOrderChangeError as n, getRenderHost as o, settleJournal as p, claimHook as r, requireInstance as s, ComponentInstance as t, journalMark as u, effectScheduler as v, Computation as w, isFlushing as x, flushSync as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as mergeProps, r as ariaDisabled, s as composeHandlers, t as composeRefs } from "./compose-ref-
|
|
1
|
+
import { o as mergeProps, r as ariaDisabled, s as composeHandlers, t as composeRefs } from "./compose-ref-ccRU59BM.js";
|
|
2
2
|
//#region src/foundations/interactions/pressable.ts
|
|
3
3
|
/** Produce click/keyboard props implementing 'press' semantics for an element. */
|
|
4
4
|
function pressable({ disabled, onPress, isNativeButton = false }) {
|
|
@@ -8,6 +8,7 @@ function pressable({ disabled, onPress, isNativeButton = false }) {
|
|
|
8
8
|
e.stopPropagation?.();
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
+
if (e.defaultPrevented) return;
|
|
11
12
|
onPress?.(e);
|
|
12
13
|
} };
|
|
13
14
|
if (isNativeButton) {
|
|
@@ -25,6 +26,7 @@ function pressable({ disabled, onPress, isNativeButton = false }) {
|
|
|
25
26
|
e.stopPropagation?.();
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
29
|
+
if (e.defaultPrevented) return;
|
|
28
30
|
if (e.key === "Enter") {
|
|
29
31
|
e.preventDefault?.();
|
|
30
32
|
onPress?.(e);
|
|
@@ -38,6 +40,7 @@ function pressable({ disabled, onPress, isNativeButton = false }) {
|
|
|
38
40
|
e.stopPropagation?.();
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
43
|
+
if (e.defaultPrevented) return;
|
|
41
44
|
if (e.key === " ") {
|
|
42
45
|
e.preventDefault?.();
|
|
43
46
|
onPress?.(e);
|
|
@@ -118,6 +121,7 @@ function rovingFocus(options) {
|
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
function handleKeyDown(e) {
|
|
124
|
+
if (e.defaultPrevented) return;
|
|
121
125
|
const { key } = e;
|
|
122
126
|
let direction;
|
|
123
127
|
if (orientation === "horizontal" || orientation === "both") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as withRouteTable, G as getRouteRecords, H as getDefaultRouteAuthOptions, J as insertRecordSorted, O as addRouteToStores, Q as setDefaultRouteBasePath, S as normalizeRouteBasePath, U as getDefaultRouteBasePath, W as getRouteList, Z as setDefaultRouteAuthOptions, j as createRouteTable } from "./resolution-
|
|
1
|
+
import { $ as withRouteTable, G as getRouteRecords, H as getDefaultRouteAuthOptions, J as insertRecordSorted, O as addRouteToStores, Q as setDefaultRouteBasePath, S as normalizeRouteBasePath, U as getDefaultRouteBasePath, W as getRouteList, Z as setDefaultRouteAuthOptions, j as createRouteTable } from "./resolution-CF1BqHLm.js";
|
|
2
2
|
//#region src/common/execution-model.ts
|
|
3
3
|
const EXECUTION_MODEL_KEY = Symbol.for("__ASKR_EXECUTION_MODEL__");
|
|
4
4
|
function getExecutionModel() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as reportUncaughtErrorLater, c as onCommit, i as currentComponent, n as createSource, o as hookSlot, r as currentAppRuntime, s as notify, u as readSource } from "./hooks-
|
|
1
|
+
import { I as logger, L as isDevelopmentEnvironment, R as isProductionEnvironment, x as isFlushing, y as flushSync } from "./instance-DL-YKrj6.js";
|
|
2
|
+
import { b as reportUncaughtErrorLater, c as onCommit, i as currentComponent, n as createSource, o as hookSlot, r as currentAppRuntime, s as notify, u as readSource } from "./hooks-kjLigwDJ.js";
|
|
3
3
|
import { n as getActiveRenderContext } from "./render-context-DGHnEveC.js";
|
|
4
4
|
import { n as isPromiseLike } from "./promise-Dz8iIHAm.js";
|
|
5
|
-
import { C as removeRouteBasePath, E as parseLocation, M as getActiveRouteBasePath, N as getActiveRoutes, T as makeQuery, Y as lockRouteRegistration, a as resolveRouteRequest, b as addLogicalRouteBasePath, g as computeRouteActivityMatches, h as computeMatchesFromRoutes, i as hasRouteRenderData, n as getRouteRenderContext, r as getRouteRenderData, w as deepFreeze } from "./resolution-
|
|
5
|
+
import { C as removeRouteBasePath, E as parseLocation, M as getActiveRouteBasePath, N as getActiveRoutes, T as makeQuery, Y as lockRouteRegistration, a as resolveRouteRequest, b as addLogicalRouteBasePath, g as computeRouteActivityMatches, h as computeMatchesFromRoutes, i as hasRouteRenderData, n as getRouteRenderContext, r as getRouteRenderData, w as deepFreeze } from "./resolution-CF1BqHLm.js";
|
|
6
6
|
import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
|
|
7
|
-
import { c as resolveNavigationUrl } from "./url-
|
|
7
|
+
import { c as resolveNavigationUrl } from "./url-C9xMpMMv.js";
|
|
8
8
|
//#region src/common/app-render-runtime.ts
|
|
9
9
|
const stagedRouteLocations = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
function createAppRenderRuntime(input = {}) {
|
|
@@ -19,11 +19,17 @@ function createAppRenderRuntime(input = {}) {
|
|
|
19
19
|
lifetime: input.lifetime
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function stageAppRenderRouteLocation(runtime, href) {
|
|
23
|
-
stagedRouteLocations.set(runtime,
|
|
22
|
+
function stageAppRenderRouteLocation(runtime, href, state) {
|
|
23
|
+
stagedRouteLocations.set(runtime, {
|
|
24
|
+
href,
|
|
25
|
+
state
|
|
26
|
+
});
|
|
24
27
|
}
|
|
25
28
|
function getStagedAppRenderRouteLocation(runtime) {
|
|
26
|
-
return runtime ? stagedRouteLocations.get(runtime) : void 0;
|
|
29
|
+
return runtime ? stagedRouteLocations.get(runtime)?.href : void 0;
|
|
30
|
+
}
|
|
31
|
+
function getStagedAppRenderRouteState(runtime) {
|
|
32
|
+
return runtime ? stagedRouteLocations.get(runtime)?.state : void 0;
|
|
27
33
|
}
|
|
28
34
|
function clearStagedAppRenderRouteLocation(runtime) {
|
|
29
35
|
if (runtime) stagedRouteLocations.delete(runtime);
|
|
@@ -53,15 +59,10 @@ function onRouteChange(fn, options = {}) {
|
|
|
53
59
|
const slot = hookSlot(instance, "onRouteChange", () => ({
|
|
54
60
|
kind: "route-change",
|
|
55
61
|
previous: null,
|
|
56
|
-
pending: null,
|
|
57
62
|
cleanup: null,
|
|
58
|
-
cleanupRegistered: false
|
|
59
|
-
callback: fn,
|
|
60
|
-
immediate: options.immediate === true
|
|
63
|
+
cleanupRegistered: false
|
|
61
64
|
}));
|
|
62
|
-
|
|
63
|
-
slot.callback = fn;
|
|
64
|
-
slot.immediate = options.immediate === true;
|
|
65
|
+
const immediate = options.immediate === true;
|
|
65
66
|
if (!slot.cleanupRegistered) {
|
|
66
67
|
instance.onCleanup(() => {
|
|
67
68
|
slot.cleanup?.();
|
|
@@ -69,27 +70,27 @@ function onRouteChange(fn, options = {}) {
|
|
|
69
70
|
});
|
|
70
71
|
slot.cleanupRegistered = true;
|
|
71
72
|
}
|
|
72
|
-
if (!slot.previous) {
|
|
73
|
-
onCommit(instance, () => {
|
|
74
|
-
const committed = slot.pending;
|
|
75
|
-
if (!committed) return;
|
|
76
|
-
if (slot.immediate) slot.cleanup = slot.callback(committed, null) ?? null;
|
|
77
|
-
slot.previous = committed;
|
|
78
|
-
});
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (routeSignature(slot.previous) === routeSignature(route)) return;
|
|
82
73
|
onCommit(instance, () => {
|
|
83
74
|
const previous = slot.previous;
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
if (!previous) {
|
|
76
|
+
if (immediate) slot.cleanup = fn(route, null) ?? null;
|
|
77
|
+
slot.previous = route;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (routeSignature(previous) === routeSignature(route)) return;
|
|
86
81
|
slot.cleanup?.();
|
|
87
|
-
slot.cleanup =
|
|
88
|
-
slot.previous =
|
|
82
|
+
slot.cleanup = fn(route, previous) ?? null;
|
|
83
|
+
slot.previous = route;
|
|
89
84
|
});
|
|
90
85
|
}
|
|
91
86
|
let serverLocation = null;
|
|
92
87
|
function readLocationState() {
|
|
88
|
+
if (getActiveRenderContext()?.mode === "ssr") return {
|
|
89
|
+
hasState: false,
|
|
90
|
+
state: void 0
|
|
91
|
+
};
|
|
92
|
+
const staged = getStagedAppRenderRouteState(currentAppRuntime());
|
|
93
|
+
if (staged) return staged;
|
|
93
94
|
const historyState = typeof window !== "undefined" && window.history?.state ? window.history.state : null;
|
|
94
95
|
const hasState = historyState?.askrHasState === true;
|
|
95
96
|
return {
|
|
@@ -863,11 +864,12 @@ function getResolvedRouteHandler(resolved) {
|
|
|
863
864
|
params: resolved.params
|
|
864
865
|
};
|
|
865
866
|
}
|
|
866
|
-
function prepareNavigationRoot(target, href, replaceLifetime) {
|
|
867
|
+
function prepareNavigationRoot(target, href, replaceLifetime, locationState) {
|
|
867
868
|
const resolved = target.resolved;
|
|
868
869
|
return prepareRootUpdate(target.app.instance, {
|
|
869
870
|
handler: bindResolvedRouteHandler(getResolvedRouteHandler(resolved)),
|
|
870
871
|
href,
|
|
872
|
+
locationState,
|
|
871
873
|
routeData: isRenderResult(resolved) ? getRouteRenderData(resolved) : void 0,
|
|
872
874
|
hasRouteData: isRenderResult(resolved) && hasRouteRenderData(resolved),
|
|
873
875
|
replaceLifetime
|
|
@@ -927,14 +929,19 @@ function applyNavigationTargets(requestId, path, options, redirectState, pathnam
|
|
|
927
929
|
return;
|
|
928
930
|
}
|
|
929
931
|
if (isStaleRouteRequest(requestId)) return;
|
|
930
|
-
|
|
932
|
+
const hasState = Object.prototype.hasOwnProperty.call(options, "state");
|
|
933
|
+
const locationState = {
|
|
934
|
+
hasState,
|
|
935
|
+
state: hasState ? options.state : void 0
|
|
936
|
+
};
|
|
937
|
+
commitNavigationRoots(requestId, pathname, href, matchedTargets, locationState, () => {
|
|
931
938
|
saveScrollPosition(previousHref);
|
|
932
939
|
const historyMode = getNavigationHistoryMode(options);
|
|
933
940
|
const historyIndex = nextHistoryIndex(historyMode);
|
|
934
941
|
window.history[historyMode === "replace" ? "replaceState" : "pushState"]({
|
|
935
942
|
path: href,
|
|
936
|
-
askrHasState:
|
|
937
|
-
askrState:
|
|
943
|
+
askrHasState: locationState.hasState,
|
|
944
|
+
askrState: locationState.state,
|
|
938
945
|
askrIndex: historyIndex
|
|
939
946
|
}, "", toDocumentUrl(href));
|
|
940
947
|
commitHistoryIndex(historyIndex);
|
|
@@ -961,7 +968,12 @@ function applyPopStateNavigationTargets(requestId, previousHref, historyIndex, p
|
|
|
961
968
|
return;
|
|
962
969
|
}
|
|
963
970
|
saveScrollPosition(previousHref);
|
|
964
|
-
|
|
971
|
+
const historyState = state;
|
|
972
|
+
const hasState = historyState?.askrHasState === true;
|
|
973
|
+
commitNavigationRoots(requestId, pathname, href, matchedTargets, {
|
|
974
|
+
hasState,
|
|
975
|
+
state: hasState ? historyState?.askrState : void 0
|
|
976
|
+
}, () => commitHistoryIndex(historyIndex), () => applyHistoryScroll(href, state), () => {
|
|
965
977
|
if (isStaleRouteRequest(requestId)) return;
|
|
966
978
|
if (!returnToRenderedHistoryEntry()) reloadDocument();
|
|
967
979
|
});
|
|
@@ -971,7 +983,7 @@ function applyPopStateNavigationTargets(requestId, previousHref, historyIndex, p
|
|
|
971
983
|
* work of the committed destination runs before history is updated, so a
|
|
972
984
|
* navigation it starts supersedes this one.
|
|
973
985
|
*/
|
|
974
|
-
function commitNavigationRoots(requestId, pathname, href, targets, updateHistory, updateScroll, restoreHistory) {
|
|
986
|
+
function commitNavigationRoots(requestId, pathname, href, targets, locationState, updateHistory, updateScroll, restoreHistory) {
|
|
975
987
|
const previousPathname = getCurrentPathname();
|
|
976
988
|
const previousHref = getCurrentHref();
|
|
977
989
|
const roots = targets.map((target) => {
|
|
@@ -979,58 +991,62 @@ function commitNavigationRoots(requestId, pathname, href, targets, updateHistory
|
|
|
979
991
|
return {
|
|
980
992
|
target,
|
|
981
993
|
replaceLifetime,
|
|
982
|
-
prepared: prepareNavigationRoot(target, href, replaceLifetime)
|
|
994
|
+
prepared: prepareNavigationRoot(target, href, replaceLifetime, locationState)
|
|
983
995
|
};
|
|
984
996
|
});
|
|
985
|
-
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
|
|
997
|
+
try {
|
|
998
|
+
const rollback = () => {
|
|
999
|
+
const errors = [];
|
|
1000
|
+
for (let index = roots.length - 1; index >= 0; index--) errors.push(...roots[index].prepared.rollback());
|
|
1001
|
+
setCurrentRouteLocation(previousPathname, previousHref);
|
|
1002
|
+
try {
|
|
1003
|
+
restoreHistory?.();
|
|
1004
|
+
} catch (error) {
|
|
1005
|
+
errors.push(error);
|
|
1006
|
+
}
|
|
1007
|
+
reportRouteCleanupErrors(errors);
|
|
1008
|
+
};
|
|
989
1009
|
try {
|
|
990
|
-
|
|
1010
|
+
for (const replaceLifetime of [true, false]) for (const root of roots) if (root.replaceLifetime === replaceLifetime) root.prepared.apply();
|
|
991
1011
|
} catch (error) {
|
|
992
|
-
|
|
1012
|
+
rollback();
|
|
1013
|
+
logger.error("[Askr] navigation failed:", error);
|
|
1014
|
+
throw error;
|
|
993
1015
|
}
|
|
994
|
-
|
|
995
|
-
};
|
|
996
|
-
try {
|
|
997
|
-
for (const replaceLifetime of [true, false]) for (const root of roots) if (root.replaceLifetime === replaceLifetime) root.prepared.apply();
|
|
998
|
-
} catch (error) {
|
|
999
|
-
rollback();
|
|
1000
|
-
logger.error("[Askr] navigation failed:", error);
|
|
1001
|
-
throw error;
|
|
1002
|
-
}
|
|
1003
|
-
if (isStaleRouteRequest(requestId)) {
|
|
1004
|
-
rollback();
|
|
1005
|
-
return;
|
|
1006
|
-
}
|
|
1007
|
-
const committedFailures = [];
|
|
1008
|
-
for (const root of roots) {
|
|
1009
|
-
const result = root.prepared.publish();
|
|
1010
|
-
if (result.aborted) {
|
|
1016
|
+
if (isStaleRouteRequest(requestId)) {
|
|
1011
1017
|
rollback();
|
|
1012
|
-
|
|
1013
|
-
logger.error("[Askr] navigation failed:", failure);
|
|
1014
|
-
throw failure;
|
|
1018
|
+
return;
|
|
1015
1019
|
}
|
|
1016
|
-
committedFailures
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1020
|
+
const committedFailures = [];
|
|
1021
|
+
for (const root of roots) {
|
|
1022
|
+
const result = root.prepared.publish();
|
|
1023
|
+
if (result.aborted) {
|
|
1024
|
+
rollback();
|
|
1025
|
+
const failure = result.errors[0];
|
|
1026
|
+
logger.error("[Askr] navigation failed:", failure);
|
|
1027
|
+
throw failure;
|
|
1028
|
+
}
|
|
1029
|
+
committedFailures.push(...result.errors);
|
|
1030
|
+
syncAppRegistrationLocation(root.target.app, pathname, href);
|
|
1031
|
+
}
|
|
1032
|
+
for (const failure of committedFailures) reportUncaughtErrorLater(failure);
|
|
1033
|
+
const retired = [];
|
|
1034
|
+
for (const root of roots) retired.push(...root.prepared.retire());
|
|
1035
|
+
if (retired.length) reportUncaughtErrorLater(retired.length === 1 ? retired[0] : new AggregateError(retired, "Route cleanup failed"));
|
|
1036
|
+
flushSync();
|
|
1037
|
+
if (isStaleRouteRequest(requestId)) return;
|
|
1038
|
+
try {
|
|
1039
|
+
updateHistory();
|
|
1040
|
+
setCurrentRouteLocation(pathname, href);
|
|
1041
|
+
syncRegisteredRouteSnapshot();
|
|
1042
|
+
reconcileNavigationMetadata(targets);
|
|
1043
|
+
updateScroll();
|
|
1044
|
+
} catch (error) {
|
|
1045
|
+
logger.error("[Askr] navigation failed:", error);
|
|
1046
|
+
throw error;
|
|
1047
|
+
}
|
|
1048
|
+
} finally {
|
|
1049
|
+
for (const root of roots) root.prepared.complete();
|
|
1034
1050
|
}
|
|
1035
1051
|
}
|
|
1036
1052
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as getOwner, T as Signal, d as recordUndo, o as getRenderHost } from "./instance-
|
|
1
|
+
import { M as getOwner, T as Signal, d as recordUndo, o as getRenderHost } from "./instance-DL-YKrj6.js";
|
|
2
2
|
import { t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
3
|
-
import { i as currentComponent, m as deliverToBoundary } from "./hooks-
|
|
3
|
+
import { i as currentComponent, m as deliverToBoundary } from "./hooks-kjLigwDJ.js";
|
|
4
4
|
import { n as getActiveRenderContext } from "./render-context-DGHnEveC.js";
|
|
5
|
-
import { i as OWNED_TYPE, n as holdUntilBoundaryRecovers, r as nearestErrorBoundary, t as ErrorBoundary } from "./error-boundary-
|
|
5
|
+
import { i as OWNED_TYPE, n as holdUntilBoundaryRecovers, r as nearestErrorBoundary, t as ErrorBoundary } from "./error-boundary-ChXoIFVl.js";
|
|
6
6
|
//#region src/common/portal.ts
|
|
7
7
|
/**
|
|
8
8
|
* Internal marker used to defer server portal host output until all writes in
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDefaultDataRuntime, d as writePrefetchedQueryData, i as findDataRuntimeState, t as createDataRuntime } from "./data-runtime-
|
|
1
|
+
import { a as getDefaultDataRuntime, d as writePrefetchedQueryData, i as findDataRuntimeState, t as createDataRuntime } from "./data-runtime-i-RD0Ffm.js";
|
|
2
2
|
//#region src/common/deferred-value.ts
|
|
3
3
|
const DEFERRED_VALUE = Symbol.for("@askrjs/askr/deferred-value");
|
|
4
4
|
const DEFERRED_BOUNDARY = Symbol.for("@askrjs/askr/deferred-boundary");
|
|
@@ -303,7 +303,12 @@ function dehydrateDataRuntime(runtime) {
|
|
|
303
303
|
const result = {};
|
|
304
304
|
for (const [key, value] of runtime.queryData) {
|
|
305
305
|
assertQueryDataTransportSafe(key, value);
|
|
306
|
-
result
|
|
306
|
+
Object.defineProperty(result, key, {
|
|
307
|
+
value,
|
|
308
|
+
enumerable: true,
|
|
309
|
+
configurable: true,
|
|
310
|
+
writable: true
|
|
311
|
+
});
|
|
307
312
|
}
|
|
308
313
|
return result;
|
|
309
314
|
}
|