@vidact/start 0.2.0-beta.0 → 0.2.0-beta.5

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 (57) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/client.d.ts +24 -16
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +137 -165
  5. package/dist/client.js.map +1 -1
  6. package/dist/index-client.d.ts +5 -4
  7. package/dist/index-client.js +4 -4
  8. package/dist/index.d.ts +5 -4
  9. package/dist/index.js +4 -4
  10. package/dist/link-client.d.ts +6 -4
  11. package/dist/link-client.d.ts.map +1 -1
  12. package/dist/link-client.js +8 -4
  13. package/dist/link-client.js.map +1 -1
  14. package/dist/link-contract.d.ts +10 -7
  15. package/dist/link-contract.d.ts.map +1 -1
  16. package/dist/link-contract.js +11 -7
  17. package/dist/link-contract.js.map +1 -1
  18. package/dist/link.d.ts +6 -4
  19. package/dist/link.d.ts.map +1 -1
  20. package/dist/link.js +8 -4
  21. package/dist/link.js.map +1 -1
  22. package/dist/router.d.ts +57 -55
  23. package/dist/router.d.ts.map +1 -1
  24. package/dist/router.js +150 -157
  25. package/dist/router.js.map +1 -1
  26. package/dist/server.d.ts +18 -16
  27. package/dist/server.d.ts.map +1 -1
  28. package/dist/server.js +95 -99
  29. package/dist/server.js.map +1 -1
  30. package/dist/snapshot.d.ts +13 -10
  31. package/dist/snapshot.d.ts.map +1 -1
  32. package/dist/snapshot.js +19 -20
  33. package/dist/snapshot.js.map +1 -1
  34. package/dist/virtual.d.ts +3 -2
  35. package/dist/virtual.js +1 -2
  36. package/dist/vite.d.ts +18 -15
  37. package/dist/vite.d.ts.map +1 -1
  38. package/dist/vite.js +144 -171
  39. package/dist/vite.js.map +1 -1
  40. package/package.json +9 -8
  41. package/src/client.ts +272 -0
  42. package/src/index-client.ts +3 -0
  43. package/src/index.ts +3 -0
  44. package/src/link-client.ts +10 -0
  45. package/src/link-contract.ts +17 -0
  46. package/src/link.ts +10 -0
  47. package/src/router.ts +282 -0
  48. package/src/server.ts +211 -0
  49. package/src/snapshot.ts +40 -0
  50. package/src/virtual.ts +5 -0
  51. package/src/vite.ts +256 -0
  52. package/dist/index-client.d.ts.map +0 -1
  53. package/dist/index-client.js.map +0 -1
  54. package/dist/index.d.ts.map +0 -1
  55. package/dist/index.js.map +0 -1
  56. package/dist/virtual.d.ts.map +0 -1
  57. package/dist/virtual.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,70 @@
1
1
  # @vidact/start
2
2
 
