@uniweb/build 1.10.0 → 1.10.1

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 (2) hide show
  1. package/package.json +6 -6
  2. package/src/prerender.js +7 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,12 +59,12 @@
59
59
  "@uniweb/content-reader": "~1.5.7",
60
60
  "@uniweb/content-writer": "~1.3.1",
61
61
  "@uniweb/projections": "~1.2.0",
62
- "@uniweb/theming": "~1.2.1",
62
+ "@uniweb/semantic-parser": "~1.13.0",
63
63
  "@uniweb/schemas": "~1.6.5",
64
- "@uniweb/semantic-parser": "~1.13.0"
64
+ "@uniweb/theming": "~1.2.1"
65
65
  },
66
66
  "optionalDependencies": {
67
- "@uniweb/runtime": "~1.2.2"
67
+ "@uniweb/runtime": "~1.2.3"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -73,8 +73,8 @@
73
73
  "@tailwindcss/vite": "^4.0.0",
74
74
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
75
75
  "vite-plugin-svgr": "^4.0.0",
76
- "@uniweb/runtime": "~1.2.2",
77
- "@uniweb/core": "~1.4.6"
76
+ "@uniweb/core": "~1.4.7",
77
+ "@uniweb/runtime": "~1.2.3"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "vite": {
package/src/prerender.js CHANGED
@@ -998,7 +998,9 @@ export async function prerenderSite(siteDir, options = {}) {
998
998
  * ⭐ A PAGE RENDERS AGAINST WHAT IT CARRIES — the entries its HTML embeds, which are all the
999
999
  * browser's store holds when it boots on that page (`initUniweb` hydrates from them). The
1000
1000
  * browser renders over the prerendered page, so a render that reads more paints content the
1001
- * browser does not have, and the browser replaces it with a loading state at boot.
1001
+ * browser does not have, and the browser replaces it with a loading state at boot. Each page
1002
+ * hands them to `renderer.render` as `fetchedData`, as a host's isolate does; the 404 page,
1003
+ * rendered on its own below, holds them the same way.
1002
1004
  *
1003
1005
  * ⛔ Until 2026-10-25 the store was hydrated once for the whole locale and then took every
1004
1006
  * page's answers in turn, so a page could render data that only other pages carried. A
@@ -1007,10 +1009,6 @@ export async function prerenderSite(siteDir, options = {}) {
1007
1009
  * the record pages before it had fetched, carried none of them, and showed "loading…" at
1008
1010
  * boot (measured).
1009
1011
  */
1010
- const holdOnly = (carried) => {
1011
- website.dataStore.clear()
1012
- hydrateDataStore(website, carried)
1013
- }
1014
1012
 
1015
1013
  for (const page of website.pages) {
1016
1014
  // Skip dynamic template pages — they exist in the content for runtime
@@ -1109,7 +1107,7 @@ export async function prerenderSite(siteDir, options = {}) {
1109
1107
  const scopeRoutes = new Set([page.route, page.parent?.route, page.dynamicContext?.templateRoute].filter(Boolean))
1110
1108
  // The same call `injectBuildData` makes below for this page's HTML, so the render holds what
1111
1109
  // the HTML embeds — the page's own data step's answers among them.
1112
- holdOnly(scopeFetchedData(siteContent.fetchedData, splitContent ? scopeRoutes : null, page.route))
1110
+ const carried = scopeFetchedData(siteContent.fetchedData, splitContent ? scopeRoutes : null, page.route)
1113
1111
 
1114
1112
  onProgress(`Rendering ${outputRoute}...`)
1115
1113
 
@@ -1120,7 +1118,7 @@ export async function prerenderSite(siteDir, options = {}) {
1120
1118
  // is how the two lanes drift. This lane passes the Page it already holds; the
1121
1119
  // isolate passes a route. See `runtime/src/page-renderer.js` for what it leaves
1122
1120
  // to the host.
1123
- const result = renderer.render(page)
1121
+ const result = renderer.render(page, { fetchedData: carried })
1124
1122
 
1125
1123
  if (result.outcome === 'failed') {
1126
1124
  const { type, message } = result.error
@@ -1176,7 +1174,8 @@ export async function prerenderSite(siteDir, options = {}) {
1176
1174
  scopeRoutes: new Set(), // SPA fallback carries site-level fetched data only
1177
1175
  })
1178
1176
  // The 404 page renders against what 404.html carries, as every page above does.
1179
- holdOnly(scopeFetchedData(siteContent.fetchedData, splitContent ? new Set() : null, null))
1177
+ website.forgetData()
1178
+ hydrateDataStore(website, scopeFetchedData(siteContent.fetchedData, splitContent ? new Set() : null, null))
1180
1179
  const { html: notFoundHtml, hasNotFoundPage } = generate404Html({
1181
1180
  baseHtml: fallbackBaseHtml,
1182
1181
  website,