vite-plugin-react-server 1.1.9 → 1.1.11

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 (415) hide show
  1. package/README.md +208 -27
  2. package/dist/index.js.map +1 -1
  3. package/dist/package.json +34 -14
  4. package/dist/plugin/{css-collector-elements.d.ts → components/css-collector-elements.d.ts} +1 -1
  5. package/dist/plugin/components/css-collector-elements.d.ts.map +1 -0
  6. package/dist/plugin/components/css-collector-elements.js.map +1 -0
  7. package/dist/plugin/{css-collector.d.ts → components/css-collector.d.ts} +1 -1
  8. package/dist/plugin/components/css-collector.d.ts.map +1 -0
  9. package/dist/plugin/components/css-collector.js.map +1 -0
  10. package/dist/plugin/components/html.d.ts +4 -0
  11. package/dist/plugin/components/html.d.ts.map +1 -0
  12. package/dist/plugin/components/html.js +17 -0
  13. package/dist/plugin/components/html.js.map +1 -0
  14. package/dist/plugin/components/index.d.ts +5 -0
  15. package/dist/plugin/components/index.d.ts.map +1 -0
  16. package/dist/plugin/components.js +9 -3
  17. package/dist/plugin/components.js.map +1 -0
  18. package/dist/plugin/config/autoDiscover/index.d.ts +6 -0
  19. package/dist/plugin/config/autoDiscover/index.d.ts.map +1 -0
  20. package/dist/plugin/config/autoDiscover/index.js +8 -0
  21. package/dist/plugin/config/{resolveAutoDiscover.d.ts → autoDiscover/resolveAutoDiscover.d.ts} +1 -1
  22. package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts.map +1 -0
  23. package/dist/plugin/config/{resolveAutoDiscover.js → autoDiscover/resolveAutoDiscover.js} +10 -9
  24. package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js.map +1 -0
  25. package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts.map +1 -1
  26. package/dist/plugin/config/autoDiscover/resolveBuildPages.js +10 -10
  27. package/dist/plugin/config/autoDiscover/resolveBuildPages.js.map +1 -1
  28. package/dist/plugin/config/defaults.d.ts +6 -4
  29. package/dist/plugin/config/defaults.d.ts.map +1 -1
  30. package/dist/plugin/config/defaults.js +8 -4
  31. package/dist/plugin/config/defaults.js.map +1 -1
  32. package/dist/plugin/config/index.d.ts +1 -0
  33. package/dist/plugin/config/index.d.ts.map +1 -1
  34. package/dist/plugin/config/index.js +1 -0
  35. package/dist/plugin/config/resolveDevServerConfig.d.ts +2 -0
  36. package/dist/plugin/config/resolveDevServerConfig.d.ts.map +1 -0
  37. package/dist/plugin/config/resolveEnv.d.ts +13 -0
  38. package/dist/plugin/config/resolveEnv.d.ts.map +1 -0
  39. package/dist/plugin/config/resolveEnv.js +120 -0
  40. package/dist/plugin/config/resolveEnv.js.map +1 -0
  41. package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
  42. package/dist/plugin/config/resolveOptions.js +34 -11
  43. package/dist/plugin/config/resolveOptions.js.map +1 -1
  44. package/dist/plugin/config/resolveUrlOption.d.ts +1 -1
  45. package/dist/plugin/config/resolveUrlOption.d.ts.map +1 -1
  46. package/dist/plugin/config/resolveUrlOption.js +1 -2
  47. package/dist/plugin/config/resolveUrlOption.js.map +1 -1
  48. package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
  49. package/dist/plugin/config/resolveUserConfig.js +80 -69
  50. package/dist/plugin/config/resolveUserConfig.js.map +1 -1
  51. package/dist/plugin/config.js +17 -0
  52. package/dist/plugin/config.js.map +1 -0
  53. package/dist/plugin/env/index.d.ts +2 -0
  54. package/dist/plugin/env/index.d.ts.map +1 -0
  55. package/dist/plugin/env/index.js +1 -0
  56. package/dist/plugin/env/plugin.d.ts +30 -0
  57. package/dist/plugin/env/plugin.d.ts.map +1 -0
  58. package/dist/plugin/env/plugin.js +64 -0
  59. package/dist/plugin/env.js +45 -0
  60. package/dist/plugin/env.js.map +1 -0
  61. package/dist/plugin/error/toError.d.ts +6 -0
  62. package/dist/plugin/error/toError.d.ts.map +1 -0
  63. package/dist/plugin/error/toError.js +19 -0
  64. package/dist/plugin/error/toError.js.map +1 -0
  65. package/dist/plugin/file-preserver/plugin.d.ts +19 -0
  66. package/dist/plugin/file-preserver/plugin.d.ts.map +1 -0
  67. package/dist/plugin/file-preserver/plugin.js +108 -0
  68. package/dist/plugin/file-preserver.js +96 -0
  69. package/dist/plugin/file-preserver.js.map +1 -0
  70. package/dist/plugin/helpers/collectManifestCss.js.map +1 -1
  71. package/dist/plugin/helpers/createCssProps.d.ts.map +1 -1
  72. package/dist/plugin/helpers/createCssProps.js +10 -2
  73. package/dist/plugin/helpers/createCssProps.js.map +1 -1
  74. package/dist/plugin/helpers/createEventHandler.d.ts +1 -1
  75. package/dist/plugin/helpers/createRscStream.js +1 -1
  76. package/dist/plugin/helpers/createRscStream.js.map +1 -1
  77. package/dist/plugin/helpers/formatMetrics.d.ts +3 -1
  78. package/dist/plugin/helpers/formatMetrics.d.ts.map +1 -1
  79. package/dist/plugin/helpers/formatMetrics.js +22 -7
  80. package/dist/plugin/helpers/formatMetrics.js.map +1 -0
  81. package/dist/plugin/helpers/getRouteFiles.d.ts +1 -1
  82. package/dist/plugin/helpers/getRouteFiles.d.ts.map +1 -1
  83. package/dist/plugin/helpers/getRouteFiles.js +2 -0
  84. package/dist/plugin/helpers/getRouteFiles.js.map +1 -1
  85. package/dist/plugin/helpers/index.d.ts +24 -0
  86. package/dist/plugin/helpers/index.d.ts.map +1 -0
  87. package/dist/plugin/helpers/index.js +31 -0
  88. package/dist/plugin/helpers/inputNormalizer.d.ts +2 -1
  89. package/dist/plugin/helpers/inputNormalizer.d.ts.map +1 -1
  90. package/dist/plugin/helpers/inputNormalizer.js +34 -9
  91. package/dist/plugin/helpers/inputNormalizer.js.map +1 -1
  92. package/dist/plugin/helpers/metrics.js +26 -2
  93. package/dist/plugin/helpers/metrics.js.map +1 -1
  94. package/dist/plugin/helpers/moduleRefs.d.ts.map +1 -0
  95. package/dist/plugin/helpers/moduleRefs.js.map +1 -0
  96. package/dist/plugin/helpers/requestInfo.d.ts +26 -0
  97. package/dist/plugin/helpers/requestInfo.d.ts.map +1 -0
  98. package/dist/plugin/helpers/requestInfo.js +66 -0
  99. package/dist/plugin/helpers/requestInfo.js.map +1 -0
  100. package/dist/plugin/helpers/requestToRoute.js.map +1 -1
  101. package/dist/plugin/helpers/resolvePage.d.ts.map +1 -0
  102. package/dist/plugin/{resolvePage.js → helpers/resolvePage.js} +19 -3
  103. package/dist/plugin/helpers/resolvePage.js.map +1 -0
  104. package/dist/plugin/helpers/resolvePageAndProps.d.ts.map +1 -1
  105. package/dist/plugin/helpers/resolvePageAndProps.js +7 -4
  106. package/dist/plugin/helpers/resolvePageAndProps.js.map +1 -1
  107. package/dist/plugin/helpers/resolveProps.d.ts.map +1 -0
  108. package/dist/plugin/{resolveProps.js → helpers/resolveProps.js} +9 -6
  109. package/dist/plugin/helpers/resolveProps.js.map +1 -0
  110. package/dist/plugin/helpers/serializeUserOptions.js +1 -1
  111. package/dist/plugin/helpers/serializeUserOptions.js.map +1 -1
  112. package/dist/plugin/helpers/stashReturnValue.js +19 -13
  113. package/dist/plugin/helpers/stashReturnValue.js.map +1 -0
  114. package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
  115. package/dist/plugin/helpers/tryManifest.js +0 -1
  116. package/dist/plugin/helpers/tryManifest.js.map +1 -1
  117. package/dist/plugin/helpers.js +27 -0
  118. package/dist/plugin/helpers.js.map +1 -0
  119. package/dist/plugin/loader/createBuildLoader.js +1 -1
  120. package/dist/plugin/loader/createBuildLoader.js.map +1 -1
  121. package/dist/plugin/loader/css-loader.development.d.ts.map +1 -1
  122. package/dist/plugin/loader/css-loader.development.js +1 -7
  123. package/dist/plugin/loader/css-loader.development.js.map +1 -1
  124. package/dist/plugin/loader/css-loader.production.js.map +1 -1
  125. package/dist/plugin/loader/env-loader.development.d.ts +12 -0
  126. package/dist/plugin/loader/env-loader.development.d.ts.map +1 -0
  127. package/dist/plugin/loader/env-loader.development.js +60 -0
  128. package/dist/plugin/loader/react-loader.d.ts.map +1 -1
  129. package/dist/plugin/loader/react-loader.js +1 -8
  130. package/dist/plugin/loader/react-loader.js.map +1 -1
  131. package/dist/plugin/metrics/formatMetrics.d.ts +6 -1
  132. package/dist/plugin/metrics/formatMetrics.d.ts.map +1 -1
  133. package/dist/plugin/metrics/formatMetrics.js +21 -3
  134. package/dist/plugin/metrics/formatMetrics.js.map +1 -1
  135. package/dist/plugin/metrics.js +1 -1
  136. package/dist/plugin/plugin.client.d.ts.map +1 -1
  137. package/dist/plugin/plugin.client.js +2 -0
  138. package/dist/plugin/plugin.client.js.map +1 -1
  139. package/dist/plugin/plugin.d.ts.map +1 -1
  140. package/dist/plugin/plugin.js +1 -2
  141. package/dist/plugin/plugin.server.d.ts.map +1 -1
  142. package/dist/plugin/plugin.server.js +3 -0
  143. package/dist/plugin/plugin.server.js.map +1 -1
  144. package/dist/plugin/preserver/plugin.js.map +1 -1
  145. package/dist/plugin/process-env.d.ts +14 -0
  146. package/dist/plugin/process-env.d.ts.map +1 -0
  147. package/dist/plugin/process-env.js +1 -0
  148. package/dist/plugin/react-client/createMessageHandlers.d.ts +11 -0
  149. package/dist/plugin/react-client/createMessageHandlers.d.ts.map +1 -0
  150. package/dist/plugin/react-client/createMessageHandlers.js +47 -0
  151. package/dist/plugin/react-client/createMessageHandlers.js.map +1 -0
  152. package/dist/plugin/react-client/createWorkerStream.d.ts +9 -3
  153. package/dist/plugin/react-client/createWorkerStream.d.ts.map +1 -1
  154. package/dist/plugin/react-client/createWorkerStream.js +102 -70
  155. package/dist/plugin/react-client/createWorkerStream.js.map +1 -1
  156. package/dist/plugin/react-client/handleWorkerRscStream.d.ts +19 -0
  157. package/dist/plugin/react-client/handleWorkerRscStream.d.ts.map +1 -0
  158. package/dist/plugin/react-client/handleWorkerRscStream.js +47 -0
  159. package/dist/plugin/react-client/handleWorkerRscStream.js.map +1 -0
  160. package/dist/plugin/react-client/plugin.d.ts.map +1 -1
  161. package/dist/plugin/react-client/plugin.js +19 -5
  162. package/dist/plugin/react-client/plugin.js.map +1 -1
  163. package/dist/plugin/react-client/restartWorker.d.ts +6 -1
  164. package/dist/plugin/react-client/restartWorker.d.ts.map +1 -1
  165. package/dist/plugin/react-client/restartWorker.js +13 -5
  166. package/dist/plugin/react-client/restartWorker.js.map +1 -1
  167. package/dist/plugin/react-client/server.d.ts +2 -13
  168. package/dist/plugin/react-client/server.d.ts.map +1 -1
  169. package/dist/plugin/react-client/server.js +123 -121
  170. package/dist/plugin/react-client/server.js.map +1 -1
  171. package/dist/plugin/react-server/plugin.d.ts.map +1 -1
  172. package/dist/plugin/react-server/plugin.js +18 -8
  173. package/dist/plugin/react-server/plugin.js.map +1 -1
  174. package/dist/plugin/react-server/server.d.ts.map +1 -1
  175. package/dist/plugin/react-server/server.js +37 -23
  176. package/dist/plugin/react-server/server.js.map +1 -1
  177. package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts.map +1 -1
  178. package/dist/plugin/react-static/collectHtmlWorkerContent.js +9 -0
  179. package/dist/plugin/react-static/collectHtmlWorkerContent.js.map +1 -1
  180. package/dist/plugin/react-static/collectRscContent.js.map +1 -1
  181. package/dist/plugin/react-static/configurePreviewServer.d.ts.map +1 -1
  182. package/dist/plugin/react-static/configurePreviewServer.js +58 -54
  183. package/dist/plugin/react-static/configurePreviewServer.js.map +1 -1
  184. package/dist/plugin/react-static/fileWriter.d.ts +1 -1
  185. package/dist/plugin/react-static/fileWriter.d.ts.map +1 -1
  186. package/dist/plugin/react-static/fileWriter.js.map +1 -1
  187. package/dist/plugin/react-static/plugin.d.ts.map +1 -1
  188. package/dist/plugin/react-static/plugin.js +21 -23
  189. package/dist/plugin/react-static/plugin.js.map +1 -1
  190. package/dist/plugin/react-static/renderPages.js.map +1 -1
  191. package/dist/plugin/root.d.ts +1 -0
  192. package/dist/plugin/root.d.ts.map +1 -1
  193. package/dist/plugin/root.js +3 -2
  194. package/dist/plugin/root.js.map +1 -1
  195. package/dist/plugin/transformer/plugin.client.d.ts.map +1 -1
  196. package/dist/plugin/transformer/plugin.client.js +3 -12
  197. package/dist/plugin/transformer/plugin.client.js.map +1 -1
  198. package/dist/plugin/transformer/plugin.js.map +1 -1
  199. package/dist/plugin/transformer/plugin.server.d.ts.map +1 -1
  200. package/dist/plugin/transformer/plugin.server.js +17 -24
  201. package/dist/plugin/transformer/plugin.server.js.map +1 -1
  202. package/dist/plugin/transformer/upgradeCssModuleCode.d.ts +1 -10
  203. package/dist/plugin/transformer/upgradeCssModuleCode.d.ts.map +1 -1
  204. package/dist/plugin/transformer/upgradeCssModuleCode.js +40 -38
  205. package/dist/plugin/types.d.ts +60 -15
  206. package/dist/plugin/types.d.ts.map +1 -1
  207. package/dist/plugin/types.js +1 -1
  208. package/dist/plugin/utils/callServer.d.ts +1 -1
  209. package/dist/plugin/utils/callServer.d.ts.map +1 -1
  210. package/dist/plugin/utils/callServer.js +3 -17
  211. package/dist/plugin/utils/callServer.js.map +1 -1
  212. package/dist/plugin/utils/createCallServer.d.ts +2 -0
  213. package/dist/plugin/utils/createCallServer.d.ts.map +1 -0
  214. package/dist/plugin/utils/createCallServer.js +28 -0
  215. package/dist/plugin/utils/createCallServer.js.map +1 -0
  216. package/dist/plugin/utils/createReactFetcher.d.ts +3 -1
  217. package/dist/plugin/utils/createReactFetcher.d.ts.map +1 -1
  218. package/dist/plugin/utils/createReactFetcher.js +11 -11
  219. package/dist/plugin/utils/createReactFetcher.js.map +1 -1
  220. package/dist/plugin/utils/env.d.ts +2 -0
  221. package/dist/plugin/utils/env.d.ts.map +1 -0
  222. package/dist/plugin/utils/env.js +9 -0
  223. package/dist/plugin/utils/env.js.map +1 -0
  224. package/dist/plugin/utils/envUrls.d.ts +9 -0
  225. package/dist/plugin/utils/envUrls.d.ts.map +1 -0
  226. package/dist/plugin/utils/envUrls.js +7 -0
  227. package/dist/plugin/utils/envUrls.node.d.ts +7 -0
  228. package/dist/plugin/utils/envUrls.node.d.ts.map +1 -0
  229. package/dist/plugin/utils/envUrls.node.js +11 -0
  230. package/dist/plugin/utils/envUrls.node.js.map +1 -0
  231. package/dist/plugin/utils/index.d.ts +2 -1
  232. package/dist/plugin/utils/index.d.ts.map +1 -1
  233. package/dist/plugin/utils/index.js +2 -1
  234. package/dist/plugin/utils/moduleBaseURL.d.ts +3 -0
  235. package/dist/plugin/utils/moduleBaseURL.d.ts.map +1 -0
  236. package/dist/plugin/utils/moduleBaseURL.js +4 -0
  237. package/dist/plugin/utils/urls.d.ts +130 -0
  238. package/dist/plugin/utils/urls.d.ts.map +1 -0
  239. package/dist/plugin/utils/urls.js +87 -0
  240. package/dist/plugin/utils/urls.js.map +1 -0
  241. package/dist/plugin/utils.js +2 -1
  242. package/dist/plugin/utils.js.map +1 -1
  243. package/dist/plugin/vendor/index.d.ts +2 -0
  244. package/dist/plugin/vendor/index.d.ts.map +1 -0
  245. package/dist/plugin/vendor/index.js +1 -0
  246. package/dist/plugin/vendor/vendor.client.d.ts.map +1 -0
  247. package/dist/plugin/vendor/vendor.client.js.map +1 -0
  248. package/dist/plugin/vendor/vendor.d.ts +2 -0
  249. package/dist/plugin/vendor/vendor.d.ts.map +1 -0
  250. package/dist/plugin/vendor/vendor.js +15 -0
  251. package/dist/plugin/vendor/vendor.js.map +1 -0
  252. package/dist/plugin/vendor/vendor.server.d.ts.map +1 -0
  253. package/dist/plugin/vendor/vendor.server.js.map +1 -0
  254. package/dist/plugin/vendor.js +7 -0
  255. package/dist/plugin/vendor.js.map +1 -0
  256. package/dist/plugin/worker/createWorker.d.ts +3 -0
  257. package/dist/plugin/worker/createWorker.d.ts.map +1 -1
  258. package/dist/plugin/worker/createWorker.js +37 -23
  259. package/dist/plugin/worker/createWorker.js.map +1 -1
  260. package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts.map +1 -1
  261. package/dist/plugin/worker/html/createHtmlWorkerRenderState.js +4 -1
  262. package/dist/plugin/worker/html/createHtmlWorkerRenderState.js.map +1 -1
  263. package/dist/plugin/worker/html/html-worker.development.js.map +1 -1
  264. package/dist/plugin/worker/html/html-worker.production.js.map +1 -1
  265. package/dist/plugin/worker/rsc/handleRender.d.ts +2 -7
  266. package/dist/plugin/worker/rsc/handleRender.d.ts.map +1 -1
  267. package/dist/plugin/worker/rsc/handleRender.js +4 -4
  268. package/dist/plugin/worker/rsc/handleRender.js.map +1 -1
  269. package/dist/plugin/worker/rsc/messageHandler.d.ts +2 -1
  270. package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -1
  271. package/dist/plugin/worker/rsc/messageHandler.js +42 -16
  272. package/dist/plugin/worker/rsc/messageHandler.js.map +1 -1
  273. package/dist/plugin/worker/rsc/rsc-worker.development.js +16 -5
  274. package/dist/plugin/worker/rsc/rsc-worker.development.js.map +1 -1
  275. package/dist/plugin/worker/rsc/rsc-worker.production.js +16 -5
  276. package/dist/plugin/worker/rsc/rsc-worker.production.js.map +1 -1
  277. package/dist/plugin/worker/rsc/state.d.ts.map +1 -1
  278. package/dist/plugin/worker/rsc/state.js.map +1 -1
  279. package/dist/plugin/worker/sendMessage.js +45 -43
  280. package/dist/plugin/worker/sendMessage.js.map +1 -0
  281. package/dist/plugin/worker/types.d.ts +32 -4
  282. package/dist/plugin/worker/types.d.ts.map +1 -1
  283. package/dist/server.js +1 -1
  284. package/dist/server.js.map +1 -1
  285. package/dist/tsconfig.tsbuildinfo +1 -1
  286. package/package.json +34 -14
  287. package/plugin/{css-collector-elements.tsx → components/css-collector-elements.tsx} +1 -1
  288. package/plugin/{css-collector.tsx → components/css-collector.tsx} +1 -1
  289. package/plugin/{html.tsx → components/html.tsx} +1 -3
  290. package/{dist/plugin/components.d.ts → plugin/components/index.ts} +1 -1
  291. package/plugin/config/autoDiscover/index.ts +10 -0
  292. package/plugin/config/{resolveAutoDiscover.ts → autoDiscover/resolveAutoDiscover.ts} +16 -12
  293. package/plugin/config/autoDiscover/resolveBuildPages.ts +10 -11
  294. package/plugin/config/defaults.tsx +6 -4
  295. package/plugin/config/index.ts +1 -1
  296. package/plugin/config/resolveEnv.ts +187 -0
  297. package/plugin/config/resolveOptions.ts +60 -27
  298. package/plugin/config/resolveUrlOption.ts +2 -7
  299. package/plugin/config/resolveUserConfig.ts +145 -98
  300. package/plugin/env/index.ts +1 -0
  301. package/plugin/env/plugin.ts +78 -0
  302. package/plugin/error/toError.ts +19 -0
  303. package/plugin/file-preserver/plugin.ts +117 -0
  304. package/plugin/helpers/createCssProps.tsx +14 -6
  305. package/plugin/helpers/createRscStream.tsx +1 -1
  306. package/plugin/helpers/formatMetrics.ts +2 -2
  307. package/plugin/helpers/getRouteFiles.ts +3 -1
  308. package/plugin/helpers/index.ts +38 -0
  309. package/plugin/helpers/inputNormalizer.ts +66 -17
  310. package/plugin/helpers/requestInfo.ts +91 -0
  311. package/plugin/{resolvePage.ts → helpers/resolvePage.ts} +19 -4
  312. package/plugin/helpers/resolvePageAndProps.ts +7 -4
  313. package/plugin/{resolveProps.ts → helpers/resolveProps.ts} +8 -6
  314. package/plugin/helpers/serializeUserOptions.ts +1 -1
  315. package/plugin/helpers/tryManifest.ts +0 -1
  316. package/plugin/loader/createBuildLoader.ts +1 -1
  317. package/plugin/loader/css-loader.development.ts +2 -8
  318. package/plugin/loader/env-loader.development.ts +84 -0
  319. package/plugin/loader/react-loader.ts +1 -10
  320. package/plugin/metrics/formatMetrics.ts +29 -4
  321. package/plugin/plugin.client.ts +2 -0
  322. package/plugin/plugin.server.ts +3 -0
  323. package/plugin/plugin.ts +1 -3
  324. package/plugin/preserver/plugin.ts +1 -0
  325. package/plugin/process-env.ts +13 -0
  326. package/plugin/react-client/createMessageHandlers.ts +49 -0
  327. package/plugin/react-client/createWorkerStream.ts +130 -83
  328. package/plugin/react-client/handleWorkerRscStream.ts +57 -0
  329. package/plugin/react-client/plugin.ts +30 -17
  330. package/plugin/react-client/restartWorker.ts +15 -7
  331. package/plugin/react-client/server.ts +129 -164
  332. package/plugin/react-server/plugin.ts +26 -13
  333. package/plugin/react-server/server.ts +40 -35
  334. package/plugin/react-static/collectHtmlWorkerContent.ts +13 -1
  335. package/plugin/react-static/configurePreviewServer.ts +75 -62
  336. package/plugin/react-static/fileWriter.ts +1 -1
  337. package/plugin/react-static/plugin.ts +23 -30
  338. package/plugin/root.ts +7 -1
  339. package/plugin/transformer/plugin.client.ts +4 -12
  340. package/plugin/transformer/plugin.server.ts +18 -25
  341. package/plugin/transformer/upgradeCssModuleCode.ts +39 -39
  342. package/plugin/types/env.d.ts +7 -0
  343. package/plugin/types.ts +80 -29
  344. package/plugin/utils/callServer.ts +3 -24
  345. package/plugin/utils/createCallServer.ts +26 -0
  346. package/plugin/utils/createReactFetcher.ts +14 -12
  347. package/plugin/utils/env.ts +1 -0
  348. package/plugin/utils/envUrls.node.ts +19 -0
  349. package/plugin/utils/envUrls.ts +8 -0
  350. package/plugin/utils/index.ts +2 -1
  351. package/plugin/utils/moduleBaseURL.ts +7 -0
  352. package/plugin/utils/urls.ts +217 -0
  353. package/plugin/vendor/index.ts +1 -0
  354. package/plugin/vendor/vendor.ts +6 -0
  355. package/plugin/worker/createWorker.ts +41 -30
  356. package/plugin/worker/html/createHtmlWorkerRenderState.tsx +4 -1
  357. package/plugin/worker/html/html-worker.development.tsx +2 -1
  358. package/plugin/worker/html/html-worker.production.tsx +2 -1
  359. package/plugin/worker/rsc/handleRender.ts +6 -12
  360. package/plugin/worker/rsc/messageHandler.tsx +53 -20
  361. package/plugin/worker/rsc/rsc-worker.development.ts +23 -9
  362. package/plugin/worker/rsc/rsc-worker.production.ts +23 -7
  363. package/plugin/worker/types.ts +35 -4
  364. package/dist/plugin/components.d.ts.map +0 -1
  365. package/dist/plugin/config/resolveAutoDiscover.d.ts.map +0 -1
  366. package/dist/plugin/config/resolveAutoDiscover.js.map +0 -1
  367. package/dist/plugin/copy.d.ts +0 -7
  368. package/dist/plugin/copy.d.ts.map +0 -1
  369. package/dist/plugin/copy.js +0 -30
  370. package/dist/plugin/css-collector-elements.d.ts.map +0 -1
  371. package/dist/plugin/css-collector-elements.js.map +0 -1
  372. package/dist/plugin/css-collector.d.ts.map +0 -1
  373. package/dist/plugin/css-collector.js.map +0 -1
  374. package/dist/plugin/getCondition.d.ts +0 -2
  375. package/dist/plugin/getCondition.d.ts.map +0 -1
  376. package/dist/plugin/html.d.ts +0 -4
  377. package/dist/plugin/html.d.ts.map +0 -1
  378. package/dist/plugin/html.js +0 -18
  379. package/dist/plugin/html.js.map +0 -1
  380. package/dist/plugin/manifest.d.ts +0 -6
  381. package/dist/plugin/manifest.d.ts.map +0 -1
  382. package/dist/plugin/manifest.js +0 -13
  383. package/dist/plugin/moduleRefs.d.ts.map +0 -1
  384. package/dist/plugin/moduleRefs.js.map +0 -1
  385. package/dist/plugin/resolvePage.d.ts.map +0 -1
  386. package/dist/plugin/resolvePage.js.map +0 -1
  387. package/dist/plugin/resolveProps.d.ts.map +0 -1
  388. package/dist/plugin/resolveProps.js.map +0 -1
  389. package/dist/plugin/utils/pageURL.d.ts +0 -2
  390. package/dist/plugin/utils/pageURL.d.ts.map +0 -1
  391. package/dist/plugin/utils/pageURL.js +0 -21
  392. package/dist/plugin/utils/pageURL.js.map +0 -1
  393. package/dist/plugin/vendor.client.d.ts.map +0 -1
  394. package/dist/plugin/vendor.client.js.map +0 -1
  395. package/dist/plugin/vendor.server.d.ts.map +0 -1
  396. package/dist/plugin/vendor.server.js.map +0 -1
  397. package/plugin/copy.ts +0 -39
  398. package/plugin/manifest.ts +0 -24
  399. package/plugin/utils/pageURL.ts +0 -28
  400. /package/dist/plugin/{css-collector-elements.js → components/css-collector-elements.js} +0 -0
  401. /package/dist/plugin/{css-collector.js → components/css-collector.js} +0 -0
  402. /package/{plugin/components.ts → dist/plugin/components/index.js} +0 -0
  403. /package/dist/plugin/{getCondition.js → config/resolveDevServerConfig.js} +0 -0
  404. /package/dist/plugin/{moduleRefs.d.ts → helpers/moduleRefs.d.ts} +0 -0
  405. /package/dist/plugin/{moduleRefs.js → helpers/moduleRefs.js} +0 -0
  406. /package/dist/plugin/{resolvePage.d.ts → helpers/resolvePage.d.ts} +0 -0
  407. /package/dist/plugin/{resolveProps.d.ts → helpers/resolveProps.d.ts} +0 -0
  408. /package/dist/plugin/{vendor.client.d.ts → vendor/vendor.client.d.ts} +0 -0
  409. /package/dist/plugin/{vendor.client.js → vendor/vendor.client.js} +0 -0
  410. /package/dist/plugin/{vendor.server.d.ts → vendor/vendor.server.d.ts} +0 -0
  411. /package/dist/plugin/{vendor.server.js → vendor/vendor.server.js} +0 -0
  412. /package/plugin/{getCondition.ts → config/resolveDevServerConfig.tsx} +0 -0
  413. /package/plugin/{moduleRefs.ts → helpers/moduleRefs.ts} +0 -0
  414. /package/plugin/{vendor.client.ts → vendor/vendor.client.ts} +0 -0
  415. /package/plugin/{vendor.server.ts → vendor/vendor.server.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sources":["../../../../plugin/worker/rsc/state.ts"],"sourcesContent":["import { workerData } from \"node:worker_threads\";\nimport { createCssProps } from \"../../helpers/createCssProps.js\";\nimport type { CssContent, ResolvedUserOptions, HmrState } from \"../../types.js\";\nimport type { PassThrough } from \"node:stream\";\nimport { relative } from \"node:path\";\n\n\n// Track active RSC streams\nexport const activeStreams = new Map<string, PassThrough>();\n\n// Track CSS files\nexport const cssFiles = new Map<string, CssContent>();\n\n\nexport const hmrState = new Map<string, HmrState>();\n\nif(workerData) {\n if(workerData.hmrPort) {\n workerData.hmrPort.on('message', (msg: { type: string; path: string; routes?: string[] }) => {\n if(msg.type === 'HMR_UPDATE') {\n // Normalize the path relative to project root\n const normalizedPath = relative(workerData.userOptions.projectRoot, msg.path);\n hmrState.set(normalizedPath, { \n timestamp: Date.now(), \n invalidated: true,\n routes: msg.routes || []\n });\n } else if(msg.type === 'HMR_ACCEPT') {\n // Normalize the path relative to project root\n const normalizedPath = relative(workerData.userOptions.projectRoot, msg.path);\n hmrState.delete(normalizedPath);\n }\n });\n }\n} else {\n throw new Error(\"This module must be run with workerData\");\n}\n\n// Create shared CSS registry\nexport const clientFiles = new Set<string>();\nexport const serverActionFiles = new Set<string>();\n\n// Helper functions\nexport function clearCssFiles() {\n cssFiles.clear();\n}\n\nexport function getCssFiles() {\n return cssFiles.entries();\n}\n\nexport function clearClientFiles() {\n clientFiles.clear();\n}\n\nexport function clearServerActionFiles() {\n serverActionFiles.clear();\n}\n\nexport function addCssFile(id: string, cssFile: CssContent) {\n cssFiles.set(id, cssFile);\n}\n\n\nexport function addCssFileContent(id: string, code: string, userOptions: Pick<ResolvedUserOptions, \"projectRoot\" | \"moduleBaseURL\" | \"moduleBasePath\" | \"moduleRootPath\" | \"css\">) {\n if(typeof code !== \"string\"){\n throw new Error(`Expected css to be loaded as a string, but got ${typeof code}`);\n }\n const normalizeId = id.startsWith(userOptions.moduleRootPath) ? id.slice(userOptions.moduleRootPath.length) : id;\n cssFiles.set(normalizeId, createCssProps({\n id,\n code,\n userOptions\n }));\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}\n\n// Helper to check if a module is invalidated\nexport function isModuleInvalidated(path: string): boolean {\n const state = hmrState.get(path);\n return state?.invalidated || false;\n}\n\n// Helper to clear HMR state for a module\nexport function clearHmrState(path: string): void {\n hmrState.delete(path);\n}\n\n// Helper to get all invalidated modules\nexport function getInvalidatedModules(): string[] {\n return Array.from(hmrState.entries())\n .filter(([_, state]) => state.invalidated)\n .map(([path]) => path);\n} "],"names":[],"mappings":";;;;;;;;;AAQa,MAAA,aAAA,uBAAoB,GAAyB;AAG7C,MAAA,QAAA,uBAAe,GAAwB;AAGvC,MAAA,QAAA,uBAAe,GAAsB;AAElD,IAAG,UAAY,EAAA;AACb,EAAA,IAAG,WAAW,OAAS,EAAA;AACrB,IAAA,UAAA,CAAW,OAAQ,CAAA,EAAA,CAAG,SAAW,EAAA,CAAC,GAA2D,KAAA;AAC3F,MAAG,IAAA,GAAA,CAAI,SAAS,YAAc,EAAA;AAE5B,QAAA,MAAM,iBAAiB,QAAS,CAAA,UAAA,CAAW,WAAY,CAAA,WAAA,EAAa,IAAI,IAAI,CAAA;AAC5E,QAAA,QAAA,CAAS,IAAI,cAAgB,EAAA;AAAA,UAC3B,SAAA,EAAW,KAAK,GAAI,EAAA;AAAA,UACpB,WAAa,EAAA,IAAA;AAAA,UACb,MAAA,EAAQ,GAAI,CAAA,MAAA,IAAU;AAAC,SACxB,CAAA;AAAA,OACH,MAAA,IAAU,GAAI,CAAA,IAAA,KAAS,YAAc,EAAA;AAEnC,QAAA,MAAM,iBAAiB,QAAS,CAAA,UAAA,CAAW,WAAY,CAAA,WAAA,EAAa,IAAI,IAAI,CAAA;AAC5E,QAAA,QAAA,CAAS,OAAO,cAAc,CAAA;AAAA;AAChC,KACD,CAAA;AAAA;AAEL,CAAO,MAAA;AACL,EAAM,MAAA,IAAI,MAAM,yCAAyC,CAAA;AAC3D;AA4BgB,SAAA,iBAAA,CAAkB,EAAY,EAAA,IAAA,EAAc,WAAuH,EAAA;AACjL,EAAG,IAAA,OAAO,SAAS,QAAS,EAAA;AAC1B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAkD,+CAAA,EAAA,OAAO,IAAI,CAAE,CAAA,CAAA;AAAA;AAEjF,EAAM,MAAA,WAAA,GAAc,EAAG,CAAA,UAAA,CAAW,WAAY,CAAA,cAAc,CAAI,GAAA,EAAA,CAAG,KAAM,CAAA,WAAA,CAAY,cAAe,CAAA,MAAM,CAAI,GAAA,EAAA;AAC9G,EAAS,QAAA,CAAA,GAAA,CAAI,aAAa,cAAe,CAAA;AAAA,IACvC,EAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACD,CAAC,CAAA;AACJ;;;;"}
