@uniweb/runtime 1.3.4 → 1.3.6
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 +2 -1
- package/dist/ssr.js.map +1 -1
- package/package.json +4 -4
- package/src/ssr-renderer.js +3 -1
- package/src/wire-foundation.js +13 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/runtime",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Minimal runtime for loading Uniweb foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"node": ">=22.12"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@uniweb/
|
|
40
|
-
"@uniweb/
|
|
39
|
+
"@uniweb/core": "~1.5.2",
|
|
40
|
+
"@uniweb/theming": "~1.2.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@vitejs/plugin-react": "^4.5.2",
|
|
44
44
|
"esbuild": "^0.21.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.27.0 || ^0.28.0",
|
|
45
45
|
"vite": "^7.3.1",
|
|
46
46
|
"vitest": "^4.1.7",
|
|
47
|
-
"@uniweb/build": "1.13.
|
|
47
|
+
"@uniweb/build": "1.13.8"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^19.0.0",
|
package/src/ssr-renderer.js
CHANGED
|
@@ -438,10 +438,11 @@ export function initPrerender(content, foundation, extensionsOrOptions, maybeOpt
|
|
|
438
438
|
* @param {Object} siteContent - Site content JSON (mutated: _iconCache added)
|
|
439
439
|
* @param {Object} uniweb - Configured uniweb instance
|
|
440
440
|
* @param {function} [onProgress] - Progress callback
|
|
441
|
+
* @returns {Promise<string[]>} the references that could not be fetched
|
|
441
442
|
*/
|
|
442
443
|
export async function prefetchIcons(siteContent, uniweb, onProgress = () => {}) {
|
|
443
444
|
const icons = siteContent.icons?.used || []
|
|
444
|
-
if (icons.length === 0) return
|
|
445
|
+
if (icons.length === 0) return []
|
|
445
446
|
|
|
446
447
|
const cdnBase = siteContent.config?.icons?.base || DEFAULT_ICON_BASE
|
|
447
448
|
|
|
@@ -479,6 +480,7 @@ export async function prefetchIcons(siteContent, uniweb, onProgress = () => {})
|
|
|
479
480
|
if (uniweb.iconCache.size > 0) {
|
|
480
481
|
siteContent._iconCache = Object.fromEntries(uniweb.iconCache)
|
|
481
482
|
}
|
|
483
|
+
return failedRefs
|
|
482
484
|
}
|
|
483
485
|
|
|
484
486
|
// ============================================================================
|
package/src/wire-foundation.js
CHANGED
|
@@ -17,26 +17,31 @@
|
|
|
17
17
|
* the DOM, the per-page render loop — stay in the per-environment
|
|
18
18
|
* entries; these helpers cover only the environment-agnostic L2 work.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* What this file keeps out of the SPA bundle is `react-dom/server`, not
|
|
21
|
+
* React: `FallbackRef` below is `React.createElement` alone. `setup.js`
|
|
22
|
+
* pulls `wire-foundation.js` directly, so this file must NOT transitively
|
|
22
23
|
* pull `ssr-renderer.js` (which imports `react-dom/server`). The L2
|
|
23
24
|
* helpers therefore live here, while the L3-composing
|
|
24
25
|
* `initPrerenderForLocale` lives in `ssr-renderer.js`.
|
|
25
26
|
*
|
|
26
27
|
* Adding a new framework-level capability:
|
|
27
|
-
* 1.
|
|
28
|
-
*
|
|
28
|
+
* 1. Name it in `extractFoundationRuntime`'s lists (`@uniweb/build`'s
|
|
29
|
+
* `src/runtime-schema.js`): the built entry carries only what they
|
|
30
|
+
* name, so anything else never reaches this file.
|
|
31
|
+
* 2. Read the foundation declaration via `foundation.default.capabilities.<name>`.
|
|
32
|
+
* 3. Apply it to the uniweb singleton (set a slot, call a build hook,
|
|
29
33
|
* register something on `activeWebsite`).
|
|
30
|
-
*
|
|
34
|
+
* 4. Provide a runtime fallback if the capability is one foundations
|
|
31
35
|
* may legitimately not declare (see `FallbackRef`).
|
|
32
36
|
*
|
|
33
37
|
* Foundation export shape contract: the runtime always loads the
|
|
34
38
|
* **built** foundation artifact (`dist/entry.js`) via
|
|
35
39
|
* `loadFoundation()` in `foundation-loader.js`, which does `import(url)`
|
|
36
40
|
* and returns a module namespace. The build pipeline
|
|
37
|
-
* (`@uniweb/build`'s `src/generate-entry.js`)
|
|
38
|
-
*
|
|
39
|
-
* sees a single canonical shape
|
|
41
|
+
* (`@uniweb/build`'s `src/generate-entry.js`) writes what the runtime
|
|
42
|
+
* reads of the foundation's source default export into
|
|
43
|
+
* `default.capabilities.*`, so the runtime sees a single canonical shape
|
|
44
|
+
* with no need for fallback chains. This
|
|
40
45
|
* differs from `@uniweb/press` / `@uniweb/unipress`,
|
|
41
46
|
* which DO need to handle a second shape because they're sometimes
|
|
42
47
|
* called from inside a foundation bundle (where the foundation imports
|