vite-plugin-react-server 0.3.18 → 0.3.19
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/README.md +119 -118
- package/bin/patch.mjs +8 -2
- package/dist/package.json +3 -3
- package/dist/plugin/checkFilesExist.d.ts.map +1 -1
- package/dist/plugin/checkFilesExist.js +6 -2
- package/dist/plugin/checkFilesExist.js.map +1 -1
- package/dist/plugin/collect-manifest-client-files.d.ts +23 -0
- package/dist/plugin/collect-manifest-client-files.d.ts.map +1 -0
- package/dist/plugin/collect-manifest-client-files.js +117 -0
- package/dist/plugin/collect-manifest-client-files.js.map +1 -0
- package/dist/plugin/components.d.ts +9 -9
- package/dist/plugin/components.d.ts.map +1 -1
- package/dist/plugin/components.js +50 -9
- package/dist/plugin/components.js.map +1 -0
- package/dist/plugin/config/defaults.d.ts +7 -6
- package/dist/plugin/config/defaults.d.ts.map +1 -1
- package/dist/plugin/config/defaults.js +8 -5
- package/dist/plugin/config/defaults.js.map +1 -1
- package/dist/plugin/config/getPaths.d.ts +0 -1
- package/dist/plugin/config/getPaths.d.ts.map +1 -1
- package/dist/plugin/config/getPaths.js +2 -7
- package/dist/plugin/config/getPaths.js.map +1 -1
- package/dist/plugin/config/mimeTypes.d.ts +2 -0
- package/dist/plugin/config/mimeTypes.d.ts.map +1 -0
- package/dist/plugin/config/mimeTypes.js +24 -0
- package/dist/plugin/config/mimeTypes.js.map +1 -0
- package/dist/plugin/config/resolveOptions.d.ts +1 -1
- package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
- package/dist/plugin/config/resolveOptions.js +41 -28
- package/dist/plugin/config/resolveOptions.js.map +1 -1
- package/dist/plugin/config/resolvePages.d.ts +1 -0
- package/dist/plugin/config/resolvePages.d.ts.map +1 -1
- package/dist/plugin/config/resolvePages.js +9 -5
- package/dist/plugin/config/resolvePages.js.map +1 -1
- package/dist/plugin/config/resolveUserConfig.d.ts +2 -1
- package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
- package/dist/plugin/config/resolveUserConfig.js +10 -5
- package/dist/plugin/config/resolveUserConfig.js.map +1 -1
- package/dist/plugin/copy-dir.js +23 -18
- package/dist/plugin/copy-dir.js.map +1 -0
- package/dist/plugin/helpers/createHandler.d.ts +22 -0
- package/dist/plugin/helpers/createHandler.d.ts.map +1 -0
- package/dist/plugin/{react-server → helpers}/createHandler.js +36 -48
- package/dist/plugin/helpers/createHandler.js.map +1 -0
- package/dist/plugin/{react-server → helpers}/createRscStream.d.ts +2 -1
- package/dist/plugin/helpers/createRscStream.d.ts.map +1 -0
- package/dist/plugin/helpers/createRscStream.js +71 -0
- package/dist/plugin/helpers/createRscStream.js.map +1 -0
- package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/getBundleManifest.js +12 -4
- package/dist/plugin/helpers/getBundleManifest.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 +8 -5
- package/dist/plugin/loader/createBuildLoader.js.map +1 -1
- package/dist/plugin/loader/css-loader.d.ts.map +1 -1
- package/dist/plugin/loader/css-loader.js.map +1 -1
- package/dist/plugin/loader/react-loader.js +2 -2
- package/dist/plugin/loader/react-loader.js.map +1 -1
- package/dist/plugin/preserver/plugin.d.ts.map +1 -1
- package/dist/plugin/preserver/plugin.js +49 -14
- package/dist/plugin/preserver/plugin.js.map +1 -1
- package/dist/plugin/react-client/plugin.d.ts.map +1 -1
- package/dist/plugin/react-client/plugin.js +18 -76
- package/dist/plugin/react-client/plugin.js.map +1 -1
- package/dist/plugin/react-server/index.d.ts.map +1 -1
- package/dist/plugin/react-server/index.js +2 -0
- package/dist/plugin/react-server/index.js.map +1 -1
- package/dist/plugin/react-server/plugin.d.ts +2 -1
- package/dist/plugin/react-server/plugin.d.ts.map +1 -1
- package/dist/plugin/react-server/plugin.js +53 -217
- package/dist/plugin/react-server/plugin.js.map +1 -1
- package/dist/plugin/react-static/index.d.ts +2 -0
- package/dist/plugin/react-static/index.d.ts.map +1 -0
- package/dist/plugin/react-static/index.js +1 -0
- package/dist/plugin/react-static/plugin.d.ts +7 -0
- package/dist/plugin/react-static/plugin.d.ts.map +1 -0
- package/dist/plugin/react-static/plugin.js +199 -0
- package/dist/plugin/react-static/plugin.js.map +1 -0
- package/dist/plugin/resolvePage.d.ts.map +1 -1
- package/dist/plugin/resolvePage.js +9 -0
- package/dist/plugin/resolvePage.js.map +1 -1
- package/dist/plugin/root.d.ts +2 -0
- package/dist/plugin/root.d.ts.map +1 -0
- package/dist/plugin/root.js +12 -0
- package/dist/plugin/root.js.map +1 -0
- package/dist/plugin/transformer/plugin.d.ts.map +1 -1
- package/dist/plugin/transformer/plugin.js +32 -23
- package/dist/plugin/transformer/plugin.js.map +1 -1
- package/dist/plugin/transformer/types.d.ts +1 -18
- package/dist/plugin/transformer/types.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +24 -6
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/worker/createWorker.js +0 -1
- package/dist/plugin/worker/createWorker.js.map +1 -1
- package/dist/plugin/worker/html/html-worker.development.d.ts +30 -0
- package/dist/plugin/worker/html/html-worker.development.d.ts.map +1 -1
- package/dist/plugin/worker/html/html-worker.development.js +30 -2
- package/dist/plugin/worker/html/html-worker.development.js.map +1 -1
- package/dist/plugin/worker/html/html-worker.production.js +3 -5
- 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 +8 -2
- package/dist/plugin/worker/html/messageHandler.js.map +1 -1
- package/dist/plugin/worker/html/plugin.d.ts.map +1 -1
- package/dist/plugin/worker/html/plugin.js +2 -3
- package/dist/plugin/worker/html/renderPages.d.ts +8 -4
- package/dist/plugin/worker/html/renderPages.d.ts.map +1 -1
- package/dist/plugin/worker/html/renderPages.js +118 -83
- package/dist/plugin/worker/html/renderPages.js.map +1 -1
- package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/messageHandler.js +89 -84
- package/dist/plugin/worker/rsc/messageHandler.js.map +1 -1
- package/dist/plugin/worker/rsc/plugin.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/plugin.js +1 -2
- package/dist/plugin/worker/rsc/rsc-worker.development.js +13 -18
- package/dist/plugin/worker/rsc/rsc-worker.development.js.map +1 -1
- package/dist/plugin/worker/rsc/rsc-worker.production.js +4 -1
- package/dist/plugin/worker/rsc/rsc-worker.production.js.map +1 -1
- package/dist/plugin/worker/rsc/state.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/state.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/plugin/checkFilesExist.ts +7 -3
- package/plugin/collect-manifest-client-files.ts +152 -0
- package/plugin/components.tsx +55 -10
- package/plugin/config/defaults.tsx +69 -0
- package/plugin/config/getPaths.ts +1 -7
- package/plugin/config/mimeTypes.ts +17 -0
- package/plugin/config/resolveOptions.ts +48 -40
- package/plugin/config/resolvePages.ts +8 -4
- package/plugin/config/resolveUserConfig.ts +12 -9
- package/plugin/{react-server → helpers}/createHandler.ts +46 -63
- package/plugin/helpers/createRscStream.ts +81 -0
- package/plugin/helpers/getBundleManifest.ts +14 -5
- package/plugin/loader/createBuildLoader.ts +9 -6
- package/plugin/loader/css-loader.ts +0 -2
- package/plugin/loader/react-loader.ts +2 -2
- package/plugin/preserver/plugin.ts +64 -17
- package/plugin/react-client/plugin.ts +20 -91
- package/plugin/react-server/index.ts +2 -0
- package/plugin/react-server/plugin.ts +66 -293
- package/plugin/react-static/index.ts +1 -0
- package/plugin/react-static/plugin.ts +247 -0
- package/plugin/resolvePage.ts +9 -0
- package/plugin/root.ts +4 -0
- package/plugin/transformer/plugin.ts +40 -31
- package/plugin/transformer/types.ts +0 -19
- package/plugin/types.ts +25 -6
- package/plugin/worker/createWorker.ts +1 -1
- package/plugin/worker/html/README.md +63 -0
- package/plugin/worker/html/html-worker.development.tsx +89 -2
- package/plugin/worker/html/html-worker.production.tsx +8 -10
- package/plugin/worker/html/messageHandler.ts +8 -2
- package/plugin/worker/html/plugin.ts +2 -3
- package/plugin/worker/html/renderPages.ts +150 -114
- package/plugin/worker/rsc/README.md +58 -0
- package/plugin/worker/rsc/messageHandler.tsx +95 -111
- package/plugin/worker/rsc/plugin.ts +1 -2
- package/plugin/worker/rsc/rsc-worker.development.ts +12 -22
- package/plugin/worker/rsc/rsc-worker.production.ts +5 -1
- package/plugin/worker/rsc/state.ts +0 -3
- package/scripts/react+0.0.0-experimental-eda36a1c-20250228.patch +114 -12
- package/scripts/react-dom+0.0.0-experimental-eda36a1c-20250228.patch +10571 -121
- package/tsconfig.json +2 -2
- package/dist/plugin/collect-css-manifest.d.ts +0 -4
- package/dist/plugin/collect-css-manifest.d.ts.map +0 -1
- package/dist/plugin/collect-css-manifest.js +0 -65
- package/dist/plugin/collect-css-manifest.js.map +0 -1
- package/dist/plugin/config/createModuleIdGenerator.d.ts +0 -11
- package/dist/plugin/config/createModuleIdGenerator.d.ts.map +0 -1
- package/dist/plugin/config/createModuleIdGenerator.js +0 -44
- package/dist/plugin/config/createModuleIdGenerator.js.map +0 -1
- package/dist/plugin/loader/createCssLoader.d.ts +0 -30
- package/dist/plugin/loader/createCssLoader.d.ts.map +0 -1
- package/dist/plugin/loader/createCssLoader.js +0 -35
- package/dist/plugin/loader/createPageLoader.d.ts +0 -24
- package/dist/plugin/loader/createPageLoader.d.ts.map +0 -1
- package/dist/plugin/loader/createPageLoader.js +0 -50
- package/dist/plugin/loader/rsc/messageHandler.d.ts +0 -2
- package/dist/plugin/loader/rsc/messageHandler.d.ts.map +0 -1
- package/dist/plugin/loader/rsc/messageHandler.js +0 -1
- package/dist/plugin/loader/rsc/rsc-worker.development.d.ts +0 -2
- package/dist/plugin/loader/rsc/rsc-worker.development.d.ts.map +0 -1
- package/dist/plugin/loader/rsc/rsc-worker.development.js +0 -1
- package/dist/plugin/react-server/createHandler.d.ts +0 -17
- package/dist/plugin/react-server/createHandler.d.ts.map +0 -1
- package/dist/plugin/react-server/createHandler.js.map +0 -1
- package/dist/plugin/react-server/createRscStream.d.ts.map +0 -1
- package/dist/plugin/react-server/createRscStream.js +0 -70
- package/dist/plugin/react-server/createRscStream.js.map +0 -1
- package/dist/plugin/react-server/createSsrHandler.d.ts +0 -4
- package/dist/plugin/react-server/createSsrHandler.d.ts.map +0 -1
- package/dist/plugin/react-server/createSsrHandler.js +0 -95
- package/dist/plugin/utils/logger.d.ts +0 -9
- package/dist/plugin/utils/logger.d.ts.map +0 -1
- package/dist/plugin/utils/logger.js +0 -68
- package/dist/plugin/utils/logger.js.map +0 -1
- package/plugin/collect-css-manifest.ts +0 -82
- package/plugin/config/createModuleIdGenerator.ts +0 -52
- package/plugin/config/defaults.ts +0 -51
- package/plugin/loader/createCssLoader.ts +0 -73
- package/plugin/loader/createPageLoader.ts +0 -103
- package/plugin/loader/rsc/messageHandler.tsx +0 -1
- package/plugin/loader/rsc/rsc-worker.development.ts +0 -1
- package/plugin/react-server/createRscStream.ts +0 -86
- package/plugin/react-server/createSsrHandler.ts +0 -125
- package/plugin/utils/logger.ts +0 -52
|
@@ -6,133 +6,117 @@ import {
|
|
|
6
6
|
renderToPipeableStream,
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
} from "react-server-dom-esm/server.node";
|
|
9
|
-
import { createLogger } from "../../utils/logger.js";
|
|
10
9
|
import type {
|
|
11
10
|
RscChunkMessage,
|
|
12
11
|
RscEndMessage,
|
|
13
12
|
RscWorkerMessage,
|
|
14
13
|
} from "../types.js";
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
cssFiles
|
|
18
|
-
} from "./state.js";
|
|
19
|
-
|
|
20
|
-
const log = createLogger("rsc-worker");
|
|
21
|
-
|
|
22
|
-
// CSS collector component
|
|
23
|
-
function CssCollector({
|
|
24
|
-
children,
|
|
25
|
-
cssFiles,
|
|
26
|
-
}: {
|
|
27
|
-
children: React.ReactNode;
|
|
28
|
-
cssFiles: Map<string, string>;
|
|
29
|
-
}) {
|
|
30
|
-
return (
|
|
31
|
-
<>
|
|
32
|
-
{Array.from(cssFiles.entries()).map(([id, css]) => {
|
|
33
|
-
return (
|
|
34
|
-
<style key={id} data-source={id}>
|
|
35
|
-
{css}
|
|
36
|
-
</style>
|
|
37
|
-
);
|
|
38
|
-
})}
|
|
39
|
-
{children}
|
|
40
|
-
</>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
14
|
+
import { addCssFile, cssFiles } from "./state.js";
|
|
15
|
+
import { CssCollector } from "../../components.js";
|
|
43
16
|
|
|
44
17
|
export async function messageHandler(message: RscWorkerMessage) {
|
|
18
|
+
switch (message.type) {
|
|
19
|
+
case "RSC_RENDER":
|
|
20
|
+
const {
|
|
21
|
+
id,
|
|
22
|
+
pageImport,
|
|
23
|
+
propsImport,
|
|
24
|
+
pageExportName,
|
|
25
|
+
propsExportName,
|
|
26
|
+
url,
|
|
27
|
+
outDir,
|
|
28
|
+
projectRoot,
|
|
29
|
+
moduleBaseURL,
|
|
30
|
+
moduleBasePath,
|
|
31
|
+
pipableStreamOptions,
|
|
32
|
+
} = message;
|
|
45
33
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
propsExportName,
|
|
53
|
-
url,
|
|
54
|
-
outDir,
|
|
55
|
-
projectRoot,
|
|
56
|
-
moduleBaseURL,
|
|
57
|
-
moduleBasePath,
|
|
58
|
-
pipableStreamOptions,
|
|
59
|
-
} = message;
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
// Load modules which will trigger CSS loading
|
|
63
|
-
const [Component, propsModule] = await Promise.all([
|
|
64
|
-
import(join(projectRoot, pageImport)),
|
|
65
|
-
import(join(projectRoot, propsImport)),
|
|
66
|
-
]);
|
|
34
|
+
try {
|
|
35
|
+
// Load modules which will trigger CSS loading
|
|
36
|
+
const [Component, propsModule] = await Promise.all([
|
|
37
|
+
import(join(projectRoot, pageImport)),
|
|
38
|
+
import(join(projectRoot, propsImport)),
|
|
39
|
+
]);
|
|
67
40
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
41
|
+
const propsAtExport = propsModule[propsExportName];
|
|
42
|
+
const props = await Promise.resolve(
|
|
43
|
+
typeof propsAtExport === "function"
|
|
44
|
+
? propsAtExport(url)
|
|
45
|
+
: propsAtExport
|
|
46
|
+
);
|
|
72
47
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
48
|
+
const PageComponent = Component[pageExportName];
|
|
49
|
+
// Now render with collected CSS
|
|
50
|
+
const stream = renderToPipeableStream(
|
|
51
|
+
<CssCollector
|
|
52
|
+
cssFiles={Array.from(cssFiles.values())}
|
|
53
|
+
moduleBaseUrl={moduleBaseURL}
|
|
54
|
+
>
|
|
55
|
+
<PageComponent {...props} />
|
|
56
|
+
</CssCollector>,
|
|
57
|
+
moduleBaseURL,
|
|
58
|
+
{
|
|
59
|
+
onError: (error: Error) => {
|
|
60
|
+
parentPort?.postMessage({
|
|
61
|
+
type: "ERROR",
|
|
62
|
+
id,
|
|
63
|
+
error: error instanceof Error ? error.message : String(error),
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
onPostpone: (reason: string) => {
|
|
67
|
+
parentPort?.postMessage({
|
|
68
|
+
type: "POSTPONE",
|
|
69
|
+
id,
|
|
70
|
+
reason,
|
|
71
|
+
});
|
|
96
72
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
73
|
+
environmentName: "Server",
|
|
74
|
+
importMap: {
|
|
75
|
+
imports: {
|
|
76
|
+
...pipableStreamOptions?.importMap?.imports,
|
|
77
|
+
"/": moduleBasePath,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
...pipableStreamOptions,
|
|
81
|
+
}
|
|
82
|
+
);
|
|
101
83
|
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
// Listen for data and end events
|
|
85
|
+
const passThrough = new PassThrough();
|
|
104
86
|
|
|
105
|
-
|
|
87
|
+
stream.pipe(passThrough);
|
|
106
88
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
89
|
+
passThrough.on("data", (chunk) => {
|
|
90
|
+
// Send to parent
|
|
91
|
+
parentPort?.postMessage({
|
|
92
|
+
type: "RSC_CHUNK",
|
|
93
|
+
id,
|
|
94
|
+
chunk: chunk.toString(),
|
|
95
|
+
moduleRootPath: moduleBasePath,
|
|
96
|
+
moduleBaseURL,
|
|
97
|
+
outDir,
|
|
98
|
+
rscOutputPath: `${outDir}/${id}.rsc`,
|
|
99
|
+
cssFiles: Array.from(cssFiles.entries()),
|
|
100
|
+
} satisfies RscChunkMessage);
|
|
101
|
+
});
|
|
120
102
|
|
|
121
|
-
|
|
103
|
+
passThrough.on("end", () => {
|
|
104
|
+
parentPort?.postMessage({
|
|
105
|
+
type: "RSC_END",
|
|
106
|
+
id,
|
|
107
|
+
} satisfies RscEndMessage);
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.trace(error);
|
|
122
111
|
parentPort?.postMessage({
|
|
123
|
-
type: "
|
|
112
|
+
type: "ERROR",
|
|
124
113
|
id,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
error: error instanceof Error ? error.message : String(error),
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
} else if (message.type === "CSS_FILE") {
|
|
136
|
-
addCssFile(message.id, message.cssFile);
|
|
114
|
+
error: error instanceof Error ? error.message : String(error),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case "CSS_FILE":
|
|
119
|
+
addCssFile(message.id, message.cssFile);
|
|
120
|
+
break;
|
|
137
121
|
}
|
|
138
122
|
}
|
|
@@ -3,14 +3,13 @@ import { resolve } from "path";
|
|
|
3
3
|
import type { ModuleFormat } from "rollup";
|
|
4
4
|
import type { StreamPluginOptions } from "../../types.js";
|
|
5
5
|
import { DEFAULT_CONFIG } from "../../config/defaults.js";
|
|
6
|
-
import {
|
|
6
|
+
import { pluginRoot } from "../../root.js";
|
|
7
7
|
|
|
8
8
|
export function reactRscWorkerPlugin(options: StreamPluginOptions): Plugin {
|
|
9
9
|
return {
|
|
10
10
|
name: "vite:react-rsc-worker",
|
|
11
11
|
config(config) {
|
|
12
12
|
const root = config.root ?? process.cwd();
|
|
13
|
-
const pluginRoot = getPluginRoot();
|
|
14
13
|
const rscWorkerPath =
|
|
15
14
|
typeof options.rscWorkerPath === "string"
|
|
16
15
|
? resolve(root, options.rscWorkerPath)
|
|
@@ -47,17 +47,13 @@ declare module 'node:module' {
|
|
|
47
47
|
//
|
|
48
48
|
import { parentPort, MessageChannel } from "node:worker_threads";
|
|
49
49
|
import { messageHandler } from "./messageHandler.js";
|
|
50
|
-
import { createLogger } from "../../utils/logger.js";
|
|
51
50
|
import {
|
|
52
|
-
registerHooks,
|
|
53
51
|
register,
|
|
54
|
-
type ResolveHookContext,
|
|
55
52
|
} from 'node:module';
|
|
56
53
|
import { register as registerTsx } from "tsx/esm/api";
|
|
57
54
|
import { join } from 'node:path';
|
|
58
|
-
import {
|
|
55
|
+
import { pluginRoot } from "../../root.js";
|
|
59
56
|
|
|
60
|
-
const ports = new MessageChannel();
|
|
61
57
|
// Initialize worker
|
|
62
58
|
if (!parentPort) {
|
|
63
59
|
throw new Error("This module must be run as a worker");
|
|
@@ -68,26 +64,20 @@ const reactLoaderChannel = new MessageChannel();
|
|
|
68
64
|
const cssLoaderChannel = new MessageChannel();
|
|
69
65
|
|
|
70
66
|
// Listen for messages from loaders
|
|
71
|
-
reactLoaderChannel.port2.on('message',
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
cssLoaderChannel.port2.on('message', (msg) => {
|
|
76
|
-
messageHandler(msg);
|
|
77
|
-
});
|
|
67
|
+
reactLoaderChannel.port2.on('message', messageHandler);
|
|
68
|
+
cssLoaderChannel.port2.on('message', messageHandler);
|
|
78
69
|
|
|
79
|
-
const loaderPath = 'file://' + join(
|
|
80
|
-
const cssLoaderPath = 'file://' + join(
|
|
81
|
-
console.log('[worker] Full loader path:', loaderPath);
|
|
70
|
+
const loaderPath = 'file://' + join(pluginRoot, 'loader/react-loader.js');
|
|
71
|
+
const cssLoaderPath = 'file://' + join(pluginRoot, 'loader/css-loader.js');
|
|
82
72
|
|
|
83
73
|
// Register react-loader
|
|
84
74
|
register(loaderPath, {
|
|
85
|
-
parentURL:
|
|
75
|
+
parentURL: pluginRoot,
|
|
86
76
|
data: { port: reactLoaderChannel.port1 },
|
|
87
77
|
transferList: [reactLoaderChannel.port1]
|
|
88
78
|
});
|
|
89
79
|
register(cssLoaderPath, {
|
|
90
|
-
parentURL:
|
|
80
|
+
parentURL: pluginRoot,
|
|
91
81
|
data: { port: cssLoaderChannel.port1 },
|
|
92
82
|
transferList: [cssLoaderChannel.port1]
|
|
93
83
|
});
|
|
@@ -96,12 +86,12 @@ register(cssLoaderPath, {
|
|
|
96
86
|
registerTsx();
|
|
97
87
|
|
|
98
88
|
// Set up message handling
|
|
99
|
-
parentPort.on("message",
|
|
100
|
-
messageHandler(message);
|
|
101
|
-
});
|
|
89
|
+
parentPort.on("message", messageHandler);
|
|
102
90
|
|
|
103
91
|
// Signal ready
|
|
104
|
-
parentPort.postMessage({ type: "READY", env: "
|
|
105
|
-
|
|
92
|
+
parentPort.postMessage({ type: "READY", env: process.env["NODE_ENV"] });
|
|
106
93
|
|
|
94
|
+
if (process.env["NODE_ENV"] !== "development") {
|
|
95
|
+
throw new Error("This module must be run in development mode");
|
|
96
|
+
}
|
|
107
97
|
|
|
@@ -10,4 +10,8 @@ if (!parentPort) {
|
|
|
10
10
|
parentPort.on("message", messageHandler);
|
|
11
11
|
|
|
12
12
|
// Signal ready
|
|
13
|
-
parentPort.postMessage({ type: "READY", env: "
|
|
13
|
+
parentPort.postMessage({ type: "READY", env: process.env["NODE_ENV"] });
|
|
14
|
+
|
|
15
|
+
if (process.env["NODE_ENV"] !== "production") {
|
|
16
|
+
throw new Error("This module must be run in production mode");
|
|
17
|
+
}
|
|
@@ -1,56 +1,158 @@
|
|
|
1
|
+
diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
|
2
|
+
index 585027f..aeca110 100644
|
|
3
|
+
--- a/node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
|
4
|
+
+++ b/node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
|
5
|
+
@@ -300,8 +300,9 @@
|
|
6
|
+
ReactSharedInternals =
|
|
7
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
8
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
9
|
+
- isArrayImpl = Array.isArray,
|
|
10
|
+
- createTask = console.createTask
|
|
11
|
+
+ isArrayImpl = Array.isArray;
|
|
12
|
+
+ new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
13
|
+
+ var createTask = console.createTask
|
|
14
|
+
? console.createTask
|
|
15
|
+
: function () {
|
|
16
|
+
return null;
|
|
17
|
+
diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js
|
|
18
|
+
index 8d1141c..0d74219 100644
|
|
19
|
+
--- a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js
|
|
20
|
+
+++ b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js
|
|
21
|
+
@@ -304,8 +304,9 @@
|
|
22
|
+
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
|
|
23
|
+
);
|
|
24
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
25
|
+
- isArrayImpl = Array.isArray,
|
|
26
|
+
- createTask = console.createTask
|
|
27
|
+
+ isArrayImpl = Array.isArray;
|
|
28
|
+
+ new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
29
|
+
+ var createTask = console.createTask
|
|
30
|
+
? console.createTask
|
|
31
|
+
: function () {
|
|
32
|
+
return null;
|
|
33
|
+
diff --git a/node_modules/react/cjs/react-jsx-runtime.development.js b/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
34
|
+
index 40bddcd..c18bba9 100644
|
|
35
|
+
--- a/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
36
|
+
+++ b/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
37
|
+
@@ -300,8 +300,9 @@
|
|
38
|
+
ReactSharedInternals =
|
|
39
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
40
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
41
|
+
- isArrayImpl = Array.isArray,
|
|
42
|
+
- createTask = console.createTask
|
|
43
|
+
+ isArrayImpl = Array.isArray;
|
|
44
|
+
+ new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
45
|
+
+ var createTask = console.createTask
|
|
46
|
+
? console.createTask
|
|
47
|
+
: function () {
|
|
48
|
+
return null;
|
|
49
|
+
diff --git a/node_modules/react/cjs/react-jsx-runtime.react-server.development.js b/node_modules/react/cjs/react-jsx-runtime.react-server.development.js
|
|
50
|
+
index dd07748..0b3aaf0 100644
|
|
51
|
+
--- a/node_modules/react/cjs/react-jsx-runtime.react-server.development.js
|
|
52
|
+
+++ b/node_modules/react/cjs/react-jsx-runtime.react-server.development.js
|
|
53
|
+
@@ -304,8 +304,9 @@
|
|
54
|
+
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
|
|
55
|
+
);
|
|
56
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
57
|
+
- isArrayImpl = Array.isArray,
|
|
58
|
+
- createTask = console.createTask
|
|
59
|
+
+ isArrayImpl = Array.isArray;
|
|
60
|
+
+ new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
61
|
+
+ var createTask = console.createTask
|
|
62
|
+
? console.createTask
|
|
63
|
+
: function () {
|
|
64
|
+
return null;
|
|
1
65
|
diff --git a/node_modules/react/cjs/react.development.js b/node_modules/react/cjs/react.development.js
|
|
2
|
-
index
|
|
66
|
+
index e3389a3..2bc8270 100644
|
|
3
67
|
--- a/node_modules/react/cjs/react.development.js
|
|
4
68
|
+++ b/node_modules/react/cjs/react.development.js
|
|
5
|
-
@@ -
|
|
69
|
+
@@ -671,7 +671,9 @@
|
|
70
|
+
getCurrentStack: null
|
|
71
|
+
},
|
|
72
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
73
|
+
- createTask = console.createTask
|
|
74
|
+
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
75
|
+
+ new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
76
|
+
+ var createTask = console.createTask
|
|
77
|
+
? console.createTask
|
|
78
|
+
: function () {
|
|
79
|
+
return null;
|
|
80
|
+
@@ -681,7 +683,6 @@
|
|
81
|
+
var didWarnAboutElementRef = {};
|
|
82
|
+
var didWarnAboutMaps = !1,
|
|
83
|
+
userProvidedKeyEscapeRegex = /\/+/g,
|
|
84
|
+
- REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
85
|
+
reportGlobalError =
|
|
86
|
+
"function" === typeof reportError
|
|
87
|
+
? reportError
|
|
88
|
+
@@ -1276,7 +1277,7 @@
|
|
6
89
|
exports.useTransition = function () {
|
|
7
90
|
return resolveDispatcher().useTransition();
|
|
8
91
|
};
|
|
9
|
-
- exports.version = "19.1.0-experimental-
|
|
92
|
+
- exports.version = "19.1.0-experimental-f9d78089-20250306";
|
|
10
93
|
+ exports.version = "19.1.0-experimental-eda36a1c-20250228";
|
|
11
94
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
12
95
|
"function" ===
|
|
13
96
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
14
97
|
diff --git a/node_modules/react/cjs/react.production.js b/node_modules/react/cjs/react.production.js
|
|
15
|
-
index
|
|
98
|
+
index f357ca5..24d6e95 100644
|
|
16
99
|
--- a/node_modules/react/cjs/react.production.js
|
|
17
100
|
+++ b/node_modules/react/cjs/react.production.js
|
|
18
101
|
@@ -576,4 +576,4 @@ exports.useSyncExternalStore = function (
|
|
19
102
|
exports.useTransition = function () {
|
|
20
103
|
return ReactSharedInternals.H.useTransition();
|
|
21
104
|
};
|
|
22
|
-
-exports.version = "19.1.0-experimental-
|
|
105
|
+
-exports.version = "19.1.0-experimental-f9d78089-20250306";
|
|
23
106
|
+exports.version = "19.1.0-experimental-eda36a1c-20250228";
|
|
24
107
|
diff --git a/node_modules/react/cjs/react.react-server.development.js b/node_modules/react/cjs/react.react-server.development.js
|
|
25
|
-
index
|
|
108
|
+
index 3cbd7eb..8497113 100644
|
|
26
109
|
--- a/node_modules/react/cjs/react.react-server.development.js
|
|
27
110
|
+++ b/node_modules/react/cjs/react.react-server.development.js
|
|
28
|
-
@@ -
|
|
111
|
+
@@ -507,7 +507,9 @@
|
|
112
|
+
REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
|
|
113
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
114
|
+
assign = Object.assign,
|
|
115
|
+
- createTask = console.createTask
|
|
116
|
+
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
117
|
+
+ new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
118
|
+
+ var createTask = console.createTask
|
|
119
|
+
? console.createTask
|
|
120
|
+
: function () {
|
|
121
|
+
return null;
|
|
122
|
+
@@ -517,7 +519,6 @@
|
|
123
|
+
var didWarnAboutElementRef = {};
|
|
124
|
+
var didWarnAboutMaps = !1,
|
|
125
|
+
userProvidedKeyEscapeRegex = /\/+/g,
|
|
126
|
+
- REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
127
|
+
reportGlobalError =
|
|
128
|
+
"function" === typeof reportError
|
|
129
|
+
? reportError
|
|
130
|
+
@@ -980,5 +981,5 @@
|
|
29
131
|
exports.useMemo = function (create, deps) {
|
|
30
132
|
return resolveDispatcher().useMemo(create, deps);
|
|
31
133
|
};
|
|
32
|
-
- exports.version = "19.1.0-experimental-
|
|
134
|
+
- exports.version = "19.1.0-experimental-f9d78089-20250306";
|
|
33
135
|
+ exports.version = "19.1.0-experimental-eda36a1c-20250228";
|
|
34
136
|
})();
|
|
35
137
|
diff --git a/node_modules/react/cjs/react.react-server.production.js b/node_modules/react/cjs/react.react-server.production.js
|
|
36
|
-
index
|
|
138
|
+
index 53a5ddf..694169d 100644
|
|
37
139
|
--- a/node_modules/react/cjs/react.react-server.production.js
|
|
38
140
|
+++ b/node_modules/react/cjs/react.react-server.production.js
|
|
39
141
|
@@ -561,4 +561,4 @@ exports.useId = function () {
|
|
40
142
|
exports.useMemo = function (create, deps) {
|
|
41
143
|
return ReactSharedInternals.H.useMemo(create, deps);
|
|
42
144
|
};
|
|
43
|
-
-exports.version = "19.1.0-experimental-
|
|
145
|
+
-exports.version = "19.1.0-experimental-f9d78089-20250306";
|
|
44
146
|
+exports.version = "19.1.0-experimental-eda36a1c-20250228";
|
|
45
147
|
diff --git a/node_modules/react/package.json b/node_modules/react/package.json
|
|
46
|
-
index
|
|
148
|
+
index 965519d..b6e85b0 100644
|
|
47
149
|
--- a/node_modules/react/package.json
|
|
48
150
|
+++ b/node_modules/react/package.json
|
|
49
151
|
@@ -4,7 +4,7 @@
|
|
50
152
|
"keywords": [
|
|
51
153
|
"react"
|
|
52
154
|
],
|
|
53
|
-
- "version": "0.0.0-experimental-
|
|
155
|
+
- "version": "0.0.0-experimental-f9d78089-20250306",
|
|
54
156
|
+ "version": "0.0.0-experimental-eda36a1c-20250228",
|
|
55
157
|
"homepage": "https://react.dev/",
|
|
56
158
|
"bugs": "https://github.com/facebook/react/issues",
|