1
+ {"version":3,"file":"state.js","sources":["../../../../plugin/worker/rsc/state.ts"],"sourcesContent":["import { workerData } from \"node:worker_threads\";\nimport { createCssProps } from \"../../helpers/createCssProps.js\";\nimport type { CssContent, ResolvedUserOptions, HmrState } from \"../../types.js\";\nimport type { PassThrough } from \"node:stream\";\nimport { relative } from \"node:path\";\n\n\n// Track active RSC streams\nexport const activeStreams = new Map<string, PassThrough>();\n\n// Track CSS files\nexport const cssFiles = new Map<string, CssContent>();\n\n\nexport const hmrState = new Map<string, HmrState>();\n\nif(workerData) {\n if(workerData.hmrPort) {\n workerData.hmrPort.on('message', (msg: { type: string; path: string; routes?: string[] }) => {\n if(msg.type === 'HMR_UPDATE') {\n // Normalize the path relative to project root\n const normalizedPath = relative(workerData.userOptions.projectRoot, msg.path);\n hmrState.set(normalizedPath, { \n timestamp: Date.now(), \n invalidated: true,\n routes: msg.routes || []\n });\n } else if(msg.type === 'HMR_ACCEPT') {\n // Normalize the path relative to project root\n const normalizedPath = relative(workerData.userOptions.projectRoot, msg.path);\n hmrState.delete(normalizedPath);\n }\n });\n }\n} else {\n throw new Error(\"This module must be run with workerData\");\n}\n\n// Create shared CSS registry\nexport const clientFiles = new Set<string>();\nexport const serverActionFiles = new Set<string>();\n\n// Helper functions\nexport function clearCssFiles() {\n cssFiles.clear();\n}\n\nexport function getCssFiles() {\n return cssFiles.entries();\n}\n\nexport function clearClientFiles() {\n clientFiles.clear();\n}\n\nexport function clearServerActionFiles() {\n serverActionFiles.clear();\n}\n\nexport function addCssFile(id: string, cssFile: CssContent) {\n cssFiles.set(id, cssFile);\n}\n\n\nexport function addCssFileContent(id: string, code: string, userOptions: Pick<ResolvedUserOptions, \"projectRoot\" | \"moduleBaseURL\" | \"moduleBasePath\" | \"moduleRootPath\" | \"css\">) {\n if(typeof code !== \"string\"){\n throw new Error(`Expected css to be loaded as a string, but got ${typeof code}`);\n }\n const normalizeId = id.startsWith(userOptions.moduleRootPath) ? id.slice(userOptions.moduleRootPath.length) : id;\n cssFiles.set(normalizeId, createCssProps({\n id,\n code,\n userOptions\n }));\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}\n\n// Helper to check if a module is invalidated\nexport function isModuleInvalidated(path: string): boolean {\n const state = hmrState.get(path);\n return state?.invalidated || false;\n}\n\n// Helper to clear HMR state for a module\nexport function clearHmrState(path: string): void {\n hmrState.delete(path);\n}\n\n// Helper to get all invalidated modules\nexport function getInvalidatedModules(): string[] {\n return Array.from(hmrState.entries())\n .filter(([_, state]) => state.invalidated)\n .map(([path]) => path);\n} "],"names":[],"mappings":";;;;;;;;;AAQa,MAAA,aAAA,uBAAoB,GAAyB;AAG7C,MAAA,QAAA,uBAAe,GAAwB;AAGvC,MAAA,QAAA,uBAAe,GAAsB;AAElD,IAAG,UAAY,EAAA;AACb,EAAA,IAAG,WAAW,OAAS,EAAA;AACrB,IAAA,UAAA,CAAW,OAAQ,CAAA,EAAA,CAAG,SAAW,EAAA,CAAC,GAA2D,KAAA;AAC3F,MAAG,IAAA,GAAA,CAAI,SAAS,YAAc,EAAA;AAE5B,QAAA,MAAM,iBAAiB,QAAS,CAAA,UAAA,CAAW,WAAY,CAAA,WAAA,EAAa,IAAI,IAAI,CAAA;AAC5E,QAAA,QAAA,CAAS,IAAI,cAAgB,EAAA;AAAA,UAC3B,SAAA,EAAW,KAAK,GAAI,EAAA;AAAA,UACpB,WAAa,EAAA,IAAA;AAAA,UACb,MAAA,EAAQ,GAAI,CAAA,MAAA,IAAU;AAAC,SACxB,CAAA;AAAA,OACH,MAAA,IAAU,GAAI,CAAA,IAAA,KAAS,YAAc,EAAA;AAEnC,QAAA,MAAM,iBAAiB,QAAS,CAAA,UAAA,CAAW,WAAY,CAAA,WAAA,EAAa,IAAI,IAAI,CAAA;AAC5E,QAAA,QAAA,CAAS,OAAO,cAAc,CAAA;AAAA;AAChC,KACD,CAAA;AAAA;AAEL,CAAO,MAAA;AACL,EAAM,MAAA,IAAI,MAAM,yCAAyC,CAAA;AAC3D;AA4BO,SAAS,iBAAA,CAAkB,EAAY,EAAA,IAAA,EAAc,WAAuH,EAAA;AACjL,EAAG,IAAA,OAAO,SAAS,QAAS,EAAA;AAC1B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAkD,+CAAA,EAAA,OAAO,IAAI,CAAE,CAAA,CAAA;AAAA;AAEjF,EAAM,MAAA,WAAA,GAAc,EAAG,CAAA,UAAA,CAAW,WAAY,CAAA,cAAc,CAAI,GAAA,EAAA,CAAG,KAAM,CAAA,WAAA,CAAY,cAAe,CAAA,MAAM,CAAI,GAAA,EAAA;AAC9G,EAAS,QAAA,CAAA,GAAA,CAAI,aAAa,cAAe,CAAA;AAAA,IACvC,EAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACD,CAAC,CAAA;AACJ;;;;"}
@@ -1,48 +1,50 @@
1
- import { cleanObject } from "../helpers/cleanObject.js";
2
- import { parentPort } from "node:worker_threads";
3
- export function sendMessage(msg, port = parentPort) {
4
- if (!port) {
5
- console.error("[Worker] No port available to send message");
6
- return;
1
+ /**
2
+ * vite-plugin-react-server
3
+ * Copyright (c) Nico Brinkkemper
4
+ * MIT License
5
+ */
6
+ import { cleanObject } from '../helpers/cleanObject.js';
7
+ import { parentPort } from 'node:worker_threads';
8
+
9
+ function sendMessage(msg, port = parentPort) {
10
+ if (!port) {
11
+ console.error("[Worker] No port available to send message");
12
+ return;
13
+ }
14
+ try {
15
+ if ("error" in msg) {
16
+ const error = msg.error;
17
+ const serializedError = error instanceof Error ? {
18
+ message: error.message,
19
+ stack: error.stack,
20
+ name: error.name,
21
+ cause: error.cause
22
+ } : {
23
+ message: String(error),
24
+ name: "Error"
25
+ };
26
+ port.postMessage({
27
+ ...cleanObject(msg),
28
+ error: serializedError
29
+ });
30
+ } else {
31
+ port.postMessage(cleanObject(msg));
7
32
  }
33
+ } catch (err) {
34
+ console.error("[Worker] Failed to send message:", err);
8
35
  try {
9
- // Handle error messages
10
- if ('error' in msg) {
11
- const error = msg.error;
12
- const serializedError = error instanceof Error ? {
13
- message: error.message,
14
- stack: error.stack,
15
- name: error.name,
16
- cause: error.cause,
17
- } : {
18
- message: String(error),
19
- name: 'Error',
20
- };
21
- port.postMessage({
22
- ...cleanObject(msg),
23
- error: serializedError,
24
- });
25
- }
26
- else {
27
- // Handle non-error messages
28
- port.postMessage(cleanObject(msg));
29
- }
30
- }
31
- catch (err) {
32
- console.error("[Worker] Failed to send message:", err);
33
- // Try to send a basic error message
34
- try {
35
- port.postMessage({
36
- type: "ERROR",
37
- error: {
38
- message: err instanceof Error ? err.message : String(err),
39
- name: err instanceof Error ? err.name : 'Error',
40
- },
41
- });
42
- }
43
- catch {
44
- // If we can't even send an error message, just log it
45
- console.error("[Worker] Critical error - could not send error message");
36
+ port.postMessage({
37
+ type: "ERROR",
38
+ error: {
39
+ message: err instanceof Error ? err.message : String(err),
40
+ name: err instanceof Error ? err.name : "Error"
46
41
  }
42
+ });
43
+ } catch {
44
+ console.error("[Worker] Critical error - could not send error message");
47
45
  }
46
+ }
48
47
  }
48
+
49
+ export { sendMessage };
50
+ //# sourceMappingURL=sendMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendMessage.js","sources":["../../../plugin/worker/sendMessage.ts"],"sourcesContent":["import { cleanObject } from \"../helpers/cleanObject.js\";\nimport type { HtmlWorkerOutputMessage, RscWorkerOutputMessage } from \"./types.js\";\nimport { parentPort } from \"node:worker_threads\";\n\nexport function sendMessage(msg: HtmlWorkerOutputMessage | RscWorkerOutputMessage, port = parentPort) {\n if (!port) {\n console.error(\"[Worker] No port available to send message\");\n return;\n }\n\n try {\n // Handle error messages\n if ('error' in msg) {\n const error = msg.error;\n const serializedError = error instanceof Error ? {\n message: error.message,\n stack: error.stack,\n name: error.name,\n cause: error.cause,\n } : {\n message: String(error),\n name: 'Error',\n };\n\n port.postMessage({\n ...cleanObject(msg),\n error: serializedError,\n });\n } else {\n // Handle non-error messages\n port.postMessage(cleanObject(msg));\n }\n } catch (err) {\n console.error(\"[Worker] Failed to send message:\", err);\n // Try to send a basic error message\n try {\n port.postMessage({\n type: \"ERROR\",\n error: {\n message: err instanceof Error ? err.message : String(err),\n name: err instanceof Error ? err.name : 'Error',\n },\n });\n } catch {\n // If we can't even send an error message, just log it\n console.error(\"[Worker] Critical error - could not send error message\");\n }\n }\n}"],"names":[],"mappings":";;;;;;;;AAIO,SAAS,WAAA,CAAY,GAAuD,EAAA,IAAA,GAAO,UAAY,EAAA;AACpG,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAA,OAAA,CAAQ,MAAM,4CAA4C,CAAA;AAC1D,IAAA;AAAA;AAGF,EAAI,IAAA;AAEF,IAAA,IAAI,WAAW,GAAK,EAAA;AAClB,MAAA,MAAM,QAAQ,GAAI,CAAA,KAAA;AAClB,MAAM,MAAA,eAAA,GAAkB,iBAAiB,KAAQ,GAAA;AAAA,QAC/C,SAAS,KAAM,CAAA,OAAA;AAAA,QACf,OAAO,KAAM,CAAA,KAAA;AAAA,QACb,MAAM,KAAM,CAAA,IAAA;AAAA,QACZ,OAAO,KAAM,CAAA;AAAA,OACX,GAAA;AAAA,QACF,OAAA,EAAS,OAAO,KAAK,CAAA;AAAA,QACrB,IAAM,EAAA;AAAA,OACR;AAEA,MAAA,IAAA,CAAK,WAAY,CAAA;AAAA,QACf,GAAG,YAAY,GAAG,CAAA;AAAA,QAClB,KAAO,EAAA;AAAA,OACR,CAAA;AAAA,KACI,MAAA;AAEL,MAAK,IAAA,CAAA,WAAA,CAAY,WAAY,CAAA,GAAG,CAAC,CAAA;AAAA;AACnC,WACO,GAAK,EAAA;AACZ,IAAQ,OAAA,CAAA,KAAA,CAAM,oCAAoC,GAAG,CAAA;AAErD,IAAI,IAAA;AACF,MAAA,IAAA,CAAK,WAAY,CAAA;AAAA,QACf,IAAM,EAAA,OAAA;AAAA,QACN,KAAO,EAAA;AAAA,UACL,SAAS,GAAe,YAAA,KAAA,GAAQ,GAAI,CAAA,OAAA,GAAU,OAAO,GAAG,CAAA;AAAA,UACxD,IAAM,EAAA,GAAA,YAAe,KAAQ,GAAA,GAAA,CAAI,IAAO,GAAA;AAAA;AAC1C,OACD,CAAA;AAAA,KACK,CAAA,MAAA;AAEN,MAAA,OAAA,CAAQ,MAAM,wDAAwD,CAAA;AAAA;AACxE;AAEJ;;;;"}
@@ -55,6 +55,14 @@ export interface ChunkErrorMessage extends WorkerMessage {
55
55
  error: string;
56
56
  sequence?: number;
57
57
  }
58
+ export type StreamHandlers = {
59
+ onError: (error: any, errorInfo?: any) => void;
60
+ onData: (data: any) => void;
61
+ onEnd: () => void;
62
+ onMetrics: (metrics: any) => void;
63
+ onHmrAccept: (routes: string[]) => void;
64
+ onHmrUpdate: (routes: string[]) => void;
65
+ };
58
66
  export type RscRenderMessage = WorkerMessage & {
59
67
  type: "RSC_RENDER";
60
68
  } & Omit<CreateHandlerOptions, "onEvent" | "onMetrics" | "loader" | "Html" | "CssCollector" | "logger" | "build" | "autoDiscover"> & {
@@ -158,7 +166,7 @@ export type HtmlWorkerOutputMessage = {
158
166
  } | {
159
167
  type: "SHUTDOWN_COMPLETE";
160
168
  id: string;
161
- } | HmrAcceptMessage;
169
+ } | HmrAcceptMessage | ReadyMessage;
162
170
  export type InitializedReactLoaderMessage = {
163
171
  type: "INITIALIZED_REACT_LOADER";
164
172
  id: string;
@@ -173,21 +181,33 @@ export type InitializedRscWorkerLoaderMessage = {
173
181
  type: "INITIALIZED_RSC_WORKER_LOADER";
174
182
  id: string;
175
183
  };
184
+ export type InitializedEnvLoaderMessage = {
185
+ type: "INITIALIZED_ENV_LOADER";
186
+ id: string;
187
+ env: Record<string, string>;
188
+ };
176
189
  export type HmrMessage = {
177
- path: string;
190
+ id: string;
178
191
  };
179
192
  export type HmrUpdateMessage = HmrMessage & {
180
193
  type: "HMR_UPDATE";
181
194
  routes?: string[];
195
+ timestamp?: number;
182
196
  };
183
197
  export type HmrCleanupMessage = HmrMessage & {
184
198
  type: "HMR_CLEANUP";
199
+ routes?: string[];
200
+ timestamp?: number;
185
201
  };
186
202
  export type HmrAcceptMessage = HmrMessage & {
187
203
  type: "HMR_ACCEPT";
188
204
  routes?: string[];
189
205
  };
190
- export type RscWorkerInputMessage = RscRenderMessage | CssFileMessage | ShutdownMessage | ChunkProcessedMessage | ClientComponentMessage | InitializedReactLoaderMessage | InitializedCssLoaderMessage | ModuleRequestMessage | InitializedRscWorkerLoaderMessage | HmrUpdateMessage | HmrAcceptMessage;
206
+ export type RscWorkerInputMessage = RscRenderMessage | CssFileMessage | ShutdownMessage | ChunkProcessedMessage | ClientComponentMessage | InitializedReactLoaderMessage | InitializedCssLoaderMessage | ModuleRequestMessage | InitializedRscWorkerLoaderMessage | InitializedEnvLoaderMessage | HmrUpdateMessage | HmrAcceptMessage | {
207
+ type: "HMR_CLEANUP";
208
+ id: string;
209
+ routes?: string[];
210
+ };
191
211
  export interface CssFileRequestMessage extends WorkerMessage {
192
212
  type: "CSS_FILE_REQUEST";
193
213
  id: string;
@@ -212,7 +232,15 @@ export interface CssProcessedMessage extends WorkerMessage {
212
232
  type: "CSS_PROCESSED";
213
233
  id: string;
214
234
  }
215
- export type RscWorkerOutputMessage = RscChunkOutputMessage | RscEndMessage | ShellReadyMessage | AllReadyMessage | ErrorMessage | CssFileMessage | CssFileRequestMessage | ClientComponentMessage | ModuleRequestMessage | ModuleResponseMessage | CssProcessedMessage | RscMetricsMessage;
235
+ export type ReadyMessage = {
236
+ type: "READY";
237
+ env: string | undefined;
238
+ pid: number;
239
+ };
240
+ export type RscWorkerOutputMessage = RscChunkOutputMessage | RscEndMessage | ShellReadyMessage | AllReadyMessage | ErrorMessage | CssFileMessage | CssFileRequestMessage | ClientComponentMessage | ModuleRequestMessage | ModuleResponseMessage | CssProcessedMessage | RscMetricsMessage | HmrAcceptMessage | HmrUpdateMessage | ReadyMessage | {
241
+ type: "SHUTDOWN_COMPLETE";
242
+ id: string;
243
+ };
216
244
  export interface ClientReferenceMessage extends WorkerMessage {
217
245
  type: "CLIENT_REFERENCE";
218
246
  location: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugin/worker/types.ts"],"names":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BAAiB,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
package/dist/server.js CHANGED
@@ -7,6 +7,6 @@ export { vitePluginReactServer } from './plugin/plugin.server.js';
7
7
 
8
8
  const condition = process.env["NODE_OPTIONS"]?.match(/--conditions[= ]react-server/) ? "server" : "client";
9
9
  if (condition !== "server") {
10
- throw new Error("Condition mismatch, should be react-server but got " + process.env["NODE_OPTIONS"]);
10
+ throw new Error("Condition mismatch, should be react-server but got " + condition);
11
11
  }
12
12
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sources":["../server.ts"],"sourcesContent":["\"use strict\";\n\nconst condition = process.env['NODE_OPTIONS']?.match(/--conditions[= ]react-server/) ? 'server' : 'client'\n\nif(condition !== 'server'){\n throw new Error('Condition mismatch, should be react-server but got ' + process.env['NODE_OPTIONS']);\n}\n\nexport { vitePluginReactServer } from './plugin/plugin.server.js'\n\n// types\nexport type * from './plugin/types.js'"],"names":[],"mappings":";;;;;;;AAEA,MAAM,SAAA,GAAY,QAAQ,GAAI,CAAA,cAAc,GAAG,KAAM,CAAA,8BAA8B,IAAI,QAAW,GAAA,QAAA;AAElG,IAAG,cAAc,QAAS,EAAA;AACxB,EAAA,MAAM,IAAI,KAAM,CAAA,qDAAA,GAAwD,OAAQ,CAAA,GAAA,CAAI,cAAc,CAAC,CAAA;AACrG"}
1
+ {"version":3,"file":"server.js","sources":["../server.ts"],"sourcesContent":["\"use strict\";\n\nconst condition = process.env['NODE_OPTIONS']?.match(/--conditions[= ]react-server/) ? 'server' : 'client'\n\nif(condition !== 'server'){\n throw new Error('Condition mismatch, should be react-server but got ' + condition);\n}\n\nexport { vitePluginReactServer } from './plugin/plugin.server.js'\n\n// types\nexport type * from './plugin/types.js'"],"names":[],"mappings":";;;;;;;AAEA,MAAM,SAAA,GAAY,QAAQ,GAAI,CAAA,cAAc,GAAG,KAAM,CAAA,8BAA8B,IAAI,QAAW,GAAA,QAAA;AAElG,IAAG,cAAc,QAAS,EAAA;AACxB,EAAM,MAAA,IAAI,KAAM,CAAA,qDAAA,GAAwD,SAAS,CAAA;AACnF"}