@voltro/web 0.37.0 → 0.39.0

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/ssr.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { s as e } from "./defaultFallbacks-B4Ak-R6R.js";
2
2
  import { _ as t, a as n, g as r, m as i, n as a, p as o, s, t as c } from "./routerState-DAT472IC.js";
3
- import { E as l, c as u, d, l as f, r as p, t as m, w as h } from "./serverContext-7toyzR70.js";
3
+ import { E as l, c as u, d, l as f, r as p, t as m, w as h } from "./serverContext-38JTbYPa.js";
4
4
  import { createElement as g } from "react";
5
- import { makePreloadSeedBag as _, makeStoreSeedBag as v, seedPreloadedSubscription as y, setPreloadSeedResolver as b, setStoreSeedResolver as x } from "@voltro/client";
6
- import { renderToPipeableStream as S, renderToString as C } from "react-dom/server";
7
- import { AsyncLocalStorage as w } from "node:async_hooks";
5
+ import { makePreloadSeedBag as _, makeStoreSeedBag as v, seedPreloadedSubscription as y, seedPreloadedSubscriptionFailure as b, setPreloadSeedResolver as x, setStoreSeedResolver as S } from "@voltro/client";
6
+ import { renderToPipeableStream as C, renderToString as w } from "react-dom/server";
7
+ import { AsyncLocalStorage as T } from "node:async_hooks";
8
8
  //#region src/storeSeedScope.ts
