@askrjs/askr 0.0.62 → 0.0.65

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.
Files changed (37) hide show
  1. package/README.md +5 -5
  2. package/dist/actions/index.d.ts +1 -1
  3. package/dist/authoring-CXMPffwN.js +200 -0
  4. package/dist/benchmark.js +4 -4
  5. package/dist/boot/index.d.ts +12 -32
  6. package/dist/boot/index.js +1 -1
  7. package/dist/{boot-B0mMBddb.js → boot-OnYuVVfg.js} +64 -75
  8. package/dist/components/index.d.ts +1 -1
  9. package/dist/control/index.d.ts +1 -1
  10. package/dist/{control-CFIrGbD7.d.ts → control-CMzFPMjr.d.ts} +3 -0
  11. package/dist/csp-nonce-C-8E85El.js +33 -0
  12. package/dist/{deferred-BeNnjR4r.js → deferred-B71c2eio.js} +51 -10
  13. package/dist/foundations/index.d.ts +1 -1
  14. package/dist/foundations/state/index.d.ts +1 -1
  15. package/dist/foundations/structures/index.d.ts +1 -1
  16. package/dist/{index-DaWuMuIc.d.ts → index-Bjm0__Rr.d.ts} +1 -1
  17. package/dist/{index-DlvpxdSz.d.ts → index-Byqjltu2.d.ts} +1 -1
  18. package/dist/{index-CRck4XVe.d.ts → index-NKPpdRh9.d.ts} +6 -2
  19. package/dist/{index-Bce-RQg-.d.ts → index-PgRn5wmg.d.ts} +1 -1
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +3 -2
  22. package/dist/{navigate-DLi79IZr.js → navigate-DTZ2SM8_.js} +68 -279
  23. package/dist/{renderer-CVr_nktj.js → renderer-aUD-acDe.js} +1 -1
  24. package/dist/{route-matching-vJpvLVbX.js → route-matching-C93To416.js} +2 -2
  25. package/dist/router/index.d.ts +4 -10
  26. package/dist/router/index.js +4 -4
  27. package/dist/{router-lmH-Tmwh.d.ts → router-eRoaj11J.d.ts} +9 -6
  28. package/dist/ssg/index.d.ts +8 -33
  29. package/dist/ssg/index.js +34 -36
  30. package/dist/ssr/index.d.ts +10 -45
  31. package/dist/ssr/index.js +1 -1
  32. package/dist/{ssr-5HlhmLhU.js → ssr-C0hzqhY8.js} +65 -43
  33. package/dist/testing/index.d.ts +4 -5
  34. package/dist/testing/index.js +7 -10
  35. package/dist/{verify-hydration-13f0FOPd.js → verify-hydration-BdKE9Hi8.js} +3 -3
  36. package/package.json +1 -1
  37. package/dist/router-internal-BC0w1_xk.js +0 -4
@@ -1,5 +1,5 @@
1
1
  import { C as Query, k as QueryStaleReason } from "../index-Bki2rqcr.js";
2
- import { S as RouteMatch, p as Route, x as RouteManifest } from "../router-lmH-Tmwh.js";
2
+ import { N as RouteRegistry, x as RouteMatch } from "../router-eRoaj11J.js";
3
3
 
4
4
  //#region src/testing/index.d.ts
5
5
  type MockRefresh = () => void | Promise<void>;
@@ -17,8 +17,7 @@ interface InvalidationRecorder {
17
17
  stop(): void;
18
18
  }
19
19
  interface MatchRouteOptions {
20
- manifest?: RouteManifest;
21
- routes?: readonly Route[];
20
+ registry: RouteRegistry;
22
21
  }
