@askrjs/askr 0.0.65 → 0.0.66
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/{authoring-CXMPffwN.js → authoring-Di8MInO-.js} +2 -2
- package/dist/benchmark.js +3 -3
- package/dist/boot/index.d.ts +1 -1
- package/dist/boot/index.js +1 -1
- package/dist/{boot-OnYuVVfg.js → boot-B4UZumvB.js} +8 -7
- package/dist/{deferred-B71c2eio.js → deferred-Eh9bCVGH.js} +25 -23
- package/dist/{navigate-DTZ2SM8_.js → navigate-QMRcR581.js} +4 -7
- package/dist/{route-matching-C93To416.js → route-matching-DLBWDeXX.js} +2 -4
- package/dist/router/index.d.ts +2 -2
- package/dist/router/index.js +3 -3
- package/dist/{router-eRoaj11J.d.ts → router-4EhVGcma.d.ts} +5 -1
- package/dist/ssg/index.d.ts +1 -1
- package/dist/ssg/index.js +3 -3
- package/dist/ssr/index.d.ts +1 -1
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-C0hzqhY8.js → ssr-Y8Pq8riM.js} +7 -16
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/{verify-hydration-BdKE9Hi8.js → verify-hydration-BcZXRU-q.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as getCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
|
|
2
|
-
import { T as getExecutionModel, x as createRouteHandler } from "./deferred-
|
|
3
|
-
import { A as insertRecordSorted, C as getCurrentPathPrefix, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, O as hasActivePageScope, R as parseSegments, S as getCurrentPageScope, _ as getCurrentInheritedAuthRequirements, b as getCurrentLayoutChain, f as addRouteToStores, p as assertRouteRegistrationUnlocked, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-
|
|
2
|
+
import { T as getExecutionModel, x as createRouteHandler } from "./deferred-Eh9bCVGH.js";
|
|
3
|
+
import { A as insertRecordSorted, C as getCurrentPathPrefix, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, O as hasActivePageScope, R as parseSegments, S as getCurrentPageScope, _ as getCurrentInheritedAuthRequirements, b as getCurrentLayoutChain, f as addRouteToStores, p as assertRouteRegistrationUnlocked, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-DLBWDeXX.js";
|
|
4
4
|
import { allOf } from "@askrjs/auth";
|
|
5
5
|
//#region src/router/access.ts
|
|
6
6
|
function compileNodePolicies(node) {
|
package/dist/benchmark.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t as state } from "./state-Cc5HumQ0.js";
|
|
|
4
4
|
import { t as selector } from "./selector-pApF_lGd.js";
|
|
5
5
|
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
6
6
|
import { i as For } from "./control-KVP6LMEQ.js";
|
|
7
|
-
import { t as createIsland } from "./boot-
|
|
7
|
+
import { t as createIsland } from "./boot-B4UZumvB.js";
|
|
8
8
|
//#region src/bench/components/benchmark-row.tsx
|
|
9
9
|
function BenchmarkRow({ item, isSelected, onSelect, onRemove }) {
|
|
10
10
|
return /* @__PURE__ */ jsxs("tr", {
|
|
@@ -63,8 +63,8 @@ function BenchmarkTable({ rows, isSelected, onSelect, onRemove }) {
|
|
|
63
63
|
installRendererBridge();
|
|
64
64
|
const benchmarkMetadata = {
|
|
65
65
|
packageName: "@askrjs/askr",
|
|
66
|
-
packageVersion: "0.0.
|
|
67
|
-
buildLabel: "0.0.
|
|
66
|
+
packageVersion: "0.0.66",
|
|
67
|
+
buildLabel: "0.0.66-local"
|
|
68
68
|
};
|
|
69
69
|
function getBenchmarkMetadata() {
|
|
70
70
|
return { ...benchmarkMetadata };
|
package/dist/boot/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as ComponentFunction } from "../control-CMzFPMjr.js";
|
|
2
2
|
import { v as DataRuntime } from "../index-Bki2rqcr.js";
|
|
3
|
-
import { N as RouteRegistry, p as RouteAuthOptions } from "../router-
|
|
3
|
+
import { N as RouteRegistry, p as RouteAuthOptions } from "../router-4EhVGcma.js";
|
|
4
4
|
import { d as ScrollRestorationOptions } from "../navigate-BVDCzOuB.js";
|
|
5
5
|
|
|
6
6
|
//#region src/boot/types.d.ts
|
package/dist/boot/index.js
CHANGED
|
@@ -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-
|
|
1
|
+
import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-B4UZumvB.js";
|
|
2
2
|
export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
|
|
@@ -4,14 +4,14 @@ import { n as createComponentInstance, r as executeComponent } from "./component
|
|
|
4
4
|
import { h as cleanupComponent, m as isPromiseLike } from "./component-lifecycle-DEMPihoZ.js";
|
|
5
5
|
import { a as withIntrinsicHydrationAdoption, i as registerDeferredHydrationBoundary, n as activateHydrationBoundary$1, o as setStaticChildSlotsCacheEnabled, r as clearDeferredHydrationBoundaries, t as installRendererBridge } from "./renderer-aUD-acDe.js";
|
|
6
6
|
import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-B6KovDZZ.js";
|
|
7
|
-
import { c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData,
|
|
7
|
+
import { c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData, v as pageRenderEnvelope, w as assertExecutionModel } from "./deferred-Eh9bCVGH.js";
|
|
8
8
|
import { a as startHydrationRenderPhase, s as stopHydrationRenderPhase } from "./render-context-Clw3rFiO.js";
|
|
9
9
|
import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-D2tPWNrC.js";
|
|
10
10
|
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-C-8E85El.js";
|
|
11
11
|
import { i as getDefaultDataRuntime } from "./data-runtime-SJ1BSUvk.js";
|
|
12
12
|
import { a as hydrateDataRuntime } from "./query-registry-CQIT4mXr.js";
|
|
13
|
-
import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-
|
|
14
|
-
import { a as resolveRouteMeta, c as registerAppInstance, d as setServerLocation, f as createAppRenderRuntime, i as reconcileRouteMeta, l as unregisterAppInstance, s as configureScrollRestoration, t as initializeNavigation } from "./navigate-
|
|
13
|
+
import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-DLBWDeXX.js";
|
|
14
|
+
import { a as resolveRouteMeta, c as registerAppInstance, d as setServerLocation, f as createAppRenderRuntime, i as reconcileRouteMeta, l as unregisterAppInstance, s as configureScrollRestoration, t as initializeNavigation } from "./navigate-QMRcR581.js";
|
|
15
15
|
import "./ssr-CbQO5xd3.js";
|
|
16
16
|
//#region src/boot/hydration.ts
|
|
17
17
|
const DEFERRED_PAYLOAD = "__askr_deferred__";
|
|
@@ -408,11 +408,12 @@ async function resolveInitialRoute(auth, source) {
|
|
|
408
408
|
for (let redirects = 0; redirects <= MAX_INITIAL_ROUTE_REDIRECTS; redirects++) {
|
|
409
409
|
if (visited.has(href)) throw new Error(`[Askr] Route redirect cycle detected at ${href}.`);
|
|
410
410
|
visited.add(href);
|
|
411
|
-
|
|
412
|
-
|
|
411
|
+
if (!source?.registry) throw new TypeError("resolveInitialRoute requires a route registry.");
|
|
412
|
+
const resolved = await resolveRouteRequest(href, {
|
|
413
|
+
registry: source.registry,
|
|
413
414
|
auth,
|
|
414
415
|
load: source.load
|
|
415
|
-
})
|
|
416
|
+
});
|
|
416
417
|
if (typeof window === "undefined" || !resolved || resolved.kind !== "redirect") return {
|
|
417
418
|
path,
|
|
418
419
|
href,
|
|
@@ -582,7 +583,7 @@ async function hydrateSPA(config) {
|
|
|
582
583
|
cspNonce: config.cspNonce
|
|
583
584
|
}));
|
|
584
585
|
if (shouldVerifyHydrationMarkup(config)) {
|
|
585
|
-
const { verifyHydrationSyncForUrl } = await import("./verify-hydration-
|
|
586
|
+
const { verifyHydrationSyncForUrl } = await import("./verify-hydration-BcZXRU-q.js");
|
|
586
587
|
if (!verifyHydrationSyncForUrl({
|
|
587
588
|
root: rootElement,
|
|
588
589
|
url: currentUrl,
|
|
@@ -6,7 +6,7 @@ import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render
|
|
|
6
6
|
import { t as resource } from "./resource-operation-Dz2Nxi1q.js";
|
|
7
7
|
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-C-8E85El.js";
|
|
8
8
|
import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-CQIT4mXr.js";
|
|
9
|
-
import { A as insertRecordSorted, D as getRouteRecords, E as getRouteList, F as snapshotRouteState, N as restoreRouteState, P as setDefaultRouteAuthOptions, T as getDefaultRouteAuthOptions, f as addRouteToStores, h as getActiveRouteAuthOptions, i as getMatchingRouteRecord, m as clearRouteState, o as buildRouteContext, s as buildRouteContextBase } from "./route-matching-
|
|
9
|
+
import { A as insertRecordSorted, D as getRouteRecords, E as getRouteList, F as snapshotRouteState, N as restoreRouteState, P as setDefaultRouteAuthOptions, T as getDefaultRouteAuthOptions, f as addRouteToStores, h as getActiveRouteAuthOptions, i as getMatchingRouteRecord, m as clearRouteState, o as buildRouteContext, s as buildRouteContextBase } from "./route-matching-DLBWDeXX.js";
|
|
10
10
|
//#region src/runtime/execution-model.ts
|
|
11
11
|
const EXECUTION_MODEL_KEY = Symbol.for("__ASKR_EXECUTION_MODEL__");
|
|
12
12
|
function getExecutionModel() {
|
|
@@ -116,6 +116,24 @@ function getRenderHandler(record) {
|
|
|
116
116
|
return record.renderHandler ?? createRouteHandler(record.component, record.pageChain, record.layoutChain, true);
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
|
+
//#region src/router/auth.ts
|
|
120
|
+
let clientAuth = Object.freeze({
|
|
121
|
+
authenticated: false,
|
|
122
|
+
principal: null,
|
|
123
|
+
session: null,
|
|
124
|
+
tenant: null
|
|
125
|
+
});
|
|
126
|
+
/** Return the identity resolved for the route currently being rendered. */
|
|
127
|
+
function currentAuth() {
|
|
128
|
+
return getActiveRenderContext()?.authContext ?? clientAuth;
|
|
129
|
+
}
|
|
130
|
+
/** @internal Updated atomically with route resolution. */
|
|
131
|
+
function setCurrentAuth(context) {
|
|
132
|
+
clientAuth = context;
|
|
133
|
+
const render = getActiveRenderContext();
|
|
134
|
+
if (render) render.authContext = context;
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
119
137
|
//#region src/common/page-render-envelope.ts
|
|
120
138
|
const PAGE_RENDER_ENVELOPE_VERSION = 1;
|
|
121
139
|
function ownedRecord(value) {
|
|
@@ -153,24 +171,6 @@ function isEmptyPageRenderEnvelope(value) {
|
|
|
153
171
|
return value.route === void 0 && Object.keys(value.resources).length === 0 && Object.keys(value.framework).length === 0;
|
|
154
172
|
}
|
|
155
173
|
//#endregion
|
|
156
|
-
//#region src/router/auth.ts
|
|
157
|
-
let clientAuth = Object.freeze({
|
|
158
|
-
authenticated: false,
|
|
159
|
-
principal: null,
|
|
160
|
-
session: null,
|
|
161
|
-
tenant: null
|
|
162
|
-
});
|
|
163
|
-
/** Return the identity resolved for the route currently being rendered. */
|
|
164
|
-
function currentAuth() {
|
|
165
|
-
return getActiveRenderContext()?.authContext ?? clientAuth;
|
|
166
|
-
}
|
|
167
|
-
/** @internal Updated atomically with route resolution. */
|
|
168
|
-
function setCurrentAuth(context) {
|
|
169
|
-
clientAuth = context;
|
|
170
|
-
const render = getActiveRenderContext();
|
|
171
|
-
if (render) render.authContext = context;
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
174
|
//#region src/router/resolution.ts
|
|
175
175
|
const anonymous = () => ({
|
|
176
176
|
authenticated: false,
|
|
@@ -300,13 +300,15 @@ function resolveMatchedRoute(record, params, context, authOptions, request, tele
|
|
|
300
300
|
const decision = record.options.auth(context.auth);
|
|
301
301
|
return isPromiseLike(decision) ? Promise.resolve(decision).then(continueResolution) : continueResolution(decision);
|
|
302
302
|
}
|
|
303
|
-
function resolveRouteRequest(target, options
|
|
303
|
+
function resolveRouteRequest(target, options) {
|
|
304
|
+
if (!options?.registry) throw new TypeError("resolveRouteRequest requires options.registry.");
|
|
304
305
|
return withTelemetry(options.telemetry?.routeMatch, {}, () => {
|
|
305
|
-
const
|
|
306
|
+
const records = options.registry.manifest.records;
|
|
307
|
+
const match = getMatchingRouteRecord(target, records);
|
|
306
308
|
if (!match) return null;
|
|
307
309
|
const mode = options.mode ?? getDefaultRouteMode();
|
|
308
310
|
const signal = options.signal ?? getActiveRenderContext()?.signal ?? new AbortController().signal;
|
|
309
|
-
const authOptions = getActiveRouteAuthOptions(options.auth ?? options.manifest
|
|
311
|
+
const authOptions = getActiveRouteAuthOptions(options.auth ?? options.registry.manifest.auth);
|
|
310
312
|
const base = buildRouteContextBase(target, match.params, {
|
|
311
313
|
mode,
|
|
312
314
|
signal
|
|
@@ -491,4 +493,4 @@ function Resolve(props) {
|
|
|
491
493
|
return props.children(result.value);
|
|
492
494
|
}
|
|
493
495
|
//#endregion
|
|
494
|
-
export { lazy as C, getRenderHandler as S, getExecutionModel as T,
|
|
496
|
+
export { lazy as C, getRenderHandler as S, getExecutionModel as T, isPageRenderEnvelope as _, resolveDeferredValues as a, Outlet as b, _applyManifest as c, getRouteRenderContext as d, getRouteRenderData as f, isEmptyPageRenderEnvelope as g, createPageRenderEnvelope as h, isDeferred as i, createRouteRegistry as l, resolveRouteRequest as m, Resolve as n, reviveDeferredValue as o, hasRouteRenderData as p, defer as r, routeData as s, DEFERRED_BOUNDARY as t, bindResolvedRouteData as u, pageRenderEnvelope as v, assertExecutionModel as w, createRouteHandler as x, currentAuth as y };
|
|
@@ -5,12 +5,12 @@ import { r as executeComponent } from "./component-internal-CbALfPGD.js";
|
|
|
5
5
|
import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
|
|
6
6
|
import { g as cleanupComponentGeneration, h as cleanupComponent, i as beginLifecycleCommitBatch, l as flushLifecycleCommitBatch, m as isPromiseLike, o as discardLifecycleCommitBatch, s as drainLifecycleCommitErrors } from "./component-lifecycle-DEMPihoZ.js";
|
|
7
7
|
import { _ as teardownNodeSubtree } from "./cleanup-B6KovDZZ.js";
|
|
8
|
-
import { d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, p as hasRouteRenderData } from "./deferred-
|
|
8
|
+
import { d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, p as hasRouteRenderData } from "./deferred-Eh9bCVGH.js";
|
|
9
9
|
import { n as getActiveRenderContext } from "./render-context-Clw3rFiO.js";
|
|
10
10
|
import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
|
|
11
11
|
import { r as clearDefaultPortalForInstance, t as DefaultPortal } from "./portal-D2tPWNrC.js";
|
|
12
12
|
import { t as CspNonceScope } from "./csp-nonce-C-8E85El.js";
|
|
13
|
-
import { c as deepFreeze, g as getActiveRoutes, j as lockRouteRegistration, l as makeQuery, n as computeMatchesFromRoutes, r as computeRouteActivityMatches, u as parseLocation } from "./route-matching-
|
|
13
|
+
import { c as deepFreeze, g as getActiveRoutes, j as lockRouteRegistration, l as makeQuery, n as computeMatchesFromRoutes, r as computeRouteActivityMatches, u as parseLocation } from "./route-matching-DLBWDeXX.js";
|
|
14
14
|
//#region src/common/app-render-runtime.ts
|
|
15
15
|
const stagedRouteLocations = /* @__PURE__ */ new WeakMap();
|
|
16
16
|
function createAppRenderRuntime(input = {}) {
|
|
@@ -150,10 +150,7 @@ function collectRouteActivityMatches(pathname, apps = registeredApps) {
|
|
|
150
150
|
const matches = [];
|
|
151
151
|
const seenPaths = /* @__PURE__ */ new Set();
|
|
152
152
|
for (const app of apps) {
|
|
153
|
-
const appMatches = computeRouteActivityMatches(pathname, {
|
|
154
|
-
manifest: app.registry.manifest,
|
|
155
|
-
routes: app.registry.routes
|
|
156
|
-
});
|
|
153
|
+
const appMatches = computeRouteActivityMatches(pathname, { registry: app.registry });
|
|
157
154
|
for (const match of appMatches) {
|
|
158
155
|
if (seenPaths.has(match.path)) continue;
|
|
159
156
|
seenPaths.add(match.path);
|
|
@@ -794,7 +791,7 @@ function rerenderResolvedRoute(instance, pathname, href) {
|
|
|
794
791
|
}
|
|
795
792
|
function resolveAppRouteRequest(app, pathname, href, signal) {
|
|
796
793
|
return resolveRouteRequest(href, {
|
|
797
|
-
|
|
794
|
+
registry: app.registry,
|
|
798
795
|
auth: app.auth,
|
|
799
796
|
signal
|
|
800
797
|
});
|
|
@@ -477,10 +477,8 @@ function computeMatchesFromRouteRecords(pathname, routeRecords) {
|
|
|
477
477
|
namespace: bestMatch.record.options.namespace
|
|
478
478
|
}];
|
|
479
479
|
}
|
|
480
|
-
function computeRouteActivityMatches(pathname, options
|
|
481
|
-
|
|
482
|
-
if (options.routes) return computeMatchesFromRoutes(pathname, options.routes);
|
|
483
|
-
return computeMatchesFromRoutes(pathname, getActiveRoutes());
|
|
480
|
+
function computeRouteActivityMatches(pathname, options) {
|
|
481
|
+
return computeMatchesFromRouteRecords(pathname, options.registry.manifest.records);
|
|
484
482
|
}
|
|
485
483
|
function resolveRoute(pathname) {
|
|
486
484
|
const normalized = pathname.endsWith("/") && pathname !== "/" ? pathname.slice(0, -1) : pathname;
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as RenderableChild } from "../control-CMzFPMjr.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
|
|
3
|
-
import { A as RouteRecord, B as RouteSnapshot, C as RouteMetaSource, D as RoutePathParams, E as RouteParams, F as RouteRenderResult, I as RouteRequestOptions, L as RouteRequestResult, M as RouteRefSearch, N as RouteRegistry, O as RoutePolicy, P as RouteRegistryOptions, R as RouteSearch, S as RouteMeta, T as RouteOptions, _ as RouteDefinition, a as AccessRedirectDecision, b as RouteManifest, c as LayoutScopeRecord, d as ParsedSegment, f as Route, g as RouteContext, h as RouteComponent, i as AccessDenyStatus, j as RouteRef, k as RouteQuery, l as PageHelperOptions, m as RouteAuthResolver, n as AccessDecision, o as AccessRedirectStatus, p as RouteAuthOptions, r as AccessDenyDecision, s as GroupHelperOptions, t as AccessAllowDecision, u as PageScopeRecord, v as RouteDestination, w as RouteMode, x as RouteMatch, y as RouteHandler, z as RouteSearchValue } from "../router-
|
|
3
|
+
import { A as RouteRecord, B as RouteSnapshot, C as RouteMetaSource, D as RoutePathParams, E as RouteParams, F as RouteRenderResult, I as RouteRequestOptions, L as RouteRequestResult, M as RouteRefSearch, N as RouteRegistry, O as RoutePolicy, P as RouteRegistryOptions, R as RouteSearch, S as RouteMeta, T as RouteOptions, _ as RouteDefinition, a as AccessRedirectDecision, b as RouteManifest, c as LayoutScopeRecord, d as ParsedSegment, f as Route, g as RouteContext, h as RouteComponent, i as AccessDenyStatus, j as RouteRef, k as RouteQuery, l as PageHelperOptions, m as RouteAuthResolver, n as AccessDecision, o as AccessRedirectStatus, p as RouteAuthOptions, r as AccessDenyDecision, s as GroupHelperOptions, t as AccessAllowDecision, u as PageScopeRecord, v as RouteDestination, w as RouteMode, x as RouteMatch, y as RouteHandler, z as RouteSearchValue } from "../router-4EhVGcma.js";
|
|
4
4
|
import { a as RouteQueryUpdates, c as NavigateOptions, d as ScrollRestorationOptions, i as RouteQueryUpdater, l as HistoryScrollBehavior, n as RouteQueryParamInput, o as UpdateRouteQueryOptions, r as RouteQueryParamValue, s as updateRouteQuery, t as navigate, u as NavigationScrollBehavior } from "../navigate-BVDCzOuB.js";
|
|
5
5
|
import { AuthContext, AuthContext as AuthContext$1, AuthRequirement, AuthRequirement as AuthRequirement$1 } from "@askrjs/auth";
|
|
6
6
|
import { ObjectSchema } from "@askrjs/schema";
|
|
@@ -32,7 +32,7 @@ declare function currentRoute<TParams extends RouteParams = RouteParams>(): Rout
|
|
|
32
32
|
declare function currentAuth(): AuthContext$1;
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/router/resolution.d.ts
|
|
35
|
-
declare function resolveRouteRequest(target: string, options
|
|
35
|
+
declare function resolveRouteRequest(target: string, options: RouteRequestOptions): RouteRequestResult | Promise<RouteRequestResult>;
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/router/manifest.d.ts
|
|
38
38
|
declare function createRouteRegistry(definition: RouteDefinition, options?: RouteRegistryOptions): RouteRegistry;
|
package/dist/router/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as lazy, a as resolveDeferredValues, b as Outlet,
|
|
1
|
+
import { C as lazy, a as resolveDeferredValues, b as Outlet, i as isDeferred, l as createRouteRegistry, m as resolveRouteRequest, n as Resolve, r as defer, s as routeData, y as currentAuth } from "../deferred-Eh9bCVGH.js";
|
|
2
2
|
import { jsx } from "../jsx-runtime.js";
|
|
3
|
-
import { a as route, i as page, n as group, r as index, t as fallback } from "../authoring-
|
|
4
|
-
import { a as resolveRouteMeta, i as reconcileRouteMeta, n as navigate, o as serializeRouteMeta, r as updateRouteQuery, u as currentRoute } from "../navigate-
|
|
3
|
+
import { a as route, i as page, n as group, r as index, t as fallback } from "../authoring-Di8MInO-.js";
|
|
4
|
+
import { a as resolveRouteMeta, i as reconcileRouteMeta, n as navigate, o as serializeRouteMeta, r as updateRouteQuery, u as currentRoute } from "../navigate-QMRcR581.js";
|
|
5
5
|
import { o as mergeProps } from "../compose-ref-Cc_YkUpM.js";
|
|
6
6
|
import { t as applyInteractionPolicy } from "../interactions-w7gQN4ha.js";
|
|
7
7
|
//#region src/router/policy.ts
|
|
@@ -154,7 +154,8 @@ interface RouteRegistryOptions {
|
|
|
154
154
|
}
|
|
155
155
|
type RouteDefinition = () => void;
|
|
156
156
|
interface RouteRequestOptions {
|
|
157
|
-
|
|
157
|
+
/** Explicit route source shared by the application renderers. */
|
|
158
|
+
registry: RouteRegistry;
|
|
158
159
|
mode?: RouteMode;
|
|
159
160
|
/** @internal Hydration adopts server loader data instead of rerunning it. */
|
|
160
161
|
load?: boolean;
|
|
@@ -226,6 +227,7 @@ interface RouteManifest {
|
|
|
226
227
|
records: RouteRecord[];
|
|
227
228
|
auth?: RouteAuthOptions;
|
|
228
229
|
}
|
|
230
|
+
declare const routeRegistryBrand: unique symbol;
|
|
229
231
|
interface RouteHandler<TParams extends RouteParams = RouteParams> {
|
|
230
232
|
(params: TParams, context?: {
|
|
231
233
|
signal: AbortSignal;
|
|
@@ -237,6 +239,8 @@ interface Route<TParams extends RouteParams = RouteParams> {
|
|
|
237
239
|
namespace?: string;
|
|
238
240
|
}
|
|
239
241
|
interface RouteRegistry {
|
|
242
|
+
/** Internal brand: registries must come from createRouteRegistry(). */
|
|
243
|
+
readonly [routeRegistryBrand]: true;
|
|
240
244
|
manifest: RouteManifest;
|
|
241
245
|
routes: readonly Route[];
|
|
242
246
|
}
|
package/dist/ssg/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as DocumentRenderContext, f as DocumentRenderer, u as DocumentRenderArgs } from "../control-CMzFPMjr.js";
|
|
2
|
-
import { D as RoutePathParams, N as RouteRegistry, O as RoutePolicy, T as RouteOptions, y as RouteHandler } from "../router-
|
|
2
|
+
import { D as RoutePathParams, N as RouteRegistry, O as RoutePolicy, T as RouteOptions, y as RouteHandler } from "../router-4EhVGcma.js";
|
|
3
3
|
import { AuthRequirement } from "@askrjs/auth";
|
|
4
4
|
//#region src/ssg/types.d.ts
|
|
5
5
|
type SSGMode = 'full' | 'incremental';
|
package/dist/ssg/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../access-ePqdQqkV.js";
|
|
2
|
-
import { S as getRenderHandler, a as resolveDeferredValues, l as createRouteRegistry, u as bindResolvedRouteData } from "../deferred-
|
|
3
|
-
import { a as route } from "../authoring-
|
|
2
|
+
import { S as getRenderHandler, a as resolveDeferredValues, l as createRouteRegistry, u as bindResolvedRouteData } from "../deferred-Eh9bCVGH.js";
|
|
3
|
+
import { a as route } from "../authoring-Di8MInO-.js";
|
|
4
4
|
import { n as renderDocument } from "../ssr-CbQO5xd3.js";
|
|
5
|
-
import { n as renderToString } from "../ssr-
|
|
5
|
+
import { n as renderToString } from "../ssr-Y8Pq8riM.js";
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
7
7
|
import * as pathModule from "node:path";
|
|
8
8
|
import * as os from "node:os";
|
package/dist/ssr/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as RenderableChild, d as DocumentRenderContext, f as DocumentRenderer, p as SSRData, u as DocumentRenderArgs } from "../control-CMzFPMjr.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
|
|
3
3
|
import { D as QueryPrefetchContext, n as ServerQueryRegistry, u as CoreTelemetry, v as DataRuntime } from "../index-Bki2rqcr.js";
|
|
4
|
-
import { A as RouteRecord, L as RouteRequestResult, N as RouteRegistry, a as AccessRedirectDecision, f as Route, p as RouteAuthOptions, r as AccessDenyDecision, y as RouteHandler } from "../router-
|
|
4
|
+
import { A as RouteRecord, L as RouteRequestResult, N as RouteRegistry, a as AccessRedirectDecision, f as Route, p as RouteAuthOptions, r as AccessDenyDecision, y as RouteHandler } from "../router-4EhVGcma.js";
|
|
5
5
|
import { AuthContext } from "@askrjs/auth";
|
|
6
6
|
|
|
7
7
|
//#region src/common/page-render-envelope.d.ts
|
package/dist/ssr/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { u as SSRDataMissingError } from "../render-context-Clw3rFiO.js";
|
|
2
|
-
import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-
|
|
2
|
+
import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-Y8Pq8riM.js";
|
|
3
3
|
export { SSRDataMissingError, createRenderContext, getRenderContext, renderResolvedToStringSync, renderRouteRequest, renderRouteRequestToString, renderToStream, renderToString, renderToStringSync, resolveRequest, withRenderContext, withRenderContextAsync };
|
|
@@ -6,15 +6,15 @@ import { c as callWithContext, d as getExecutionContextFrame, f as getVNodeConte
|
|
|
6
6
|
import { f as getCurrentComponentInstance, w as setCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
|
|
7
7
|
import { h as cleanupComponent, m as isPromiseLike } from "./component-lifecycle-DEMPihoZ.js";
|
|
8
8
|
import { g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, o as rollbackForStateTransaction, r as commitForStateTransaction } from "./for-internal-B2rBq6yB.js";
|
|
9
|
-
import { _ as
|
|
9
|
+
import { _ as isPageRenderEnvelope, g as isEmptyPageRenderEnvelope, h as createPageRenderEnvelope, i as isDeferred, l as createRouteRegistry, m as resolveRouteRequest, t as DEFERRED_BOUNDARY } from "./deferred-Eh9bCVGH.js";
|
|
10
10
|
import { c as stopRenderPhase$1, o as startRenderPhase$1, t as configureRenderContextProvider, u as SSRDataMissingError } from "./render-context-Clw3rFiO.js";
|
|
11
11
|
import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-D2tPWNrC.js";
|
|
12
12
|
import { t as getPublicAttributeName } from "./attr-names-CjhzmHOn.js";
|
|
13
13
|
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-C-8E85El.js";
|
|
14
14
|
import { t as createDataRuntime } from "./data-runtime-SJ1BSUvk.js";
|
|
15
15
|
import { c as withTelemetry, i as dehydrateDataRuntime, t as createQueryPrefetchContext } from "./query-registry-CQIT4mXr.js";
|
|
16
|
-
import { a as resolveRouteFromRoutes, t as _resolveRouteMatchFromRoutes } from "./route-matching-
|
|
17
|
-
import { a as route } from "./authoring-
|
|
16
|
+
import { a as resolveRouteFromRoutes, t as _resolveRouteMatchFromRoutes } from "./route-matching-DLBWDeXX.js";
|
|
17
|
+
import { a as route } from "./authoring-Di8MInO-.js";
|
|
18
18
|
import { n as renderDocument, t as SSR_RENDER_DATA_ATTR } from "./ssr-CbQO5xd3.js";
|
|
19
19
|
//#region src/ssr/escape.ts
|
|
20
20
|
/**
|
|
@@ -359,23 +359,14 @@ function routeHasSSRLoader(manifest, route) {
|
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
361
|
function resolvePolicyAwareSSRRoute(opts, routeTable) {
|
|
362
|
-
const manifest = opts.registry
|
|
363
|
-
if (!manifest) {
|
|
364
|
-
const matched = _resolveRouteMatchFromRoutes(new URL(opts.url, "http://localhost").pathname, routeTable);
|
|
365
|
-
if (!matched) throw new Error(`SSR: no route found for url: ${opts.url}`);
|
|
366
|
-
return {
|
|
367
|
-
url: opts.url,
|
|
368
|
-
route: matched.route,
|
|
369
|
-
params: matched.params
|
|
370
|
-
};
|
|
371
|
-
}
|
|
362
|
+
const manifest = opts.registry.manifest;
|
|
372
363
|
let href = opts.url;
|
|
373
364
|
const visited = /* @__PURE__ */ new Set();
|
|
374
365
|
for (let redirects = 0; redirects <= MAX_SSR_REDIRECTS; redirects += 1) {
|
|
375
366
|
const matched = _resolveRouteMatchFromRoutes(new URL(href, "http://localhost").pathname, routeTable);
|
|
376
367
|
if (!matched) throw new Error(`SSR: no route found for url: ${href}`);
|
|
377
368
|
const resolved = getRouteRequestResultSync(resolveRouteRequest(href, {
|
|
378
|
-
|
|
369
|
+
registry: opts.registry,
|
|
379
370
|
mode: "ssr"
|
|
380
371
|
}));
|
|
381
372
|
if (resolved === null) throw new Error(`SSR: no route found for url: ${href}`);
|
|
@@ -493,7 +484,7 @@ async function resolveRequest(opts) {
|
|
|
493
484
|
if (!opts?.registry) throw new TypeError("resolveRequest requires opts.registry.");
|
|
494
485
|
const { url, auth, authContext, request, signal } = opts;
|
|
495
486
|
return await resolveRouteRequest(url, {
|
|
496
|
-
|
|
487
|
+
registry: opts.registry,
|
|
497
488
|
mode: "ssr",
|
|
498
489
|
auth,
|
|
499
490
|
authContext,
|
|
@@ -1390,7 +1381,7 @@ async function renderRouteRequestInternal(options) {
|
|
|
1390
1381
|
});
|
|
1391
1382
|
return withTelemetry(options.telemetry?.ssrRender, {}, () => withRenderContextAsync(context, async () => {
|
|
1392
1383
|
const resolved = await resolveRouteRequest(options.url, {
|
|
1393
|
-
|
|
1384
|
+
registry: options.registry,
|
|
1394
1385
|
mode: "ssr",
|
|
1395
1386
|
auth: options.auth ?? manifest.auth,
|
|
1396
1387
|
authContext: options.authContext,
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as Query, k as QueryStaleReason } from "../index-Bki2rqcr.js";
|
|
2
|
-
import { N as RouteRegistry, x as RouteMatch } from "../router-
|
|
2
|
+
import { N as RouteRegistry, x as RouteMatch } from "../router-4EhVGcma.js";
|
|
3
3
|
|
|
4
4
|
//#region src/testing/index.d.ts
|
|
5
5
|
type MockRefresh = () => void | Promise<void>;
|
package/dist/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as addInvalidationListener } from "../invalidation-listeners-Des3AHYs.js";
|
|
2
|
-
import { r as computeRouteActivityMatches } from "../route-matching-
|
|
2
|
+
import { r as computeRouteActivityMatches } from "../route-matching-DLBWDeXX.js";
|
|
3
3
|
//#region src/testing/index.ts
|
|
4
4
|
function normalizeRefresh(options) {
|
|
5
5
|
return async () => {
|
|
@@ -116,7 +116,7 @@ function createInvalidationRecorder() {
|
|
|
116
116
|
}
|
|
117
117
|
function matchRoute(path, options) {
|
|
118
118
|
if (!options?.registry) throw new TypeError("matchRoute requires options.registry.");
|
|
119
|
-
return computeRouteActivityMatches(path, {
|
|
119
|
+
return computeRouteActivityMatches(path, { registry: options.registry })[0] ?? null;
|
|
120
120
|
}
|
|
121
121
|
function getRoutePatternRecords(options) {
|
|
122
122
|
if (!options?.registry) throw new TypeError("getRouteWarnings requires options.registry.");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as SSR_RENDER_DATA_ATTR } from "./ssr-CbQO5xd3.js";
|
|
2
|
-
import { a as renderResolvedToStringSync } from "./ssr-
|
|
2
|
+
import { a as renderResolvedToStringSync } from "./ssr-Y8Pq8riM.js";
|
|
3
3
|
//#region src/ssr/verify-hydration.ts
|
|
4
4
|
function normalizeHydrationHtml(html) {
|
|
5
5
|
const template = document.createElement("template");
|