@cedarjs/vite 4.0.0-canary.13654 → 4.0.0-canary.13656
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/bundled/react-server-dom-webpack.server.js +6 -6
- package/dist/cjs/devFeServer.js +17 -6
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/lib/registerFwGlobalsAndShims.js +1 -1
- package/dist/cjs/plugins/vite-plugin-rsc-transform-client.js +1 -0
- package/dist/cjs/plugins/vite-plugin-rsc-transform-server.js +1 -0
- package/dist/cjs/rsc/rscBuildAnalyze.js +7 -1
- package/dist/cjs/rsc/rscBuildForServer.js +9 -2
- package/dist/cjs/rsc/rscRenderer.js +2 -2
- package/dist/cjs/rsc/utils.js +2 -2
- package/dist/devFeServer.js +22 -7
- package/dist/index.js +2 -2
- package/dist/lib/registerFwGlobalsAndShims.js +1 -1
- package/dist/plugins/vite-plugin-rsc-transform-client.js +1 -0
- package/dist/plugins/vite-plugin-rsc-transform-server.js +1 -0
- package/dist/rsc/rscBuildAnalyze.d.ts.map +1 -1
- package/dist/rsc/rscBuildAnalyze.js +8 -2
- package/dist/rsc/rscBuildForServer.d.ts.map +1 -1
- package/dist/rsc/rscBuildForServer.js +10 -3
- package/dist/rsc/rscRenderer.js +2 -2
- package/dist/rsc/utils.d.ts.map +1 -1
- package/dist/rsc/utils.js +2 -2
- package/package.json +11 -11
|
@@ -363,7 +363,7 @@ var require_react_react_server_production = __commonJS({
|
|
|
363
363
|
var require_react_react_server_development = __commonJS({
|
|
364
364
|
"../../node_modules/react/cjs/react.react-server.development.js"(exports) {
|
|
365
365
|
"use strict";
|
|
366
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
366
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
367
367
|
function noop() {
|
|
368
368
|
}
|
|
369
369
|
function getIteratorFn(maybeIterable) {
|
|
@@ -986,7 +986,7 @@ var require_react_react_server_development = __commonJS({
|
|
|
986
986
|
return resolveDispatcher().useMemo(create, deps);
|
|
987
987
|
};
|
|
988
988
|
exports.version = "19.2.3";
|
|
989
|
-
}();
|
|
989
|
+
})();
|
|
990
990
|
}
|
|
991
991
|
});
|
|
992
992
|
|
|
@@ -1118,7 +1118,7 @@ var require_react_dom_react_server_development = __commonJS({
|
|
|
1118
1118
|
"../../node_modules/react-dom/cjs/react-dom.react-server.development.js"(exports) {
|
|
1119
1119
|
"use strict";
|
|
1120
1120
|
var import_react = __toESM(require_react_react_server());
|
|
1121
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
1121
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
1122
1122
|
function noop() {
|
|
1123
1123
|
}
|
|
1124
1124
|
function getCrossOriginStringAs(as, input) {
|
|
@@ -1297,7 +1297,7 @@ var require_react_dom_react_server_development = __commonJS({
|
|
|
1297
1297
|
})) : Internals.d.m(href));
|
|
1298
1298
|
};
|
|
1299
1299
|
exports.version = "19.2.3";
|
|
1300
|
-
}();
|
|
1300
|
+
})();
|
|
1301
1301
|
}
|
|
1302
1302
|
});
|
|
1303
1303
|
|
|
@@ -4229,7 +4229,7 @@ var require_react_server_dom_webpack_server_node_development = __commonJS({
|
|
|
4229
4229
|
"use strict";
|
|
4230
4230
|
var import_react_dom = __toESM(require_react_dom_react_server());
|
|
4231
4231
|
var import_react = __toESM(require_react_react_server());
|
|
4232
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
4232
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
4233
4233
|
function voidHandler() {
|
|
4234
4234
|
}
|
|
4235
4235
|
function getIteratorFn(maybeIterable) {
|
|
@@ -9117,7 +9117,7 @@ var require_react_server_dom_webpack_server_node_development = __commonJS({
|
|
|
9117
9117
|
{ highWaterMark: 0 }
|
|
9118
9118
|
);
|
|
9119
9119
|
};
|
|
9120
|
-
}();
|
|
9120
|
+
})();
|
|
9121
9121
|
}
|
|
9122
9122
|
});
|
|
9123
9123
|
|
package/dist/cjs/devFeServer.js
CHANGED
|
@@ -164,7 +164,9 @@ async function createServer() {
|
|
|
164
164
|
clearScreen: false,
|
|
165
165
|
appType: "custom"
|
|
166
166
|
});
|
|
167
|
-
globalThis.__cedarjs__vite_ssr_runtime =
|
|
167
|
+
globalThis.__cedarjs__vite_ssr_runtime = (0, import_vite.createServerModuleRunner)(
|
|
168
|
+
viteSsrDevServer.environments.ssr
|
|
169
|
+
);
|
|
168
170
|
globalThis.__cedarjs__client_references = /* @__PURE__ */ new Set();
|
|
169
171
|
globalThis.__cedarjs__server_references = /* @__PURE__ */ new Set();
|
|
170
172
|
const viteRscServer = await (0, import_vite.createServer)({
|
|
@@ -210,8 +212,14 @@ async function createServer() {
|
|
|
210
212
|
// dependencies apart from node built-ins.
|
|
211
213
|
// TODO (RSC): What's the difference between `conditions` and
|
|
212
214
|
// `externalConditions`? When is one used over the other?
|
|
213
|
-
|
|
214
|
-
|
|
215
|
+
// In Vite 6, we must include `defaultServerConditions` alongside
|
|
216
|
+
// `react-server` so that nested condition maps (e.g. the `node`
|
|
217
|
+
// sub-condition inside `react-server-dom-webpack/server`'s exports)
|
|
218
|
+
// can still be resolved. Without `node` (or another environment
|
|
219
|
+
// condition), the resolver throws "No known conditions for
|
|
220
|
+
// './server' specifier in 'react-server-dom-webpack' package".
|
|
221
|
+
conditions: ["react-server", ...import_vite.defaultServerConditions],
|
|
222
|
+
externalConditions: ["react-server", ...import_vite.defaultServerConditions]
|
|
215
223
|
},
|
|
216
224
|
optimizeDeps: {
|
|
217
225
|
// We need Vite to optimize these dependencies so that they are resolved
|
|
@@ -259,7 +267,8 @@ async function createServer() {
|
|
|
259
267
|
}
|
|
260
268
|
},
|
|
261
269
|
resolve: {
|
|
262
|
-
|
|
270
|
+
// See comment above in ssr.resolve for why we include defaultServerConditions.
|
|
271
|
+
conditions: ["react-server", ...import_vite.defaultServerConditions]
|
|
263
272
|
},
|
|
264
273
|
plugins: [
|
|
265
274
|
{
|
|
@@ -330,7 +339,9 @@ async function createServer() {
|
|
|
330
339
|
// Using a unique cache dir here to not clash with our other vite server
|
|
331
340
|
cacheDir: "../node_modules/.vite-rsc"
|
|
332
341
|
});
|
|
333
|
-
globalThis.__cedarjs__vite_rsc_runtime =
|
|
342
|
+
globalThis.__cedarjs__vite_rsc_runtime = (0, import_vite.createServerModuleRunner)(
|
|
343
|
+
viteRscServer.environments.ssr
|
|
344
|
+
);
|
|
334
345
|
const handleWithMiddleware = (route) => {
|
|
335
346
|
return (0, import_server.createServerAdapter)(async (req) => {
|
|
336
347
|
const middlewareRouter = await (0, import_register.createMiddlewareRouter)(viteSsrDevServer);
|
|
@@ -351,7 +362,7 @@ async function createServer() {
|
|
|
351
362
|
app.use(viteSsrDevServer.middlewares);
|
|
352
363
|
if (rscEnabled) {
|
|
353
364
|
(0, import_rscWebSocketServer.createWebSocketServer)();
|
|
354
|
-
const { createRscRequestHandler } = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
365
|
+
const { createRscRequestHandler } = await globalThis.__cedarjs__vite_rsc_runtime.import(
|
|
355
366
|
new URL("./rsc/rscRequestHandler.js", import_meta.url).pathname
|
|
356
367
|
);
|
|
357
368
|
app.use(
|
package/dist/cjs/index.js
CHANGED
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var index_exports = {};
|
|
30
|
+
__export(index_exports, {
|
|
31
31
|
cedar: () => cedar,
|
|
32
32
|
cedarAutoImportsPlugin: () => import_vite_plugin_cedar_auto_import.cedarAutoImportsPlugin,
|
|
33
33
|
cedarCellTransform: () => import_vite_plugin_cedar_cell2.cedarCellTransform,
|
|
@@ -41,9 +41,9 @@ __export(src_exports, {
|
|
|
41
41
|
cedarTransformJsAsJsx: () => import_vite_plugin_jsx_loader2.cedarTransformJsAsJsx,
|
|
42
42
|
cedarjsDirectoryNamedImportPlugin: () => import_vite_plugin_cedarjs_directory_named_import.cedarjsDirectoryNamedImportPlugin,
|
|
43
43
|
cedarjsJobPathInjectorPlugin: () => import_vite_plugin_cedarjs_job_path_injector.cedarjsJobPathInjectorPlugin,
|
|
44
|
-
default: () =>
|
|
44
|
+
default: () => index_default
|
|
45
45
|
});
|
|
46
|
-
module.exports = __toCommonJS(
|
|
46
|
+
module.exports = __toCommonJS(index_exports);
|
|
47
47
|
var import_plugin_react = __toESM(require("@vitejs/plugin-react"), 1);
|
|
48
48
|
var import_babel_config = require("@cedarjs/babel-config");
|
|
49
49
|
var import_project_config = require("@cedarjs/project-config");
|
|
@@ -99,7 +99,7 @@ function cedar({ mode } = {}) {
|
|
|
99
99
|
(0, import_plugin_react.default)({ babel: babelConfig })
|
|
100
100
|
];
|
|
101
101
|
}
|
|
102
|
-
var
|
|
102
|
+
var index_default = cedar;
|
|
103
103
|
// Annotate the CommonJS export names for ESM import in node:
|
|
104
104
|
0 && (module.exports = {
|
|
105
105
|
cedar,
|
|
@@ -80,7 +80,7 @@ function registerFwShims() {
|
|
|
80
80
|
globalThis.__webpack_chunk_load__ ||= async (id) => {
|
|
81
81
|
console.log("registerFwShims chunk load id", id);
|
|
82
82
|
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
83
|
-
return globalThis.__cedarjs__vite_ssr_runtime?.
|
|
83
|
+
return globalThis.__cedarjs__vite_ssr_runtime?.import(id).then((mod) => {
|
|
84
84
|
console.log("registerFwShims chunk load mod", mod);
|
|
85
85
|
if (mod.default && typeof mod.default === "object") {
|
|
86
86
|
return globalThis.__rw_module_cache__.set(id, mod.default);
|
|
@@ -119,6 +119,7 @@ function transformServerModule(mod, url, code) {
|
|
|
119
119
|
const localTypes = /* @__PURE__ */ new Map();
|
|
120
120
|
for (const node of mod.body) {
|
|
121
121
|
switch (node.type) {
|
|
122
|
+
// TODO (RSC): Add code comments with examples of each type of node
|
|
122
123
|
case "ExportDeclaration":
|
|
123
124
|
if (node.declaration.type === "FunctionDeclaration") {
|
|
124
125
|
const name = node.declaration.identifier.value;
|
|
@@ -74,7 +74,13 @@ async function rscBuildAnalyze() {
|
|
|
74
74
|
"react"
|
|
75
75
|
],
|
|
76
76
|
resolve: {
|
|
77
|
-
|
|
77
|
+
// In Vite 6, we must include `defaultServerConditions` alongside
|
|
78
|
+
// `react-server` so that nested condition maps (e.g. the `node`
|
|
79
|
+
// sub-condition inside `react-server-dom-webpack/server`'s exports)
|
|
80
|
+
// can still be resolved. Without `node` (or another environment
|
|
81
|
+
// condition), the resolver throws "No known conditions for
|
|
82
|
+
// './server' specifier in 'react-server-dom-webpack' package".
|
|
83
|
+
externalConditions: ["react-server", ...import_vite.defaultServerConditions]
|
|
78
84
|
}
|
|
79
85
|
},
|
|
80
86
|
build: {
|
|
@@ -81,8 +81,15 @@ async function rscBuildForServer(clientEntryFiles, serverEntryFiles, customModul
|
|
|
81
81
|
// dependencies apart from node built-ins.
|
|
82
82
|
// TODO (RSC): What's the difference between `conditions` and
|
|
83
83
|
// `externalConditions`? When is one used over the other?
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
//
|
|
85
|
+
// In Vite 6, we must include `defaultServerConditions` alongside
|
|
86
|
+
// `react-server` so that nested condition maps (e.g. the `node`
|
|
87
|
+
// sub-condition inside `react-server-dom-webpack/server`'s exports)
|
|
88
|
+
// can still be resolved. Without `node` (or another environment
|
|
89
|
+
// condition), the commonjs resolver throws "No known conditions for
|
|
90
|
+
// './server' specifier in 'react-server-dom-webpack' package".
|
|
91
|
+
conditions: ["react-server", ...import_vite.defaultServerConditions],
|
|
92
|
+
externalConditions: ["react-server", ...import_vite.defaultServerConditions]
|
|
86
93
|
}
|
|
87
94
|
},
|
|
88
95
|
plugins: [
|
|
@@ -44,7 +44,7 @@ async function renderRscToStream(input) {
|
|
|
44
44
|
async function loadServerFile(filePath) {
|
|
45
45
|
console.log("rscRenderer.ts loadServerFile filePath", filePath);
|
|
46
46
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
47
|
-
const serverMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
47
|
+
const serverMod = await globalThis.__cedarjs__vite_rsc_runtime.import(filePath);
|
|
48
48
|
return serverMod.default ? serverMod.default : serverMod;
|
|
49
49
|
}
|
|
50
50
|
return import(`file://${filePath}`);
|
|
@@ -52,7 +52,7 @@ async function loadServerFile(filePath) {
|
|
|
52
52
|
const getRoutesComponent = async () => {
|
|
53
53
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
54
54
|
const routesPath2 = (0, import_project_config.getPaths)().web.routes;
|
|
55
|
-
const routesMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
55
|
+
const routesMod = await globalThis.__cedarjs__vite_rsc_runtime.import(routesPath2);
|
|
56
56
|
return routesMod.default;
|
|
57
57
|
}
|
|
58
58
|
const serverEntries = await (0, import_entries.getEntriesFromDist)();
|
package/dist/cjs/rsc/utils.js
CHANGED
|
@@ -34,14 +34,14 @@ __export(utils_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(utils_exports);
|
|
35
35
|
async function importRscReact() {
|
|
36
36
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
37
|
-
const reactMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
37
|
+
const reactMod = await globalThis.__cedarjs__vite_rsc_runtime.import("react");
|
|
38
38
|
return reactMod.default;
|
|
39
39
|
}
|
|
40
40
|
return import("react");
|
|
41
41
|
}
|
|
42
42
|
async function importRsdwServer() {
|
|
43
43
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
44
|
-
const rsdwServerMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
44
|
+
const rsdwServerMod = await globalThis.__cedarjs__vite_rsc_runtime.import(
|
|
45
45
|
"react-server-dom-webpack/server.edge"
|
|
46
46
|
);
|
|
47
47
|
return rsdwServerMod.default;
|
package/dist/devFeServer.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
2
|
import { createServerAdapter } from "@whatwg-node/server";
|
|
3
3
|
import express from "express";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createServer as createViteServer,
|
|
6
|
+
createServerModuleRunner,
|
|
7
|
+
defaultServerConditions
|
|
8
|
+
} from "vite";
|
|
5
9
|
import { cjsInterop } from "vite-plugin-cjs-interop";
|
|
6
10
|
import { getProjectRoutes } from "@cedarjs/internal/dist/routes.js";
|
|
7
11
|
import { getConfig, getPaths } from "@cedarjs/project-config";
|
|
@@ -144,7 +148,9 @@ async function createServer() {
|
|
|
144
148
|
clearScreen: false,
|
|
145
149
|
appType: "custom"
|
|
146
150
|
});
|
|
147
|
-
globalThis.__cedarjs__vite_ssr_runtime =
|
|
151
|
+
globalThis.__cedarjs__vite_ssr_runtime = createServerModuleRunner(
|
|
152
|
+
viteSsrDevServer.environments.ssr
|
|
153
|
+
);
|
|
148
154
|
globalThis.__cedarjs__client_references = /* @__PURE__ */ new Set();
|
|
149
155
|
globalThis.__cedarjs__server_references = /* @__PURE__ */ new Set();
|
|
150
156
|
const viteRscServer = await createViteServer({
|
|
@@ -190,8 +196,14 @@ async function createServer() {
|
|
|
190
196
|
// dependencies apart from node built-ins.
|
|
191
197
|
// TODO (RSC): What's the difference between `conditions` and
|
|
192
198
|
// `externalConditions`? When is one used over the other?
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
// In Vite 6, we must include `defaultServerConditions` alongside
|
|
200
|
+
// `react-server` so that nested condition maps (e.g. the `node`
|
|
201
|
+
// sub-condition inside `react-server-dom-webpack/server`'s exports)
|
|
202
|
+
// can still be resolved. Without `node` (or another environment
|
|
203
|
+
// condition), the resolver throws "No known conditions for
|
|
204
|
+
// './server' specifier in 'react-server-dom-webpack' package".
|
|
205
|
+
conditions: ["react-server", ...defaultServerConditions],
|
|
206
|
+
externalConditions: ["react-server", ...defaultServerConditions]
|
|
195
207
|
},
|
|
196
208
|
optimizeDeps: {
|
|
197
209
|
// We need Vite to optimize these dependencies so that they are resolved
|
|
@@ -239,7 +251,8 @@ async function createServer() {
|
|
|
239
251
|
}
|
|
240
252
|
},
|
|
241
253
|
resolve: {
|
|
242
|
-
|
|
254
|
+
// See comment above in ssr.resolve for why we include defaultServerConditions.
|
|
255
|
+
conditions: ["react-server", ...defaultServerConditions]
|
|
243
256
|
},
|
|
244
257
|
plugins: [
|
|
245
258
|
{
|
|
@@ -310,7 +323,9 @@ async function createServer() {
|
|
|
310
323
|
// Using a unique cache dir here to not clash with our other vite server
|
|
311
324
|
cacheDir: "../node_modules/.vite-rsc"
|
|
312
325
|
});
|
|
313
|
-
globalThis.__cedarjs__vite_rsc_runtime =
|
|
326
|
+
globalThis.__cedarjs__vite_rsc_runtime = createServerModuleRunner(
|
|
327
|
+
viteRscServer.environments.ssr
|
|
328
|
+
);
|
|
314
329
|
const handleWithMiddleware = (route) => {
|
|
315
330
|
return createServerAdapter(async (req) => {
|
|
316
331
|
const middlewareRouter = await createMiddlewareRouter(viteSsrDevServer);
|
|
@@ -331,7 +346,7 @@ async function createServer() {
|
|
|
331
346
|
app.use(viteSsrDevServer.middlewares);
|
|
332
347
|
if (rscEnabled) {
|
|
333
348
|
createWebSocketServer();
|
|
334
|
-
const { createRscRequestHandler } = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
349
|
+
const { createRscRequestHandler } = await globalThis.__cedarjs__vite_rsc_runtime.import(
|
|
335
350
|
new URL("./rsc/rscRequestHandler.js", import.meta.url).pathname
|
|
336
351
|
);
|
|
337
352
|
app.use(
|
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ function cedar({ mode } = {}) {
|
|
|
57
57
|
react({ babel: babelConfig })
|
|
58
58
|
];
|
|
59
59
|
}
|
|
60
|
-
var
|
|
60
|
+
var index_default = cedar;
|
|
61
61
|
export {
|
|
62
62
|
cedar,
|
|
63
63
|
cedarAutoImportsPlugin,
|
|
@@ -72,5 +72,5 @@ export {
|
|
|
72
72
|
cedarTransformJsAsJsx2 as cedarTransformJsAsJsx,
|
|
73
73
|
cedarjsDirectoryNamedImportPlugin,
|
|
74
74
|
cedarjsJobPathInjectorPlugin,
|
|
75
|
-
|
|
75
|
+
index_default as default
|
|
76
76
|
};
|
|
@@ -56,7 +56,7 @@ function registerFwShims() {
|
|
|
56
56
|
globalThis.__webpack_chunk_load__ ||= async (id) => {
|
|
57
57
|
console.log("registerFwShims chunk load id", id);
|
|
58
58
|
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
59
|
-
return globalThis.__cedarjs__vite_ssr_runtime?.
|
|
59
|
+
return globalThis.__cedarjs__vite_ssr_runtime?.import(id).then((mod) => {
|
|
60
60
|
console.log("registerFwShims chunk load mod", mod);
|
|
61
61
|
if (mod.default && typeof mod.default === "object") {
|
|
62
62
|
return globalThis.__rw_module_cache__.set(id, mod.default);
|
|
@@ -86,6 +86,7 @@ function transformServerModule(mod, url, code) {
|
|
|
86
86
|
const localTypes = /* @__PURE__ */ new Map();
|
|
87
87
|
for (const node of mod.body) {
|
|
88
88
|
switch (node.type) {
|
|
89
|
+
// TODO (RSC): Add code comments with examples of each type of node
|
|
89
90
|
case "ExportDeclaration":
|
|
90
91
|
if (node.declaration.type === "FunctionDeclaration") {
|
|
91
92
|
const name = node.declaration.identifier.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rscBuildAnalyze.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildAnalyze.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAsB,eAAe;;;;;;;
|
|
1
|
+
{"version":3,"file":"rscBuildAnalyze.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildAnalyze.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAsB,eAAe;;;;;;;GAwGpC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { build as viteBuild } from "vite";
|
|
1
|
+
import { build as viteBuild, defaultServerConditions } from "vite";
|
|
2
2
|
import { getPaths } from "@cedarjs/project-config";
|
|
3
3
|
import { getEntries } from "../lib/entries.js";
|
|
4
4
|
import { onWarn } from "../lib/onWarn.js";
|
|
@@ -51,7 +51,13 @@ async function rscBuildAnalyze() {
|
|
|
51
51
|
"react"
|
|
52
52
|
],
|
|
53
53
|
resolve: {
|
|
54
|
-
|
|
54
|
+
// In Vite 6, we must include `defaultServerConditions` alongside
|
|
55
|
+
// `react-server` so that nested condition maps (e.g. the `node`
|
|
56
|
+
// sub-condition inside `react-server-dom-webpack/server`'s exports)
|
|
57
|
+
// can still be resolved. Without `node` (or another environment
|
|
58
|
+
// condition), the resolver throws "No known conditions for
|
|
59
|
+
// './server' specifier in 'react-server-dom-webpack' package".
|
|
60
|
+
externalConditions: ["react-server", ...defaultServerConditions]
|
|
55
61
|
}
|
|
56
62
|
},
|
|
57
63
|
build: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rscBuildForServer.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildForServer.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,+
|
|
1
|
+
{"version":3,"file":"rscBuildForServer.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildForServer.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,+GAkJtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { build as viteBuild } from "vite";
|
|
1
|
+
import { build as viteBuild, defaultServerConditions } from "vite";
|
|
2
2
|
import { getPaths } from "@cedarjs/project-config";
|
|
3
3
|
import { getEntries } from "../lib/entries.js";
|
|
4
4
|
import { onWarn } from "../lib/onWarn.js";
|
|
@@ -58,8 +58,15 @@ async function rscBuildForServer(clientEntryFiles, serverEntryFiles, customModul
|
|
|
58
58
|
// dependencies apart from node built-ins.
|
|
59
59
|
// TODO (RSC): What's the difference between `conditions` and
|
|
60
60
|
// `externalConditions`? When is one used over the other?
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
//
|
|
62
|
+
// In Vite 6, we must include `defaultServerConditions` alongside
|
|
63
|
+
// `react-server` so that nested condition maps (e.g. the `node`
|
|
64
|
+
// sub-condition inside `react-server-dom-webpack/server`'s exports)
|
|
65
|
+
// can still be resolved. Without `node` (or another environment
|
|
66
|
+
// condition), the commonjs resolver throws "No known conditions for
|
|
67
|
+
// './server' specifier in 'react-server-dom-webpack' package".
|
|
68
|
+
conditions: ["react-server", ...defaultServerConditions],
|
|
69
|
+
externalConditions: ["react-server", ...defaultServerConditions]
|
|
63
70
|
}
|
|
64
71
|
},
|
|
65
72
|
plugins: [
|
package/dist/rsc/rscRenderer.js
CHANGED
|
@@ -10,7 +10,7 @@ async function renderRscToStream(input) {
|
|
|
10
10
|
async function loadServerFile(filePath) {
|
|
11
11
|
console.log("rscRenderer.ts loadServerFile filePath", filePath);
|
|
12
12
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
13
|
-
const serverMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
13
|
+
const serverMod = await globalThis.__cedarjs__vite_rsc_runtime.import(filePath);
|
|
14
14
|
return serverMod.default ? serverMod.default : serverMod;
|
|
15
15
|
}
|
|
16
16
|
return import(`file://${filePath}`);
|
|
@@ -18,7 +18,7 @@ async function loadServerFile(filePath) {
|
|
|
18
18
|
const getRoutesComponent = async () => {
|
|
19
19
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
20
20
|
const routesPath2 = getPaths().web.routes;
|
|
21
|
-
const routesMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
21
|
+
const routesMod = await globalThis.__cedarjs__vite_rsc_runtime.import(routesPath2);
|
|
22
22
|
return routesMod.default;
|
|
23
23
|
}
|
|
24
24
|
const serverEntries = await getEntriesFromDist();
|
package/dist/rsc/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/rsc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C;;;GAGG;AACH,wBAAsB,cAAc,iBAQnC;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/rsc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C;;;GAGG;AACH,wBAAsB,cAAc,iBAQnC;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,CAUhE"}
|
package/dist/rsc/utils.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
async function importRscReact() {
|
|
2
2
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
3
|
-
const reactMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
3
|
+
const reactMod = await globalThis.__cedarjs__vite_rsc_runtime.import("react");
|
|
4
4
|
return reactMod.default;
|
|
5
5
|
}
|
|
6
6
|
return import("react");
|
|
7
7
|
}
|
|
8
8
|
async function importRsdwServer() {
|
|
9
9
|
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
10
|
-
const rsdwServerMod = await globalThis.__cedarjs__vite_rsc_runtime.
|
|
10
|
+
const rsdwServerMod = await globalThis.__cedarjs__vite_rsc_runtime.import(
|
|
11
11
|
"react-server-dom-webpack/server.edge"
|
|
12
12
|
);
|
|
13
13
|
return rsdwServerMod.default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/vite",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.13656+8a19315ca",
|
|
4
4
|
"description": "Vite configuration package for CedarJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"@babel/generator": "7.29.1",
|
|
65
65
|
"@babel/parser": "7.29.2",
|
|
66
66
|
"@babel/traverse": "7.29.0",
|
|
67
|
-
"@cedarjs/auth": "4.0.0-canary.
|
|
68
|
-
"@cedarjs/babel-config": "4.0.0-canary.
|
|
69
|
-
"@cedarjs/cookie-jar": "4.0.0-canary.
|
|
70
|
-
"@cedarjs/internal": "4.0.0-canary.
|
|
71
|
-
"@cedarjs/project-config": "4.0.0-canary.
|
|
72
|
-
"@cedarjs/server-store": "4.0.0-canary.
|
|
73
|
-
"@cedarjs/testing": "4.0.0-canary.
|
|
74
|
-
"@cedarjs/web": "4.0.0-canary.
|
|
67
|
+
"@cedarjs/auth": "4.0.0-canary.13656",
|
|
68
|
+
"@cedarjs/babel-config": "4.0.0-canary.13656",
|
|
69
|
+
"@cedarjs/cookie-jar": "4.0.0-canary.13656",
|
|
70
|
+
"@cedarjs/internal": "4.0.0-canary.13656",
|
|
71
|
+
"@cedarjs/project-config": "4.0.0-canary.13656",
|
|
72
|
+
"@cedarjs/server-store": "4.0.0-canary.13656",
|
|
73
|
+
"@cedarjs/testing": "4.0.0-canary.13656",
|
|
74
|
+
"@cedarjs/web": "4.0.0-canary.13656",
|
|
75
75
|
"@swc/core": "1.15.18",
|
|
76
76
|
"@vitejs/plugin-react": "4.7.0",
|
|
77
77
|
"@whatwg-node/fetch": "0.10.13",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"react": "19.2.3",
|
|
90
90
|
"react-server-dom-webpack": "19.2.4",
|
|
91
91
|
"rimraf": "6.1.3",
|
|
92
|
-
"vite": "
|
|
92
|
+
"vite": "6.3.7",
|
|
93
93
|
"vite-plugin-cjs-interop": "2.4.4",
|
|
94
94
|
"vite-plugin-node-polyfills": "0.25.0",
|
|
95
95
|
"ws": "8.19.0",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"publishConfig": {
|
|
116
116
|
"access": "public"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "8a19315ca33a674f71575730b73169c48b6a48dd"
|
|
119
119
|
}
|