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.
Files changed (208) hide show
  1. package/README.md +119 -118
  2. package/bin/patch.mjs +8 -2
  3. package/dist/package.json +3 -3
  4. package/dist/plugin/checkFilesExist.d.ts.map +1 -1
  5. package/dist/plugin/checkFilesExist.js +6 -2
  6. package/dist/plugin/checkFilesExist.js.map +1 -1
  7. package/dist/plugin/collect-manifest-client-files.d.ts +23 -0
  8. package/dist/plugin/collect-manifest-client-files.d.ts.map +1 -0
  9. package/dist/plugin/collect-manifest-client-files.js +117 -0
  10. package/dist/plugin/collect-manifest-client-files.js.map +1 -0
  11. package/dist/plugin/components.d.ts +9 -9
  12. package/dist/plugin/components.d.ts.map +1 -1
  13. package/dist/plugin/components.js +50 -9
  14. package/dist/plugin/components.js.map +1 -0
  15. package/dist/plugin/config/defaults.d.ts +7 -6
  16. package/dist/plugin/config/defaults.d.ts.map +1 -1
  17. package/dist/plugin/config/defaults.js +8 -5
  18. package/dist/plugin/config/defaults.js.map +1 -1
  19. package/dist/plugin/config/getPaths.d.ts +0 -1
  20. package/dist/plugin/config/getPaths.d.ts.map +1 -1
  21. package/dist/plugin/config/getPaths.js +2 -7
  22. package/dist/plugin/config/getPaths.js.map +1 -1
  23. package/dist/plugin/config/mimeTypes.d.ts +2 -0
  24. package/dist/plugin/config/mimeTypes.d.ts.map +1 -0
  25. package/dist/plugin/config/mimeTypes.js +24 -0
  26. package/dist/plugin/config/mimeTypes.js.map +1 -0
  27. package/dist/plugin/config/resolveOptions.d.ts +1 -1
  28. package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
  29. package/dist/plugin/config/resolveOptions.js +41 -28
  30. package/dist/plugin/config/resolveOptions.js.map +1 -1
  31. package/dist/plugin/config/resolvePages.d.ts +1 -0
  32. package/dist/plugin/config/resolvePages.d.ts.map +1 -1
  33. package/dist/plugin/config/resolvePages.js +9 -5
  34. package/dist/plugin/config/resolvePages.js.map +1 -1
  35. package/dist/plugin/config/resolveUserConfig.d.ts +2 -1
  36. package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
  37. package/dist/plugin/config/resolveUserConfig.js +10 -5
  38. package/dist/plugin/config/resolveUserConfig.js.map +1 -1
  39. package/dist/plugin/copy-dir.js +23 -18
  40. package/dist/plugin/copy-dir.js.map +1 -0
  41. package/dist/plugin/helpers/createHandler.d.ts +22 -0
  42. package/dist/plugin/helpers/createHandler.d.ts.map +1 -0
  43. package/dist/plugin/{react-server → helpers}/createHandler.js +36 -48
  44. package/dist/plugin/helpers/createHandler.js.map +1 -0
  45. package/dist/plugin/{react-server → helpers}/createRscStream.d.ts +2 -1
  46. package/dist/plugin/helpers/createRscStream.d.ts.map +1 -0
  47. package/dist/plugin/helpers/createRscStream.js +71 -0
  48. package/dist/plugin/helpers/createRscStream.js.map +1 -0
  49. package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
  50. package/dist/plugin/helpers/getBundleManifest.js +12 -4
  51. package/dist/plugin/helpers/getBundleManifest.js.map +1 -1
  52. package/dist/plugin/loader/createBuildLoader.d.ts +1 -1
  53. package/dist/plugin/loader/createBuildLoader.d.ts.map +1 -1
  54. package/dist/plugin/loader/createBuildLoader.js +8 -5
  55. package/dist/plugin/loader/createBuildLoader.js.map +1 -1
  56. package/dist/plugin/loader/css-loader.d.ts.map +1 -1
  57. package/dist/plugin/loader/css-loader.js.map +1 -1
  58. package/dist/plugin/loader/react-loader.js +2 -2
  59. package/dist/plugin/loader/react-loader.js.map +1 -1
  60. package/dist/plugin/preserver/plugin.d.ts.map +1 -1
  61. package/dist/plugin/preserver/plugin.js +49 -14
  62. package/dist/plugin/preserver/plugin.js.map +1 -1
  63. package/dist/plugin/react-client/plugin.d.ts.map +1 -1
  64. package/dist/plugin/react-client/plugin.js +18 -76
  65. package/dist/plugin/react-client/plugin.js.map +1 -1
  66. package/dist/plugin/react-server/index.d.ts.map +1 -1
  67. package/dist/plugin/react-server/index.js +2 -0
  68. package/dist/plugin/react-server/index.js.map +1 -1
  69. package/dist/plugin/react-server/plugin.d.ts +2 -1
  70. package/dist/plugin/react-server/plugin.d.ts.map +1 -1
  71. package/dist/plugin/react-server/plugin.js +53 -217
  72. package/dist/plugin/react-server/plugin.js.map +1 -1
  73. package/dist/plugin/react-static/index.d.ts +2 -0
  74. package/dist/plugin/react-static/index.d.ts.map +1 -0
  75. package/dist/plugin/react-static/index.js +1 -0
  76. package/dist/plugin/react-static/plugin.d.ts +7 -0
  77. package/dist/plugin/react-static/plugin.d.ts.map +1 -0
  78. package/dist/plugin/react-static/plugin.js +199 -0
  79. package/dist/plugin/react-static/plugin.js.map +1 -0
  80. package/dist/plugin/resolvePage.d.ts.map +1 -1
  81. package/dist/plugin/resolvePage.js +9 -0
  82. package/dist/plugin/resolvePage.js.map +1 -1
  83. package/dist/plugin/root.d.ts +2 -0
  84. package/dist/plugin/root.d.ts.map +1 -0
  85. package/dist/plugin/root.js +12 -0
  86. package/dist/plugin/root.js.map +1 -0
  87. package/dist/plugin/transformer/plugin.d.ts.map +1 -1
  88. package/dist/plugin/transformer/plugin.js +32 -23
  89. package/dist/plugin/transformer/plugin.js.map +1 -1
  90. package/dist/plugin/transformer/types.d.ts +1 -18
  91. package/dist/plugin/transformer/types.d.ts.map +1 -1
  92. package/dist/plugin/types.d.ts +24 -6
  93. package/dist/plugin/types.d.ts.map +1 -1
  94. package/dist/plugin/worker/createWorker.js +0 -1
  95. package/dist/plugin/worker/createWorker.js.map +1 -1
  96. package/dist/plugin/worker/html/html-worker.development.d.ts +30 -0
  97. package/dist/plugin/worker/html/html-worker.development.d.ts.map +1 -1
  98. package/dist/plugin/worker/html/html-worker.development.js +30 -2
  99. package/dist/plugin/worker/html/html-worker.development.js.map +1 -1
  100. package/dist/plugin/worker/html/html-worker.production.js +3 -5
  101. package/dist/plugin/worker/html/html-worker.production.js.map +1 -1
  102. package/dist/plugin/worker/html/messageHandler.d.ts.map +1 -1
  103. package/dist/plugin/worker/html/messageHandler.js +8 -2
  104. package/dist/plugin/worker/html/messageHandler.js.map +1 -1
  105. package/dist/plugin/worker/html/plugin.d.ts.map +1 -1
  106. package/dist/plugin/worker/html/plugin.js +2 -3
  107. package/dist/plugin/worker/html/renderPages.d.ts +8 -4
  108. package/dist/plugin/worker/html/renderPages.d.ts.map +1 -1
  109. package/dist/plugin/worker/html/renderPages.js +118 -83
  110. package/dist/plugin/worker/html/renderPages.js.map +1 -1
  111. package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -1
  112. package/dist/plugin/worker/rsc/messageHandler.js +89 -84
  113. package/dist/plugin/worker/rsc/messageHandler.js.map +1 -1
  114. package/dist/plugin/worker/rsc/plugin.d.ts.map +1 -1
  115. package/dist/plugin/worker/rsc/plugin.js +1 -2
  116. package/dist/plugin/worker/rsc/rsc-worker.development.js +13 -18
  117. package/dist/plugin/worker/rsc/rsc-worker.development.js.map +1 -1
  118. package/dist/plugin/worker/rsc/rsc-worker.production.js +4 -1
  119. package/dist/plugin/worker/rsc/rsc-worker.production.js.map +1 -1
  120. package/dist/plugin/worker/rsc/state.d.ts.map +1 -1
  121. package/dist/plugin/worker/rsc/state.js.map +1 -1
  122. package/dist/tsconfig.tsbuildinfo +1 -1
  123. package/package.json +3 -3
  124. package/plugin/checkFilesExist.ts +7 -3
  125. package/plugin/collect-manifest-client-files.ts +152 -0
  126. package/plugin/components.tsx +55 -10
  127. package/plugin/config/defaults.tsx +69 -0
  128. package/plugin/config/getPaths.ts +1 -7
  129. package/plugin/config/mimeTypes.ts +17 -0
  130. package/plugin/config/resolveOptions.ts +48 -40
  131. package/plugin/config/resolvePages.ts +8 -4
  132. package/plugin/config/resolveUserConfig.ts +12 -9
  133. package/plugin/{react-server → helpers}/createHandler.ts +46 -63
  134. package/plugin/helpers/createRscStream.ts +81 -0
  135. package/plugin/helpers/getBundleManifest.ts +14 -5
  136. package/plugin/loader/createBuildLoader.ts +9 -6
  137. package/plugin/loader/css-loader.ts +0 -2
  138. package/plugin/loader/react-loader.ts +2 -2
  139. package/plugin/preserver/plugin.ts +64 -17
  140. package/plugin/react-client/plugin.ts +20 -91
  141. package/plugin/react-server/index.ts +2 -0
  142. package/plugin/react-server/plugin.ts +66 -293
  143. package/plugin/react-static/index.ts +1 -0
  144. package/plugin/react-static/plugin.ts +247 -0
  145. package/plugin/resolvePage.ts +9 -0
  146. package/plugin/root.ts +4 -0
  147. package/plugin/transformer/plugin.ts +40 -31
  148. package/plugin/transformer/types.ts +0 -19
  149. package/plugin/types.ts +25 -6
  150. package/plugin/worker/createWorker.ts +1 -1
  151. package/plugin/worker/html/README.md +63 -0
  152. package/plugin/worker/html/html-worker.development.tsx +89 -2
  153. package/plugin/worker/html/html-worker.production.tsx +8 -10
  154. package/plugin/worker/html/messageHandler.ts +8 -2
  155. package/plugin/worker/html/plugin.ts +2 -3
  156. package/plugin/worker/html/renderPages.ts +150 -114
  157. package/plugin/worker/rsc/README.md +58 -0
  158. package/plugin/worker/rsc/messageHandler.tsx +95 -111
  159. package/plugin/worker/rsc/plugin.ts +1 -2
  160. package/plugin/worker/rsc/rsc-worker.development.ts +12 -22
  161. package/plugin/worker/rsc/rsc-worker.production.ts +5 -1
  162. package/plugin/worker/rsc/state.ts +0 -3
  163. package/scripts/react+0.0.0-experimental-eda36a1c-20250228.patch +114 -12
  164. package/scripts/react-dom+0.0.0-experimental-eda36a1c-20250228.patch +10571 -121
  165. package/tsconfig.json +2 -2
  166. package/dist/plugin/collect-css-manifest.d.ts +0 -4
  167. package/dist/plugin/collect-css-manifest.d.ts.map +0 -1
  168. package/dist/plugin/collect-css-manifest.js +0 -65
  169. package/dist/plugin/collect-css-manifest.js.map +0 -1
  170. package/dist/plugin/config/createModuleIdGenerator.d.ts +0 -11
  171. package/dist/plugin/config/createModuleIdGenerator.d.ts.map +0 -1
  172. package/dist/plugin/config/createModuleIdGenerator.js +0 -44
  173. package/dist/plugin/config/createModuleIdGenerator.js.map +0 -1
  174. package/dist/plugin/loader/createCssLoader.d.ts +0 -30
  175. package/dist/plugin/loader/createCssLoader.d.ts.map +0 -1
  176. package/dist/plugin/loader/createCssLoader.js +0 -35
  177. package/dist/plugin/loader/createPageLoader.d.ts +0 -24
  178. package/dist/plugin/loader/createPageLoader.d.ts.map +0 -1
  179. package/dist/plugin/loader/createPageLoader.js +0 -50
  180. package/dist/plugin/loader/rsc/messageHandler.d.ts +0 -2
  181. package/dist/plugin/loader/rsc/messageHandler.d.ts.map +0 -1
  182. package/dist/plugin/loader/rsc/messageHandler.js +0 -1
  183. package/dist/plugin/loader/rsc/rsc-worker.development.d.ts +0 -2
  184. package/dist/plugin/loader/rsc/rsc-worker.development.d.ts.map +0 -1
  185. package/dist/plugin/loader/rsc/rsc-worker.development.js +0 -1
  186. package/dist/plugin/react-server/createHandler.d.ts +0 -17
  187. package/dist/plugin/react-server/createHandler.d.ts.map +0 -1
  188. package/dist/plugin/react-server/createHandler.js.map +0 -1
  189. package/dist/plugin/react-server/createRscStream.d.ts.map +0 -1
  190. package/dist/plugin/react-server/createRscStream.js +0 -70
  191. package/dist/plugin/react-server/createRscStream.js.map +0 -1
  192. package/dist/plugin/react-server/createSsrHandler.d.ts +0 -4
  193. package/dist/plugin/react-server/createSsrHandler.d.ts.map +0 -1
  194. package/dist/plugin/react-server/createSsrHandler.js +0 -95
  195. package/dist/plugin/utils/logger.d.ts +0 -9
  196. package/dist/plugin/utils/logger.d.ts.map +0 -1
  197. package/dist/plugin/utils/logger.js +0 -68
  198. package/dist/plugin/utils/logger.js.map +0 -1
  199. package/plugin/collect-css-manifest.ts +0 -82
  200. package/plugin/config/createModuleIdGenerator.ts +0 -52
  201. package/plugin/config/defaults.ts +0 -51
  202. package/plugin/loader/createCssLoader.ts +0 -73
  203. package/plugin/loader/createPageLoader.ts +0 -103
  204. package/plugin/loader/rsc/messageHandler.tsx +0 -1
  205. package/plugin/loader/rsc/rsc-worker.development.ts +0 -1
  206. package/plugin/react-server/createRscStream.ts +0 -86
  207. package/plugin/react-server/createSsrHandler.ts +0 -125
  208. 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
