@voltro/web 0.1.1 → 0.1.3
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/CHANGELOG.md +19 -0
- package/dist/{defaultFallbacks-Bg_X-9Wv.js → defaultFallbacks-CGs2z5qv.js} +3 -2
- package/dist/{frameworkBoot-DBOFujAI.js → frameworkBoot-C_d7E8Fj.js} +43 -42
- package/dist/frameworkBoot.js +1 -1
- package/dist/globalContext-d4A-ugDg.js +10 -0
- package/dist/hooks.js +3 -2
- package/dist/index.js +9 -8
- package/dist/{mount-BuFzlw1e.js → mount-DhGdfjSE.js} +1 -1
- package/dist/mount.js +1 -1
- package/dist/{serverContext-D5-Dmh8d.js → serverContext-DSValgbm.js} +11 -10
- package/dist/ssr.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -39,6 +39,25 @@ _Changes staged for the next release accumulate here (rolled up from
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
+
## [0.1.1] — 2026-07-15
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- **@voltro/ai** — `AgentDescriptor` / `AgentExecutor` no longer carry a `unique
|
|
47
|
+
symbol` type brand (only the portable string `_brand`). A d.ts bundler
|
|
48
|
+
duplicates a `unique symbol` per entry point, so a descriptor built with
|
|
49
|
+
`defineAgent` (from the browser-safe `@voltro/ai/agent` subpath) was not
|
|
50
|
+
assignable to `defineAgentExecutor` (from the main entry) when the package is
|
|
51
|
+
consumed from npm — the canonical agent pattern failed to typecheck for every
|
|
52
|
+
published-package consumer. Type-only; the runtime brand was never read.
|
|
53
|
+
- **@voltro/cli** — the `voltro` bin resolves the `tsx` loader relative to
|
|
54
|
+
`@voltro/cli` (via `import.meta.resolve`) instead of a bare `--import tsx`
|
|
55
|
+
resolved from the consuming app's CWD, so a standalone (non-monorepo) install
|
|
56
|
+
no longer fails with "Cannot find package 'tsx'" at `voltro dev` / `voltro
|
|
57
|
+
build`.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
42
61
|
## [0.1.0]
|
|
43
62
|
|
|
44
63
|
Initial pre-release baseline. This is the starting point the changelog tracks
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "./globalContext-d4A-ugDg.js";
|
|
2
|
+
import { useCallback as t, useContext as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
3
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
3
4
|
//#region src/statusBus.ts
|
|
4
5
|
var l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), d = [], f = () => {
|
|
@@ -43,7 +44,7 @@ var l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), d = [], f = ()
|
|
|
43
44
|
" — file-based routing maps directly from the directory tree."
|
|
44
45
|
] })
|
|
45
46
|
}
|
|
46
|
-
}, v = e(_), y = (e, t) => ({
|
|
47
|
+
}, v = e("fallbackStrings", _), y = (e, t) => ({
|
|
47
48
|
error: {
|
|
48
49
|
...e.error,
|
|
49
50
|
...t.error
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as e } from "./globalContext-d4A-ugDg.js";
|
|
2
|
+
import { AppClientsContext as t } from "./hooks.js";
|
|
3
|
+
import { c as n, l as r, r as i, s as a } from "./defaultFallbacks-CGs2z5qv.js";
|
|
4
|
+
import { useCallback as o, useContext as s, useEffect as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
|
|
4
5
|
import { Context as f, Layer as p, ManagedRuntime as m } from "effect";
|
|
5
6
|
import * as h from "@effect/platform/Socket";
|
|
6
7
|
import * as g from "@effect/platform/Headers";
|
|
@@ -8,14 +9,14 @@ import { RpcClient as _, RpcSerialization as v } from "@effect/rpc";
|
|
|
8
9
|
import { FrameworkRuntimesProvider as y, RpcErrorBus as b, SubscriptionCache as ee, ssrClientProxy as te, ssrStubHandle as ne, subscribeClientTraces as re } from "@voltro/client";
|
|
9
10
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
10
11
|
//#region src/reconnect.ts
|
|
11
|
-
var w =
|
|
12
|
-
let e = d(
|
|
12
|
+
var w = e("reconnect", null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
13
|
+
let e = d(r, a, a).some((e) => e.kind === "loading" || e.kind === "reconnecting"), [t, n] = u(!1);
|
|
13
14
|
return c(() => {
|
|
14
15
|
if (!e) {
|
|
15
|
-
|
|
16
|
+
n(!1);
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
|
-
let t = setTimeout(() =>
|
|
19
|
+
let t = setTimeout(() => n(!0), ae);
|
|
19
20
|
return () => clearTimeout(t);
|
|
20
21
|
}, [e]), /* @__PURE__ */ C("div", {
|
|
21
22
|
"aria-hidden": "true",
|
|
@@ -62,10 +63,10 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
62
63
|
}, j = (e) => {
|
|
63
64
|
e.cache.destroy(e.runtime), e.runtime.dispose();
|
|
64
65
|
}, pe = (e) => {
|
|
65
|
-
let
|
|
66
|
+
let t = e.apis, r = e.buildClient, i = e.onChange, a = e.retryDelayMs ?? se, o = e.stableWindowMs ?? 5e3, s = e.scheduler?.setTimeout ?? ((e, t) => setTimeout(e, t)), c = e.scheduler?.clearTimeout ?? ((e) => {
|
|
66
67
|
clearTimeout(e);
|
|
67
68
|
}), l = e.scheduler?.queueMicrotask ?? queueMicrotask, u = /* @__PURE__ */ new Map();
|
|
68
|
-
for (let e of
|
|
69
|
+
for (let e of t) u.set(e.name, fe());
|
|
69
70
|
let d = !1, f = /* @__PURE__ */ new Set(), p = (e, t) => {
|
|
70
71
|
let n = s(() => {
|
|
71
72
|
f.delete(n), e();
|
|
@@ -75,20 +76,20 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
75
76
|
if (d) return;
|
|
76
77
|
let e = /* @__PURE__ */ new Map();
|
|
77
78
|
for (let [t, n] of u) n.resolved && e.set(t, n.resolved);
|
|
78
|
-
i(e,
|
|
79
|
+
i(e, t.every((t) => e.has(t.name)));
|
|
79
80
|
}, h = (e) => {
|
|
80
81
|
if (d) return;
|
|
81
|
-
let
|
|
82
|
-
if (!
|
|
83
|
-
|
|
84
|
-
let r = a(
|
|
85
|
-
if (
|
|
82
|
+
let t = u.get(e.name);
|
|
83
|
+
if (!t) return;
|
|
84
|
+
t.failureCount += 1;
|
|
85
|
+
let r = a(t.failureCount), i = ++t.retryToken;
|
|
86
|
+
if (t.reconnectStatusDispose ||= n({
|
|
86
87
|
id: `voltro:supervisor:${e.name}`,
|
|
87
88
|
kind: "reconnecting",
|
|
88
89
|
label: "Reconnecting…"
|
|
89
|
-
}), O() &&
|
|
90
|
+
}), O() && t.everOpened && t.failureCount >= ce && t.healthPollHandle === null) {
|
|
90
91
|
let e = le();
|
|
91
|
-
e && (
|
|
92
|
+
e && (t.healthPollHandle = setInterval(() => {
|
|
92
93
|
fetch(e, {
|
|
93
94
|
method: "GET",
|
|
94
95
|
cache: "no-store",
|
|
@@ -99,7 +100,7 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
99
100
|
}, D));
|
|
100
101
|
}
|
|
101
102
|
p(() => {
|
|
102
|
-
d ||
|
|
103
|
+
d || t.retryToken === i && (t.generation += 1, g(e));
|
|
103
104
|
}, r);
|
|
104
105
|
}, g = async (e) => {
|
|
105
106
|
if (d) return;
|
|
@@ -128,13 +129,13 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
128
129
|
h(e);
|
|
129
130
|
}
|
|
130
131
|
};
|
|
131
|
-
return
|
|
132
|
+
return t.length === 0 ? (i(/* @__PURE__ */ new Map(), !0), {
|
|
132
133
|
dispose: () => {
|
|
133
134
|
d = !0;
|
|
134
135
|
},
|
|
135
136
|
reconnect: () => {}
|
|
136
137
|
}) : (l(() => {
|
|
137
|
-
if (!d) for (let e of
|
|
138
|
+
if (!d) for (let e of t) g(e);
|
|
138
139
|
}), {
|
|
139
140
|
dispose: () => {
|
|
140
141
|
if (!d) {
|
|
@@ -146,7 +147,7 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
146
147
|
}
|
|
147
148
|
},
|
|
148
149
|
reconnect: () => {
|
|
149
|
-
if (!d) for (let e of
|
|
150
|
+
if (!d) for (let e of t) {
|
|
150
151
|
let t = u.get(e.name);
|
|
151
152
|
t && (t.retryToken += 1, t.generation += 1, t.failureCount = 0, A(t), g(e));
|
|
152
153
|
}
|
|
@@ -356,7 +357,7 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
356
357
|
}, e.id))
|
|
357
358
|
});
|
|
358
359
|
}, Se = ({ toast: e, onDismiss: t }) => {
|
|
359
|
-
let [n,
|
|
360
|
+
let [n, r] = u(!1), a = `voltro logs --trace ${e.traceId}`;
|
|
360
361
|
return /* @__PURE__ */ C("div", {
|
|
361
362
|
style: {
|
|
362
363
|
pointerEvents: "auto",
|
|
@@ -432,8 +433,8 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
432
433
|
}),
|
|
433
434
|
/* @__PURE__ */ S("button", {
|
|
434
435
|
onClick: () => {
|
|
435
|
-
|
|
436
|
-
e !== "failed" && (
|
|
436
|
+
i(a).then((e) => {
|
|
437
|
+
e !== "failed" && (r(!0), setTimeout(() => r(!1), 1500));
|
|
437
438
|
});
|
|
438
439
|
},
|
|
439
440
|
title: "Copy command",
|
|
@@ -515,9 +516,9 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
515
516
|
} catch (n) {
|
|
516
517
|
throw Z(e.name, `build gen=${t}: runtime FAILED, disposing`, n.message ?? n), l.dispose(), n;
|
|
517
518
|
}
|
|
518
|
-
}, $ = ({ apis:
|
|
519
|
+
}, $ = ({ apis: e, children: n, chrome: r }) => {
|
|
519
520
|
let [i, a] = u(() => ({
|
|
520
|
-
initialized:
|
|
521
|
+
initialized: e.length === 0,
|
|
521
522
|
clients: /* @__PURE__ */ new Map()
|
|
522
523
|
})), s = l(null), d = o(() => {
|
|
523
524
|
s.current?.reconnect();
|
|
@@ -525,8 +526,8 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
525
526
|
c(() => {
|
|
526
527
|
p(!0);
|
|
527
528
|
}, []), c(() => {
|
|
528
|
-
let
|
|
529
|
-
apis:
|
|
529
|
+
let t = pe({
|
|
530
|
+
apis: e,
|
|
530
531
|
buildClient: De,
|
|
531
532
|
onChange: (e, t) => {
|
|
532
533
|
a({
|
|
@@ -535,31 +536,31 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
535
536
|
});
|
|
536
537
|
}
|
|
537
538
|
});
|
|
538
|
-
return s.current =
|
|
539
|
-
|
|
539
|
+
return s.current = t, () => {
|
|
540
|
+
t.dispose(), s.current === t && (s.current = null);
|
|
540
541
|
};
|
|
541
|
-
}, [
|
|
542
|
+
}, [e]), c(() => {
|
|
542
543
|
if (!X() || typeof window > "u") return;
|
|
543
|
-
let
|
|
544
|
-
|
|
544
|
+
let t = [], n = [], r = e[0]?.name ?? "web";
|
|
545
|
+
t.push(B({
|
|
545
546
|
baseUrl: window.location.origin,
|
|
546
547
|
appName: r
|
|
547
548
|
}));
|
|
548
|
-
for (let
|
|
549
|
-
let
|
|
550
|
-
|
|
551
|
-
baseUrl:
|
|
552
|
-
originLabel:
|
|
549
|
+
for (let t of e) {
|
|
550
|
+
let e = Y(t.wsUrl, t.name);
|
|
551
|
+
e.length !== 0 && n.push(K({
|
|
552
|
+
baseUrl: e,
|
|
553
|
+
originLabel: t.name
|
|
553
554
|
}));
|
|
554
555
|
}
|
|
555
556
|
let i = re((e) => H(e.traceId));
|
|
556
557
|
return () => {
|
|
557
|
-
for (let
|
|
558
|
+
for (let e of t) e.dispose();
|
|
558
559
|
for (let e of n) e.dispose();
|
|
559
560
|
i();
|
|
560
561
|
};
|
|
561
|
-
}, [
|
|
562
|
-
let m = new Map(
|
|
562
|
+
}, [e]);
|
|
563
|
+
let m = new Map(e.map((e) => [e.name, i.clients.get(e.name)?.client ?? te])), h = new Map(e.map((e) => {
|
|
563
564
|
let t = i.clients.get(e.name);
|
|
564
565
|
return t ? [e.name, {
|
|
565
566
|
runtime: t.runtime,
|
|
@@ -577,7 +578,7 @@ var w = a(null), ie = () => s(w) ?? (() => {}), ae = 150, T = 220, E = () => {
|
|
|
577
578
|
value: d,
|
|
578
579
|
children: /* @__PURE__ */ S(y, {
|
|
579
580
|
apis: h,
|
|
580
|
-
children: /* @__PURE__ */ C(
|
|
581
|
+
children: /* @__PURE__ */ C(t.Provider, {
|
|
581
582
|
value: m,
|
|
582
583
|
children: [n, f ? /* @__PURE__ */ C(x, { children: [
|
|
583
584
|
/* @__PURE__ */ S(E, {}),
|
package/dist/frameworkBoot.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./frameworkBoot-
|
|
1
|
+
import { n as e, t } from "./frameworkBoot-C_d7E8Fj.js";
|
|
2
2
|
export { t as FrameworkBoot, e as VoltroRuntimeProvider };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext as e } from "react";
|
|
2
|
+
//#region src/globalContext.ts
|
|
3
|
+
var t = (t, n) => {
|
|
4
|
+
let r = globalThis, i = Symbol.for(`@voltro/web/context:${t}`), a = r[i];
|
|
5
|
+
if (a) return a;
|
|
6
|
+
let o = e(n);
|
|
7
|
+
return r[i] = o, o;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t };
|
package/dist/hooks.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "./globalContext-d4A-ugDg.js";
|
|
2
|
+
import { useContext as t } from "react";
|
|
2
3
|
//#region src/hooks.ts
|
|
3
|
-
var n = e(null), r = (e) => {
|
|
4
|
+
var n = e("appClients", null), r = (e) => {
|
|
4
5
|
let r = t(n);
|
|
5
6
|
if (!r) throw Error("useAppClient: no clients in context. Make sure your app is mounted via @voltro/web mount().");
|
|
6
7
|
let i = r.get(e);
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { t as e } from "./globalContext-d4A-ugDg.js";
|
|
2
|
+
import { AppClientsContext as t, useAppClient as n } from "./hooks.js";
|
|
3
|
+
import { a as r, c as i, i as a, l as o, o as s, r as c, s as l, u } from "./frameworkBoot-C_d7E8Fj.js";
|
|
4
|
+
import { a as d, c as f, i as p, l as m, o as h, s as g } from "./defaultFallbacks-CGs2z5qv.js";
|
|
5
|
+
import { i as _, n as ee, r as te, t as ne } from "./mount-DhGdfjSE.js";
|
|
6
|
+
import { A as re, B as ie, C as v, D as y, E as b, F as x, I as S, L as C, M as w, N as T, O as E, P as D, R as O, S as k, T as A, V as j, _ as M, a as N, b as P, c as F, d as I, f as L, g as R, h as z, i as B, j as V, k as ae, l as H, m as U, n as W, o as G, p as K, r as q, s as J, t as oe, u as se, v as ce, w as le, x as ue, y as de, z as fe } from "./serverContext-DSValgbm.js";
|
|
7
|
+
import { createElement as Y, useContext as pe } from "react";
|
|
7
8
|
export * from "@voltro/client";
|
|
8
9
|
export * from "@voltro/ui";
|
|
9
10
|
//#region src/image.tsx
|
|
10
|
-
var X = ({ src: e }) => e, Z =
|
|
11
|
+
var X = ({ src: e }) => e, Z = e("imageConfig", { loader: X }), me = ({ loader: e, children: t }) => Y(Z.Provider, { value: { loader: e } }, t), Q = [
|
|
11
12
|
640,
|
|
12
13
|
750,
|
|
13
14
|
828,
|
|
@@ -138,4 +139,4 @@ var X = ({ src: e }) => e, Z = fe({ loader: X }), me = ({ loader: e, children: t
|
|
|
138
139
|
}, a) : null);
|
|
139
140
|
}, be = "framework-web";
|
|
140
141
|
//#endregion
|
|
141
|
-
export {
|
|
142
|
+
export { t as AppClientsContext, ye as BlogLayout, p as FallbackStringsProvider, ge as Image, me as ImageConfigProvider, G as Link, J as LoaderCache, F as LoaderDataContext, i as NavigationIndicator, T as NotFoundError, H as PlainLink, o as ReconnectContext, D as RedirectError, se as Router, I as RouterContext, oe as ServerRequestContext, W as ServerRequestProvider, be as WEB_NAME, L as compileRoute, d as defaultFallbackStrings, K as externalUrl, U as findNotFound, c as formatPrintf, ee as getIslandComponent, fe as getRouteSnapshot, g as getStatuses, te as hydrateIslandsOnPage, a as installBrowserConsoleBridge, r as installServerLogRelay, x as isNotFound, S as isRedirect, _ as island, z as lazyPageRoute, R as loaderCacheKey, M as matchRoute, ne as mount, C as notFound, ce as pageRoute, q as parseCookieHeader, X as passthroughImageLoader, de as preloadRouteModule, f as pushStatus, O as redirect, s as registerClientTrace, P as resolveAnchorNavigation, ue as resolveMeta, k as segmentLoaderKey, ie as setRouteSnapshot, v as sortRoutesByPriority, j as subscribeRouteSnapshot, m as subscribeStatuses, l as subscribeTraceErrors, n as useAppClient, le as useBlocker, h as useFallbackStrings, A as useLoaderData, b as useLocation, y as useNavigate, E as useParams, ae as usePrefetch, u as useReconnect, B as useSearchParams, N as useServerRequest, re as useSetSearchParams, V as withHash, w as withQuery };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./frameworkBoot-
|
|
1
|
+
import { t as e } from "./frameworkBoot-C_d7E8Fj.js";
|
|
2
2
|
import { StrictMode as t, createElement as n } from "react";
|
|
3
3
|
import { createRoot as r, hydrateRoot as i } from "react-dom/client";
|
|
4
4
|
import { jsx as a } from "react/jsx-runtime";
|
package/dist/mount.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./mount-
|
|
1
|
+
import { t as e } from "./mount-DhGdfjSE.js";
|
|
2
2
|
export { e as mount };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "./globalContext-d4A-ugDg.js";
|
|
2
|
+
import { c as t, n, t as r } from "./defaultFallbacks-CGs2z5qv.js";
|
|
3
|
+
import { Component as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
3
4
|
import { jsx as d, jsxs as ee } from "react/jsx-runtime";
|
|
4
5
|
//#region src/routeEventBus.ts
|
|
5
6
|
var f = {
|
|
@@ -185,11 +186,11 @@ var f = {
|
|
|
185
186
|
}, N = 0, de = () => {
|
|
186
187
|
let e = typeof crypto < "u" ? crypto : void 0;
|
|
187
188
|
return e && typeof e.randomUUID == "function" ? e.randomUUID() : (N += 1, `k${Date.now().toString(36)}-${N}`);
|
|
188
|
-
}, P =
|
|
189
|
+
}, P = e("router", null), F = () => {
|
|
189
190
|
let e = o(P);
|
|
190
191
|
if (!e) throw Error("Router hooks must be used inside <Router>.");
|
|
191
192
|
return e;
|
|
192
|
-
}, I =
|
|
193
|
+
}, I = e("loaderData", void 0), fe = () => {
|
|
193
194
|
if (typeof document > "u") return;
|
|
194
195
|
let e = document.cookie.match(/(?:^|;\s*)voltro:lang=([^;]*)/);
|
|
195
196
|
return e ? decodeURIComponent(e[1]) : void 0;
|
|
@@ -238,7 +239,7 @@ var f = {
|
|
|
238
239
|
for (let { el: e, previous: t } of r) e.content = t;
|
|
239
240
|
for (let { el: e, previous: t } of a) e.href = t;
|
|
240
241
|
};
|
|
241
|
-
}, L = (e) => JSON.stringify(e).replace(/<\/(script)/gi, "<\\/$1").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"), R = class extends
|
|
242
|
+
}, L = (e) => JSON.stringify(e).replace(/<\/(script)/gi, "<\\/$1").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"), R = class extends i {
|
|
242
243
|
state = { error: null };
|
|
243
244
|
static getDerivedStateFromError(e) {
|
|
244
245
|
return { error: e };
|
|
@@ -262,10 +263,10 @@ var f = {
|
|
|
262
263
|
}
|
|
263
264
|
return this.props.children;
|
|
264
265
|
}
|
|
265
|
-
}, z = ({ routes:
|
|
266
|
+
}, z = ({ routes: e, notFounds: i = [], notFound: o = n, errorFallback: f = r }) => {
|
|
266
267
|
let [p, m] = u(() => window.location.pathname), [h, g] = u(() => window.location.pathname), [_, v] = u(() => window.location.search + window.location.hash), y = l(new se()), x = l(/* @__PURE__ */ new Map()), [S, C] = u(null), w = a((e, t) => (x.current.set(e, t), () => {
|
|
267
268
|
x.current.delete(e);
|
|
268
|
-
}), []), re = l(/* @__PURE__ */ new Map()), A = l(null), j = c(() => ie(
|
|
269
|
+
}), []), re = l(/* @__PURE__ */ new Map()), A = l(null), j = c(() => ie(e.map(T)), [e]);
|
|
269
270
|
s(() => {
|
|
270
271
|
if (typeof window > "u") return;
|
|
271
272
|
let e = window.history.scrollRestoration;
|
|
@@ -540,13 +541,13 @@ var f = {
|
|
|
540
541
|
H,
|
|
541
542
|
J
|
|
542
543
|
]), s(() => {
|
|
543
|
-
if (G.status === "pending") return
|
|
544
|
+
if (G.status === "pending") return t({
|
|
544
545
|
id: "voltro:router:loader",
|
|
545
546
|
kind: "loading",
|
|
546
547
|
label: "Loading…"
|
|
547
548
|
});
|
|
548
549
|
}, [G.status]), s(() => {
|
|
549
|
-
if (G.status === "error") return
|
|
550
|
+
if (G.status === "error") return t({
|
|
550
551
|
id: "voltro:router:loader-error",
|
|
551
552
|
kind: "error",
|
|
552
553
|
label: "Loader failed"
|
|
@@ -710,7 +711,7 @@ var f = {
|
|
|
710
711
|
if (n) try {
|
|
711
712
|
await n();
|
|
712
713
|
} catch {}
|
|
713
|
-
}, Q =
|
|
714
|
+
}, Q = e("serverRequest", null), Ce = () => o(Q), we = () => {
|
|
714
715
|
let e = Ce();
|
|
715
716
|
if (e !== null) {
|
|
716
717
|
let t = e.url.indexOf("?");
|
package/dist/ssr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, d as t, r as n, t as r, x as i } from "./serverContext-
|
|
1
|
+
import { c as e, d as t, r as n, t as r, x as i } from "./serverContext-DSValgbm.js";
|
|
2
2
|
import { createElement as a } from "react";
|
|
3
3
|
import { renderToPipeableStream as o, renderToString as s } from "react-dom/server";
|
|
4
4
|
//#region src/ssr.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The Voltro web framework — file-based routing, render modes (SSR / SSG / islands), the page-export contract, data hooks, and the browser mount.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"node": ">=24.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@voltro/client": "0.1.
|
|
56
|
-
"@voltro/ui": "0.1.
|
|
55
|
+
"@voltro/client": "0.1.3",
|
|
56
|
+
"@voltro/ui": "0.1.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@effect/platform": "^0.96.2",
|