@askrjs/askr 0.0.96 → 0.0.97

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/benchmark.js CHANGED
@@ -4,7 +4,7 @@ import { t as selector } from "./selector-CyK-sDwB.js";
4
4
  import { t as installRendererBridge } from "./renderer-tXX_xj86.js";
5
5
  import { i as For } from "./control-C0klPV7Q.js";
6
6
  import { jsx, jsxs } from "./jsx-runtime.js";
7
- import { t as createIsland } from "./boot-C1wT3Vfs.js";
7
+ import { t as createIsland } from "./boot-CZuC3Muv.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.96",
67
- buildLabel: "0.0.96-local"
66
+ packageVersion: "0.0.97",
67
+ buildLabel: "0.0.97-local"
68
68
  };
69
69
  function getBenchmarkMetadata() {
70
70
  return { ...benchmarkMetadata };
@@ -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-C1wT3Vfs.js";
1
+ import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-CZuC3Muv.js";
2
2
  export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
@@ -11,9 +11,9 @@ import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-BVybpV1v.
11
11
  import { i as getDefaultDataRuntime } from "./data-runtime-JxoRgrrt.js";
12
12
  import { a as hydrateDataRuntime } from "./query-registry-CimB1YeW.js";
13
13
  import { I as lockRouteRegistration, P as hasRegisteredRoutes, _ as clearRouteState, m as _setActiveRouteAuthOptions } from "./route-matching-Bo6UqG-5.js";
14
- import { a as resolveRouteRequest, i as hasRouteRenderData, m as reviveDeferredValue, n as getRouteRenderContext, r as getRouteRenderData } from "./resolution-BQyo7qNn.js";
14
+ import { a as resolveRouteRequest, i as hasRouteRenderData, m as reviveDeferredValue, n as getRouteRenderContext, r as getRouteRenderData } from "./resolution-C-ZE5swD.js";
15
15
  import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-d4t3CdzK.js";
16
- import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-DChM5m8m.js";
16
+ import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-CbsZobFg.js";
17
17
  import { n as disposeRegisteredDefaultPortalScope, r as getDefaultPortalHost } from "./default-portal-runtime-DvMvWJVp.js";
18
18
  import "./ssr-DSHd_Q9K.js";
19
19
  //#region src/boot/hydration.ts
@@ -612,7 +612,7 @@ async function hydrateSPA(config) {
612
612
  cspNonce: config.cspNonce
613
613
  }));
