@uniweb/build 0.11.9 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "0.11.9",
3
+ "version": "0.12.0",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -58,9 +58,9 @@
58
58
  "@uniweb/theming": "0.1.3"
59
59
  },
60
60
  "optionalDependencies": {
61
+ "@uniweb/content-reader": "1.1.9",
61
62
  "@uniweb/schemas": "0.2.1",
62
- "@uniweb/runtime": "0.8.9",
63
- "@uniweb/content-reader": "1.1.9"
63
+ "@uniweb/runtime": "0.8.9"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -156,30 +156,31 @@ async function emitRuntimePin(outDir, projectRoot) {
156
156
  }
157
157
 
158
158
  /**
159
- * Build a self-contained ESM bundle for edge SSR (Cloudflare Dynamic Workers).
159
+ * @deprecated 2026-04-27 Strategy S Phase 2.
160
+ *
161
+ * Foundations no longer carry their own runtime bundle. Runtime + React +
162
+ * core + theming now live in R2 under `runtime/{version}/worker-runtime.js`,
163
+ * published by the platform's `/deploy-runtime` skill, and side-loaded
164
+ * by the Cloudflare isolate alongside `dist/foundation.js`.
165
+ *
166
+ * The invocation in `writeBundle()` is commented out; this function
167
+ * definition is kept for the rollout window so it can be flipped back
168
+ * on with one line if Phase 1's edge dispatcher misbehaves in production.
169
+ * Phase 3 cleanup deletes this function entirely once the new path is
170
+ * proven healthy.
171
+ *
172
+ * See `kb/platform/plans/edge-ssr-bundling-strategy.md`.
160
173
  *
174
+ * Original purpose (preserved for context):
175
+ * Build a self-contained ESM bundle for edge SSR (Cloudflare Dynamic Workers).
161
176
  * Produces `ssr-worker-bundle.js` — a single ESM file with React,
162
177
  * ReactDOM/server, `@uniweb/core`, `@uniweb/runtime/ssr`,
163
178
  * `@uniweb/theming`, and the foundation's components all inlined. No
164
- * external imports.
165
- *
166
- * This is **NOT a foundation**. The foundation is `dist/foundation.js`
167
- * a foundation-shaped ESM module that externalizes runtime and links
168
- * to it at runtime, the same as in browser SPA / framework SSG / unipress
169
- * (Node SSR). This file is something different: a self-contained SSR
170
- * pipeline shaped for the Cloudflare Workers Dynamic Worker LOADER, with
171
- * the foundation embedded as one of several inputs. The size ratio
172
- * (typical ~12× larger than `foundation.js`) reflects what's actually
173
- * inside it.
174
- *
175
- * The artifact is bundled this way because the Dynamic Worker LOADER
176
- * accepts a closed `modules` map at isolate construction (no external
177
- * resolver, no path back to npm or R2 for transitive imports). One
178
- * file in, everything resolves. A future refactor can switch to side-
179
- * loading runtime + React + core into the modules map separately so
180
- * foundations stop carrying runtime in their bundles — see
181
- * `kb/platform/plans/edge-ssr-bundling-strategy.md`. Until then, this
182
- * build pre-bundles for the isolate's contract.
179
+ * external imports. The artifact was bundled this way because the
180
+ * Dynamic Worker LOADER accepts a closed `modules` map at isolate
181
+ * construction. The Phase -1 prototype (2026-04-27) verified the LOADER
182
+ * actually deduplicates shared modules across multiple ESM bundles, so
183
+ * a multi-entry modules map became viable that's what Strategy S uses.
183
184
  *
184
185
  * @param {string} outDir - Path to dist/ directory containing foundation.js
185
186
  */
@@ -366,11 +367,18 @@ export function foundationBuildPlugin(options = {}) {
366
367
  // automatically once the edge is updated.
367
368
  await emitRuntimePin(outDir, resolvedRoot)
368
369
 
369
- // Build self-contained SSR bundle for edge rendering (Dynamic Workers).
370
- // Stays in the build until Strategy S Phase 2 dual-mode edge
371
- // resolver continues to fall back to it for foundations without
372
- // a runtime pin.
373
- await buildSSRBundle(outDir)
370
+ // Strategy S Phase 2: foundations no longer carry a self-contained
371
+ // SSR bundle. The runtime + React + core + theming live in R2 under
372
+ // runtime/{version}/worker-runtime.js (uploaded by the platform's
373
+ // /deploy-runtime skill); the Cloudflare isolate side-loads them
374
+ // alongside dist/foundation.js via the edge dual-mode dispatcher.
375
+ // See kb/platform/plans/edge-ssr-bundling-strategy.md.
376
+ //
377
+ // The buildSSRBundle() function is kept (just not invoked) so it
378
+ // can be flipped back on with one line if Phase 1's edge dispatcher
379
+ // misbehaves in production. Phase 3 cleanup deletes the function
380
+ // entirely once we're confident the new path is healthy.
381
+ // await buildSSRBundle(outDir)
374
382
  },
375
383
 
376
384
  async closeBundle() {