- addCssFile,
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
- if (message.type === "RSC_RENDER") {
47
- const {
48
- id,
49
- pageImport,
50
- propsImport,
51
- pageExportName,
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
- const propsAtExport = propsModule[propsExportName];
69
- const props = await Promise.resolve(
70
- typeof propsAtExport === "function" ? propsAtExport(url) : propsAtExport
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
- const PageComponent = Component[pageExportName];
74
- // Now render with collected CSS
75
- const stream = renderToPipeableStream(
76
- <CssCollector cssFiles={cssFiles}>
77
- <PageComponent {...props} />
78
- </CssCollector>,
79
- moduleBaseURL,
80
- {
81
- onError: (error: Error) => {
82
- console.log('onError', error);
83
- log.error(`Stream error at ${id}:`, error);
84
- parentPort?.postMessage({
85
- type: "ERROR",
86
- id,
87
- error: error instanceof Error ? error.message : String(error),
88
- });
89
- },
90
- onPostpone: log?.info ?? console.info,
91
- environmentName: "Server",
92
- importMap: {
93
- imports: {
94
- ...pipableStreamOptions?.importMap?.imports,
95
- "/": moduleBasePath,
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
- ...pipableStreamOptions,
99
- }
100
- );
73
+ environmentName: "Server",
74
+ importMap: {
75
+ imports: {
76
+ ...pipableStreamOptions?.importMap?.imports,
77
+ "/": moduleBasePath,
78
+ },
79
+ },
80
+ ...pipableStreamOptions,
81
+ }
82
+ );
101
83
 
102
- // Listen for data and end events
103
- const passThrough = new PassThrough();
84
+ // Listen for data and end events
85
+ const passThrough = new PassThrough();
104
86
 
105
- stream.pipe(passThrough);
87
+ stream.pipe(passThrough);
106
88
 
107
- passThrough.on("data", (chunk) => {
108
- // Send to parent
109
- parentPort?.postMessage({
110
- type: "RSC_CHUNK",
111
- id,
112
- chunk: chunk.toString(),
113
- moduleRootPath: moduleBasePath,
114
- moduleBaseURL,
115
- outDir,
116
- rscOutputPath: `${outDir}/${id}.rsc`,
117
- cssFiles: Array.from(cssFiles.entries()),
118
- } satisfies RscChunkMessage);
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
- passThrough.on("end", () => {
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: "RSC_END",
112
+ type: "ERROR",
124
113
  id,
125
- } satisfies RscEndMessage);
126
- });
127
- } catch (error) {
128
- console.trace(error);
129
- parentPort?.postMessage({
130
- type: "ERROR",
131
- id,
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 { getPluginRoot } from "../../config/getPaths.js";
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 { getPluginRoot } from "../../config/getPaths.js";
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', (msg) => {
72
- messageHandler(msg);
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(getPluginRoot(), 'loader/react-loader.js');
80
- const cssLoaderPath = 'file://' + join(getPluginRoot(), 'loader/css-loader.js');
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: getPluginRoot(),
75
+ parentURL: pluginRoot,
86
76
  data: { port: reactLoaderChannel.port1 },
87
77
  transferList: [reactLoaderChannel.port1]
88
78
  });
89
79
  register(cssLoaderPath, {
90
- parentURL: getPluginRoot(),
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", (message) => {
100
- messageHandler(message);
101
- });
89
+ parentPort.on("message", messageHandler);
102
90
 
103
91
  // Signal ready
104
- parentPort.postMessage({ type: "READY", env: "development" });
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: "production" });
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,6 +1,3 @@
1
- import { createLogger } from "../../utils/logger.js";
2
-
3
-
4
1
  // Create shared CSS registry
5
2
  export const cssFiles = new Map<string, string>();
6
3
  export const clientFiles = new Set<string>();
@@ -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 9aa7fdf..2bc8270 100644
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
- @@ -1277,7 +1277,7 @@
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-d55cc79b-20250228";
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 3678d50..24d6e95 100644
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-d55cc79b-20250228";
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 15d4371..8497113 100644
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
- @@ -981,5 +981,5 @@
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-d55cc79b-20250228";
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 6c7c438..694169d 100644
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-d55cc79b-20250228";
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 f7c9f76..b6e85b0 100644
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-d55cc79b-20250228",
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",