@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.
- package/README.md +5 -5
- package/dist/actions/index.d.ts +1 -1
- package/dist/authoring-CXMPffwN.js +200 -0
- package/dist/benchmark.js +4 -4
- package/dist/boot/index.d.ts +12 -32
- package/dist/boot/index.js +1 -1
- package/dist/{boot-B0mMBddb.js → boot-OnYuVVfg.js} +64 -75
- package/dist/components/index.d.ts +1 -1
- package/dist/control/index.d.ts +1 -1
- package/dist/{control-CFIrGbD7.d.ts → control-CMzFPMjr.d.ts} +3 -0
- package/dist/csp-nonce-C-8E85El.js +33 -0
- package/dist/{deferred-BeNnjR4r.js → deferred-B71c2eio.js} +51 -10
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/state/index.d.ts +1 -1
- package/dist/foundations/structures/index.d.ts +1 -1
- package/dist/{index-DaWuMuIc.d.ts → index-Bjm0__Rr.d.ts} +1 -1
- package/dist/{index-DlvpxdSz.d.ts → index-Byqjltu2.d.ts} +1 -1
- package/dist/{index-CRck4XVe.d.ts → index-NKPpdRh9.d.ts} +6 -2
- package/dist/{index-Bce-RQg-.d.ts → index-PgRn5wmg.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -2
- package/dist/{navigate-DLi79IZr.js → navigate-DTZ2SM8_.js} +68 -279
- package/dist/{renderer-CVr_nktj.js → renderer-aUD-acDe.js} +1 -1
- package/dist/{route-matching-vJpvLVbX.js → route-matching-C93To416.js} +2 -2
- package/dist/router/index.d.ts +4 -10
- package/dist/router/index.js +4 -4
- package/dist/{router-lmH-Tmwh.d.ts → router-eRoaj11J.d.ts} +9 -6
- package/dist/ssg/index.d.ts +8 -33
- package/dist/ssg/index.js +34 -36
- package/dist/ssr/index.d.ts +10 -45
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-5HlhmLhU.js → ssr-C0hzqhY8.js} +65 -43
- package/dist/testing/index.d.ts +4 -5
- package/dist/testing/index.js +7 -10
- package/dist/{verify-hydration-13f0FOPd.js → verify-hydration-BdKE9Hi8.js} +3 -3
- package/package.json +1 -1
- package/dist/router-internal-BC0w1_xk.js +0 -4
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 {
|
|
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
|
-
|
|
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
|
|
50
|
-
declare function getRouteWarnings(options
|
|
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 };
|
package/dist/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as addInvalidationListener } from "../invalidation-listeners-Des3AHYs.js";
|
|
2
|
-
import {
|
|
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
|
-
|
|
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
|
|
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-
|
|
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,
|
|
11
|
+
const { root, url, registry, resolved, options } = opts;
|
|
12
12
|
const expected = renderResolvedToStringSync({
|
|
13
13
|
url,
|
|
14
|
-
|
|
14
|
+
registry,
|
|
15
15
|
handler: resolved.handler,
|
|
16
16
|
params: resolved.params,
|
|
17
17
|
options
|
package/package.json
CHANGED