vite-plugin-react-server 0.3.11 → 0.3.12
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/package.json +15 -11
- package/dist/plugin/checkFilesExist.d.ts +2 -2
- package/dist/plugin/checkFilesExist.d.ts.map +1 -1
- package/dist/plugin/checkFilesExist.js +39 -57
- package/dist/plugin/checkFilesExist.js.map +1 -1
- package/dist/plugin/collect-css-manifest.d.ts.map +1 -1
- package/dist/plugin/collect-css-manifest.js +5 -0
- package/dist/plugin/collect-css-manifest.js.map +1 -1
- package/dist/plugin/components.js +10 -15
- package/dist/plugin/config/createModuleIdGenerator.js +1 -1
- package/dist/plugin/config/createModuleIdGenerator.js.map +1 -1
- package/dist/plugin/config/defaults.d.ts +5 -14
- package/dist/plugin/config/defaults.d.ts.map +1 -1
- package/dist/plugin/config/defaults.js +12 -12
- package/dist/plugin/config/defaults.js.map +1 -1
- package/dist/plugin/config/getPaths.js +1 -1
- package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
- package/dist/plugin/config/resolveOptions.js +73 -52
- package/dist/plugin/config/resolveOptions.js.map +1 -1
- package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
- package/dist/plugin/config/resolveUserConfig.js +53 -65
- package/dist/plugin/config/resolveUserConfig.js.map +1 -1
- package/dist/plugin/helpers/getBundleManifest.d.ts +6 -1
- package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/getBundleManifest.js +48 -19
- package/dist/plugin/helpers/getBundleManifest.js.map +1 -1
- package/dist/plugin/helpers/inputNormalizer.d.ts +1 -2
- package/dist/plugin/helpers/inputNormalizer.d.ts.map +1 -1
- package/dist/plugin/helpers/inputNormalizer.js +52 -46
- package/dist/plugin/helpers/inputNormalizer.js.map +1 -1
- package/dist/plugin/helpers/tryManifest.d.ts +1 -1
- package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/tryManifest.js.map +1 -1
- package/dist/plugin/loader/createBuildLoader.d.ts +1 -1
- package/dist/plugin/loader/createBuildLoader.d.ts.map +1 -1
- package/dist/plugin/loader/createBuildLoader.js +29 -26
- package/dist/plugin/loader/createBuildLoader.js.map +1 -1
- package/dist/plugin/loader/css-loader.d.ts +16 -0
- package/dist/plugin/loader/css-loader.d.ts.map +1 -0
- package/dist/plugin/loader/css-loader.js +70 -0
- package/dist/plugin/loader/css-loader.js.map +1 -0
- package/dist/plugin/loader/react-loader.d.ts +17 -0
- package/dist/plugin/loader/react-loader.d.ts.map +1 -0
- package/dist/plugin/loader/react-loader.js +647 -0
- package/dist/plugin/loader/react-loader.js.map +1 -0
- package/dist/plugin/loader/rsc/messageHandler.d.ts +2 -0
- package/dist/plugin/loader/rsc/messageHandler.d.ts.map +1 -0
- package/dist/plugin/loader/rsc/messageHandler.js +1 -0
- package/dist/plugin/loader/rsc/rsc-worker.development.d.ts +2 -0
- package/dist/plugin/loader/rsc/rsc-worker.development.d.ts.map +1 -0
- package/dist/plugin/loader/rsc/rsc-worker.development.js +1 -0
- package/dist/plugin/react-client/index.js +2 -2
- package/dist/plugin/react-client/index.js.map +1 -1
- package/dist/plugin/react-client/plugin.d.ts.map +1 -1
- package/dist/plugin/react-client/plugin.js +202 -25
- package/dist/plugin/react-client/plugin.js.map +1 -1
- package/dist/plugin/react-server/createHandler.d.ts.map +1 -1
- package/dist/plugin/react-server/createHandler.js +10 -4
- package/dist/plugin/react-server/createHandler.js.map +1 -1
- package/dist/plugin/react-server/createRscStream.d.ts +15 -3
- package/dist/plugin/react-server/createRscStream.d.ts.map +1 -1
- package/dist/plugin/react-server/createRscStream.js +52 -49
- package/dist/plugin/react-server/createRscStream.js.map +1 -1
- package/dist/plugin/react-server/plugin.d.ts.map +1 -1
- package/dist/plugin/react-server/plugin.js +24 -20
- package/dist/plugin/react-server/plugin.js.map +1 -1
- package/dist/plugin/transformer/plugin.d.ts.map +1 -1
- package/dist/plugin/transformer/plugin.js +65 -52
- package/dist/plugin/transformer/plugin.js.map +1 -1
- package/dist/plugin/types.d.ts +5 -0
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/utils/logger.d.ts +9 -0
- package/dist/plugin/utils/logger.d.ts.map +1 -0
- package/dist/plugin/utils/logger.js +68 -0
- package/dist/plugin/utils/logger.js.map +1 -0
- package/dist/plugin/worker/createWorker.d.ts +1 -0
- package/dist/plugin/worker/createWorker.d.ts.map +1 -1
- package/dist/plugin/worker/createWorker.js +23 -36
- package/dist/plugin/worker/createWorker.js.map +1 -1
- package/dist/plugin/worker/html/html-worker.production.js +5 -1
- package/dist/plugin/worker/html/html-worker.production.js.map +1 -1
- package/dist/plugin/worker/html/messageHandler.d.ts.map +1 -1
- package/dist/plugin/worker/html/messageHandler.js +10 -19
- package/dist/plugin/worker/html/messageHandler.js.map +1 -1
- package/dist/plugin/worker/html/renderPages.d.ts +2 -2
- package/dist/plugin/worker/html/renderPages.d.ts.map +1 -1
- package/dist/plugin/worker/html/renderPages.js +130 -131
- package/dist/plugin/worker/html/renderPages.js.map +1 -1
- package/dist/plugin/worker/rsc/index.d.ts +1 -3
- package/dist/plugin/worker/rsc/index.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/index.js +1 -9
- package/dist/plugin/worker/rsc/index.js.map +1 -1
- package/dist/plugin/worker/rsc/messageHandler.d.ts +3 -0
- package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/messageHandler.js +107 -0
- package/dist/plugin/worker/rsc/messageHandler.js.map +1 -0
- package/dist/plugin/worker/rsc/plugin.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/plugin.js +74 -80
- package/dist/plugin/worker/rsc/rsc-worker.development.d.ts +32 -0
- package/dist/plugin/worker/rsc/rsc-worker.development.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/rsc-worker.development.js +43 -0
- package/dist/plugin/worker/rsc/rsc-worker.development.js.map +1 -0
- package/dist/plugin/worker/rsc/rsc-worker.js +4 -106
- package/dist/plugin/worker/rsc/rsc-worker.production.d.ts +2 -0
- package/dist/plugin/worker/rsc/rsc-worker.production.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/rsc-worker.production.js +14 -0
- package/dist/plugin/worker/rsc/rsc-worker.production.js.map +1 -0
- package/dist/plugin/worker/rsc/state.d.ts +11 -0
- package/dist/plugin/worker/rsc/state.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/state.js +12 -0
- package/dist/plugin/worker/rsc/state.js.map +1 -0
- package/dist/plugin/worker/types.d.ts +60 -46
- package/dist/plugin/worker/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -11
- package/plugin/checkFilesExist.ts +42 -62
- package/plugin/collect-css-manifest.ts +5 -1
- package/plugin/config/createModuleIdGenerator.ts +1 -1
- package/plugin/config/defaults.ts +13 -15
- package/plugin/config/resolveOptions.ts +134 -76
- package/plugin/config/resolveUserConfig.ts +75 -76
- package/plugin/helpers/getBundleManifest.ts +69 -31
- package/plugin/helpers/inputNormalizer.ts +82 -70
- package/plugin/helpers/tryManifest.ts +1 -1
- package/plugin/loader/createBuildLoader.ts +38 -41
- package/plugin/loader/css-loader.ts +96 -0
- package/plugin/loader/react-loader.ts +945 -0
- package/plugin/loader/rsc/messageHandler.tsx +1 -0
- package/plugin/loader/rsc/rsc-worker.development.ts +1 -0
- package/plugin/react-client/index.ts +1 -1
- package/plugin/react-client/plugin.ts +266 -41
- package/plugin/react-server/createHandler.ts +9 -5
- package/plugin/react-server/createRscStream.ts +75 -54
- package/plugin/react-server/plugin.ts +26 -21
- package/plugin/transformer/plugin.ts +67 -76
- package/plugin/types/global.d.ts +8 -0
- package/plugin/types.ts +2 -0
- package/plugin/utils/logger.ts +52 -0
- package/plugin/worker/createWorker.ts +43 -44
- package/plugin/worker/html/html-worker.production.tsx +7 -2
- package/plugin/worker/html/messageHandler.ts +13 -21
- package/plugin/worker/html/renderPages.ts +146 -179
- package/plugin/worker/rsc/index.ts +4 -13
- package/plugin/worker/rsc/messageHandler.tsx +143 -0
- package/plugin/worker/rsc/plugin.ts +38 -37
- package/plugin/worker/rsc/rsc-worker.development.ts +107 -0
- package/plugin/worker/rsc/rsc-worker.production.ts +13 -0
- package/plugin/worker/rsc/rsc-worker.tsx +5 -128
- package/plugin/worker/rsc/state.ts +37 -0
- package/plugin/worker/types.ts +79 -55
- package/scripts/check-react-version.mjs +17 -7
- package/scripts/react+0.0.0-experimental-b3a95caf-20250113.patch +143 -4170
- package/scripts/react-dom+0.0.0-experimental-b3a95caf-20250113.patch +14271 -90079
- package/dist/plugin/components.js.map +0 -1
- package/dist/plugin/helpers/createClientInputNormalizer.d.ts +0 -8
- package/dist/plugin/helpers/createClientInputNormalizer.d.ts.map +0 -1
- package/dist/plugin/helpers/createClientInputNormalizer.js +0 -35
- package/dist/plugin/helpers/createServerInputNormalizer.d.ts +0 -9
- package/dist/plugin/helpers/createServerInputNormalizer.d.ts.map +0 -1
- package/dist/plugin/helpers/createServerInputNormalizer.js +0 -37
- package/dist/plugin/helpers/createStaticInputNormalizer.d.ts +0 -7
- package/dist/plugin/helpers/createStaticInputNormalizer.d.ts.map +0 -1
- package/dist/plugin/helpers/createStaticInputNormalizer.js +0 -18
- package/dist/plugin/helpers/getModuleManifest.d.ts +0 -17
- package/dist/plugin/helpers/getModuleManifest.d.ts.map +0 -1
- package/dist/plugin/helpers/getModuleManifest.js +0 -23
- package/dist/plugin/helpers/inputNormalizerWorker.d.ts +0 -12
- package/dist/plugin/helpers/inputNormalizerWorker.d.ts.map +0 -1
- package/dist/plugin/helpers/inputNormalizerWorker.js +0 -33
- package/dist/plugin/helpers/normalizedRelativePath.d.ts +0 -11
- package/dist/plugin/helpers/normalizedRelativePath.d.ts.map +0 -1
- package/dist/plugin/helpers/normalizedRelativePath.js +0 -36
- package/dist/plugin/helpers/resolveFilePath.d.ts +0 -13
- package/dist/plugin/helpers/resolveFilePath.d.ts.map +0 -1
- package/dist/plugin/helpers/resolveFilePath.js +0 -74
- package/dist/plugin/helpers/resolveWorkerModule.d.ts +0 -6
- package/dist/plugin/helpers/resolveWorkerModule.d.ts.map +0 -1
- package/dist/plugin/helpers/resolveWorkerModule.js +0 -24
- package/dist/plugin/helpers/validateModuleBase.d.ts +0 -3
- package/dist/plugin/helpers/validateModuleBase.d.ts.map +0 -1
- package/dist/plugin/helpers/validateModuleBase.js +0 -16
- package/dist/plugin/helpers/validateResolvedConfig.d.ts +0 -3
- package/dist/plugin/helpers/validateResolvedConfig.d.ts.map +0 -1
- package/dist/plugin/helpers/validateResolvedConfig.js +0 -17
- package/dist/plugin/transformer/transformer-client-components.d.ts +0 -30
- package/dist/plugin/transformer/transformer-client-components.d.ts.map +0 -1
- package/dist/plugin/transformer/transformer-client-components.js +0 -122
- package/dist/plugin/transformer/transformer-client-components.js.map +0 -1
- package/dist/plugin/transformer/transformer-server-actions.d.ts +0 -29
- package/dist/plugin/transformer/transformer-server-actions.d.ts.map +0 -1
- package/dist/plugin/transformer/transformer-server-actions.js +0 -90
- package/dist/plugin/worker/rsc/createRscStream.d.ts +0 -5
- package/dist/plugin/worker/rsc/createRscStream.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/createRscStream.js +0 -39
- package/dist/plugin/worker/rsc/createRscStream.js.map +0 -1
- package/dist/plugin/worker/rsc/development.d.ts +0 -5
- package/dist/plugin/worker/rsc/development.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/development.js +0 -13
- package/dist/plugin/worker/rsc/development.js.map +0 -1
- package/dist/plugin/worker/rsc/plugin.js.map +0 -1
- package/dist/plugin/worker/rsc/production.d.ts +0 -5
- package/dist/plugin/worker/rsc/production.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/production.js +0 -13
- package/dist/plugin/worker/rsc/production.js.map +0 -1
- package/plugin/helpers/createClientInputNormalizer.ts +0 -48
- package/plugin/helpers/createServerInputNormalizer.ts +0 -52
- package/plugin/helpers/createStaticInputNormalizer.ts +0 -26
- package/plugin/helpers/getModuleManifest.ts +0 -36
- package/plugin/helpers/inputNormalizerWorker.ts +0 -52
- package/plugin/helpers/normalizedRelativePath.ts +0 -59
- package/plugin/helpers/resolveFilePath.ts +0 -108
- package/plugin/helpers/resolveWorkerModule.ts +0 -41
- package/plugin/helpers/validateModuleBase.ts +0 -30
- package/plugin/helpers/validateResolvedConfig.ts +0 -21
- package/plugin/transformer/transformer-client-components.ts +0 -168
- package/plugin/transformer/transformer-server-actions.ts +0 -125
- package/plugin/worker/rsc/createRscStream.ts +0 -42
- package/plugin/worker/rsc/development.ts +0 -6
- package/plugin/worker/rsc/production.ts +0 -6
- package/scripts/react-server-dom-esm+0.0.1.patch +0 -24775
|
@@ -1,82 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { DEFAULT_CONFIG } from "../../config/defaults.js";
|
|
3
|
+
import { getPluginRoot } from "../../config/getPaths.js";
|
|
4
|
+
export function reactRscWorkerPlugin(options) {
|
|
5
|
+
return {
|
|
6
|
+
name: "vite:react-rsc-worker",
|
|
7
|
+
config(config) {
|
|
8
|
+
const root = config.root ?? process.cwd();
|
|
9
|
+
const pluginRoot = getPluginRoot();
|
|
10
|
+
const rscWorkerPath = typeof options.rscWorkerPath === "string"
|
|
11
|
+
? resolve(root, options.rscWorkerPath)
|
|
12
|
+
: resolve(pluginRoot, DEFAULT_CONFIG.RSC_WORKER_PATH);
|
|
13
|
+
const format = "esm";
|
|
14
|
+
// Single worker output for server build
|
|
15
|
+
const workerConfig = {
|
|
16
|
+
input: {
|
|
17
|
+
"rsc-worker": rscWorkerPath,
|
|
18
|
+
},
|
|
19
|
+
output: {
|
|
20
|
+
format,
|
|
21
|
+
dir: options.build?.server ?? "dist/server", // Output to server directory
|
|
22
|
+
entryFileNames: "[name].js",
|
|
23
|
+
preserveModules: true,
|
|
24
|
+
manualChunks: {
|
|
25
|
+
"rsc-worker": [rscWorkerPath],
|
|
26
|
+
},
|
|
27
|
+
resolve: {
|
|
28
|
+
conditions: ["react-server"],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
build: {
|
|
34
|
+
rollupOptions: {
|
|
35
|
+
preserveEntrySignatures: "strict",
|
|
36
|
+
input: {
|
|
37
|
+
...workerConfig.input,
|
|
38
|
+
...(typeof config.build?.rollupOptions?.input === "object"
|
|
39
|
+
? config.build?.rollupOptions?.input
|
|
40
|
+
: {}),
|
|
41
|
+
},
|
|
42
|
+
external: [
|
|
43
|
+
"vite",
|
|
44
|
+
"rollup",
|
|
45
|
+
"react",
|
|
46
|
+
"react-dom",
|
|
47
|
+
"react-dom/server",
|
|
48
|
+
"react-server-dom-esm",
|
|
49
|
+
"react-server-dom-esm/client.node",
|
|
50
|
+
"react-server-dom-esm/server.node",
|
|
51
|
+
"react-server-dom-esm/node-loader",
|
|
52
|
+
"source-map",
|
|
53
|
+
"acorn-loose",
|
|
54
|
+
"webpack-sources",
|
|
55
|
+
"stream",
|
|
56
|
+
"util",
|
|
57
|
+
"crypto",
|
|
58
|
+
"async_hooks",
|
|
59
|
+
"fs",
|
|
60
|
+
"path",
|
|
61
|
+
"worker_threads",
|
|
62
|
+
// if we use node: paths in our code, it should always be catched by below rule.
|
|
63
|
+
/^node:.*/,
|
|
64
|
+
],
|
|
65
|
+
output: {
|
|
66
|
+
...workerConfig.output,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
manifest: true, // Ensure manifest is generated
|
|
70
|
+
minify: false,
|
|
71
|
+
sourcemap: true,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
21
74
|
},
|
|
22
|
-
|
|
23
|
-
format,
|
|
24
|
-
dir: options.build?.server ?? "dist/server",
|
|
25
|
-
// Output to server directory
|
|
26
|
-
entryFileNames: "[name].js",
|
|
27
|
-
preserveModules: true,
|
|
28
|
-
manualChunks: {
|
|
29
|
-
"rsc-worker": [rscWorkerPath]
|
|
30
|
-
},
|
|
31
|
-
resolve: {
|
|
32
|
-
conditions: ["react-server"]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
return {
|
|
37
|
-
build: {
|
|
38
|
-
rollupOptions: {
|
|
39
|
-
preserveEntrySignatures: "strict",
|
|
40
|
-
input: {
|
|
41
|
-
...workerConfig.input,
|
|
42
|
-
...typeof config.build?.rollupOptions?.input === "object" ? config.build?.rollupOptions?.input : {}
|
|
43
|
-
},
|
|
44
|
-
external: [
|
|
45
|
-
"vite",
|
|
46
|
-
"rollup",
|
|
47
|
-
"react",
|
|
48
|
-
"react-dom",
|
|
49
|
-
"react-dom/server",
|
|
50
|
-
"react-server-dom-esm",
|
|
51
|
-
"react-server-dom-esm/client.node",
|
|
52
|
-
"react-server-dom-esm/server.node",
|
|
53
|
-
"react-server-dom-esm/node-loader",
|
|
54
|
-
"source-map",
|
|
55
|
-
"acorn-loose",
|
|
56
|
-
"webpack-sources",
|
|
57
|
-
"stream",
|
|
58
|
-
"util",
|
|
59
|
-
"crypto",
|
|
60
|
-
"async_hooks",
|
|
61
|
-
"fs",
|
|
62
|
-
"path",
|
|
63
|
-
"worker_threads",
|
|
64
|
-
// if we use node: paths in our code, it should always be catched by below rule.
|
|
65
|
-
/^node:.*/
|
|
66
|
-
],
|
|
67
|
-
output: {
|
|
68
|
-
...workerConfig.output
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
manifest: true,
|
|
72
|
-
// Ensure manifest is generated
|
|
73
|
-
minify: false,
|
|
74
|
-
sourcemap: true
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
};
|
|
75
|
+
};
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
export { reactRscWorkerPlugin };
|
|
82
|
-
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare module 'node:module' {
|
|
2
|
+
interface ImportAttributes {
|
|
3
|
+
[key: string]: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
interface ResolveHookContext {
|
|
6
|
+
conditions: string[];
|
|
7
|
+
parentURL: string | undefined;
|
|
8
|
+
importAttributes: ImportAttributes;
|
|
9
|
+
}
|
|
10
|
+
interface LoadHookContext {
|
|
11
|
+
conditions: string[];
|
|
12
|
+
format: ModuleFormat | null | undefined;
|
|
13
|
+
importAttributes: ImportAttributes;
|
|
14
|
+
shortCircuit?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface ResolveResult {
|
|
17
|
+
url: string;
|
|
18
|
+
shortCircuit: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface LoadResult {
|
|
21
|
+
format: string;
|
|
22
|
+
source: string | SharedArrayBuffer | Uint8Array;
|
|
23
|
+
shortCircuit: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface HooksAPI {
|
|
26
|
+
resolve?: (specifier: string, context: ResolveHookContext, nextResolve: (specifier: string, context: ResolveHookContext) => ResolveResult) => ResolveResult;
|
|
27
|
+
load?: (url: string, context: LoadHookContext, nextLoad: (url: string, context: LoadHookContext) => LoadResult) => LoadResult;
|
|
28
|
+
}
|
|
29
|
+
function registerHooks(hooks: HooksAPI): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=rsc-worker.development.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc-worker.development.d.ts","sourceRoot":"","sources":["../../../../plugin/worker/rsc/rsc-worker.development.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAiB,gBAAgB;QAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACnC;IAED,UAAiB,kBAAkB;QACjC,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,gBAAgB,EAAE,gBAAgB,CAAC;KACpC;IAED,UAAiB,eAAe;QAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;QACxC,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;IAED,UAAiB,aAAa;QAC5B,GAAG,EAAE,MAAM,CAAC;QACZ,YAAY,EAAE,OAAO,CAAC;KACvB;IAED,UAAiB,UAAU;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,UAAU,CAAC;QAChD,YAAY,EAAE,OAAO,CAAC;KACvB;IAED,UAAiB,QAAQ;QACvB,OAAO,CAAC,EAAE,CACR,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,KAAK,aAAa,KAC3E,aAAa,CAAC;QAEnB,IAAI,CAAC,EAAE,CACL,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,KAAK,UAAU,KAC5D,UAAU,CAAC;KACjB;IAED,SAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACtD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { MessageChannel, parentPort } from 'node:worker_threads';
|
|
7
|
+
import { messageHandler } from './messageHandler.js';
|
|
8
|
+
import { register } from 'node:module';
|
|
9
|
+
import { register as register$1 } from 'tsx/esm/api';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { getPluginRoot } from '../../config/getPaths.js';
|
|
12
|
+
|
|
13
|
+
new MessageChannel();
|
|
14
|
+
if (!parentPort) {
|
|
15
|
+
throw new Error("This module must be run as a worker");
|
|
16
|
+
}
|
|
17
|
+
const reactLoaderChannel = new MessageChannel();
|
|
18
|
+
const cssLoaderChannel = new MessageChannel();
|
|
19
|
+
reactLoaderChannel.port2.on("message", (msg) => {
|
|
20
|
+
messageHandler(msg);
|
|
21
|
+
});
|
|
22
|
+
cssLoaderChannel.port2.on("message", (msg) => {
|
|
23
|
+
messageHandler(msg);
|
|
24
|
+
});
|
|
25
|
+
const loaderPath = "file://" + join(getPluginRoot(), "loader/react-loader.js");
|
|
26
|
+
const cssLoaderPath = "file://" + join(getPluginRoot(), "loader/css-loader.js");
|
|
27
|
+
console.log("[worker] Full loader path:", loaderPath);
|
|
28
|
+
register(loaderPath, {
|
|
29
|
+
parentURL: getPluginRoot(),
|
|
30
|
+
data: { port: reactLoaderChannel.port1 },
|
|
31
|
+
transferList: [reactLoaderChannel.port1]
|
|
32
|
+
});
|
|
33
|
+
register(cssLoaderPath, {
|
|
34
|
+
parentURL: getPluginRoot(),
|
|
35
|
+
data: { port: cssLoaderChannel.port1 },
|
|
36
|
+
transferList: [cssLoaderChannel.port1]
|
|
37
|
+
});
|
|
38
|
+
register$1();
|
|
39
|
+
parentPort.on("message", (message) => {
|
|
40
|
+
messageHandler(message);
|
|
41
|
+
});
|
|
42
|
+
parentPort.postMessage({ type: "READY", env: "development" });
|
|
43
|
+
//# sourceMappingURL=rsc-worker.development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc-worker.development.js","sources":["../../../../plugin/worker/rsc/rsc-worker.development.ts"],"sourcesContent":["// no offical types for node:module available yet (23.7.0)\ndeclare module 'node:module' {\n export interface ImportAttributes {\n [key: string]: string | undefined;\n }\n\n export interface ResolveHookContext {\n conditions: string[];\n parentURL: string | undefined;\n importAttributes: ImportAttributes;\n }\n\n export interface LoadHookContext {\n conditions: string[];\n format: ModuleFormat | null | undefined;\n importAttributes: ImportAttributes;\n shortCircuit?: boolean;\n }\n\n export interface ResolveResult {\n url: string;\n shortCircuit: boolean;\n }\n\n export interface LoadResult {\n format: string;\n source: string | SharedArrayBuffer | Uint8Array;\n shortCircuit: boolean;\n }\n\n export interface HooksAPI {\n resolve?: (\n specifier: string,\n context: ResolveHookContext,\n nextResolve: (specifier: string, context: ResolveHookContext) => ResolveResult\n ) => ResolveResult;\n\n load?: (\n url: string,\n context: LoadHookContext,\n nextLoad: (url: string, context: LoadHookContext) => LoadResult\n ) => LoadResult;\n }\n\n export function registerHooks(hooks: HooksAPI): void;\n}\n//\nimport { parentPort, MessageChannel } from \"node:worker_threads\";\nimport { messageHandler } from \"./messageHandler.js\";\nimport { createLogger } from \"../../utils/logger.js\";\nimport { \n registerHooks,\n register,\n type ResolveHookContext,\n} from 'node:module';\nimport { register as registerTsx } from \"tsx/esm/api\";\nimport { join } from 'node:path';\nimport { getPluginRoot } from \"../../config/getPaths.js\";\n\nconst ports = new MessageChannel();\n// Initialize worker\nif (!parentPort) {\n throw new Error(\"This module must be run as a worker\");\n}\n\n// Create channels for each loader\nconst reactLoaderChannel = new MessageChannel();\nconst cssLoaderChannel = new MessageChannel();\n\n// Listen for messages from loaders\nreactLoaderChannel.port2.on('message', (msg) => {\n messageHandler(msg);\n});\n\ncssLoaderChannel.port2.on('message', (msg) => {\n messageHandler(msg);\n});\n\nconst loaderPath = 'file://' + join(getPluginRoot(), 'loader/react-loader.js');\nconst cssLoaderPath = 'file://' + join(getPluginRoot(), 'loader/css-loader.js');\nconsole.log('[worker] Full loader path:', loaderPath);\n\n// Register react-loader\nregister(loaderPath, {\n parentURL: getPluginRoot(),\n data: { port: reactLoaderChannel.port1 },\n transferList: [reactLoaderChannel.port1]\n});\nregister(cssLoaderPath, {\n parentURL: getPluginRoot(),\n data: { port: cssLoaderChannel.port1 },\n transferList: [cssLoaderChannel.port1]\n});\n\n// Register loaders\nregisterTsx();\n\n// Set up message handling\nparentPort.on(\"message\", (message) => {\n messageHandler(message);\n});\n\n// Signal ready\nparentPort.postMessage({ type: \"READY\", env: \"development\" });\n\n\n\n"],"names":["registerTsx"],"mappings":";;;;;;;;;;;;AA2Dc,IAAI,cAAe;AAEjC,IAAI,CAAC,UAAY,EAAA;AACf,EAAM,MAAA,IAAI,MAAM,qCAAqC,CAAA;AACvD;AAGA,MAAM,kBAAA,GAAqB,IAAI,cAAe,EAAA;AAC9C,MAAM,gBAAA,GAAmB,IAAI,cAAe,EAAA;AAG5C,kBAAA,CAAmB,KAAM,CAAA,EAAA,CAAG,SAAW,EAAA,CAAC,GAAQ,KAAA;AAC9C,EAAA,cAAA,CAAe,GAAG,CAAA;AACpB,CAAC,CAAA;AAED,gBAAA,CAAiB,KAAM,CAAA,EAAA,CAAG,SAAW,EAAA,CAAC,GAAQ,KAAA;AAC5C,EAAA,cAAA,CAAe,GAAG,CAAA;AACpB,CAAC,CAAA;AAED,MAAM,UAAa,GAAA,SAAA,GAAY,IAAK,CAAA,aAAA,IAAiB,wBAAwB,CAAA;AAC7E,MAAM,aAAgB,GAAA,SAAA,GAAY,IAAK,CAAA,aAAA,IAAiB,sBAAsB,CAAA;AAC9E,OAAQ,CAAA,GAAA,CAAI,8BAA8B,UAAU,CAAA;AAGpD,QAAA,CAAS,UAAY,EAAA;AAAA,EACnB,WAAW,aAAc,EAAA;AAAA,EACzB,IAAM,EAAA,EAAE,IAAM,EAAA,kBAAA,CAAmB,KAAM,EAAA;AAAA,EACvC,YAAA,EAAc,CAAC,kBAAA,CAAmB,KAAK;AACzC,CAAC,CAAA;AACD,QAAA,CAAS,aAAe,EAAA;AAAA,EACtB,WAAW,aAAc,EAAA;AAAA,EACzB,IAAM,EAAA,EAAE,IAAM,EAAA,gBAAA,CAAiB,KAAM,EAAA;AAAA,EACrC,YAAA,EAAc,CAAC,gBAAA,CAAiB,KAAK;AACvC,CAAC,CAAA;AAGDA,UAAY,EAAA;AAGZ,UAAW,CAAA,EAAA,CAAG,SAAW,EAAA,CAAC,OAAY,KAAA;AACpC,EAAA,cAAA,CAAe,OAAO,CAAA;AACxB,CAAC,CAAA;AAGD,UAAA,CAAW,YAAY,EAAE,IAAA,EAAM,OAAS,EAAA,GAAA,EAAK,eAAe,CAAA"}
|
|
@@ -1,106 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { registerClientReference, registerServerReference
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
} from "react-server-dom-esm/server.node";
|
|
8
|
-
import { createRscStream } from "./createRscStream.js";
|
|
9
|
-
if (!parentPort) {
|
|
10
|
-
throw new Error("This module must be run as a worker");
|
|
11
|
-
}
|
|
12
|
-
// Track active renders
|
|
13
|
-
const activeRenders = new Map();
|
|
14
|
-
const activeStreams = new Map();
|
|
15
|
-
const activeWrites = new Map();
|
|
16
|
-
async function shutdown() {
|
|
17
|
-
console.log("[RSC Worker] Shutting down forcefully");
|
|
18
|
-
for (const stream of activeStreams.values()) {
|
|
19
|
-
stream.abort();
|
|
20
|
-
}
|
|
21
|
-
for (const writeStream of activeWrites.values()) {
|
|
22
|
-
writeStream.destroy();
|
|
23
|
-
}
|
|
24
|
-
process.exit(0);
|
|
25
|
-
}
|
|
26
|
-
function sendMessage(message) {
|
|
27
|
-
parentPort?.postMessage(message);
|
|
28
|
-
}
|
|
29
|
-
// Handle incoming messages
|
|
30
|
-
parentPort.on("message", async (message) => {
|
|
31
|
-
if (message.type === "SHUTDOWN") {
|
|
32
|
-
await shutdown();
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
switch (message.type) {
|
|
37
|
-
case "RSC_RENDER": {
|
|
38
|
-
const { id, pageImport, propsImport, outDir, moduleRootPath, moduleBaseURL, pipableStreamOptions } = message;
|
|
39
|
-
// Skip if already rendered
|
|
40
|
-
if (activeRenders.has(id))
|
|
41
|
-
return;
|
|
42
|
-
// Create render state
|
|
43
|
-
const renderState = {
|
|
44
|
-
id,
|
|
45
|
-
outDir,
|
|
46
|
-
moduleRootPath,
|
|
47
|
-
moduleBaseURL,
|
|
48
|
-
rscOutputPath: `${outDir}/${id}.rsc`,
|
|
49
|
-
componentImport: pageImport,
|
|
50
|
-
propsImport,
|
|
51
|
-
pipableStreamOptions
|
|
52
|
-
};
|
|
53
|
-
// Ensure output directory exists
|
|
54
|
-
await mkdir(dirname(renderState.rscOutputPath), { recursive: true });
|
|
55
|
-
const writeStream = createWriteStream(renderState.rscOutputPath);
|
|
56
|
-
// Create stream
|
|
57
|
-
const stream = createRscStream(renderState, writeStream, parentPort);
|
|
58
|
-
// Track active streams
|
|
59
|
-
activeRenders.set(id, renderState);
|
|
60
|
-
activeStreams.set(id, stream);
|
|
61
|
-
activeWrites.set(id, writeStream);
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
case "RSC_END": {
|
|
65
|
-
const { id } = message;
|
|
66
|
-
activeRenders.delete(id);
|
|
67
|
-
activeStreams.delete(id);
|
|
68
|
-
activeWrites.delete(id);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
case "CLIENT_REFERENCE": {
|
|
72
|
-
const { id, location, key } = message;
|
|
73
|
-
const ref = registerClientReference(id, location, key);
|
|
74
|
-
sendMessage({
|
|
75
|
-
type: "CLIENT_REFERENCE",
|
|
76
|
-
id,
|
|
77
|
-
location,
|
|
78
|
-
key,
|
|
79
|
-
ref
|
|
80
|
-
});
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
case "SERVER_REFERENCE": {
|
|
84
|
-
const { id, location, key } = message;
|
|
85
|
-
const ref = registerServerReference(id, location, key);
|
|
86
|
-
sendMessage({
|
|
87
|
-
type: "SERVER_REFERENCE",
|
|
88
|
-
id,
|
|
89
|
-
location,
|
|
90
|
-
key,
|
|
91
|
-
ref
|
|
92
|
-
});
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
sendMessage({
|
|
99
|
-
type: "ERROR",
|
|
100
|
-
id: message.type === "RSC_RENDER" ? message.id : "",
|
|
101
|
-
error: error instanceof Error ? error.message : String(error)
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
// Signal ready
|
|
106
|
-
parentPort.postMessage({ type: "READY" });
|
|
1
|
+
await (process.env["NODE_ENV"] === "production"
|
|
2
|
+
? import("./rsc-worker.production.js")
|
|
3
|
+
: import("./rsc-worker.development.js"));
|
|
4
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc-worker.production.d.ts","sourceRoot":"","sources":["../../../../plugin/worker/rsc/rsc-worker.production.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { parentPort } from 'node:worker_threads';
|
|
7
|
+
import { messageHandler } from './messageHandler.js';
|
|
8
|
+
|
|
9
|
+
if (!parentPort) {
|
|
10
|
+
throw new Error("This module must be run as a worker");
|
|
11
|
+
}
|
|
12
|
+
parentPort.on("message", messageHandler);
|
|
13
|
+
parentPort.postMessage({ type: "READY", env: "production" });
|
|
14
|
+
//# sourceMappingURL=rsc-worker.production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc-worker.production.js","sources":["../../../../plugin/worker/rsc/rsc-worker.production.ts"],"sourcesContent":["import { parentPort } from \"node:worker_threads\";\nimport { messageHandler } from \"./messageHandler.js\";\n\n\nif (!parentPort) {\n throw new Error(\"This module must be run as a worker\");\n}\n\n// Handle incoming messages\nparentPort.on(\"message\", messageHandler);\n\n// Signal ready\nparentPort.postMessage({ type: \"READY\", env: \"production\" });"],"names":[],"mappings":";;;;;;;;AAIA,IAAI,CAAC,UAAY,EAAA;AACf,EAAM,MAAA,IAAI,MAAM,qCAAqC,CAAA;AACvD;AAGA,UAAW,CAAA,EAAA,CAAG,WAAW,cAAc,CAAA;AAGvC,UAAA,CAAW,YAAY,EAAE,IAAA,EAAM,OAAS,EAAA,GAAA,EAAK,cAAc,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const cssFiles: Map<string, string>;
|
|
2
|
+
export declare const clientFiles: Set<string>;
|
|
3
|
+
export declare const serverActionFiles: Set<string>;
|
|
4
|
+
export declare function clearCssFiles(): void;
|
|
5
|
+
export declare function clearClientFiles(): void;
|
|
6
|
+
export declare function clearServerActionFiles(): void;
|
|
7
|
+
export declare function addCssFile(id: string, cssFile: string): void;
|
|
8
|
+
export declare function addClientFile(url: string): void;
|
|
9
|
+
export declare function addServerActionFile(url: string): void;
|
|
10
|
+
export declare function clearAllFiles(): void;
|
|
11
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../plugin/worker/rsc/state.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,qBAA4B,CAAC;AAClD,eAAO,MAAM,WAAW,aAAoB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,aAAoB,CAAC;AAEnD,wBAAgB,aAAa,SAE5B;AAED,wBAAgB,gBAAgB,SAE/B;AAED,wBAAgB,sBAAsB,SAErC;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAErD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,QAExC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,wBAAgB,aAAa,SAI5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
const cssFiles = /* @__PURE__ */ new Map();
|
|
7
|
+
function addCssFile(id, cssFile) {
|
|
8
|
+
cssFiles.set(id, cssFile);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { addCssFile, cssFiles };
|
|
12
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sources":["../../../../plugin/worker/rsc/state.ts"],"sourcesContent":["import { createLogger } from \"../../utils/logger.js\";\n\n\n// Create shared CSS registry\nexport const cssFiles = new Map<string, string>();\nexport const clientFiles = new Set<string>();\nexport const serverActionFiles = new Set<string>();\n// Helper functions\nexport function clearCssFiles() {\n cssFiles.clear();\n}\n\nexport function clearClientFiles() {\n clientFiles.clear();\n}\n\nexport function clearServerActionFiles() {\n serverActionFiles.clear();\n}\n\nexport function addCssFile(id: string, cssFile: string) {\n cssFiles.set(id, cssFile);\n} \n\nexport function addClientFile(url: string) {\n clientFiles.add(url);\n}\n\nexport function addServerActionFile(url: string) {\n serverActionFiles.add(url);\n}\n\nexport function clearAllFiles() {\n clearCssFiles();\n clearClientFiles();\n clearServerActionFiles();\n} "],"names":[],"mappings":";;;;;AAIa,MAAA,QAAA,uBAAe,GAAoB;AAgBhC,SAAA,UAAA,CAAW,IAAY,OAAiB,EAAA;AACtD,EAAS,QAAA,CAAA,GAAA,CAAI,IAAI,OAAO,CAAA;AAC1B;;;;"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { Manifest } from "vite";
|
|
2
|
+
export interface WorkerMessage {
|
|
3
|
+
type: string;
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
2
6
|
export interface PipeableStreamOptions {
|
|
3
7
|
bootstrapModules?: string[];
|
|
4
8
|
bootstrapScripts?: string[];
|
|
@@ -28,85 +32,95 @@ export interface HtmlRenderState {
|
|
|
28
32
|
}
|
|
29
33
|
export interface RscRenderState {
|
|
30
34
|
id: string;
|
|
31
|
-
pipableStreamOptions: PipeableStreamOptions;
|
|
32
35
|
outDir: string;
|
|
33
36
|
moduleRootPath: string;
|
|
34
37
|
moduleBaseURL: string;
|
|
35
38
|
rscOutputPath: string;
|
|
36
39
|
componentImport: string;
|
|
37
40
|
propsImport: string;
|
|
38
|
-
}
|
|
39
|
-
export interface WorkerRscChunkMessage {
|
|
40
|
-
type: "RSC_CHUNK";
|
|
41
|
-
id: string;
|
|
42
|
-
chunk: string;
|
|
43
|
-
moduleRootPath: string;
|
|
44
|
-
moduleBaseURL: string;
|
|
45
|
-
outDir: string;
|
|
46
|
-
htmlOutputPath: string;
|
|
47
41
|
pipableStreamOptions: PipeableStreamOptions;
|
|
48
|
-
clientManifest: Manifest;
|
|
49
|
-
serverManifest: Manifest;
|
|
50
42
|
}
|
|
51
|
-
export interface ShutdownMessage {
|
|
43
|
+
export interface ShutdownMessage extends WorkerMessage {
|
|
52
44
|
type: "SHUTDOWN";
|
|
53
|
-
id: string;
|
|
54
45
|
}
|
|
55
|
-
export interface
|
|
56
|
-
type: "SHELL_READY";
|
|
57
|
-
id: string;
|
|
58
|
-
}
|
|
59
|
-
export interface AllReadyMessage {
|
|
60
|
-
type: "ALL_READY";
|
|
61
|
-
id: string;
|
|
62
|
-
outputPath: string;
|
|
63
|
-
html: string;
|
|
64
|
-
}
|
|
65
|
-
export interface RscRenderMessage {
|
|
46
|
+
export interface RscRenderMessage extends WorkerMessage {
|
|
66
47
|
type: "RSC_RENDER";
|
|
67
|
-
id: string;
|
|
68
48
|
pageImport: string;
|
|
69
49
|
propsImport: string;
|
|
50
|
+
pageExportName: string;
|
|
51
|
+
propsExportName: string;
|
|
52
|
+
url: string;
|
|
70
53
|
outDir: string;
|
|
54
|
+
projectRoot: string;
|
|
71
55
|
moduleRootPath: string;
|
|
72
56
|
moduleBaseURL: string;
|
|
57
|
+
moduleBasePath: string;
|
|
73
58
|
pipableStreamOptions: PipeableStreamOptions;
|
|
59
|
+
cssFiles: string[];
|
|
74
60
|
}
|
|
75
|
-
export interface
|
|
76
|
-
type: "
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
export interface RscChunkMessage extends WorkerMessage {
|
|
62
|
+
type: "RSC_CHUNK";
|
|
63
|
+
chunk: string;
|
|
64
|
+
moduleRootPath: string;
|
|
65
|
+
moduleBaseURL: string;
|
|
66
|
+
outDir: string;
|
|
67
|
+
rscOutputPath: string;
|
|
68
|
+
cssFiles: Array<[string, string]>;
|
|
79
69
|
}
|
|
80
|
-
export interface
|
|
81
|
-
type: "
|
|
82
|
-
id: string;
|
|
83
|
-
error: string;
|
|
70
|
+
export interface RscShellReadyMessage extends WorkerMessage {
|
|
71
|
+
type: "SHELL_READY";
|
|
84
72
|
}
|
|
85
|
-
export interface
|
|
86
|
-
type: "
|
|
87
|
-
id: string;
|
|
73
|
+
export interface RscAllReadyMessage extends WorkerMessage {
|
|
74
|
+
type: "ALL_READY";
|
|
88
75
|
outputPath: string;
|
|
76
|
+
contents: string;
|
|
89
77
|
}
|
|
90
|
-
export interface RscEndMessage {
|
|
78
|
+
export interface RscEndMessage extends WorkerMessage {
|
|
91
79
|
type: "RSC_END";
|
|
92
|
-
id: string;
|
|
93
80
|
}
|
|
94
|
-
export interface
|
|
81
|
+
export interface RscErrorMessage extends WorkerMessage {
|
|
82
|
+
type: "ERROR";
|
|
83
|
+
error: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ClientReferenceMessage extends WorkerMessage {
|
|
95
86
|
type: "CLIENT_REFERENCE";
|
|
96
|
-
id: string;
|
|
97
87
|
location: string;
|
|
98
88
|
key: string;
|
|
99
89
|
ref: unknown;
|
|
100
90
|
}
|
|
101
|
-
export interface ServerReferenceMessage {
|
|
91
|
+
export interface ServerReferenceMessage extends WorkerMessage {
|
|
102
92
|
type: "SERVER_REFERENCE";
|
|
103
|
-
id: string;
|
|
104
93
|
location: string;
|
|
105
94
|
key: string;
|
|
106
95
|
ref: unknown;
|
|
107
96
|
}
|
|
97
|
+
export interface WorkerRscChunkMessage extends WorkerMessage {
|
|
98
|
+
type: "RSC_CHUNK";
|
|
99
|
+
chunk: string;
|
|
100
|
+
moduleRootPath: string;
|
|
101
|
+
moduleBaseURL: string;
|
|
102
|
+
outDir: string;
|
|
103
|
+
htmlOutputPath: string;
|
|
104
|
+
pipableStreamOptions: PipeableStreamOptions;
|
|
105
|
+
clientManifest: Manifest;
|
|
106
|
+
serverManifest: Manifest;
|
|
107
|
+
}
|
|
108
|
+
export interface ShellReadyMessage extends WorkerMessage {
|
|
109
|
+
type: "SHELL_READY";
|
|
110
|
+
}
|
|
111
|
+
export interface AllReadyMessage extends WorkerMessage {
|
|
112
|
+
type: "ALL_READY";
|
|
113
|
+
outputPath: string;
|
|
114
|
+
html: string;
|
|
115
|
+
}
|
|
116
|
+
export interface CssFileMessage extends WorkerMessage {
|
|
117
|
+
type: "CSS_FILE";
|
|
118
|
+
id: string;
|
|
119
|
+
cssFile: string;
|
|
120
|
+
moduleClasses?: Record<string, string>;
|
|
121
|
+
}
|
|
108
122
|
export type HtmlWorkerMessage = WorkerRscChunkMessage | RscEndMessage | ShutdownMessage;
|
|
109
|
-
export type HtmlWorkerResponse = ShellReadyMessage | AllReadyMessage |
|
|
110
|
-
export type RscWorkerMessage = RscRenderMessage | RscEndMessage | ShutdownMessage | ClientReferenceMessage | ServerReferenceMessage;
|
|
111
|
-
export type RscWorkerResponse =
|
|
123
|
+
export type HtmlWorkerResponse = ShellReadyMessage | AllReadyMessage | RscErrorMessage;
|
|
124
|
+
export type RscWorkerMessage = RscRenderMessage | RscChunkMessage | RscEndMessage | ShutdownMessage | ClientReferenceMessage | ServerReferenceMessage | CssFileMessage;
|
|
125
|
+
export type RscWorkerResponse = RscShellReadyMessage | RscAllReadyMessage | RscErrorMessage | CssFileMessage;
|
|
112
126
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugin/worker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugin/worker/types.ts"],"names":[],"mappings":"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"}
|