9
- var T = new w();
10
- x(() => T.getStore()?.store ?? null), b(() => T.getStore()?.preload ?? null);
11
- var E = async (e) => {
9
+ var E = new T();
10
+ S(() => E.getStore()?.store ?? null), x(() => E.getStore()?.preload ?? null);
11
+ var D = async (e) => {
12
12
  let t = {
13
13
  store: v(),
14
14
  preload: _()
15
15
  };
16
16
  return {
17
- result: await T.run(t, e),
17
+ result: await E.run(t, e),
18
18
  storeSeeds: t.store.seeds,
19
19
  preloadSeeds: t.preload.seeds
20
20
  };
21
- }, D = () => {
21
+ }, O = () => {
22
22
  let e = {
23
23
  store: v(),
24
24
  preload: _()
25
25
  };
26
- return T.enterWith(e), e.store;
27
- }, O = () => T.getStore()?.store.seeds ?? null, k = () => T.getStore()?.preload.seeds ?? null, A = (e) => {
28
- let t = O(), r = k(), i = e.storeSeeds !== void 0 || t === null || t.length === 0 ? e : {
26
+ return E.enterWith(e), e.store;
27
+ }, k = () => E.getStore()?.store.seeds ?? null, A = () => E.getStore()?.preload.seeds ?? null, j = (e) => {
28
+ let t = k(), r = A(), i = e.storeSeeds !== void 0 || t === null || t.length === 0 ? e : {
29
29
  ...e,
30
30
  storeSeeds: t
31
31
  };
@@ -33,7 +33,7 @@ var E = async (e) => {
33
33
  ...i,
34
34
  preloadSeeds: r
35
35
  });
36
- }, j = (e, t, n, r, i) => {
36
+ }, M = (e, t, n, r, i) => {
37
37
  let a = g(u.Provider, { value: i ? n : f }, g(e));
38
38
  if (!t) return a;
39
39
  for (let e = t.length - 1; e >= 0; e--) {
@@ -44,7 +44,7 @@ var E = async (e) => {
44
44
  }
45
45
  }
46
46
  return a;
47
- }, M = (t) => {
47
+ }, N = (t) => {
48
48
  let { descriptor: n, params: r, pathname: i, search: a, loaderData: o, segmentLoaderData: s, requestContext: c, outerWrap: u, locale: f, pageSlot: p } = t, _ = l(n.meta, r, o, f), v = {
49
49
  pathname: i,
50
50
  search: a ?? "",
@@ -58,7 +58,7 @@ var E = async (e) => {
58
58
  blocked: null
59
59
  }, y = p ? d : n.Component;
60
60
  if (!y) throw Error(`SSR received a descriptor with no Component for "${i}". Lazy page routes are a client-only optimization and must not be used on the server.`);
61
- let b = h(v, j(y, n.chain, p ? void 0 : o, (e) => s?.[e], !p && n.loader !== void 0));
61
+ let b = h(v, M(y, n.chain, p ? void 0 : o, (e) => s?.[e], !p && n.loader !== void 0));
62
62
  return b = g(e, {
63
63
  chrome: null,
64
64
  children: b
@@ -66,16 +66,16 @@ var E = async (e) => {
66
66
  tree: b,
67
67
  meta: _
68
68
  };
69
- }, N = (e) => {
70
- let { tree: t, meta: n } = M(e);
69
+ }, P = (e) => {
70
+ let { tree: t, meta: n } = N(e);
71
71
  return {
72
- html: C(t),
72
+ html: w(t),
73
73
  meta: n
74
74
  };
75
- }, P = (e) => {
76
- let { tree: t, meta: n } = M(e);
75
+ }, F = (e) => {
76
+ let { tree: t, meta: n } = N(e);
77
77
  return {
78
- stream: S(t, {
78
+ stream: C(t, {
79
79
  ...e.bootstrapModules ? { bootstrapModules: [...e.bootstrapModules] } : {},
80
80
  ...e.onShellReady ? { onShellReady: e.onShellReady } : {},
81
81
  ...e.onShellError ? { onShellError: e.onShellError } : {},
@@ -83,20 +83,20 @@ var E = async (e) => {
83
83
  }),
84
84
  meta: n
85
85
  };
86
- }, F = (e) => {
86
+ }, I = (e) => {
87
87
  if (!e) return "";
88
88
  let t = [];
89
- if (typeof e.title == "string" && t.push(`<title>${I(e.title)}</title>`), e.description && t.push(`<meta name="description" content="${L(e.description)}" />`), e.noIndex && t.push("<meta name=\"robots\" content=\"noindex, nofollow\" />"), e.canonical && t.push(`<link rel="canonical" href="${L(e.canonical)}" />`), e.tags) for (let n of e.tags) {
90
- let e = n.name ? `name="${L(n.name)}"` : n.property ? `property="${L(n.property)}"` : "";
91
- e && t.push(`<meta ${e} content="${L(n.content)}" />`);
89
+ if (typeof e.title == "string" && t.push(`<title>${L(e.title)}</title>`), e.description && t.push(`<meta name="description" content="${R(e.description)}" />`), e.noIndex && t.push("<meta name=\"robots\" content=\"noindex, nofollow\" />"), e.canonical && t.push(`<link rel="canonical" href="${R(e.canonical)}" />`), e.tags) for (let n of e.tags) {
90
+ let e = n.name ? `name="${R(n.name)}"` : n.property ? `property="${R(n.property)}"` : "";
91
+ e && t.push(`<meta ${e} content="${R(n.content)}" />`);
92
92
  }
93
93
  if (e.links) for (let n of e.links) {
94
94
  let e = [
95
- `rel="${L(n.rel)}"`,
96
- `href="${L(n.href)}"`,
97
- n.hreflang ? `hreflang="${L(n.hreflang)}"` : "",
98
- n.type ? `type="${L(n.type)}"` : "",
99
- n.title ? `title="${L(n.title)}"` : ""
95
+ `rel="${R(n.rel)}"`,
96
+ `href="${R(n.href)}"`,
97
+ n.hreflang ? `hreflang="${R(n.hreflang)}"` : "",
98
+ n.type ? `type="${R(n.type)}"` : "",
99
+ n.title ? `title="${R(n.title)}"` : ""
100
100
  ].filter(Boolean).join(" ");
101
101
  t.push(`<link ${e} />`);
102
102
  }
@@ -105,6 +105,6 @@ var E = async (e) => {
105
105
  t.push(`<script type="application/ld+json" data-voltro-page-jsonld>${e}<\/script>`);
106
106
  }
107
107
  return t.join("\n ");
108
- }, I = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), L = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
108
+ }, L = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), R = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
109
109
  //#endregion
110
- export { c as ROUTER_STATE_SCRIPT_ID, s as assertDeferralSupported, D as beginStoreSeeds, k as currentPreloadSeeds, O as currentStoreSeeds, a as encodeRouterState, o as isDeferredLoaderResult, p as parseCookieHeader, i as prepareDeferredLoaderData, r as renderDeferredRegistryScript, F as renderMetaToHtml, N as renderPageToHtml, P as renderPageToStream, A as renderRouterStateScript, y as seedPreloadedSubscription, t as serialiseStateForInlining, E as withStoreSeeds };
110
+ export { c as ROUTER_STATE_SCRIPT_ID, s as assertDeferralSupported, O as beginStoreSeeds, A as currentPreloadSeeds, k as currentStoreSeeds, a as encodeRouterState, o as isDeferredLoaderResult, p as parseCookieHeader, i as prepareDeferredLoaderData, r as renderDeferredRegistryScript, I as renderMetaToHtml, P as renderPageToHtml, F as renderPageToStream, j as renderRouterStateScript, y as seedPreloadedSubscription, b as seedPreloadedSubscriptionFailure, t as serialiseStateForInlining, D as withStoreSeeds };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/web",
3
- "version": "0.37.0",
3
+ "version": "0.39.0",
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",
@@ -53,8 +53,8 @@
53
53
  "node": ">=24.0.0"
54
54
  },
55
55
  "dependencies": {
56
- "@voltro/client": "0.37.0",
57
- "@voltro/ui": "0.37.0"
56
+ "@voltro/client": "0.39.0",
57
+ "@voltro/ui": "0.39.0"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@effect/platform": "^0.97.0",