@uniweb/build 0.17.0 → 0.18.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@uniweb/projections": "0.2.5"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@uniweb/runtime": "0.10.0",
|
|
69
68
|
"@uniweb/schemas": "0.2.10",
|
|
69
|
+
"@uniweb/runtime": "0.11.1",
|
|
70
70
|
"@uniweb/semantic-parser": "1.2.1",
|
|
71
71
|
"@uniweb/content-reader": "1.2.2"
|
|
72
72
|
},
|
package/src/foundation/config.js
CHANGED
|
@@ -26,23 +26,14 @@
|
|
|
26
26
|
import { resolve } from 'node:path'
|
|
27
27
|
import { foundationPlugin } from '../vite-foundation-plugin.js'
|
|
28
28
|
import { resolveFoundationSrcDir } from '../utils/foundation-source-root.js'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
const DEFAULT_EXTERNALS = [
|
|
39
|
-
'react',
|
|
40
|
-
'react-dom',
|
|
41
|
-
'react-dom/server',
|
|
42
|
-
'react/jsx-runtime',
|
|
43
|
-
'react/jsx-dev-runtime',
|
|
44
|
-
'@uniweb/core'
|
|
45
|
-
]
|
|
29
|
+
// The ONE definition. This list used to be re-typed here, and again in
|
|
30
|
+
// vite-foundation-plugin.js — three hand-synced copies of "what a foundation
|
|
31
|
+
// externalizes", with nothing binding them. The failure mode of a drift is not
|
|
32
|
+
// a build error: it is the same bare specifier resolving to two React
|
|
33
|
+
// instances at runtime, which breaks hooks with no signal at build time.
|
|
34
|
+
// `import-map-plugin.js` imports nothing, so this is a leaf import with no
|
|
35
|
+
// cycle risk.
|
|
36
|
+
import { DEFAULT_EXTERNALS } from '../import-map-plugin.js'
|
|
46
37
|
|
|
47
38
|
/**
|
|
48
39
|
* Create a complete Vite configuration for a Uniweb foundation
|
|
@@ -14,6 +14,7 @@ import { buildSchema } from './schema.js'
|
|
|
14
14
|
import { generateEntryPoint, shouldRegenerateForFile } from './generate-entry.js'
|
|
15
15
|
import { processAllPreviews } from './images.js'
|
|
16
16
|
import { generateFoundationVars } from './theme/index.js'
|
|
17
|
+
import { DEFAULT_EXTERNALS } from './import-map-plugin.js'
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Build schema.json with preview image references
|
|
@@ -358,11 +359,12 @@ async function emitFoundationVarsCss(outDir, schema) {
|
|
|
358
359
|
/**
|
|
359
360
|
* Externals for the SSR bundle (`dist/entry-ssr.js`).
|
|
360
361
|
*
|
|
361
|
-
* Same set the browser foundation build externalizes
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
362
|
+
* Same set the browser foundation build externalizes, and now literally the
|
|
363
|
+
* same array — `DEFAULT_EXTERNALS`, imported rather than re-typed. The isolate
|
|
364
|
+
* resolves these to the SHARED runtime's React/core (worker-runtime.js) via its
|
|
365
|
+
* shims, so React stays deduped and runtime patches still propagate without a
|
|
366
|
+
* foundation rebuild. "Same set" was a comment three copies made a promise
|
|
367
|
+
* rather than a fact; deriving it makes drift unrepresentable.
|
|
366
368
|
*
|
|
367
369
|
* PLUS the client-only libraries kit code-splits via dynamic import:
|
|
368
370
|
* - shiki / shiki/bundle/full — syntax highlighting (kit Code renderer)
|
|
@@ -372,14 +374,7 @@ async function emitFoundationVarsCss(outDir, schema) {
|
|
|
372
374
|
* the SSR bundle and leaves them as DORMANT dynamic imports the isolate never
|
|
373
375
|
* awaits — so no extra modules-map entry is needed for them edge-side.
|
|
374
376
|
*/
|
|
375
|
-
const SSR_DEFAULT_EXTERNALS =
|
|
376
|
-
'react',
|
|
377
|
-
'react-dom',
|
|
378
|
-
'react-dom/server',
|
|
379
|
-
'react/jsx-runtime',
|
|
380
|
-
'react/jsx-dev-runtime',
|
|
381
|
-
'@uniweb/core',
|
|
382
|
-
]
|
|
377
|
+
const SSR_DEFAULT_EXTERNALS = DEFAULT_EXTERNALS
|
|
383
378
|
|
|
384
379
|
function isSSRExternal(id) {
|
|
385
380
|
if (SSR_DEFAULT_EXTERNALS.includes(id)) return true
|