@timber-js/app 0.1.8 → 0.1.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-bundle.d.ts","sourceRoot":"","sources":["../../src/plugins/server-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"server-bundle.d.ts","sourceRoot":"","sources":["../../src/plugins/server-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CA0G7C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timber-js/app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Vite-native React framework for Cloudflare Workers — correct HTTP semantics, real status codes, pages that work without JavaScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,11 +26,20 @@ export function timberServerBundle(): Plugin[] {
|
|
|
26
26
|
// which throws in the SSR environment.
|
|
27
27
|
if (command === 'serve') {
|
|
28
28
|
// In dev, Vite externalizes node_modules and loads them via Node's
|
|
29
|
-
// native require().
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
29
|
+
// native require(). This causes two problems:
|
|
30
|
+
//
|
|
31
|
+
// 1. Poison-pill packages: deps that import `server-only` (like `bright`)
|
|
32
|
+
// hit the real CJS package which throws in the SSR environment.
|
|
33
|
+
//
|
|
34
|
+
// 2. Dual React instances: deps with React hooks (nuqs, etc.) are
|
|
35
|
+
// externalized and loaded via Node.js, getting their own copy of
|
|
36
|
+
// React. Meanwhile, SSR's renderToReadableStream uses Vite's
|
|
37
|
+
// dep-optimized React. Two React instances = dispatcher mismatch,
|
|
38
|
+
// causing "Invalid hook call" / "Cannot read properties of null
|
|
39
|
+
// (reading 'useId')" errors. See LOCAL-297.
|
|
40
|
+
//
|
|
41
|
+
// We force these packages to be non-external so they go through
|
|
42
|
+
// Vite's module pipeline, which deduplicates React correctly.
|
|
34
43
|
return {
|
|
35
44
|
environments: {
|
|
36
45
|
rsc: {
|
|
@@ -40,7 +49,7 @@ export function timberServerBundle(): Plugin[] {
|
|
|
40
49
|
},
|
|
41
50
|
ssr: {
|
|
42
51
|
resolve: {
|
|
43
|
-
noExternal: ['server-only', 'client-only'],
|
|
52
|
+
noExternal: ['server-only', 'client-only', 'nuqs'],
|
|
44
53
|
},
|
|
45
54
|
},
|
|
46
55
|
},
|