@askrjs/askr 0.0.84 → 0.0.85
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 +1 -1
- package/dist/{activity-pySy9t7Y.d.ts → activity-B1I5HJQI.d.ts} +1 -1
- package/dist/{activity-CZiPgZy0.js → activity-Jd9CgEa3.js} +52 -15
- package/dist/{authoring-DQPG0VAm.js → authoring-DdQ3pHqt.js} +6 -3
- 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-DWe880Et.js} +16 -15
- 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 +1 -1
- package/dist/{data-BRS5woEh.js → data-Dkqb8_QP.js} +3 -3
- package/dist/{deferred-oqtAJ4iH.js → deferred-vUOy-awa.js} +198 -16
- 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 +2 -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 +3 -3
- package/dist/fx/index.js +1 -1
- package/dist/{index-BApH3laU.d.ts → index-Bkh9S9-t.d.ts} +6 -2
- 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 +10 -10
- 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/{navigate-CgVIrrSs.d.ts → navigate-NyIjQUwI.d.ts} +1 -1
- package/dist/{navigate-Dr3cjOSz.js → navigate-b4GGxO_l.js} +15 -14
- package/dist/{portal-pHBoqwYd.js → portal-BVWjAhNQ.js} +5 -5
- package/dist/{readable-_GQGe_St.js → readable-B5NtV7V0.js} +1 -1
- package/dist/{renderer-B9j5IV1q.js → renderer-CZzNtoj2.js} +57 -16
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +5 -5
- package/dist/{route-matching-IfQZmqkN.js → route-matching-DHduNiGk.js} +49 -6
- package/dist/router/index.d.ts +7 -7
- package/dist/router/index.js +9 -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 +30 -15
- package/dist/ssr/index.d.ts +7 -3
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-CtC4lChT.js → ssr-CpiBHMNv.js} +29 -18
- package/dist/ssr-DSHd_Q9K.js +25 -0
- package/dist/{state-BzIMC6-i.js → state-DCjONcHK.js} +4 -3
- package/dist/{structures-D3vO-WMN.js → structures-DSLF_iis.js} +4 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/{verify-hydration-BguOSco9.js → verify-hydration-C3QBBQqR.js} +2 -2
- package/package.json +1 -1
- package/dist/ssr-CbQO5xd3.js +0 -12
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
2
|
-
import { g as readScope, u as defineScope } from "./component-internal-Bw4Mf9fd.js";
|
|
3
1
|
import { d as getCurrentAppRenderRuntime } from "./component-scope-DzJEbYGE.js";
|
|
4
|
-
import {
|
|
2
|
+
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
3
|
+
import { g as readScope, u as defineScope } from "./component-internal-DcrLymUJ.js";
|
|
4
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Dfpid9-A.js";
|
|
5
5
|
import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render-context-D-DFk2WN.js";
|
|
6
|
-
import { A as
|
|
7
|
-
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-
|
|
6
|
+
import { A as getDefaultRouteBasePath, B as setDefaultRouteBasePath, F as insertRecordSorted, G as resource, M as getRouteRecords, R as restoreRouteState, V as snapshotRouteState, _ as clearRouteState, c as removeRouteBasePath, h as addRouteToStores, i as getMatchingRouteRecord, j as getRouteList, k as getDefaultRouteAuthOptions, l as buildRouteContext, o as addRouteBasePath, s as normalizeRouteBasePath, u as buildRouteContextBase, v as getActiveRouteAuthOptions, z as setDefaultRouteAuthOptions } from "./route-matching-DHduNiGk.js";
|
|
7
|
+
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-Bc52OIVc.js";
|
|
8
8
|
import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-BL6rjGsO.js";
|
|
9
9
|
//#region src/runtime/execution-model.ts
|
|
10
10
|
const EXECUTION_MODEL_KEY = Symbol.for("__ASKR_EXECUTION_MODEL__");
|
|
@@ -173,10 +173,168 @@ function replacePageRoute(value, route) {
|
|
|
173
173
|
framework: current.framework
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
+
function withPageFramework(value, framework) {
|
|
177
|
+
const current = pageRenderEnvelope(value);
|
|
178
|
+
return createPageRenderEnvelope({
|
|
179
|
+
resources: current.resources,
|
|
180
|
+
route: current.route,
|
|
181
|
+
framework
|
|
182
|
+
});
|
|
183
|
+
}
|
|
176
184
|
function isEmptyPageRenderEnvelope(value) {
|
|
177
185
|
return value.route === void 0 && Object.keys(value.resources).length === 0 && Object.keys(value.framework).length === 0;
|
|
178
186
|
}
|
|
179
187
|
//#endregion
|
|
188
|
+
//#region src/router/route-hydration.ts
|
|
189
|
+
const DEFERRED_VALUE$1 = Symbol.for("@askrjs/askr/deferred-value");
|
|
190
|
+
function isDeferredHydrationValue(value) {
|
|
191
|
+
if (!value || typeof value !== "object") return false;
|
|
192
|
+
const marker = Object.getOwnPropertyDescriptor(value, DEFERRED_VALUE$1);
|
|
193
|
+
return Boolean(marker && "value" in marker && marker.value === true);
|
|
194
|
+
}
|
|
195
|
+
const omissionGuards = /* @__PURE__ */ new WeakMap();
|
|
196
|
+
function propertyPath(parent, key) {
|
|
197
|
+
if (/^(?:0|[1-9]\d*)$/.test(key)) return `${parent}[${key}]`;
|
|
198
|
+
if (/^[A-Za-z_$][\w$]*$/.test(key)) return `${parent}.${key}`;
|
|
199
|
+
return `${parent}[${JSON.stringify(key)}]`;
|
|
200
|
+
}
|
|
201
|
+
function invalid(route, path, reason) {
|
|
202
|
+
throw new TypeError(`[Askr] Route hydration data for "${route}" at "${path}" is not JSON transport-safe: ${reason}. Return JSON-compatible data or use route(..., { dehydrate(data) { ... } }) to omit server-only values.`);
|
|
203
|
+
}
|
|
204
|
+
function objectLabel(value) {
|
|
205
|
+
if (value instanceof Date) return "Date";
|
|
206
|
+
if (value instanceof Map) return "Map";
|
|
207
|
+
if (value instanceof Set) return "Set";
|
|
208
|
+
const constructor = value.constructor;
|
|
209
|
+
return typeof constructor === "function" && constructor.name ? constructor.name : "class instance";
|
|
210
|
+
}
|
|
211
|
+
/** Validate the exact value that will enter the route hydration envelope. */
|
|
212
|
+
function validateRouteHydrationData(value, route, path = "$", ancestors = /* @__PURE__ */ new Set()) {
|
|
213
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return;
|
|
214
|
+
if (typeof value === "number") {
|
|
215
|
+
if (!Number.isFinite(value)) invalid(route, path, "non-finite numbers are not supported");
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (typeof value === "undefined") invalid(route, path, "undefined is not supported");
|
|
219
|
+
if (typeof value === "bigint") invalid(route, path, "bigint is not supported");
|
|
220
|
+
if (typeof value === "symbol") invalid(route, path, "symbols are not supported");
|
|
221
|
+
if (typeof value === "function") invalid(route, path, "functions are not supported");
|
|
222
|
+
const object = value;
|
|
223
|
+
if (isDeferredHydrationValue(object)) {
|
|
224
|
+
if (object.state === "fulfilled") validateRouteHydrationData(object.value, route, `${path}.value`, ancestors);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (ancestors.has(object)) invalid(route, path, "cyclic references are not supported");
|
|
228
|
+
ancestors.add(object);
|
|
229
|
+
try {
|
|
230
|
+
if (Array.isArray(object)) {
|
|
231
|
+
for (let index = 0; index < object.length; index += 1) if (!Object.prototype.hasOwnProperty.call(object, index)) invalid(route, `${path}[${index}]`, "sparse arrays are not supported");
|
|
232
|
+
for (const key of Reflect.ownKeys(object)) {
|
|
233
|
+
if (key === "length") continue;
|
|
234
|
+
if (typeof key === "symbol") invalid(route, path, "symbol-keyed properties are not supported");
|
|
235
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
236
|
+
if (!descriptor.enumerable) invalid(route, propertyPath(path, key), "non-enumerable properties are not supported");
|
|
237
|
+
if (!("value" in descriptor)) invalid(route, propertyPath(path, key), "accessors are not supported");
|
|
238
|
+
if (!/^(?:0|[1-9]\d*)$/.test(key) || Number(key) >= object.length) invalid(route, propertyPath(path, key), "named array properties are not supported");
|
|
239
|
+
validateRouteHydrationData(descriptor.value, route, propertyPath(path, key), ancestors);
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const prototype = Object.getPrototypeOf(object);
|
|
244
|
+
if (prototype !== Object.prototype && prototype !== null) invalid(route, path, `${objectLabel(object)} instances are not supported; use a plain object`);
|
|
245
|
+
for (const key of Reflect.ownKeys(object)) {
|
|
246
|
+
if (typeof key === "symbol") invalid(route, path, "symbol-keyed properties are not supported");
|
|
247
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
248
|
+
const childPath = propertyPath(path, key);
|
|
249
|
+
if (!descriptor.enumerable) invalid(route, childPath, "non-enumerable properties are not supported");
|
|
250
|
+
if (!("value" in descriptor)) invalid(route, childPath, "accessors are not supported");
|
|
251
|
+
validateRouteHydrationData(descriptor.value, route, childPath, ancestors);
|
|
252
|
+
}
|
|
253
|
+
} finally {
|
|
254
|
+
ancestors.delete(object);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function omissionMap(complete, selected, ancestors = /* @__PURE__ */ new Set()) {
|
|
258
|
+
if (!complete || typeof complete !== "object" || isDeferredHydrationValue(complete)) return void 0;
|
|
259
|
+
if (ancestors.has(complete)) return void 0;
|
|
260
|
+
ancestors.add(complete);
|
|
261
|
+
const selectedObject = selected && typeof selected === "object" ? selected : void 0;
|
|
262
|
+
const output = Object.create(null);
|
|
263
|
+
try {
|
|
264
|
+
for (const key of Object.keys(complete)) {
|
|
265
|
+
if (!selectedObject || !Object.prototype.hasOwnProperty.call(selectedObject, key)) {
|
|
266
|
+
output[key] = 1;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
const completeDescriptor = Object.getOwnPropertyDescriptor(complete, key);
|
|
270
|
+
const selectedDescriptor = Object.getOwnPropertyDescriptor(selectedObject, key);
|
|
271
|
+
if (!completeDescriptor || !selectedDescriptor) continue;
|
|
272
|
+
if (!("value" in completeDescriptor) || !("value" in selectedDescriptor)) continue;
|
|
273
|
+
const nested = omissionMap(completeDescriptor.value, selectedDescriptor.value, ancestors);
|
|
274
|
+
if (nested) output[key] = nested;
|
|
275
|
+
}
|
|
276
|
+
} finally {
|
|
277
|
+
ancestors.delete(complete);
|
|
278
|
+
}
|
|
279
|
+
return Object.keys(output).length > 0 ? Object.freeze(output) : void 0;
|
|
280
|
+
}
|
|
281
|
+
function prepareRouteHydrationData(complete, dehydrate, context, route = context.href || context.pathname) {
|
|
282
|
+
const selected = dehydrate ? dehydrate(complete, context) : complete;
|
|
283
|
+
if (isPromiseLike(selected)) throw new TypeError(`[Askr] Route dehydrate() for "${route}" returned a Promise. dehydrate(data, context) must be synchronous.`);
|
|
284
|
+
validateRouteHydrationData(selected, route);
|
|
285
|
+
return {
|
|
286
|
+
data: selected,
|
|
287
|
+
metadata: Object.freeze({
|
|
288
|
+
r: route,
|
|
289
|
+
...dehydrate ? { o: omissionMap(complete, selected) } : {}
|
|
290
|
+
})
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function readMetadata(framework) {
|
|
294
|
+
const value = framework["rh"];
|
|
295
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
296
|
+
const metadata = value;
|
|
297
|
+
return typeof metadata.r === "string" ? metadata : void 0;
|
|
298
|
+
}
|
|
299
|
+
function omittedRead(route, path) {
|
|
300
|
+
throw new Error(`[Askr] routeData() read "${path}" on the initial hydration of "${route}", but that branch was intentionally omitted by dehydrate(). Keep initial hydrated rendering within the selected data, or wait for a client navigation that reruns the loader with the complete result.`);
|
|
301
|
+
}
|
|
302
|
+
function guardOmissions(value, omissions, route, path = "$") {
|
|
303
|
+
if (!omissions || !value || typeof value !== "object" || isDeferredHydrationValue(value)) return value;
|
|
304
|
+
let guards = omissionGuards.get(value);
|
|
305
|
+
if (!guards) {
|
|
306
|
+
guards = /* @__PURE__ */ new WeakMap();
|
|
307
|
+
omissionGuards.set(value, guards);
|
|
308
|
+
}
|
|
309
|
+
const cached = guards.get(omissions);
|
|
310
|
+
if (cached) return cached;
|
|
311
|
+
const guarded = new Proxy(value, { get(target, property, receiver) {
|
|
312
|
+
if (typeof property === "string") {
|
|
313
|
+
const omitted = omissions[property];
|
|
314
|
+
if (omitted && !Object.prototype.hasOwnProperty.call(target, property)) omittedRead(route, propertyPath(path, property));
|
|
315
|
+
const child = Reflect.get(target, property, receiver);
|
|
316
|
+
return omitted === 1 ? child : guardOmissions(child, omitted, route, propertyPath(path, property));
|
|
317
|
+
}
|
|
318
|
+
return Reflect.get(target, property, receiver);
|
|
319
|
+
} });
|
|
320
|
+
guards.set(omissions, guarded);
|
|
321
|
+
return guarded;
|
|
322
|
+
}
|
|
323
|
+
function guardHydratedRouteData(value, framework) {
|
|
324
|
+
const metadata = readMetadata(framework);
|
|
325
|
+
return metadata ? guardOmissions(value, metadata.o, metadata.r) : value;
|
|
326
|
+
}
|
|
327
|
+
function getRouteHydrationMetadata(framework) {
|
|
328
|
+
return readMetadata(framework);
|
|
329
|
+
}
|
|
330
|
+
/** @internal Remove initial-only omission guards after a client loader reruns. */
|
|
331
|
+
function withoutRouteHydrationMetadata(framework) {
|
|
332
|
+
if (!framework || !("rh" in framework)) return framework;
|
|
333
|
+
const next = { ...framework };
|
|
334
|
+
delete next["rh"];
|
|
335
|
+
return next;
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
180
338
|
//#region src/router/resolution.ts
|
|
181
339
|
const anonymous = () => ({
|
|
182
340
|
authenticated: false,
|
|
@@ -208,14 +366,21 @@ function createRouteRenderResult(record, params, context, handler) {
|
|
|
208
366
|
function getDefaultRouteMode() {
|
|
209
367
|
return typeof window !== "undefined" ? "spa" : "ssr";
|
|
210
368
|
}
|
|
369
|
+
function withoutInitialRouteHydrationMetadata(envelope) {
|
|
370
|
+
return withPageFramework(envelope, withoutRouteHydrationMetadata(envelope.framework) ?? {});
|
|
371
|
+
}
|
|
211
372
|
/** @internal Bind resolved loader output to one route subtree and its hydration envelope. */
|
|
212
|
-
function bindResolvedRouteData(handler, data) {
|
|
373
|
+
function bindResolvedRouteData(handler, data, hydration) {
|
|
213
374
|
return (params, context) => {
|
|
214
375
|
const renderContext = getActiveRenderContext();
|
|
215
376
|
if (renderContext) {
|
|
216
377
|
const envelope = replacePageRoute(renderContext.renderData, data);
|
|
217
|
-
renderContext.renderData = envelope;
|
|
218
|
-
renderContext.hydrationData
|
|
378
|
+
renderContext.renderData = hydration ? envelope : withoutInitialRouteHydrationMetadata(envelope);
|
|
379
|
+
const hydrationEnvelope = replacePageRoute(renderContext.hydrationData, hydration?.data ?? data);
|
|
380
|
+
renderContext.hydrationData = hydration ? withPageFramework(hydrationEnvelope, {
|
|
381
|
+
...hydrationEnvelope.framework,
|
|
382
|
+
["rh"]: hydration.metadata
|
|
383
|
+
}) : withoutInitialRouteHydrationMetadata(hydrationEnvelope);
|
|
219
384
|
}
|
|
220
385
|
return handler(params, context);
|
|
221
386
|
};
|
|
@@ -254,7 +419,12 @@ function buildLoadedRenderResult(record, params, context, request, telemetry, lo
|
|
|
254
419
|
}));
|
|
255
420
|
const loaded = runPreload ? runPreload.then(load) : load();
|
|
256
421
|
const finalize = (data) => {
|
|
257
|
-
const
|
|
422
|
+
const hydration = context.mode === "ssr" ? prepareRouteHydrationData(data, record.options?.dehydrate, {
|
|
423
|
+
...context,
|
|
424
|
+
params,
|
|
425
|
+
request
|
|
426
|
+
}, context.href || context.pathname || record.path) : void 0;
|
|
427
|
+
const result = createRouteRenderResult(record, params, context, bindResolvedRouteData(renderHandler, data, hydration));
|
|
258
428
|
routeRenderData.set(result, data);
|
|
259
429
|
return result;
|
|
260
430
|
};
|
|
@@ -308,24 +478,33 @@ function resolveMatchedRoute(record, params, context, authOptions, request, tele
|
|
|
308
478
|
}
|
|
309
479
|
function resolveRouteRequest(target, options) {
|
|
310
480
|
if (!options?.registry) throw new TypeError("resolveRouteRequest requires options.registry.");
|
|
481
|
+
const basePath = normalizeRouteBasePath(options.registry.manifest.basePath);
|
|
482
|
+
const logicalTarget = removeRouteBasePath(target, basePath);
|
|
483
|
+
if (logicalTarget === void 0) return null;
|
|
311
484
|
return withTelemetry(options.telemetry?.routeMatch, {}, () => {
|
|
312
485
|
const records = options.registry.manifest.records;
|
|
313
|
-
const match = getMatchingRouteRecord(
|
|
486
|
+
const match = getMatchingRouteRecord(logicalTarget, records);
|
|
314
487
|
if (!match) return null;
|
|
315
488
|
const mode = options.mode ?? getDefaultRouteMode();
|
|
316
489
|
const signal = options.signal ?? getActiveRenderContext()?.signal ?? new AbortController().signal;
|
|
317
490
|
const authOptions = getActiveRouteAuthOptions(options.auth ?? options.registry.manifest.auth);
|
|
318
|
-
const base = buildRouteContextBase(
|
|
491
|
+
const base = buildRouteContextBase(logicalTarget, match.params, {
|
|
319
492
|
mode,
|
|
320
493
|
signal
|
|
321
494
|
});
|
|
495
|
+
const exposeRedirect = (result) => result?.kind === "redirect" ? {
|
|
496
|
+
...result,
|
|
497
|
+
to: addRouteBasePath(result.to, basePath)
|
|
498
|
+
} : result;
|
|
322
499
|
const finalize = (authContext) => {
|
|
323
500
|
setCurrentAuth(authContext);
|
|
324
|
-
|
|
501
|
+
const result = resolveMatchedRoute(match.record, match.params, buildRouteContext(logicalTarget, match.params, {
|
|
325
502
|
mode,
|
|
326
503
|
signal,
|
|
327
504
|
authContext
|
|
328
505
|
}), authOptions, options.request, options.telemetry, options.load !== false);
|
|
506
|
+
if (!basePath) return result;
|
|
507
|
+
return isPromiseLike(result) ? Promise.resolve(result).then(exposeRedirect) : exposeRedirect(result);
|
|
329
508
|
};
|
|
330
509
|
if (options.authContext) return finalize(options.authContext);
|
|
331
510
|
if (!authOptions?.resolve) return finalize(anonymous());
|
|
@@ -339,11 +518,13 @@ function createRouteManifest() {
|
|
|
339
518
|
const auth = getDefaultRouteAuthOptions();
|
|
340
519
|
return {
|
|
341
520
|
records: [...getRouteRecords()],
|
|
342
|
-
...auth ? { auth } : {}
|
|
521
|
+
...auth ? { auth } : {},
|
|
522
|
+
...getDefaultRouteBasePath() ? { basePath: getDefaultRouteBasePath() } : {}
|
|
343
523
|
};
|
|
344
524
|
}
|
|
345
525
|
function _applyManifest(manifest) {
|
|
346
526
|
setDefaultRouteAuthOptions(manifest.auth);
|
|
527
|
+
setDefaultRouteBasePath(normalizeRouteBasePath(manifest.basePath));
|
|
347
528
|
for (const record of manifest.records) {
|
|
348
529
|
insertRecordSorted(record);
|
|
349
530
|
addRouteToStores({
|
|
@@ -359,6 +540,7 @@ function createRouteRegistry(definition, options = {}) {
|
|
|
359
540
|
clearRouteState();
|
|
360
541
|
try {
|
|
361
542
|
setDefaultRouteAuthOptions(options.auth);
|
|
543
|
+
setDefaultRouteBasePath(normalizeRouteBasePath(options.basePath));
|
|
362
544
|
definition();
|
|
363
545
|
const manifest = createRouteManifest();
|
|
364
546
|
return Object.freeze({
|
|
@@ -465,10 +647,10 @@ async function resolveDeferredValues(input, signal) {
|
|
|
465
647
|
}
|
|
466
648
|
function routeData() {
|
|
467
649
|
const envelope = getCurrentRenderData();
|
|
468
|
-
if (envelope) return envelope.route;
|
|
650
|
+
if (envelope) return guardHydratedRouteData(envelope.route, envelope.framework);
|
|
469
651
|
const runtime = getCurrentAppRenderRuntime();
|
|
470
652
|
if (!runtime?.hasRoute) throw new Error("routeData() can only be read while rendering a route with loader data.");
|
|
471
|
-
return runtime.route;
|
|
653
|
+
return guardHydratedRouteData(runtime.route, runtime.framework);
|
|
472
654
|
}
|
|
473
655
|
function rejectedChild(props, error) {
|
|
474
656
|
return typeof props.rejected === "function" ? props.rejected(error) : props.rejected ?? null;
|
|
@@ -499,4 +681,4 @@ function Resolve(props) {
|
|
|
499
681
|
return props.children(result.value);
|
|
500
682
|
}
|
|
501
683
|
//#endregion
|
|
502
|
-
export {
|
|
684
|
+
export { getExecutionModel as A, currentAuth as C, _preloadRouteHandler as D, getRenderHandler as E, lazy as O, pageRenderEnvelope as S, createRouteHandler as T, validateRouteHydrationData as _, resolveDeferredValues as a, isEmptyPageRenderEnvelope as b, _applyManifest as c, getRouteRenderContext as d, getRouteRenderData as f, prepareRouteHydrationData as g, getRouteHydrationMetadata as h, isDeferred as i, assertExecutionModel as k, 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, withoutRouteHydrationMetadata as v, Outlet as w, isPageRenderEnvelope as x, createPageRenderEnvelope as y };
|
|
@@ -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 { _ as
|
|
2
|
+
import { _ as Portal, c as Presence, d as SlotProps, g as DefaultPortal, h as layout, l as PresenceProps, m as LayoutComponent, u as Slot, v as PortalProps, y as definePortal } from "../index-Bkh9S9-t.js";
|
|
3
3
|
export { DefaultPortal, type JSXElement, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, definePortal, layout };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as layout, i as Slot, r as Presence } from "../structures-
|
|
2
|
-
import { i as definePortal, n as Portal, t as DefaultPortal } from "../portal-
|
|
1
|
+
import { a as layout, i as Slot, r as Presence } from "../structures-DSLF_iis.js";
|
|
2
|
+
import { i as definePortal, n as Portal, t as DefaultPortal } from "../portal-BVWjAhNQ.js";
|
|
3
3
|
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 Portal, a as Collection, c as Presence, d as SlotProps, f as cloneElement, g as DefaultPortal, h as layout, i as createLayer, l as PresenceProps, m as LayoutComponent, n as LayerManager, o as CollectionItem, p as isElement, r as LayerOptions, s as createCollection, t as Layer, u as Slot, v as PortalProps, y as definePortal } from "../../index-Bkh9S9-t.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,3 @@
|
|
|
1
|
-
import { a as layout, i as Slot, n as createCollection, r as Presence, t as createLayer } from "../../structures-
|
|
2
|
-
import { i as definePortal, n as Portal, t as DefaultPortal } from "../../portal-
|
|
3
|
-
export { DefaultPortal, Portal, Presence, Slot, createCollection, createLayer, definePortal, layout };
|
|
1
|
+
import { a as layout, i as Slot, n as createCollection, o as cloneElement, r as Presence, s as isElement, t as createLayer } from "../../structures-DSLF_iis.js";
|
|
2
|
+
import { i as definePortal, n as Portal, t as DefaultPortal } from "../../portal-BVWjAhNQ.js";
|
|
3
|
+
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,4 +1,4 @@
|
|
|
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
4
|
//#region src/runtime/portal.d.ts
|
|
@@ -44,6 +44,10 @@ type LayoutComponent<P = object> = (props: P & {
|
|
|
44
44
|
}) => unknown;
|
|
45
45
|
declare function layout<P = object>(Layout: LayoutComponent<P>): (children?: RenderableChild, props?: P) => unknown;
|
|
46
46
|
//#endregion
|
|
47
|
+
//#region src/jsx/utils.d.ts
|
|
48
|
+
declare function isElement(value: unknown): value is JSXElement;
|
|
49
|
+
declare function cloneElement(element: JSXElement, props: Record<string, unknown>): JSXElement;
|
|
50
|
+
//#endregion
|
|
47
51
|
//#region src/foundations/structures/slot.d.ts
|
|
48
52
|
type SlotProps = {
|
|
49
53
|
asChild: true;
|
|
@@ -276,4 +280,4 @@ declare function createLayer(): LayerManager;
|
|
|
276
280
|
* }
|
|
277
281
|
*/
|
|
278
282
|
//#endregion
|
|
279
|
-
export {
|
|
283
|
+
export { Portal as _, Collection as a, Presence as c, SlotProps as d, cloneElement as f, DefaultPortal as g, layout as h, createLayer as i, PresenceProps as l, LayoutComponent as m, LayerManager as n, CollectionItem as o, isElement as p, LayerOptions as r, createCollection as s, Layer as t, Slot as u, PortalProps as v, definePortal 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,17 +1,17 @@
|
|
|
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-
|
|
7
|
+
import { t as installRendererBridge } from "./renderer-CZzNtoj2.js";
|
|
8
8
|
import { a as registerSSRStyle } from "./render-context-D-DFk2WN.js";
|
|
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-
|
|
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-
|
|
14
|
+
import { t as createQuery } from "./data-Dkqb8_QP.js";
|
|
15
15
|
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-BL6rjGsO.js";
|
|
16
16
|
//#region src/runtime/derive.ts
|
|
17
17
|
const deriveCells = /* @__PURE__ */ new WeakMap();
|
|
@@ -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);
|