614
614
  if (shouldVerifyHydrationMarkup(config)) {
615
- const { verifyHydrationSyncForUrl } = await import("./verify-hydration-m-wVbYOD.js");
615
+ const { verifyHydrationSyncForUrl } = await import("./verify-hydration-CUgKeP65.js");
616
616
  if (!verifyHydrationSyncForUrl({
617
617
  root: rootElement,
618
618
  url: currentUrl,
@@ -3,7 +3,7 @@ import { i as getExecutionModel } from "./manifest-D6rfj_jC.js";
3
3
  import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render-context-B7ohlh6t.js";
4
4
  import { t as resource } from "./resource-operation-B62UQKHV.js";
5
5
  import { A as getDefaultRouteBasePath, C as getCurrentInheritedPolicies, D as getCurrentPathPrefix, E as getCurrentPageScope, F as insertRecordSorted, H as computeRank, L as pushRegistrationScope, N as hasActivePageScope, O as getCurrentScopeKind, S as getCurrentInheritedMeta, T as getCurrentPageChain, U as normalizeRouteSegmentName, W as parseSegments, g as assertRouteRegistrationUnlocked, h as addRouteToStores, w as getCurrentLayoutChain, x as getCurrentInheritedAuthRequirements } from "./route-matching-Bo6UqG-5.js";
6
- import { _ as createRouteHandler, d as DEFERRED_BOUNDARY, p as isDeferred, s as guardHydratedRouteData } from "./resolution-BQyo7qNn.js";
6
+ import { _ as createRouteHandler, d as DEFERRED_BOUNDARY, p as isDeferred, s as guardHydratedRouteData } from "./resolution-C-ZE5swD.js";
7
7
  import { allOf } from "@askrjs/auth";
8
8
  //#region src/router/access.ts
9
9
  function compileNodePolicies(node) {
@@ -7,7 +7,7 @@ import { i as drainLifecycleCommitErrors, p as isPromiseLike, r as discardLifecy
7
7
  import { _ as teardownNodeSubtree } from "./cleanup-D7uN-Z1s.js";
8
8
  import { t as CspNonceScope } from "./csp-nonce-BVybpV1v.js";
9
9
  import { I as lockRouteRegistration, o as addRouteBasePath, r as computeRouteActivityMatches, y as getActiveRouteBasePath } from "./route-matching-Bo6UqG-5.js";
10
- import { a as resolveRouteRequest, i as hasRouteRenderData, n as getRouteRenderContext, r as getRouteRenderData, u as withoutRouteHydrationMetadata } from "./resolution-BQyo7qNn.js";
10
+ import { a as resolveRouteRequest, i as hasRouteRenderData, n as getRouteRenderContext, r as getRouteRenderData, u as withoutRouteHydrationMetadata } from "./resolution-C-ZE5swD.js";
11
11
  import { a as clearStagedAppRenderRouteLocation, i as syncCurrentRouteSnapshot, o as createAppRenderRuntime, s as stageAppRenderRouteLocation } from "./activity-d4t3CdzK.js";
12
12
  import { r as getDefaultPortalHost, t as clearRegisteredDefaultPortalForInstance } from "./default-portal-runtime-DvMvWJVp.js";
13
13
  //#region src/router/navigation-registry.ts
@@ -40,9 +40,13 @@ function startLazyLoad(state) {
40
40
  let promise;
41
41
  promise = Promise.resolve().then(state.factory).then((mod) => {
42
42
  state.resolved = typeof mod === "function" ? mod : mod.default;
43
+ state.loadError = null;
44
+ state.hasLoadError = false;
43
45
  }, (err) => {
44
46
  state.loadError = err;
47
+ state.hasLoadError = true;
45
48
  }).finally(() => {
49
+ if (state.hasLoadError) state.promise = null;
46
50
  pendingLazy.delete(promise);
47
51
  });
48
52
  state.promise = promise;
@@ -55,10 +59,11 @@ function lazy(factory) {
55
59
  factory,
56
60
  promise: null,
57
61
  resolved: null,
58
- loadError: null
62
+ loadError: null,
63
+ hasLoadError: false
59
64
  };
60
65
  const component = ((params) => {
61
- if (state.loadError) throw state.loadError;
66
+ if (state.hasLoadError) throw state.loadError;
62
67
  if (!state.resolved) throw new Error("lazy() component used before it was resolved. Matched routes load automatically; call component.preload() for explicit preloading.");
63
68
  return state.resolved(params);
64
69
  });
@@ -72,7 +77,14 @@ function lazy(factory) {
72
77
  */
73
78
  function lazyRouteData(factory, select) {
74
79
  let imported = null;
75
- const load = () => imported ??= Promise.resolve().then(factory);
80
+ const load = () => {
81
+ if (imported) return imported;
82
+ imported = Promise.resolve().then(factory).catch((error) => {
83
+ imported = null;
84
+ throw error;
85
+ });
86
+ return imported;
87
+ };
76
88
  const loader = ((context) => load().then((module) => select ? select(module, context) : module).catch((error) => _wrapRouteDataLoadError(error, context)));
77
89
  Object.defineProperty(loader, "preload", { value: () => load().then(() => void 0) });
78
90
  return loader;
@@ -537,7 +549,7 @@ function resolveRouteRequest(target, options) {
537
549
  to: addRouteBasePath(result.to, basePath)
538
550
  } : result;
539
551
  const finalize = (authContext) => {
540
- setCurrentAuth(authContext);
552
+ if (!signal.aborted) setCurrentAuth(authContext);
541
553
  const result = resolveMatchedRoute(match.record, match.params, buildRouteContext(logicalTarget, match.params, {
542
554
  mode,
543
555
  signal,
@@ -2,10 +2,10 @@ import { n as createRouteRegistry } from "../manifest-D6rfj_jC.js";
2
2
  import { a as isSafeHref } from "../csp-nonce-BVybpV1v.js";
3
3
  import { jsx } from "../jsx-runtime.js";
4
4
  import { o as addRouteBasePath, y as getActiveRouteBasePath } from "../route-matching-Bo6UqG-5.js";
5
- import { a as group, c as route, i as fallback, n as resolveDeferredValues, o as index, r as routeData, s as page, t as Resolve } from "../deferred-p8hyanxJ.js";
6
- import { S as RouteDataLoadError, a as resolveRouteRequest, b as lazy, f as defer, g as Outlet, h as currentAuth, p as isDeferred, x as lazyRouteData } from "../resolution-BQyo7qNn.js";
5
+ import { a as group, c as route, i as fallback, n as resolveDeferredValues, o as index, r as routeData, s as page, t as Resolve } from "../deferred-DFyDy5e7.js";
6
+ import { S as RouteDataLoadError, a as resolveRouteRequest, b as lazy, f as defer, g as Outlet, h as currentAuth, p as isDeferred, x as lazyRouteData } from "../resolution-C-ZE5swD.js";
7
7
  import { n as onRouteChange, t as currentRoute } from "../activity-d4t3CdzK.js";
8
- import { a as serializeRouteMeta, c as getCurrentHref, d as parseTargetUrl, h as syncRegisteredRouteSnapshot, i as resolveRouteMeta, l as getRegisteredAppsSnapshot, m as syncAppRegistrationLocation, n as navigate, p as setCurrentRouteLocation, r as reconcileRouteMeta, s as saveScrollPosition, u as getWindowHref } from "../navigate-DChM5m8m.js";
8
+ import { a as serializeRouteMeta, c as getCurrentHref, d as parseTargetUrl, h as syncRegisteredRouteSnapshot, i as resolveRouteMeta, l as getRegisteredAppsSnapshot, m as syncAppRegistrationLocation, n as navigate, p as setCurrentRouteLocation, r as reconcileRouteMeta, s as saveScrollPosition, u as getWindowHref } from "../navigate-CbsZobFg.js";
9
9
  import { o as mergeProps } from "../compose-ref-1Fhs7mbF.js";
10
10
  import { t as applyInteractionPolicy } from "../interactions-B4XaFxt1.js";
11
11
  //#region src/router/route-query.ts
package/dist/ssg/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import "../access-d_DCdwqn.js";
2
2
  import { n as createRouteRegistry } from "../manifest-D6rfj_jC.js";
3
3
  import { o as addRouteBasePath } from "../route-matching-Bo6UqG-5.js";
4
- import { c as route, n as resolveDeferredValues } from "../deferred-p8hyanxJ.js";
5
- import { S as RouteDataLoadError, c as prepareRouteHydrationData, t as bindResolvedRouteData, v as getRenderHandler, y as _preloadRouteHandler } from "../resolution-BQyo7qNn.js";
4
+ import { c as route, n as resolveDeferredValues } from "../deferred-DFyDy5e7.js";
5
+ import { S as RouteDataLoadError, c as prepareRouteHydrationData, t as bindResolvedRouteData, v as getRenderHandler, y as _preloadRouteHandler } from "../resolution-C-ZE5swD.js";
6
6
  import { n as renderDocument } from "../ssr-DSHd_Q9K.js";
7
- import { n as renderToString } from "../ssr-DYcK20IX.js";
7
+ import { n as renderToString } from "../ssr-BhcP35fE.js";
8
8
  import * as fs from "node:fs/promises";
9
9
  import * as pathModule from "node:path";
10
10
  import * as os from "node:os";
package/dist/ssr/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { C as SSRDataMissingError } from "../render-context-B7ohlh6t.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-DYcK20IX.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-BhcP35fE.js";
3
3
  export { SSRDataMissingError, createRenderContext, getRenderContext, renderResolvedToStringSync, renderRouteRequest, renderRouteRequestToString, renderToStream, renderToString, renderToStringSync, resolveRequest, withRenderContext, withRenderContextAsync };
@@ -14,7 +14,7 @@ import { n as SSR_PORTAL_HOST, t as SSR_PORTAL_ANCHOR } from "./portal-w3oQ6oQU.
14
14
  import { t as createDataRuntime } from "./data-runtime-JxoRgrrt.js";
15
15
  import { c as withTelemetry, i as dehydrateDataRuntime, t as createQueryPrefetchContext } from "./query-registry-CimB1YeW.js";
16
16
  import { a as resolveRouteFromRoutes, c as removeRouteBasePath, s as normalizeRouteBasePath, t as _resolveRouteMatchFromRoutes } from "./route-matching-Bo6UqG-5.js";
17
- import { a as resolveRouteRequest, d as DEFERRED_BOUNDARY, l as validateRouteHydrationData, o as getRouteHydrationMetadata, p as isDeferred } from "./resolution-BQyo7qNn.js";
17
+ import { a as resolveRouteRequest, d as DEFERRED_BOUNDARY, l as validateRouteHydrationData, o as getRouteHydrationMetadata, p as isDeferred } from "./resolution-C-ZE5swD.js";
18
18
  import { n as disposeRegisteredDefaultPortalScope, r as getDefaultPortalHost } from "./default-portal-runtime-DvMvWJVp.js";
19
19
  import { n as renderDocument, t as SSR_RENDER_DATA_ATTR } from "./ssr-DSHd_Q9K.js";
20
20
  //#region src/ssr/escape.ts
@@ -3,7 +3,7 @@ import { u as recordReadableRead } from "../readable-BsdGWsDE.js";
3
3
  import { l as addInvalidationListener, t as createDataRuntime } from "../data-runtime-JxoRgrrt.js";
4
4
  import { a as notifySource, i as normalizeAsyncDataError, r as createReadableSource } from "../data-Bm8L6JOm.js";
5
5
  import { r as computeRouteActivityMatches } from "../route-matching-Bo6UqG-5.js";
6
- import { a as cleanupApp, r as createSPA, t as createIsland } from "../boot-C1wT3Vfs.js";
6
+ import { a as cleanupApp, r as createSPA, t as createIsland } from "../boot-CZuC3Muv.js";
7
7
  //#region src/testing/render.ts
8
8
  const renderStates = /* @__PURE__ */ new WeakMap();
9
9
  const eventConstructorNames = {
@@ -1,6 +1,6 @@
1
1
  import { g as getHydrationRenderUrl, m as withHydrationVerificationRender } from "./render-context-B7ohlh6t.js";
2
2
  import { t as SSR_RENDER_DATA_ATTR } from "./ssr-DSHd_Q9K.js";
3
- import { a as renderResolvedToStringSync } from "./ssr-DYcK20IX.js";
3
+ import { a as renderResolvedToStringSync } from "./ssr-BhcP35fE.js";
4
4
  //#region src/ssr/verify-hydration.ts
5
5
  function normalizeHydrationHtml(html) {
6
6
  const template = document.createElement("template");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askrjs/askr",
3
- "version": "0.0.96",
3
+ "version": "0.0.97",
4
4
  "description": "Actor-backed deterministic UI framework",
5
5
  "keywords": [
6
6
  "askr",