3
+ ## 0.2.0-beta.5
4
+
5
+ ### Patch Changes
6
+
7
+ - f7fe490: Hydration fixes for server-rendered content the client cannot reproduce immediately.
8
+
9
+ - Keep hydration markers out of raw-text elements. The server no longer emits `<!--vidact:v1:*-->` comments inside `<textarea>`, `<title>`, `<script>` and `<style>`, where the HTML parser turned them into literal text that stayed visible until hydration recovered from the mismatch. The hydrator synthesizes those markers around the element's parsed text node instead, so such elements hydrate in place.
10
+ - Dehydrated Suspense boundaries. When a Suspense child suspends while hydrating server-rendered content — a `lazy` chunk that has not loaded yet, for example — the boundary now keeps the server DOM on screen and swaps in the client render once the resource resolves, instead of publishing the fallback over it, mismatching, and re-mounting the whole root.
11
+ - `@vidact/start` renders the route tree inside a root component on the server. The client mounts the application under a compiled root of its own, which claims a component marker range; without a matching server root every client component claimed the range of the _next_ server component, which surfaced as a hydration mismatch (and a visible fallback flash) on any route whose component has more than one return.
12
+ - `hydrateStart` accepts `onRecoverableError`, and warns on the console by default when hydration has to recover by re-rendering. A silent recovery looks like a working page that merely flashes.
13
+ - Hydration mismatch messages describe the element (`DIV.class[data-x]`) instead of just its tag.
14
+ - Element claiming no longer prefers a candidate that contains an array marker unless the pending structural child is a list. A conditional or Suspense child triggered the same bias, so a class-less wrapper `<div>{cond ? <A/> : <B/>}</div>` could claim an unrelated sibling that happened to hold a keyed list.
15
+
16
+ - Hydration marker protocol `v2`. The server no longer wraps intrinsic elements (`s`) or scalar text (`t`) in marker comments — inside a child slot an element can only be the intrinsic child and a text node the scalar, so the hydrator infers them, splitting a text node that adjacent scalars parsed into. A scalar binding borrows its child-slot markers as its range (no DOM writes) and only creates anchor comments where there is nothing to borrow, such as inside `<textarea>`. The prefix shrank from `vidact:v1` to `v2`; together this removes about 40% of markers and 60% of marker bytes from server HTML. A `v1` render is rejected by a `v2` client and re-rendered, and vice versa.
17
+
18
+ - Updated dependencies [f7fe490]
19
+ - @vidact/runtime@0.2.0-beta.5
20
+ - @vidact/vite@0.2.0-beta.5
21
+
22
+ ## 0.2.0-beta.4
23
+
24
+ ### Patch Changes
25
+
26
+ - 917f0be: Re-release CLI
27
+ - Updated dependencies [917f0be]
28
+ - @vidact/runtime@0.2.0-beta.4
29
+ - @vidact/vite@0.2.0-beta.4
30
+
31
+ ## 0.2.0-beta.3
32
+
33
+ ### Patch Changes
34
+
35
+ - 917f0be: Release vidact CLI
36
+ - Updated dependencies [917f0be]
37
+ - @vidact/runtime@0.2.0-beta.3
38
+ - @vidact/vite@0.2.0-beta.3
39
+
40
+ ## 0.2.0-beta.2
41
+
42
+ ### Patch Changes
43
+
44
+ - 9b7d659: Build every package with `tsdown` in unbundle mode instead of `tsc` plus two
45
+ repository scripts. `dist` still mirrors `src` file for file, with the same entry
46
+ points, ESM output, declarations, declaration maps, and source maps, and the
47
+ runtime's tree-shaking budgets are unchanged. The Vidact Start ambient route
48
+ module ships as written so it stays an ambient declaration rather than a module
49
+ augmentation.
50
+
51
+ Packages now publish their `src` directory, so the shipped source maps and
52
+ declaration maps resolve. Vite no longer reports "points to missing source
53
+ files" for Vidact modules, debugging steps into real TypeScript, and go-to-
54
+ definition lands on the source rather than the declaration.
55
+
56
+ - Updated dependencies [9b7d659]
57
+ - @vidact/runtime@0.2.0-beta.2
58
+ - @vidact/vite@0.2.0-beta.2
59
+
60
+ ## 0.2.0-beta.1
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [7765e99]
65
+ - @vidact/runtime@0.2.0-beta.1
66
+ - @vidact/vite@0.2.0-beta.1
67
+
3
68
  ## 0.2.0-beta.0
4
69
 
5
70
  ### Minor Changes
