@uniweb/runtime 0.14.1 → 0.15.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 +206 -356
- package/dist/ssr.js.map +1 -1
- package/package.json +3 -3
- package/src/components/BlockRenderer.jsx +7 -0
- package/src/default-fetcher.js +234 -378
- package/src/isolate-api.js +86 -0
- package/src/page-renderer.js +158 -0
- package/src/prefetch.js +71 -17
- package/src/prepare-props.js +1 -1
- package/src/setup.js +7 -5
- package/src/ssr.js +6 -0
- package/src/wire-foundation.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Minimal runtime for loading Uniweb foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"node": ">=20.19"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@uniweb/core": "^0.
|
|
39
|
+
"@uniweb/core": "^0.20.0",
|
|
40
40
|
"@uniweb/theming": "^0.1.15"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"esbuild": "^0.21.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.27.0",
|
|
45
45
|
"vite": "^7.3.1",
|
|
46
46
|
"vitest": "^4.1.7",
|
|
47
|
-
"@uniweb/build": "0.
|
|
47
|
+
"@uniweb/build": "0.37.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^19.0.0",
|
|
@@ -91,6 +91,7 @@ export default function BlockRenderer({ block, as = 'section' }) {
|
|
|
91
91
|
// Reset async data when block changes (SPA navigation)
|
|
92
92
|
useEffect(() => {
|
|
93
93
|
setAsyncData(null)
|
|
94
|
+
block.dataError = null
|
|
94
95
|
}, [block])
|
|
95
96
|
|
|
96
97
|
// Fetch missing data asynchronously. The AbortController's signal flows
|
|
@@ -103,6 +104,12 @@ export default function BlockRenderer({ block, as = 'section' }) {
|
|
|
103
104
|
const controller = new AbortController()
|
|
104
105
|
entityStore.fetch(block, meta, { signal: controller.signal }).then((result) => {
|
|
105
106
|
if (controller.signal.aborted) return
|
|
107
|
+
// ⛔ A failed key is ABSENT from `result.data` (never `[]`) and named on
|
|
108
|
+
// `result.errors`; the block carries it so a section can tell "no records"
|
|
109
|
+
// from "the request failed". Set before the state update so the render it
|
|
110
|
+
// triggers sees it. `data` is `{}` when every key failed — still an
|
|
111
|
+
// update, so `dataLoading` clears rather than spinning forever.
|
|
112
|
+
block.dataError = result.errors ?? null
|
|
106
113
|
if (result.data) setAsyncData(result.data)
|
|
107
114
|
})
|
|
108
115
|
return () => controller.abort()
|