23
22
  interface RoutePatternWarning {
24
23
  kind: 'route-collision';
@@ -46,7 +45,7 @@ declare const queryState: {
46
45
  pendingWrite: <T extends {}>(data: T, options?: MockQueryOptions) => Query<T>;
47
46
  };
48
47
  declare function createInvalidationRecorder(): InvalidationRecorder;
49
- declare function matchRoute(path: string, options?: MatchRouteOptions): RouteMatch | null;
50
- declare function getRouteWarnings(options?: MatchRouteOptions): RoutePatternWarning[];
48
+ declare function matchRoute(path: string, options: MatchRouteOptions): RouteMatch | null;
49
+ declare function getRouteWarnings(options: MatchRouteOptions): RoutePatternWarning[];
51
50
  //#endregion
52
51
  export { InvalidationRecord, InvalidationRecorder, MockQueryOptions, MockRefresh, RoutePatternWarning, createInvalidationRecorder, getRouteWarnings, matchRoute, mockQuery, queryState };
@@ -1,5 +1,5 @@
1
1
  import { t as addInvalidationListener } from "../invalidation-listeners-Des3AHYs.js";
2
- import { R as parseSegments, r as computeRouteActivityMatches } from "../route-matching-vJpvLVbX.js";
2
+ import { r as computeRouteActivityMatches } from "../route-matching-C93To416.js";
3
3
  //#region src/testing/index.ts
4
4
  function normalizeRefresh(options) {
5
5
  return async () => {
@@ -114,20 +114,17 @@ function createInvalidationRecorder() {
114
114
  }
115
115
  };
116
116
  }
117
- function matchRoute(path, options = {}) {
118
- return computeRouteActivityMatches(path, options)[0] ?? null;
117
+ function matchRoute(path, options) {
118
+ if (!options?.registry) throw new TypeError("matchRoute requires options.registry.");
119
+ return computeRouteActivityMatches(path, { manifest: options.registry.manifest })[0] ?? null;
119
120
  }
120
121
  function getRoutePatternRecords(options) {
121
- if (options.manifest) return options.manifest.records.map((record) => ({
122
+ if (!options?.registry) throw new TypeError("getRouteWarnings requires options.registry.");
123
+ return options.registry.manifest.records.map((record) => ({
122
124
  path: record.path,
123
125
  segments: record.segments,
124
126
  namespace: record.options.namespace
125
127
  }));
126
- return (options.routes ?? []).map((route) => ({
127
- path: route.path,
128
- segments: parseSegments(route.path),
129
- namespace: route.namespace
130
- }));
131
128
  }
132
129
  function routePrefixMatches(splatPrefix, routeSegments) {
133
130
  if (routeSegments.length <= splatPrefix.length) return false;
@@ -138,7 +135,7 @@ function routePrefixMatches(splatPrefix, routeSegments) {
138
135
  }
139
136
  return true;
140
137
  }
141
- function getRouteWarnings(options = {}) {
138
+ function getRouteWarnings(options) {
142
139
  const records = getRoutePatternRecords(options);
143
140
  const warnings = [];
144
141
  for (const record of records) {
@@ -1,5 +1,5 @@
1
1
  import { t as SSR_RENDER_DATA_ATTR } from "./ssr-CbQO5xd3.js";
2
- import { a as renderResolvedToStringSync } from "./ssr-5HlhmLhU.js";
2
+ import { a as renderResolvedToStringSync } from "./ssr-C0hzqhY8.js";
3
3
  //#region src/ssr/verify-hydration.ts
4
4
  function normalizeHydrationHtml(html) {
5
5
  const template = document.createElement("template");
@@ -8,10 +8,10 @@ function normalizeHydrationHtml(html) {
8
8
  return template.innerHTML.replace(/<!--[\s\S]*?-->/g, "");
9
9
  }
10
10
  function verifyHydrationSyncForUrl(opts) {
11
- const { root, url, routes, resolved, options } = opts;
11
+ const { root, url, registry, resolved, options } = opts;
12
12
  const expected = renderResolvedToStringSync({
13
13
  url,
14
- routes,
14
+ registry,
15
15
  handler: resolved.handler,
16
16
  params: resolved.params,
17
17
  options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askrjs/askr",
3
- "version": "0.0.62",
3
+ "version": "0.0.65",
4
4
  "description": "Actor-backed deterministic UI framework",
5
5
  "keywords": [
6
6
  "askr",
@@ -1,4 +0,0 @@
1
- //#region src/common/router-internal.ts
2
- const ROUTE_ROOT_COMPONENT = Symbol.for("askr.route-root-component");
3
- //#endregion
4
- export { ROUTE_ROOT_COMPONENT as t };