package/dist/client.d.ts CHANGED
@@ -1,20 +1,28 @@
1
- import { type CompiledRoot } from '@vidact/runtime';
2
- import { type RouteManifest, type StartComponent } from './router.js';
3
- export interface HydrateStartOptions {
4
- readonly fetch?: typeof globalThis.fetch;
5
- readonly manifest: RouteManifest;
6
- readonly root?: ParentNode;
7
- readonly rootId?: string;
8
- readonly snapshot?: string;
9
- readonly snapshotId?: string;
1
+ import { RouteManifest, StartComponent } from "./router.js";
2
+ import { CompiledRoot } from "@vidact/runtime";
3
+ //#region src/client.d.ts
4
+ interface HydrateStartOptions {
5
+ readonly fetch?: typeof globalThis.fetch;
6
+ readonly manifest: RouteManifest;
7
+ /**
8
+ * Called when hydration could not attach to the server DOM and the root was rendered
9
+ * client-side instead. Defaults to a console warning: a silent recovery looks like a
10
+ * working page that merely flashes, and is far harder to notice than a warning.
11
+ */
12
+ readonly onRecoverableError?: (error: unknown) => void;
13
+ readonly root?: ParentNode;
14
+ readonly rootId?: string;
15
+ readonly snapshot?: string;
16
+ readonly snapshotId?: string;
10
17
  }
11
- export interface StartNavigateOptions {
12
- readonly replace?: boolean;
13
- readonly scroll?: boolean;
18
+ interface StartNavigateOptions {
19
+ readonly replace?: boolean;
20
+ readonly scroll?: boolean;
14
21
  }
15
- export interface StartClient extends CompiledRoot {
16
- readonly navigate: (to: string | URL, options?: StartNavigateOptions) => Promise<boolean>;
22
+ interface StartClient extends CompiledRoot {
23
+ readonly navigate: (to: string | URL, options?: StartNavigateOptions) => Promise<boolean>;
17
24
  }
18
- export declare function hydrateStart(options: HydrateStartOptions): Promise<StartClient>;
19
- export type { StartComponent };
25
+ declare function hydrateStart(options: HydrateStartOptions): Promise<StartClient>;
26
+ //#endregion
27
+ export { HydrateStartOptions, StartClient, type StartComponent, StartNavigateOptions, hydrateStart };
20
28
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAA;AAUpB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC1F;AAID,wBAAsB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,CAqIrF;AAkFD,YAAY,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../src/client.ts"],"mappings":";;;UA0BiB;WACN,eAAe,WAAW;WAC1B,UAAU;;;;;;WAMV,sBAAsB;WACtB,OAAO;WACP;WACA;WACA;;UAGM;WACN;WACA;;UAGM,oBAAoB;WAC1B,WAAW,aAAa,KAAK,UAAU,yBAAyB;;iBAKrD,aAAa,SAAS,sBAAsB,QAAQ"}
package/dist/client.js CHANGED
@@ -1,181 +1,153 @@
1
- import { cloneRenderable, compiledRoot, createCompiledScope, } from '@vidact/runtime';
2
- import { createElement, hydrateRoot } from '@vidact/runtime/hydrate';
3
- import { composeRouteMatches, loadRouteMatches, matchRoutes, } from './router.js';
4
- import { decodeStartSnapshot, VIDACT_START_NAVIGATION_HEADER, VIDACT_START_SNAPSHOT_MEDIA_TYPE, } from './snapshot.js';
5
- const DEFAULT_ROOT_ID = 'vidact-start-root';
6
- const DEFAULT_SNAPSHOT_ID = 'vidact-start-snapshot';
7
- export async function hydrateStart(options) {
8
- const snapshot = decodeStartSnapshot(options.snapshot ?? readSnapshot(options.snapshotId ?? DEFAULT_SNAPSHOT_ID));
9
- const initialUrl = new URL(snapshot.pathname, window.location.href);
10
- const matches = matchRoutes(options.manifest, initialUrl.pathname);
11
- if (matches.length === 0)
12
- throw new Error(`cannot hydrate unmatched route ${snapshot.pathname}`);
13
- const request = new Request(initialUrl);
14
- const loaded = await loadRouteMatches(matches, request, snapshot.loaderData);
15
- const host = options.root ?? document.querySelector(`#${CSS.escape(options.rootId ?? DEFAULT_ROOT_ID)}`);
16
- if (host === null)
17
- throw new Error('Vidact Start hydration root is missing');
18
- const root = hydrateRoot(host, createClientApplication(loaded, request.url));
19
- const fetchNavigation = options.fetch ?? window.fetch.bind(window);
20
- let navigation = 0;
21
- let navigationController;
22
- let disposed = false;
23
- async function navigate(to, navigationOptions = {}) {
24
- return performNavigation(new URL(to, window.location.href), navigationOptions.replace === true ? 'replace' : 'push', navigationOptions.scroll !== false);
25
- }
26
- async function performNavigation(target, historyMode, scroll) {
27
- if (disposed)
28
- throw new Error('cannot navigate an unmounted Vidact Start client');
29
- if (!isClientNavigationUrl(target)) {
30
- navigateDocument(target, historyMode === 'replace');
31
- return false;
32
- }
33
- const nextMatches = matchRoutes(options.manifest, target.pathname);
34
- if (nextMatches.length === 0) {
35
- navigateDocument(target, historyMode === 'replace');
36
- return false;
37
- }
38
- navigation += 1;
39
- const attempt = navigation;
40
- navigationController?.abort();
41
- const controller = new AbortController();
42
- navigationController = controller;
43
- try {
44
- const response = await fetchNavigation(target, {
45
- credentials: 'same-origin',
46
- headers: { [VIDACT_START_NAVIGATION_HEADER]: '1' },
47
- signal: controller.signal,
48
- });
49
- if (attempt !== navigation)
50
- return false;
51
- if (!response.ok ||
52
- response.headers.get('content-type')?.split(';', 1)[0] !== VIDACT_START_SNAPSHOT_MEDIA_TYPE) {
53
- navigateDocument(target, historyMode === 'replace');
54
- return false;
55
- }
56
- const nextSnapshot = decodeStartSnapshot(await response.text());
57
- const nextUrl = new URL(nextSnapshot.pathname, target.origin);
58
- const snapshotMatches = matchRoutes(options.manifest, nextUrl.pathname);
59
- if (snapshotMatches.length === 0) {
60
- navigateDocument(target, historyMode === 'replace');
61
- return false;
62
- }
63
- const nextRequest = new Request(nextUrl);
64
- const nextLoaded = await loadRouteMatches(snapshotMatches, nextRequest, nextSnapshot.loaderData);
65
- if (attempt !== navigation)
66
- return false;
67
- root.replace(createClientApplication(nextLoaded, nextRequest.url));
68
- updateHistory(nextUrl, historyMode);
69
- if (scroll)
70
- scrollToLocation(nextUrl);
71
- return true;
72
- }
73
- catch {
74
- if (controller.signal.aborted || attempt !== navigation)
75
- return false;
76
- navigateDocument(target, historyMode === 'replace');
77
- return false;
78
- }
79
- }
80
- function handleClick(event) {
81
- const anchor = linkForEvent(event);
82
- if (anchor === undefined)
83
- return;
84
- const target = new URL(anchor.href, window.location.href);
85
- if (target.pathname === window.location.pathname &&
86
- target.search === window.location.search &&
87
- target.hash !== window.location.hash) {
88
- return;
89
- }
90
- event.preventDefault();
91
- void performNavigation(target, anchor.hasAttribute('data-vidact-start-replace') ? 'replace' : 'push', true);
92
- }
93
- function handlePopState() {
94
- void performNavigation(new URL(window.location.href), 'none', false);
95
- }
96
- document.addEventListener('click', handleClick);
97
- window.addEventListener('popstate', handlePopState);
98
- return {
99
- mount: root.mount,
100
- replace: root.replace,
101
- navigate,
102
- unmount() {
103
- if (disposed)
104
- return;
105
- disposed = true;
106
- navigation += 1;
107
- navigationController?.abort();
108
- document.removeEventListener('click', handleClick);
109
- window.removeEventListener('popstate', handlePopState);
110
- root.unmount();
111
- },
112
- };
1
+ import { composeRouteMatches, loadRouteMatches, matchRoutes } from "./router.js";
2
+ import { VIDACT_START_NAVIGATION_HEADER, decodeStartSnapshot } from "./snapshot.js";
3
+ import { cloneRenderable, compiledRoot, createCompiledScope } from "@vidact/runtime";
4
+ import { createElement, hydrateRoot } from "@vidact/runtime/hydrate";
5
+ //#region src/client.ts
6
+ const DEFAULT_ROOT_ID = "vidact-start-root";
7
+ const DEFAULT_SNAPSHOT_ID = "vidact-start-snapshot";
8
+ async function hydrateStart(options) {
9
+ const snapshot = decodeStartSnapshot(options.snapshot ?? readSnapshot(options.snapshotId ?? DEFAULT_SNAPSHOT_ID));
10
+ const initialUrl = new URL(snapshot.pathname, window.location.href);
11
+ const matches = matchRoutes(options.manifest, initialUrl.pathname);
12
+ if (matches.length === 0) throw new Error(`cannot hydrate unmatched route ${snapshot.pathname}`);
13
+ const request = new Request(initialUrl);
14
+ const loaded = await loadRouteMatches(matches, request, snapshot.loaderData);
15
+ const host = options.root ?? document.querySelector(`#${CSS.escape(options.rootId ?? DEFAULT_ROOT_ID)}`);
16
+ if (host === null) throw new Error("Vidact Start hydration root is missing");
17
+ const root = hydrateRoot(host, createClientApplication(loaded, request.url), { onRecoverableError: options.onRecoverableError ?? ((error) => console.warn("[vidact/start] hydration recovered by re-rendering:", error)) });
18
+ const fetchNavigation = options.fetch ?? window.fetch.bind(window);
19
+ let navigation = 0;
20
+ let navigationController;
21
+ let disposed = false;
22
+ async function navigate(to, navigationOptions = {}) {
23
+ return performNavigation(new URL(to, window.location.href), navigationOptions.replace === true ? "replace" : "push", navigationOptions.scroll !== false);
24
+ }
25
+ async function performNavigation(target, historyMode, scroll) {
26
+ if (disposed) throw new Error("cannot navigate an unmounted Vidact Start client");
27
+ if (!isClientNavigationUrl(target)) {
28
+ navigateDocument(target, historyMode === "replace");
29
+ return false;
30
+ }
31
+ if (matchRoutes(options.manifest, target.pathname).length === 0) {
32
+ navigateDocument(target, historyMode === "replace");
33
+ return false;
34
+ }
35
+ navigation += 1;
36
+ const attempt = navigation;
37
+ navigationController?.abort();
38
+ const controller = new AbortController();
39
+ navigationController = controller;
40
+ try {
41
+ const response = await fetchNavigation(target, {
42
+ credentials: "same-origin",
43
+ headers: { [VIDACT_START_NAVIGATION_HEADER]: "1" },
44
+ signal: controller.signal
45
+ });
46
+ if (attempt !== navigation) return false;
47
+ if (!response.ok || response.headers.get("content-type")?.split(";", 1)[0] !== "application/x-vidact-start+json") {
48
+ navigateDocument(target, historyMode === "replace");
49
+ return false;
50
+ }
51
+ const nextSnapshot = decodeStartSnapshot(await response.text());
52
+ const nextUrl = new URL(nextSnapshot.pathname, target.origin);
53
+ const snapshotMatches = matchRoutes(options.manifest, nextUrl.pathname);
54
+ if (snapshotMatches.length === 0) {
55
+ navigateDocument(target, historyMode === "replace");
56
+ return false;
57
+ }
58
+ const nextRequest = new Request(nextUrl);
59
+ const nextLoaded = await loadRouteMatches(snapshotMatches, nextRequest, nextSnapshot.loaderData);
60
+ if (attempt !== navigation) return false;
61
+ root.replace(createClientApplication(nextLoaded, nextRequest.url));
62
+ updateHistory(nextUrl, historyMode);
63
+ if (scroll) scrollToLocation(nextUrl);
64
+ return true;
65
+ } catch {
66
+ if (controller.signal.aborted || attempt !== navigation) return false;
67
+ navigateDocument(target, historyMode === "replace");
68
+ return false;
69
+ }
70
+ }
71
+ function handleClick(event) {
72
+ const anchor = linkForEvent(event);
73
+ if (anchor === void 0) return;
74
+ const target = new URL(anchor.href, window.location.href);
75
+ if (target.pathname === window.location.pathname && target.search === window.location.search && target.hash !== window.location.hash) return;
76
+ event.preventDefault();
77
+ performNavigation(target, anchor.hasAttribute("data-vidact-start-replace") ? "replace" : "push", true);
78
+ }
79
+ function handlePopState() {
80
+ performNavigation(new URL(window.location.href), "none", false);
81
+ }
82
+ document.addEventListener("click", handleClick);
83
+ window.addEventListener("popstate", handlePopState);
84
+ return {
85
+ mount: root.mount,
86
+ replace: root.replace,
87
+ navigate,
88
+ unmount() {
89
+ if (disposed) return;
90
+ disposed = true;
91
+ navigation += 1;
92
+ navigationController?.abort();
93
+ document.removeEventListener("click", handleClick);
94
+ window.removeEventListener("popstate", handlePopState);
95
+ root.unmount();
96
+ }
97
+ };
113
98
  }
114
99
  function createClientApplication(matches, requestUrl) {
115
- return () => {
116
- const scope = createCompiledScope();
117
- const application = composeRouteMatches(matches, (component, props) => createElement(component, props), requestUrl);
118
- return compiledRoot(scope, () => cloneRenderable(application));
119
- };
100
+ return () => {
101
+ const scope = createCompiledScope();
102
+ const application = composeRouteMatches(matches, (component, props) => createElement(component, props), requestUrl);
103
+ return compiledRoot(scope, () => cloneRenderable(application));
104
+ };
120
105
  }
121
106
  function linkForEvent(event) {
122
- if (event.defaultPrevented ||
123
- event.button !== 0 ||
124
- event.metaKey ||
125
- event.ctrlKey ||
126
- event.shiftKey ||
127
- event.altKey) {
128
- return undefined;
129
- }
130
- const target = event.target;
131
- if (!(target instanceof Element))
132
- return undefined;
133
- const anchor = target.closest('a[data-vidact-start-link]');
134
- if (anchor === null ||
135
- anchor.hasAttribute('download') ||
136
- (anchor.target !== '' && anchor.target !== '_self') ||
137
- anchor.rel.split(/\s+/u).includes('external')) {
138
- return undefined;
139
- }
140
- const url = new URL(anchor.href, window.location.href);
141
- return isClientNavigationUrl(url) ? anchor : undefined;
107
+ if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
108
+ const target = event.target;
109
+ if (!(target instanceof Element)) return void 0;
110
+ const anchor = target.closest("a[data-vidact-start-link]");
111
+ if (anchor === null || anchor.hasAttribute("download") || anchor.target !== "" && anchor.target !== "_self" || anchor.rel.split(/\s+/u).includes("external")) return;
112
+ return isClientNavigationUrl(new URL(anchor.href, window.location.href)) ? anchor : void 0;
142
113
  }
143
114
  function isClientNavigationUrl(url) {
144
- return (url.origin === window.location.origin && (url.protocol === 'http:' || url.protocol === 'https:'));
115
+ return url.origin === window.location.origin && (url.protocol === "http:" || url.protocol === "https:");
145
116
  }
146
117
  function updateHistory(url, mode) {
147
- if (mode === 'push')
148
- window.history.pushState({}, '', url);
149
- else if (mode === 'replace')
150
- window.history.replaceState(window.history.state, '', url);
118
+ if (mode === "push") window.history.pushState({}, "", url);
119
+ else if (mode === "replace") window.history.replaceState(window.history.state, "", url);
151
120
  }
152
121
  function scrollToLocation(url) {
153
- if (url.hash.length > 1) {
154
- let id;
155
- try {
156
- id = decodeURIComponent(url.hash.slice(1));
157
- }
158
- catch {
159
- id = url.hash.slice(1);
160
- }
161
- const target = document.getElementById(id);
162
- if (target !== null) {
163
- target.scrollIntoView();
164
- return;
165
- }
166
- }
167
- window.scrollTo({ top: 0, left: 0, behavior: 'instant' });
122
+ if (url.hash.length > 1) {
123
+ let id;
124
+ try {
125
+ id = decodeURIComponent(url.hash.slice(1));
126
+ } catch {
127
+ id = url.hash.slice(1);
128
+ }
129
+ const target = document.getElementById(id);
130
+ if (target !== null) {
131
+ target.scrollIntoView();
132
+ return;
133
+ }
134
+ }
135
+ window.scrollTo({
136
+ top: 0,
137
+ left: 0,
138
+ behavior: "instant"
139
+ });
168
140
  }
169
141
  function navigateDocument(url, replace) {
170
- if (replace)
171
- window.location.replace(url);
172
- else
173
- window.location.assign(url);
142
+ if (replace) window.location.replace(url);
143
+ else window.location.assign(url);
174
144
  }
175
145
  function readSnapshot(id) {
176
- const element = document.querySelector(`#${CSS.escape(id)}`);
177
- if (element === null)
178
- throw new Error(`Vidact Start snapshot ${id} is missing`);
179
- return element.textContent ?? '';
146
+ const element = document.querySelector(`#${CSS.escape(id)}`);
147
+ if (element === null) throw new Error(`Vidact Start snapshot ${id} is missing`);
148
+ return element.textContent ?? "";
180
149
  }
150
+ //#endregion
151
+ export { hydrateStart };
152
+
181
153
  //# sourceMappingURL=client.js.map
@@ -1 +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AO,MAAM,OAAO,SAAS,IAClB,CAAC,IAAI,SAAS,KAAA;AAC/C;AAEA,SAAS,sBAAsB,KAAmB;CAChD,OACE,IAAI,WAAW,OAAO,SAAS,WAAW,IAAI,aAAa,WAAW,IAAI,aAAa;AAE3F;AAEA,SAAS,cAAc,KAAU,MAAyB;CACxD,IAAI,SAAS,QAAQ,OAAO,QAAQ,UAAU,CAAC,GAAG,IAAI,GAAG;MACpD,IAAI,SAAS,WAAW,OAAO,QAAQ,aAAa,OAAO,QAAQ,OAAO,IAAI,GAAG;AACxF;AAEA,SAAS,iBAAiB,KAAgB;CACxC,IAAI,IAAI,KAAK,SAAS,GAAG;EACvB,IAAI;EACJ,IAAI;GACF,KAAK,mBAAmB,IAAI,KAAK,MAAM,CAAC,CAAC;EAC3C,QAAQ;GACN,KAAK,IAAI,KAAK,MAAM,CAAC;EACvB;EACA,MAAM,SAAS,SAAS,eAAe,EAAE;EACzC,IAAI,WAAW,MAAM;GACnB,OAAO,eAAe;GACtB;EACF;CACF;CACA,OAAO,SAAS;EAAE,KAAK;EAAG,MAAM;EAAG,UAAU;CAAU,CAAC;AAC1D;AAEA,SAAS,iBAAiB,KAAU,SAAwB;CAC1D,IAAI,SAAS,OAAO,SAAS,QAAQ,GAAG;MACnC,OAAO,SAAS,OAAO,GAAG;AACjC;AAEA,SAAS,aAAa,IAAoB;CACxC,MAAM,UAAU,SAAS,cAAc,IAAI,IAAI,OAAO,EAAE,GAAG;CAC3D,IAAI,YAAY,MAAM,MAAM,IAAI,MAAM,yBAAyB,GAAG,YAAY;CAC9E,OAAO,QAAQ,eAAe;AAChC"}
@@ -1,4 +1,5 @@
1
- export * from './link-client.js';
2
- export * from './router.js';
3
- export * from './snapshot.js';
4
- //# sourceMappingURL=index-client.d.ts.map
1
+ import { FileRouteDefinition, FileRouteOptions, LoadedRouteMatch, ResolvedRouteMatch, RouteComponentProps, RouteLoaderContext, RouteManifest, RouteManifestEntry, RouteMatch, RouteModule, RouteParameters, RouteServerContext, RouteServerHandler, StartComponent, composeRouteMatches, createRouteManifest, defineFileRoute, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders } from "./router.js";
2
+ import { LinkProps } from "./link-contract.js";
3
+ import { Link } from "./link-client.js";
4
+ import { StartSnapshot, VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, decodeStartSnapshot, encodeStartSnapshot } from "./snapshot.js";
5
+ export { FileRouteDefinition, FileRouteOptions, Link, type LinkProps, LoadedRouteMatch, ResolvedRouteMatch, RouteComponentProps, RouteLoaderContext, RouteManifest, RouteManifestEntry, RouteMatch, RouteModule, RouteParameters, RouteServerContext, RouteServerHandler, StartComponent, StartSnapshot, VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, composeRouteMatches, createRouteManifest, decodeStartSnapshot, defineFileRoute, encodeStartSnapshot, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders };
@@ -1,4 +1,4 @@
1
- export * from './link-client.js';
2
- export * from './router.js';
3
- export * from './snapshot.js';
4
- //# sourceMappingURL=index-client.js.map
1
+ import { composeRouteMatches, createRouteManifest, defineFileRoute, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders } from "./router.js";
2
+ import { VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, decodeStartSnapshot, encodeStartSnapshot } from "./snapshot.js";
3
+ import { Link } from "./link-client.js";
4
+ export { Link, VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, composeRouteMatches, createRouteManifest, decodeStartSnapshot, defineFileRoute, encodeStartSnapshot, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from './link.js';
2
- export * from './router.js';
3
- export * from './snapshot.js';
4
- //# sourceMappingURL=index.d.ts.map
1
+ import { FileRouteDefinition, FileRouteOptions, LoadedRouteMatch, ResolvedRouteMatch, RouteComponentProps, RouteLoaderContext, RouteManifest, RouteManifestEntry, RouteMatch, RouteModule, RouteParameters, RouteServerContext, RouteServerHandler, StartComponent, composeRouteMatches, createRouteManifest, defineFileRoute, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders } from "./router.js";
2
+ import { LinkProps } from "./link-contract.js";
3
+ import { StartSnapshot, VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, decodeStartSnapshot, encodeStartSnapshot } from "./snapshot.js";
4
+ import { Link } from "./link.js";
5
+ export { FileRouteDefinition, FileRouteOptions, Link, type LinkProps, LoadedRouteMatch, ResolvedRouteMatch, RouteComponentProps, RouteLoaderContext, RouteManifest, RouteManifestEntry, RouteMatch, RouteModule, RouteParameters, RouteServerContext, RouteServerHandler, StartComponent, StartSnapshot, VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, composeRouteMatches, createRouteManifest, decodeStartSnapshot, defineFileRoute, encodeStartSnapshot, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export * from './link.js';
2
- export * from './router.js';
3
- export * from './snapshot.js';
4
- //# sourceMappingURL=index.js.map
1
+ import { composeRouteMatches, createRouteManifest, defineFileRoute, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders } from "./router.js";
2
+ import { VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, decodeStartSnapshot, encodeStartSnapshot } from "./snapshot.js";
3
+ import { Link } from "./link.js";
4
+ export { Link, VIDACT_START_NAVIGATION_HEADER, VIDACT_START_PROTOCOL, VIDACT_START_SNAPSHOT_MEDIA_TYPE, composeRouteMatches, createRouteManifest, decodeStartSnapshot, defineFileRoute, encodeStartSnapshot, isFileRouteDefinition, loadRouteMatches, matchRoutes, resolveRouteMatches, routeLoaderData, runRouteLoaders };
@@ -1,5 +1,7 @@
1
- import type { CompiledRenderValue } from '@vidact/runtime';
2
- import { type LinkProps } from './link-contract.js';
3
- export declare function Link(props: LinkProps): CompiledRenderValue;
4
- export type { LinkProps };
1
+ import { LinkProps } from "./link-contract.js";
2
+ import { CompiledRenderValue } from "@vidact/runtime";
3
+ //#region src/link-client.d.ts
4
+ declare function Link(props: LinkProps): CompiledRenderValue;
5
+ //#endregion
6
+ export { Link, type LinkProps };
5
7
  //# sourceMappingURL=link-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link-client.d.ts","sourceRoot":"","sources":["../src/link-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAG1D,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEhE,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,mBAAmB,CAE1D;AAED,YAAY,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"link-client.d.ts","names":[],"sources":["../src/link-client.ts"],"mappings":";;;iBAKgB,KAAK,OAAO,YAAY"}
@@ -1,6 +1,10 @@
1
- import { createElement } from '@vidact/runtime/hydrate';
2
- import { anchorProps } from './link-contract.js';
3
- export function Link(props) {
4
- return createElement('a', anchorProps(props));
1
+ import { anchorProps } from "./link-contract.js";
2
+ import { createElement } from "@vidact/runtime/hydrate";
3
+ //#region src/link-client.ts
4
+ function Link(props) {
5
+ return createElement("a", anchorProps(props));
5
6
  }
7
+ //#endregion
8
+ export { Link };
9
+
6
10
  //# sourceMappingURL=link-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"link-client.js","sourceRoot":"","sources":["../src/link-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAA;AAEhE,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,OAAO,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAmC,CAAA;AACjF,CAAC"}
1
+ {"version":3,"file":"link-client.js","names":[],"sources":["../src/link-client.ts"],"mappings":";;;AAKA,SAAgB,KAAK,OAAuC;CAC1D,OAAO,cAAc,KAAK,YAAY,KAAK,CAAC;AAC9C"}
@@ -1,9 +1,12 @@
1
- import type { CompiledRenderValue } from '@vidact/runtime';
2
- export interface LinkProps extends Readonly<Record<string, unknown>> {
3
- readonly children?: CompiledRenderValue;
4
- readonly href: string;
5
- readonly reloadDocument?: boolean;
6
- readonly replace?: boolean;
1
+ import { CompiledRenderValue } from "@vidact/runtime";
2
+ //#region src/link-contract.d.ts
3
+ interface LinkProps extends Readonly<Record<string, unknown>> {
4
+ readonly children?: CompiledRenderValue;
5
+ readonly href: string;
6
+ readonly reloadDocument?: boolean;
7
+ readonly replace?: boolean;
7
8
  }
8
- export declare function anchorProps(props: LinkProps): Record<string, unknown>;
9
+ declare function anchorProps(props: LinkProps): Record<string, unknown>;
10
+ //#endregion
11
+ export { LinkProps, anchorProps };
9
12
  //# sourceMappingURL=link-contract.d.ts.map