@cedarjs/vite 7.0.0-rc.128 → 8.0.0-canary.3263
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/buildApp.d.ts.map +1 -1
- package/dist/buildApp.js +3 -7
- package/dist/buildRouteHooks.d.ts +7 -13
- package/dist/buildRouteHooks.d.ts.map +1 -1
- package/dist/buildRouteHooks.js +5 -10
- package/dist/bundled/react-server-dom-webpack.server.js +2263 -29124
- package/dist/devFeServer.js +278 -19
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/lib/registerFwGlobalsAndShims.js +9 -0
- package/dist/plugins/vite-plugin-cedar-cell.d.ts +2 -1
- package/dist/plugins/vite-plugin-cedar-cell.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-cedar-cell.js +30 -11
- package/dist/plugins/vite-plugin-cedar-parsed-scalars.d.ts +20 -0
- package/dist/plugins/vite-plugin-cedar-parsed-scalars.d.ts.map +1 -0
- package/dist/plugins/vite-plugin-cedar-parsed-scalars.js +60 -0
- package/dist/plugins/vite-plugin-handler-als-wrapping.d.ts +2 -6
- package/dist/plugins/vite-plugin-handler-als-wrapping.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-handler-als-wrapping.js +4 -7
- package/dist/plugins/vite-plugin-rsc-ssr-router-import.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-rsc-ssr-router-import.js +2 -2
- package/dist/plugins/vite-plugin-rsc-transform-server.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-rsc-transform-server.js +4 -0
- package/dist/rsc/rscRenderer.d.ts.map +1 -1
- package/dist/rsc/rscRenderer.js +19 -5
- package/dist/rsc/rscRequestHandler.d.ts +2 -2
- package/dist/rsc/rscRequestHandler.d.ts.map +1 -1
- package/dist/rsc/rscRequestHandler.js +4 -4
- package/dist/rsc/rscWebSocketServer.d.ts +2 -0
- package/dist/rsc/rscWebSocketServer.d.ts.map +1 -0
- package/dist/rsc/rscWebSocketServer.js +22 -0
- package/dist/rsc/utils.d.ts +10 -0
- package/dist/rsc/utils.d.ts.map +1 -0
- package/dist/rsc/utils.js +21 -0
- package/dist/runFeServer.js +5 -24
- package/dist/streaming/createReactStreamingHandler.d.ts +1 -1
- package/dist/streaming/createReactStreamingHandler.d.ts.map +1 -1
- package/dist/streaming/createReactStreamingHandler.js +13 -10
- package/dist/streaming/streamHelpers.d.ts +8 -3
- package/dist/streaming/streamHelpers.d.ts.map +1 -1
- package/dist/streaming/streamHelpers.js +50 -32
- package/dist/streaming/triggerRouteHooks.d.ts +2 -2
- package/dist/streaming/triggerRouteHooks.d.ts.map +1 -1
- package/dist/streaming/triggerRouteHooks.js +3 -3
- package/package.json +31 -29
package/dist/buildApp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA6DA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,EAC1B,EAAU,GACX,GAAE,oBAAyB,
|
|
1
|
+
{"version":3,"file":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA6DA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,EAC1B,EAAU,GACX,GAAE,oBAAyB,iBAsa3B"}
|
package/dist/buildApp.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
applySrcAlias
|
|
21
21
|
} from "@cedarjs/internal/dist/build/api.js";
|
|
22
22
|
import { findApiFiles } from "@cedarjs/internal/dist/files.js";
|
|
23
|
-
import { getConfig, getPaths
|
|
23
|
+
import { getConfig, getPaths } from "@cedarjs/project-config";
|
|
24
24
|
import { generateDiffSourceMap } from "./lib/generateDiffSourceMap.js";
|
|
25
25
|
import { getWorkspacePackageAliases } from "./lib/workspacePackageAliases.js";
|
|
26
26
|
import { cedarAutoImportsPlugin } from "./plugins/vite-plugin-cedar-auto-import.js";
|
|
@@ -60,8 +60,6 @@ async function buildCedarApp({
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
if (workspace.includes("api")) {
|
|
63
|
-
const isEsm = projectSideIsEsm("api");
|
|
64
|
-
const format = isEsm ? "es" : "cjs";
|
|
65
63
|
const apiFiles = findApiFiles();
|
|
66
64
|
const input = {};
|
|
67
65
|
for (const f of apiFiles) {
|
|
@@ -77,7 +75,7 @@ async function buildCedarApp({
|
|
|
77
75
|
rollupOptions: {
|
|
78
76
|
input,
|
|
79
77
|
output: {
|
|
80
|
-
format,
|
|
78
|
+
format: "es",
|
|
81
79
|
preserveModules: true,
|
|
82
80
|
preserveModulesRoot: cedarPaths.api.src,
|
|
83
81
|
entryFileNames: "[name].js",
|
|
@@ -256,9 +254,7 @@ async function buildCedarApp({
|
|
|
256
254
|
plugins.push(cedarDirectoryNamedImportPlugin());
|
|
257
255
|
plugins.push(cedarOtelWrappingPlugin());
|
|
258
256
|
plugins.push(cedarjsJobPathInjectorPlugin());
|
|
259
|
-
plugins.push(
|
|
260
|
-
handlerAlsWrappingPlugin({ projectIsEsm: projectSideIsEsm("api") })
|
|
261
|
-
);
|
|
257
|
+
plugins.push(handlerAlsWrappingPlugin());
|
|
262
258
|
}
|
|
263
259
|
plugins.push(cedarMockCellDataPlugin());
|
|
264
260
|
if (workspace.includes("api")) {
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import type { Paths } from '@cedarjs/project-config';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Returns the path, relative to `web/dist/ssr/routeHooks`, that the built
|
|
10
|
-
* version of the given route hook source file is written to. The layout
|
|
11
|
-
* mirrors `web/src`, so `web/src/pages/HomePage/HomePage.routeHooks.ts` ends
|
|
12
|
-
* up at `pages/HomePage/HomePage.routeHooks.js` and `web/src/App.routeHooks.ts`
|
|
13
|
-
* at `App.routeHooks.js` (`.mjs` in a CommonJS web side, see
|
|
14
|
-
* getRouteHookDistExtension()).
|
|
3
|
+
* Returns the path, relative to `web/dist/ssr/routeHooks` and with a `.js`
|
|
4
|
+
* extension, that the built version of the given route hook source file is
|
|
5
|
+
* written to. The layout mirrors `web/src`, so
|
|
6
|
+
* `web/src/pages/HomePage/HomePage.routeHooks.ts` ends up at
|
|
7
|
+
* `pages/HomePage/HomePage.routeHooks.js` and `web/src/App.routeHooks.ts` at
|
|
8
|
+
* `App.routeHooks.js`.
|
|
15
9
|
*
|
|
16
10
|
* Used both by the build (to name the Rollup entries) and by the route
|
|
17
11
|
* manifest (so the streaming handler can find the file at request time).
|
|
18
12
|
*/
|
|
19
|
-
export declare function getRouteHookDistPath(routeHookSrcPath: string, webSrc?: string
|
|
13
|
+
export declare function getRouteHookDistPath(routeHookSrcPath: string, webSrc?: string): string;
|
|
20
14
|
/**
|
|
21
15
|
* Bundles every `web/src/** /*.routeHooks.{js,ts,tsx,jsx}` file into
|
|
22
16
|
* `web/dist/ssr/routeHooks` as a node ESM module, one output file per route
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRouteHooks.d.ts","sourceRoot":"","sources":["../src/buildRouteHooks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAiBpD
|
|
1
|
+
{"version":3,"file":"buildRouteHooks.d.ts","sourceRoot":"","sources":["../src/buildRouteHooks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAiBpD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,MAAM,EACxB,MAAM,SAAqB,UAG5B;AA6BD;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,OAAO,EAAE,KAAK,iBAuEf"}
|
package/dist/buildRouteHooks.js
CHANGED
|
@@ -3,7 +3,7 @@ import { build as viteBuild } from "vite";
|
|
|
3
3
|
import { gqlPlugin as gqlTagPlugin } from "vite-plugin-graphql-tag";
|
|
4
4
|
import tsPathsMod from "vite-tsconfig-paths";
|
|
5
5
|
import { findRouteHooksSrc } from "@cedarjs/internal/dist/files.js";
|
|
6
|
-
import { getPaths
|
|
6
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
7
7
|
import { cedarApiImportGuardPlugin } from "./plugins/vite-plugin-cedar-api-import-guard.js";
|
|
8
8
|
import { cedarAutoImportsPlugin } from "./plugins/vite-plugin-cedar-auto-import.js";
|
|
9
9
|
import { cedarDirectoryNamedImportPlugin } from "./plugins/vite-plugin-cedar-directory-named-import.js";
|
|
@@ -13,11 +13,8 @@ const tsconfigPaths = (
|
|
|
13
13
|
// interop
|
|
14
14
|
tsPathsMod.default?.default || tsPathsMod.default || tsPathsMod
|
|
15
15
|
);
|
|
16
|
-
function
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
function getRouteHookDistPath(routeHookSrcPath, webSrc = getPaths().web.src, extension = getRouteHookDistExtension()) {
|
|
20
|
-
return getRouteHookEntryName(routeHookSrcPath, webSrc) + extension;
|
|
16
|
+
function getRouteHookDistPath(routeHookSrcPath, webSrc = getPaths().web.src) {
|
|
17
|
+
return getRouteHookEntryName(routeHookSrcPath, webSrc) + ".js";
|
|
21
18
|
}
|
|
22
19
|
function getRouteHookEntryName(routeHookSrcPath, webSrc) {
|
|
23
20
|
return path.relative(webSrc, routeHookSrcPath).replace(/\.(js|ts|tsx|jsx)$/, "").split(path.sep).join("/");
|
|
@@ -38,7 +35,6 @@ async function buildRouteHooks(verbose, rwPaths) {
|
|
|
38
35
|
for (const routeHook of allRouteHooks) {
|
|
39
36
|
input[getRouteHookEntryName(routeHook, rwPaths.web.src)] = routeHook;
|
|
40
37
|
}
|
|
41
|
-
const extension = getRouteHookDistExtension();
|
|
42
38
|
await viteBuild({
|
|
43
39
|
// Route hooks run in node, so the project's web/vite.config, which is set
|
|
44
40
|
// up for browser and SSR builds of React code, doesn't apply. Only the
|
|
@@ -81,9 +77,9 @@ async function buildRouteHooks(verbose, rwPaths) {
|
|
|
81
77
|
input,
|
|
82
78
|
output: {
|
|
83
79
|
format: "es",
|
|
84
|
-
entryFileNames: "[name]"
|
|
80
|
+
entryFileNames: "[name].js",
|
|
85
81
|
// Modules shared between route hooks, like the api side's db.js
|
|
86
|
-
chunkFileNames: "chunks/[name]-[hash]"
|
|
82
|
+
chunkFileNames: "chunks/[name]-[hash].js",
|
|
87
83
|
exports: "named"
|
|
88
84
|
}
|
|
89
85
|
}
|
|
@@ -100,6 +96,5 @@ async function buildRouteHooks(verbose, rwPaths) {
|
|
|
100
96
|
}
|
|
101
97
|
export {
|
|
102
98
|
buildRouteHooks,
|
|
103
|
-
getRouteHookDistExtension,
|
|
104
99
|
getRouteHookDistPath
|
|
105
100
|
};
|