vite-plugin-react-server 1.1.19 → 1.2.0-alpha.0

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 (783) hide show
  1. package/README.md +102 -395
  2. package/dist/_virtual/dynamic-import-helper.js +1 -1
  3. package/dist/client.d.ts +1 -1
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +5 -2
  6. package/dist/index.js +1 -1
  7. package/dist/package.json +58 -25
  8. package/dist/plugin/components/{css-collector-elements.d.ts → css.d.ts} +2 -2
  9. package/dist/plugin/components/css.d.ts.map +1 -0
  10. package/dist/plugin/components/css.js +33 -0
  11. package/dist/plugin/components/html.d.ts +1 -1
  12. package/dist/plugin/components/html.d.ts.map +1 -1
  13. package/dist/plugin/components/html.js +5 -5
  14. package/dist/plugin/components/index.d.ts +3 -3
  15. package/dist/plugin/components/index.d.ts.map +1 -1
  16. package/dist/plugin/components/index.js +9 -3
  17. package/dist/plugin/components/root.d.ts +7 -0
  18. package/dist/plugin/components/root.d.ts.map +1 -0
  19. package/dist/plugin/components/root.js +18 -0
  20. package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js +1 -1
  21. package/dist/plugin/config/autoDiscover/customWorkerFiles.js +1 -1
  22. package/dist/plugin/config/autoDiscover/pageAndPropFiles.js +1 -1
  23. package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts +5 -4
  24. package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts.map +1 -1
  25. package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js +26 -7
  26. package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts +25 -2
  27. package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts.map +1 -1
  28. package/dist/plugin/config/autoDiscover/resolveBuildPages.js +84 -5
  29. package/dist/plugin/config/createModuleID.d.ts +3 -6
  30. package/dist/plugin/config/createModuleID.d.ts.map +1 -1
  31. package/dist/plugin/config/createModuleID.js +42 -32
  32. package/dist/plugin/config/defaults.d.ts +199 -121
  33. package/dist/plugin/config/defaults.d.ts.map +1 -1
  34. package/dist/plugin/config/defaults.js +155 -89
  35. package/dist/plugin/config/extMap.d.ts +6 -2
  36. package/dist/plugin/config/extMap.d.ts.map +1 -1
  37. package/dist/plugin/config/extMap.js +38 -48
  38. package/dist/plugin/config/flightBindings.d.ts +4 -0
  39. package/dist/plugin/config/flightBindings.d.ts.map +1 -0
  40. package/dist/plugin/config/flightBindings.js +215 -0
  41. package/dist/plugin/config/getCondition.d.ts +2 -0
  42. package/dist/plugin/config/getCondition.d.ts.map +1 -1
  43. package/dist/plugin/config/getCondition.js +4 -2
  44. package/dist/plugin/config/getPaths.js +1 -1
  45. package/dist/plugin/config/index.d.ts +17 -4
  46. package/dist/plugin/config/index.d.ts.map +1 -1
  47. package/dist/plugin/config/index.js +29 -7
  48. package/dist/plugin/config/interpolatePattern.d.ts +13 -0
  49. package/dist/plugin/config/interpolatePattern.d.ts.map +1 -0
  50. package/dist/plugin/config/interpolatePattern.js +13 -0
  51. package/dist/plugin/config/mimeTypes.js +1 -1
  52. package/dist/plugin/config/parsePattern.d.ts +25 -0
  53. package/dist/plugin/config/parsePattern.d.ts.map +1 -0
  54. package/dist/plugin/config/parsePattern.js +30 -0
  55. package/dist/plugin/config/resolveAllowedDirectives.d.ts +26 -0
  56. package/dist/plugin/config/resolveAllowedDirectives.d.ts.map +1 -0
  57. package/dist/plugin/config/resolveAllowedDirectives.js +35 -0
  58. package/dist/plugin/config/resolveDirectiveMatcher.d.ts +25 -0
  59. package/dist/plugin/config/resolveDirectiveMatcher.d.ts.map +1 -0
  60. package/dist/plugin/config/resolveDirectiveMatcher.js +33 -0
  61. package/dist/plugin/config/resolveEnv.d.ts.map +1 -1
  62. package/dist/plugin/config/resolveEnv.js +14 -4
  63. package/dist/plugin/config/resolveOptions.d.ts +13 -3
  64. package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
  65. package/dist/plugin/config/resolveOptions.js +228 -206
  66. package/dist/plugin/config/resolvePages.js +1 -1
  67. package/dist/plugin/config/resolvePatternWithValues.d.ts +39 -0
  68. package/dist/plugin/config/resolvePatternWithValues.d.ts.map +1 -0
  69. package/dist/plugin/config/resolvePatternWithValues.js +36 -0
  70. package/dist/plugin/config/resolveRegExp.d.ts +29 -0
  71. package/dist/plugin/config/resolveRegExp.d.ts.map +1 -0
  72. package/dist/plugin/config/resolveRegExp.js +39 -0
  73. package/dist/plugin/config/resolveUrlOption.d.ts +37 -6
  74. package/dist/plugin/config/resolveUrlOption.d.ts.map +1 -1
  75. package/dist/plugin/config/resolveUrlOption.js +42 -12
  76. package/dist/plugin/config/resolveUserConfig.d.ts +5 -4
  77. package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
  78. package/dist/plugin/config/resolveUserConfig.js +86 -40
  79. package/dist/plugin/env/plugin.d.ts +6 -0
  80. package/dist/plugin/env/plugin.d.ts.map +1 -1
  81. package/dist/plugin/env/plugin.js +111 -93
  82. package/dist/plugin/error/directiveError.d.ts +13 -0
  83. package/dist/plugin/error/directiveError.d.ts.map +1 -0
  84. package/dist/plugin/error/directiveError.js +21 -0
  85. package/dist/plugin/error/enhanceError.d.ts +14 -0
  86. package/dist/plugin/error/enhanceError.d.ts.map +1 -0
  87. package/dist/plugin/error/enhanceError.js +24 -0
  88. package/dist/plugin/error/index.d.ts +4 -0
  89. package/dist/plugin/error/index.d.ts.map +1 -0
  90. package/dist/plugin/error/index.js +9 -0
  91. package/dist/plugin/error/logError.d.ts +3 -0
  92. package/dist/plugin/error/logError.d.ts.map +1 -0
  93. package/dist/plugin/error/logError.js +47 -0
  94. package/dist/plugin/error/serializeError.d.ts +7 -0
  95. package/dist/plugin/error/serializeError.d.ts.map +1 -0
  96. package/dist/plugin/error/serializeError.js +37 -0
  97. package/dist/plugin/error/toError.d.ts +1 -8
  98. package/dist/plugin/error/toError.d.ts.map +1 -1
  99. package/dist/plugin/error/toError.js +62 -34
  100. package/dist/plugin/file-preserver/plugin.js +93 -105
  101. package/dist/plugin/getNodeEnv.d.ts +11 -0
  102. package/dist/plugin/getNodeEnv.d.ts.map +1 -0
  103. package/dist/plugin/getNodeEnv.js +17 -0
  104. package/dist/plugin/helpers/cleanObject.d.ts.map +1 -1
  105. package/dist/plugin/helpers/cleanObject.js +2 -1
  106. package/dist/plugin/helpers/collectManifestCss.js +1 -1
  107. package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts +6 -4
  108. package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts.map +1 -1
  109. package/dist/plugin/helpers/collectViteModuleGraphCss.js +15 -9
  110. package/dist/plugin/helpers/createCssProps.d.ts +3 -4
  111. package/dist/plugin/helpers/createCssProps.d.ts.map +1 -1
  112. package/dist/plugin/helpers/createCssProps.js +16 -4
  113. package/dist/plugin/helpers/createEventHandler.d.ts +2 -2
  114. package/dist/plugin/helpers/createEventHandler.d.ts.map +1 -1
  115. package/dist/plugin/helpers/createEventHandler.js +1 -1
  116. package/dist/plugin/helpers/createHandler.d.ts +10 -8
  117. package/dist/plugin/helpers/createHandler.d.ts.map +1 -1
  118. package/dist/plugin/helpers/createHandler.js +11 -5
  119. package/dist/plugin/helpers/createRscStream.d.ts +18 -5
  120. package/dist/plugin/helpers/createRscStream.d.ts.map +1 -1
  121. package/dist/plugin/helpers/createRscStream.js +48 -14
  122. package/dist/plugin/helpers/formatMetrics.d.ts +1 -5
  123. package/dist/plugin/helpers/formatMetrics.d.ts.map +1 -1
  124. package/dist/plugin/helpers/formatMetrics.js +2 -39
  125. package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
  126. package/dist/plugin/helpers/getBundleManifest.js +9 -2
  127. package/dist/plugin/helpers/getRouteFiles.d.ts +30 -2
  128. package/dist/plugin/helpers/getRouteFiles.d.ts.map +1 -1
  129. package/dist/plugin/helpers/getRouteFiles.js +70 -7
  130. package/dist/plugin/helpers/handleServerAction.d.ts +8 -7
  131. package/dist/plugin/helpers/handleServerAction.d.ts.map +1 -1
  132. package/dist/plugin/helpers/handleServerAction.js +5 -2
  133. package/dist/plugin/helpers/hydrateUserOptions.d.ts +9 -0
  134. package/dist/plugin/helpers/hydrateUserOptions.d.ts.map +1 -0
  135. package/dist/plugin/helpers/hydrateUserOptions.js +22 -0
  136. package/dist/plugin/helpers/index.d.ts +2 -0
  137. package/dist/plugin/helpers/index.d.ts.map +1 -1
  138. package/dist/plugin/helpers/index.js +31 -31
  139. package/dist/plugin/helpers/inputNormalizer.d.ts +1 -1
  140. package/dist/plugin/helpers/inputNormalizer.d.ts.map +1 -1
  141. package/dist/plugin/helpers/inputNormalizer.js +33 -20
  142. package/dist/plugin/helpers/metrics.d.ts +4 -10
  143. package/dist/plugin/helpers/metrics.d.ts.map +1 -1
  144. package/dist/plugin/helpers/metrics.js +3 -59
  145. package/dist/plugin/helpers/moduleRefs.js +1 -1
  146. package/dist/plugin/helpers/moduleResolver.d.ts +24 -2
  147. package/dist/plugin/helpers/moduleResolver.d.ts.map +1 -1
  148. package/dist/plugin/helpers/moduleResolver.js +61 -22
  149. package/dist/plugin/helpers/requestInfo.d.ts +28 -1
  150. package/dist/plugin/helpers/requestInfo.d.ts.map +1 -1
  151. package/dist/plugin/helpers/requestInfo.js +43 -30
  152. package/dist/plugin/helpers/requestToRoute.d.ts +1 -1
  153. package/dist/plugin/helpers/requestToRoute.d.ts.map +1 -1
  154. package/dist/plugin/helpers/requestToRoute.js +17 -9
  155. package/dist/plugin/helpers/resolveComponent.d.ts +57 -0
  156. package/dist/plugin/helpers/resolveComponent.d.ts.map +1 -0
  157. package/dist/plugin/helpers/resolveComponent.js +71 -0
  158. package/dist/plugin/helpers/resolveComponents.d.ts +27 -0
  159. package/dist/plugin/helpers/resolveComponents.d.ts.map +1 -0
  160. package/dist/plugin/helpers/resolveComponents.js +137 -0
  161. package/dist/plugin/helpers/resolvePage.d.ts +15 -11
  162. package/dist/plugin/helpers/resolvePage.d.ts.map +1 -1
  163. package/dist/plugin/helpers/resolvePage.js +11 -7
  164. package/dist/plugin/helpers/resolvePageAndProps.d.ts +3 -10
  165. package/dist/plugin/helpers/resolvePageAndProps.d.ts.map +1 -1
  166. package/dist/plugin/helpers/resolvePageAndProps.js +28 -18
  167. package/dist/plugin/helpers/resolveProps.d.ts +13 -7
  168. package/dist/plugin/helpers/resolveProps.d.ts.map +1 -1
  169. package/dist/plugin/helpers/resolveProps.js +55 -25
  170. package/dist/plugin/helpers/resolveUserComponents.d.ts +33 -0
  171. package/dist/plugin/helpers/resolveUserComponents.d.ts.map +1 -0
  172. package/dist/plugin/helpers/resolveUserComponents.js +163 -0
  173. package/dist/plugin/helpers/serializeUserOptions.d.ts +7 -7
  174. package/dist/plugin/helpers/serializeUserOptions.d.ts.map +1 -1
  175. package/dist/plugin/helpers/serializeUserOptions.js +127 -42
  176. package/dist/plugin/helpers/stashReturnValue.d.ts +2 -1
  177. package/dist/plugin/helpers/stashReturnValue.d.ts.map +1 -1
  178. package/dist/plugin/helpers/stashReturnValue.js +6 -3
  179. package/dist/plugin/helpers/tryManifest.d.ts +1 -2
  180. package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
  181. package/dist/plugin/helpers/tryManifest.js +1 -1
  182. package/dist/plugin/loader/createDefaultLoader.d.ts +19 -8
  183. package/dist/plugin/loader/createDefaultLoader.d.ts.map +1 -1
  184. package/dist/plugin/loader/createDefaultLoader.js +69 -107
  185. package/dist/plugin/loader/createTransformer.d.ts +6 -0
  186. package/dist/plugin/loader/createTransformer.d.ts.map +1 -0
  187. package/dist/plugin/loader/createTransformer.js +97 -0
  188. package/dist/plugin/loader/{css-loader.development.d.ts → css-loader.d.ts} +6 -8
  189. package/dist/plugin/loader/css-loader.d.ts.map +1 -0
  190. package/dist/plugin/loader/css-loader.js +134 -0
  191. package/dist/plugin/loader/directives/addLocalExportedNames.d.ts +4 -0
  192. package/dist/plugin/loader/directives/addLocalExportedNames.d.ts.map +1 -0
  193. package/dist/plugin/loader/directives/addLocalExportedNames.js +57 -0
  194. package/dist/plugin/loader/directives/analyzeDirectives.d.ts +9 -0
  195. package/dist/plugin/loader/directives/analyzeDirectives.d.ts.map +1 -0
  196. package/dist/plugin/loader/directives/analyzeDirectives.js +221 -0
  197. package/dist/plugin/loader/directives/analyzeModule.d.ts +11 -0
  198. package/dist/plugin/loader/directives/analyzeModule.d.ts.map +1 -0
  199. package/dist/plugin/loader/directives/analyzeModule.js +34 -0
  200. package/dist/plugin/loader/directives/collectExports.d.ts +13 -0
  201. package/dist/plugin/loader/directives/collectExports.d.ts.map +1 -0
  202. package/dist/plugin/loader/directives/collectExports.js +116 -0
  203. package/dist/plugin/loader/directives/collectExportsFromModule.d.ts +6 -0
  204. package/dist/plugin/loader/directives/collectExportsFromModule.d.ts.map +1 -0
  205. package/dist/plugin/loader/directives/collectExportsFromModule.js +24 -0
  206. package/dist/plugin/loader/directives/findDirectiveMatches.d.ts +3 -0
  207. package/dist/plugin/loader/directives/findDirectiveMatches.d.ts.map +1 -0
  208. package/dist/plugin/loader/directives/findDirectiveMatches.js +46 -0
  209. package/dist/plugin/loader/directives/getExportedName.d.ts +3 -0
  210. package/dist/plugin/loader/directives/getExportedName.d.ts.map +1 -0
  211. package/dist/plugin/loader/directives/getExportedName.js +59 -0
  212. package/dist/plugin/loader/directives/getExports.d.ts +7 -0
  213. package/dist/plugin/loader/directives/getExports.d.ts.map +1 -0
  214. package/dist/plugin/loader/directives/getExports.js +28 -0
  215. package/dist/plugin/loader/directives/getFunctionBody.d.ts +3 -0
  216. package/dist/plugin/loader/directives/getFunctionBody.d.ts.map +1 -0
  217. package/dist/plugin/loader/directives/getFunctionBody.js +31 -0
  218. package/dist/plugin/loader/directives/getFunctionName.d.ts +10 -0
  219. package/dist/plugin/loader/directives/getFunctionName.d.ts.map +1 -0
  220. package/dist/plugin/loader/directives/getFunctionName.js +42 -0
  221. package/dist/plugin/loader/directives/getQualifiedName.d.ts +3 -0
  222. package/dist/plugin/loader/directives/getQualifiedName.d.ts.map +1 -0
  223. package/dist/plugin/loader/directives/getQualifiedName.js +65 -0
  224. package/dist/plugin/loader/directives/index.d.ts +14 -0
  225. package/dist/plugin/loader/directives/index.d.ts.map +1 -0
  226. package/dist/plugin/loader/directives/index.js +18 -0
  227. package/dist/plugin/loader/directives/processFunctionNode.d.ts +4 -0
  228. package/dist/plugin/loader/directives/processFunctionNode.d.ts.map +1 -0
  229. package/dist/plugin/loader/directives/processFunctionNode.js +86 -0
  230. package/dist/plugin/loader/directives/typeGuards.d.ts +37 -0
  231. package/dist/plugin/loader/directives/typeGuards.d.ts.map +1 -0
  232. package/dist/plugin/loader/directives/typeGuards.js +100 -0
  233. package/dist/plugin/loader/directives/types.d.ts +154 -0
  234. package/dist/plugin/loader/directives/types.d.ts.map +1 -0
  235. package/dist/plugin/loader/directives/utils.d.ts +14 -0
  236. package/dist/plugin/loader/directives/utils.d.ts.map +1 -0
  237. package/dist/plugin/loader/directives/utils.js +21 -0
  238. package/dist/plugin/loader/env-loader.d.ts +11 -0
  239. package/dist/plugin/loader/env-loader.d.ts.map +1 -0
  240. package/dist/plugin/loader/env-loader.js +65 -0
  241. package/dist/plugin/loader/index.d.ts +8 -1
  242. package/dist/plugin/loader/index.d.ts.map +1 -1
  243. package/dist/plugin/loader/index.js +13 -4
  244. package/dist/plugin/loader/parse.d.ts +11 -2
  245. package/dist/plugin/loader/parse.d.ts.map +1 -1
  246. package/dist/plugin/loader/parse.js +29 -6
  247. package/dist/plugin/loader/react-loader.d.ts +22 -1
  248. package/dist/plugin/loader/react-loader.d.ts.map +1 -1
  249. package/dist/plugin/loader/react-loader.js +169 -6
  250. package/dist/plugin/loader/removeDirectives.d.ts +5 -0
  251. package/dist/plugin/loader/removeDirectives.d.ts.map +1 -0
  252. package/dist/plugin/loader/removeDirectives.js +17 -0
  253. package/dist/plugin/loader/removeRanges.d.ts +5 -0
  254. package/dist/plugin/loader/removeRanges.d.ts.map +1 -0
  255. package/dist/plugin/loader/removeRanges.js +20 -0
  256. package/dist/plugin/loader/sourceMap.d.ts +16 -24
  257. package/dist/plugin/loader/sourceMap.d.ts.map +1 -1
  258. package/dist/plugin/loader/sourceMap.js +125 -97
  259. package/dist/plugin/loader/transformClientModule.d.ts +10 -0
  260. package/dist/plugin/loader/transformClientModule.d.ts.map +1 -0
  261. package/dist/plugin/loader/transformClientModule.js +46 -0
  262. package/dist/plugin/loader/transformModule.d.ts +6 -0
  263. package/dist/plugin/loader/transformModule.d.ts.map +1 -0
  264. package/dist/plugin/loader/transformModule.js +33 -0
  265. package/dist/plugin/loader/transformModuleIfNeeded.d.ts +12 -1
  266. package/dist/plugin/loader/transformModuleIfNeeded.d.ts.map +1 -1
  267. package/dist/plugin/loader/transformModuleIfNeeded.js +9 -20
  268. package/dist/plugin/loader/transformServerModule.d.ts +11 -0
  269. package/dist/plugin/loader/transformServerModule.d.ts.map +1 -0
  270. package/dist/plugin/loader/transformServerModule.js +84 -0
  271. package/dist/plugin/loader/transformWithAcornLoose.d.ts +12 -0
  272. package/dist/plugin/loader/transformWithAcornLoose.d.ts.map +1 -0
  273. package/dist/plugin/loader/transformWithAcornLoose.js +18 -0
  274. package/dist/plugin/loader/types.d.ts +59 -12
  275. package/dist/plugin/loader/types.d.ts.map +1 -1
  276. package/dist/plugin/metrics/collectStreamMetrics.d.ts +9 -0
  277. package/dist/plugin/metrics/collectStreamMetrics.d.ts.map +1 -0
  278. package/dist/plugin/metrics/collectStreamMetrics.js +35 -0
  279. package/dist/plugin/metrics/createRenderMetrics.d.ts +3 -0
  280. package/dist/plugin/metrics/createRenderMetrics.d.ts.map +1 -0
  281. package/dist/plugin/metrics/createRenderMetrics.js +24 -0
  282. package/dist/plugin/metrics/createStreamMetrics.d.ts +3 -0
  283. package/dist/plugin/metrics/createStreamMetrics.d.ts.map +1 -0
  284. package/dist/plugin/metrics/createStreamMetrics.js +19 -0
  285. package/dist/plugin/metrics/formatMetrics.d.ts +6 -3
  286. package/dist/plugin/metrics/formatMetrics.d.ts.map +1 -1
  287. package/dist/plugin/metrics/formatMetrics.js +5 -2
  288. package/dist/plugin/metrics/index.d.ts +3 -1
  289. package/dist/plugin/metrics/index.d.ts.map +1 -1
  290. package/dist/plugin/metrics/index.js +9 -1
  291. package/dist/plugin/metrics/types.d.ts +23 -0
  292. package/dist/plugin/metrics/types.d.ts.map +1 -0
  293. package/dist/plugin/metrics/types.js +1 -0
  294. package/dist/plugin/plugin.client.d.ts +23 -2
  295. package/dist/plugin/plugin.client.d.ts.map +1 -1
  296. package/dist/plugin/plugin.client.js +30 -17
  297. package/dist/plugin/plugin.server.d.ts +13 -2
  298. package/dist/plugin/plugin.server.d.ts.map +1 -1
  299. package/dist/plugin/plugin.server.js +7 -4
  300. package/dist/plugin/preserver/plugin.d.ts +2 -2
  301. package/dist/plugin/preserver/plugin.d.ts.map +1 -1
  302. package/dist/plugin/preserver/plugin.js +33 -29
  303. package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts +11 -0
  304. package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts.map +1 -0
  305. package/dist/plugin/react-client/cleanupWorkerServerAction.js +18 -0
  306. package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts +9 -9
  307. package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts.map +1 -1
  308. package/dist/plugin/react-client/configureWorkerRequestHandler.js +25 -14
  309. package/dist/plugin/react-client/createMessageHandlers.d.ts +1 -1
  310. package/dist/plugin/react-client/createMessageHandlers.d.ts.map +1 -1
  311. package/dist/plugin/react-client/createMessageHandlers.js +15 -3
  312. package/dist/plugin/react-client/createWorkerStream.d.ts +12 -10
  313. package/dist/plugin/react-client/createWorkerStream.d.ts.map +1 -1
  314. package/dist/plugin/react-client/createWorkerStream.js +27 -29
  315. package/dist/plugin/react-client/handleWorkerRscStream.d.ts +13 -8
  316. package/dist/plugin/react-client/handleWorkerRscStream.d.ts.map +1 -1
  317. package/dist/plugin/react-client/handleWorkerRscStream.js +59 -24
  318. package/dist/plugin/react-client/handleWorkerServerAction.d.ts +2 -1
  319. package/dist/plugin/react-client/handleWorkerServerAction.d.ts.map +1 -1
  320. package/dist/plugin/react-client/handleWorkerServerAction.js +43 -28
  321. package/dist/plugin/react-client/index.d.ts +4 -1
  322. package/dist/plugin/react-client/index.d.ts.map +1 -1
  323. package/dist/plugin/react-client/index.js +10 -1
  324. package/dist/plugin/react-client/plugin.d.ts +5 -3
  325. package/dist/plugin/react-client/plugin.d.ts.map +1 -1
  326. package/dist/plugin/react-client/plugin.js +9 -11
  327. package/dist/plugin/react-client/restartWorker.d.ts +5 -4
  328. package/dist/plugin/react-client/restartWorker.d.ts.map +1 -1
  329. package/dist/plugin/react-client/restartWorker.js +12 -10
  330. package/dist/plugin/react-server/configureReactServer.d.ts +5 -4
  331. package/dist/plugin/react-server/configureReactServer.d.ts.map +1 -1
  332. package/dist/plugin/react-server/configureReactServer.js +98 -43
  333. package/dist/plugin/react-server/handleServerAction.d.ts +3 -2
  334. package/dist/plugin/react-server/handleServerAction.d.ts.map +1 -1
  335. package/dist/plugin/react-server/handleServerAction.js +14 -20
  336. package/dist/plugin/react-server/plugin.d.ts +3 -4
  337. package/dist/plugin/react-server/plugin.d.ts.map +1 -1
  338. package/dist/plugin/react-server/plugin.js +14 -17
  339. package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts +8 -6
  340. package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts.map +1 -1
  341. package/dist/plugin/react-static/collectHtmlWorkerContent.js +4 -4
  342. package/dist/plugin/react-static/collectRscContent.d.ts +8 -6
  343. package/dist/plugin/react-static/collectRscContent.d.ts.map +1 -1
  344. package/dist/plugin/react-static/collectRscContent.js +4 -4
  345. package/dist/plugin/react-static/configurePreviewServer.d.ts +6 -4
  346. package/dist/plugin/react-static/configurePreviewServer.d.ts.map +1 -1
  347. package/dist/plugin/react-static/configurePreviewServer.js +38 -31
  348. package/dist/plugin/react-static/createBuildLoader.d.ts +5 -5
  349. package/dist/plugin/react-static/createBuildLoader.d.ts.map +1 -1
  350. package/dist/plugin/react-static/createBuildLoader.js +122 -30
  351. package/dist/plugin/react-static/fileWriter.js +1 -1
  352. package/dist/plugin/react-static/plugin.d.ts +3 -4
  353. package/dist/plugin/react-static/plugin.d.ts.map +1 -1
  354. package/dist/plugin/react-static/plugin.js +62 -47
  355. package/dist/plugin/react-static/renderPage.d.ts +4 -2
  356. package/dist/plugin/react-static/renderPage.d.ts.map +1 -1
  357. package/dist/plugin/react-static/renderPage.js +33 -17
  358. package/dist/plugin/react-static/renderPages.d.ts +4 -2
  359. package/dist/plugin/react-static/renderPages.d.ts.map +1 -1
  360. package/dist/plugin/react-static/renderPages.js +7 -6
  361. package/dist/plugin/react-static/renderStreams.d.ts +5 -22
  362. package/dist/plugin/react-static/renderStreams.d.ts.map +1 -1
  363. package/dist/plugin/react-static/renderStreams.js +6 -6
  364. package/dist/plugin/react-static/rscToHtmlStream.d.ts.map +1 -1
  365. package/dist/plugin/react-static/rscToHtmlStream.js +1 -1
  366. package/dist/plugin/react-static/temporaryReferences.js +1 -1
  367. package/dist/plugin/react-static/types.d.ts +0 -1
  368. package/dist/plugin/react-static/types.d.ts.map +1 -1
  369. package/dist/plugin/root.js +1 -1
  370. package/dist/plugin/transformer/plugin.js +1 -1
  371. package/dist/plugin/transformer/plugin.server.d.ts +5 -3
  372. package/dist/plugin/transformer/plugin.server.d.ts.map +1 -1
  373. package/dist/plugin/transformer/plugin.server.js +43 -44
  374. package/dist/plugin/types/css-tracking.d.ts +2 -2
  375. package/dist/plugin/types/css-tracking.d.ts.map +1 -1
  376. package/dist/plugin/types.d.ts +452 -192
  377. package/dist/plugin/types.d.ts.map +1 -1
  378. package/dist/plugin/types.js +2 -1
  379. package/dist/plugin/utils/callServer.js +1 -1
  380. package/dist/plugin/utils/createCallServer.d.ts +1 -1
  381. package/dist/plugin/utils/createCallServer.d.ts.map +1 -1
  382. package/dist/plugin/utils/createCallServer.js +1 -1
  383. package/dist/plugin/utils/createReactFetcher.d.ts +2 -3
  384. package/dist/plugin/utils/createReactFetcher.d.ts.map +1 -1
  385. package/dist/plugin/utils/createReactFetcher.js +1 -1
  386. package/dist/plugin/utils/env.js +1 -1
  387. package/dist/plugin/utils/envUrls.node.js +1 -1
  388. package/dist/plugin/utils/index.d.ts +1 -0
  389. package/dist/plugin/utils/index.d.ts.map +1 -1
  390. package/dist/plugin/utils/index.js +12 -5
  391. package/dist/plugin/utils/routeToURL.d.ts +12 -0
  392. package/dist/plugin/utils/routeToURL.d.ts.map +1 -0
  393. package/dist/plugin/utils/routeToURL.js +26 -0
  394. package/dist/plugin/utils/urls.d.ts.map +1 -1
  395. package/dist/plugin/utils/urls.js +5 -3
  396. package/dist/plugin/vendor/index.js +7 -1
  397. package/dist/plugin/vendor/vendor.client.js +1 -1
  398. package/dist/plugin/vendor/vendor.js +1 -1
  399. package/dist/plugin/vendor/vendor.server.js +1 -1
  400. package/dist/plugin/worker/createWorker.d.ts +31 -17
  401. package/dist/plugin/worker/createWorker.d.ts.map +1 -1
  402. package/dist/plugin/worker/createWorker.js +18 -12
  403. package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts +2 -2
  404. package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts.map +1 -1
  405. package/dist/plugin/worker/html/createHtmlWorkerRenderState.js +5 -2
  406. package/dist/plugin/worker/html/html-worker.development.js +3 -3
  407. package/dist/plugin/worker/html/html-worker.production.js +1 -1
  408. package/dist/plugin/worker/html/index.d.ts +1 -1
  409. package/dist/plugin/worker/html/index.d.ts.map +1 -1
  410. package/dist/plugin/worker/html/index.js +1 -1
  411. package/dist/plugin/worker/html/messageHandler.d.ts +1 -1
  412. package/dist/plugin/worker/html/messageHandler.d.ts.map +1 -1
  413. package/dist/plugin/worker/html/messageHandler.js +9 -11
  414. package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts +3 -0
  415. package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts.map +1 -0
  416. package/dist/plugin/worker/html/sendHtmlWorkerMessage.js +2 -0
  417. package/dist/plugin/worker/html/types.d.ts +20 -2
  418. package/dist/plugin/worker/html/types.d.ts.map +1 -1
  419. package/dist/plugin/worker/index.d.ts +3 -0
  420. package/dist/plugin/worker/index.d.ts.map +1 -0
  421. package/dist/plugin/worker/index.js +7 -0
  422. package/dist/plugin/worker/registerLoaders.js +2 -2
  423. package/dist/plugin/worker/rsc/handleRender.d.ts +4 -3
  424. package/dist/plugin/worker/rsc/handleRender.d.ts.map +1 -1
  425. package/dist/plugin/worker/rsc/handleRender.js +54 -32
  426. package/dist/plugin/worker/rsc/handlers.d.ts.map +1 -1
  427. package/dist/plugin/worker/rsc/handlers.js +19 -15
  428. package/dist/plugin/worker/rsc/index.d.ts +1 -1
  429. package/dist/plugin/worker/rsc/index.d.ts.map +1 -1
  430. package/dist/plugin/worker/rsc/index.js +1 -1
  431. package/dist/plugin/worker/rsc/messageHandler.d.ts +1 -1
  432. package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -1
  433. package/dist/plugin/worker/rsc/messageHandler.js +16 -4
  434. package/dist/plugin/worker/rsc/rsc-worker.development.js +77 -11
  435. package/dist/plugin/worker/rsc/rsc-worker.production.js +1 -1
  436. package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts +3 -0
  437. package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts.map +1 -0
  438. package/dist/plugin/worker/rsc/sendRscWorkerMessage.js +11 -0
  439. package/dist/plugin/worker/rsc/state.js +1 -1
  440. package/dist/plugin/worker/rsc/types.d.ts +95 -0
  441. package/dist/plugin/worker/rsc/types.d.ts.map +1 -0
  442. package/dist/plugin/worker/rsc/types.js +1 -0
  443. package/dist/plugin/worker/rsc/userOptions.d.ts +1 -1
  444. package/dist/plugin/worker/rsc/userOptions.d.ts.map +1 -1
  445. package/dist/plugin/worker/rsc/userOptions.js +3 -4
  446. package/dist/plugin/worker/sendMessage.d.ts +3 -4
  447. package/dist/plugin/worker/sendMessage.d.ts.map +1 -1
  448. package/dist/plugin/worker/sendMessage.js +15 -5
  449. package/dist/plugin/worker/types.d.ts +109 -260
  450. package/dist/plugin/worker/types.d.ts.map +1 -1
  451. package/dist/server.js +1 -1
  452. package/dist/tsconfig.tsbuildinfo +1 -1
  453. package/package.json +58 -25
  454. package/plugin/components/{css-collector-elements.tsx → css.tsx} +3 -3
  455. package/plugin/components/html.tsx +4 -4
  456. package/plugin/components/index.ts +3 -3
  457. package/plugin/components/root.tsx +20 -0
  458. package/plugin/config/autoDiscover/resolveAutoDiscover.ts +173 -134
  459. package/plugin/config/autoDiscover/resolveBuildPages.ts +120 -7
  460. package/plugin/config/createModuleID.ts +60 -39
  461. package/plugin/config/defaults.tsx +184 -95
  462. package/plugin/config/extMap.ts +51 -56
  463. package/plugin/config/flightBindings.ts +221 -0
  464. package/plugin/config/getCondition.ts +6 -0
  465. package/plugin/config/index.ts +17 -4
  466. package/plugin/config/interpolatePattern.ts +19 -0
  467. package/plugin/config/parsePattern.ts +81 -0
  468. package/plugin/config/resolveAllowedDirectives.ts +59 -0
  469. package/plugin/config/resolveDirectiveMatcher.ts +57 -0
  470. package/plugin/config/resolveEnv.ts +5 -10
  471. package/plugin/config/resolveOptions.ts +415 -299
  472. package/plugin/config/resolvePatternWithValues.ts +70 -0
  473. package/plugin/config/resolveRegExp.ts +89 -0
  474. package/plugin/config/resolveUrlOption.ts +92 -20
  475. package/plugin/config/resolveUserConfig.ts +417 -351
  476. package/plugin/env/plugin.ts +71 -7
  477. package/plugin/error/directiveError.ts +29 -0
  478. package/plugin/error/enhanceError.ts +41 -0
  479. package/plugin/error/index.ts +3 -0
  480. package/plugin/error/logError.ts +45 -0
  481. package/plugin/error/serializeError.ts +34 -0
  482. package/plugin/error/toError.ts +75 -45
  483. package/plugin/file-preserver/plugin.ts +3 -3
  484. package/plugin/getNodeEnv.ts +24 -0
  485. package/plugin/helpers/cleanObject.ts +2 -1
  486. package/plugin/helpers/collectViteModuleGraphCss.ts +138 -118
  487. package/plugin/helpers/createCssProps.tsx +41 -20
  488. package/plugin/helpers/createEventHandler.ts +1 -1
  489. package/plugin/helpers/createHandler.ts +40 -12
  490. package/plugin/helpers/createRscStream.tsx +97 -35
  491. package/plugin/helpers/formatMetrics.ts +2 -37
  492. package/plugin/helpers/getBundleManifest.ts +10 -1
  493. package/plugin/helpers/getRouteFiles.ts +112 -8
  494. package/plugin/helpers/handleServerAction.ts +10 -6
  495. package/plugin/helpers/hydrateUserOptions.ts +23 -0
  496. package/plugin/helpers/index.ts +4 -0
  497. package/plugin/helpers/inputNormalizer.ts +44 -24
  498. package/plugin/helpers/metrics.ts +4 -64
  499. package/plugin/helpers/moduleResolver.ts +74 -19
  500. package/plugin/helpers/requestInfo.ts +72 -52
  501. package/plugin/helpers/requestToRoute.ts +38 -12
  502. package/plugin/helpers/resolveComponent.ts +173 -0
  503. package/plugin/helpers/resolveComponents.ts +185 -0
  504. package/plugin/helpers/resolvePage.ts +35 -29
  505. package/plugin/helpers/resolvePageAndProps.ts +82 -61
  506. package/plugin/helpers/resolveProps.ts +100 -37
  507. package/plugin/helpers/resolveUserComponents.ts +190 -0
  508. package/plugin/helpers/serializeUserOptions.ts +190 -69
  509. package/plugin/helpers/stashReturnValue.ts +7 -4
  510. package/plugin/helpers/tryManifest.ts +1 -1
  511. package/plugin/loader/createDefaultLoader.ts +119 -119
  512. package/plugin/loader/createTransformer.ts +118 -0
  513. package/plugin/loader/css-loader.ts +206 -0
  514. package/plugin/loader/directives/addLocalExportedNames.ts +78 -0
  515. package/plugin/loader/directives/analyzeDirectives.ts +298 -0
  516. package/plugin/loader/directives/analyzeModule.ts +39 -0
  517. package/plugin/loader/directives/collectExports.ts +181 -0
  518. package/plugin/loader/directives/collectExportsFromModule.ts +25 -0
  519. package/plugin/loader/directives/findDirectiveMatches.ts +58 -0
  520. package/plugin/loader/directives/getExportedName.ts +73 -0
  521. package/plugin/loader/directives/getExports.ts +27 -0
  522. package/plugin/loader/directives/getFunctionBody.ts +32 -0
  523. package/plugin/loader/directives/getFunctionName.ts +70 -0
  524. package/plugin/loader/directives/getQualifiedName.ts +76 -0
  525. package/plugin/loader/directives/index.ts +13 -0
  526. package/plugin/loader/directives/processFunctionNode.ts +97 -0
  527. package/plugin/loader/directives/typeGuards.ts +160 -0
  528. package/plugin/loader/directives/types.ts +174 -0
  529. package/plugin/loader/directives/utils.ts +35 -0
  530. package/plugin/loader/{env-loader.development.ts → env-loader.ts} +8 -22
  531. package/plugin/loader/index.ts +8 -6
  532. package/plugin/loader/parse.ts +42 -12
  533. package/plugin/loader/react-loader.ts +255 -4
  534. package/plugin/loader/removeDirectives.ts +14 -0
  535. package/plugin/loader/removeRanges.ts +21 -0
  536. package/plugin/loader/sourceMap.ts +174 -84
  537. package/plugin/loader/transformClientModule.ts +64 -0
  538. package/plugin/loader/transformModule.ts +54 -0
  539. package/plugin/loader/transformModuleIfNeeded.ts +40 -40
  540. package/plugin/loader/transformServerModule.ts +136 -0
  541. package/plugin/loader/transformWithAcornLoose.ts +27 -0
  542. package/plugin/loader/types.ts +65 -13
  543. package/plugin/metrics/collectStreamMetrics.ts +38 -0
  544. package/plugin/metrics/createRenderMetrics.ts +17 -0
  545. package/plugin/metrics/createStreamMetrics.ts +14 -0
  546. package/plugin/metrics/formatMetrics.ts +7 -3
  547. package/plugin/metrics/index.ts +3 -1
  548. package/plugin/metrics/types.ts +24 -0
  549. package/plugin/plugin.client.ts +39 -15
  550. package/plugin/plugin.server.ts +39 -18
  551. package/plugin/preserver/plugin.ts +42 -42
  552. package/plugin/react-client/cleanupWorkerServerAction.ts +33 -0
  553. package/plugin/react-client/configureWorkerRequestHandler.ts +212 -201
  554. package/plugin/react-client/createMessageHandlers.ts +17 -3
  555. package/plugin/react-client/createWorkerStream.ts +55 -51
  556. package/plugin/react-client/handleWorkerRscStream.ts +141 -61
  557. package/plugin/react-client/handleWorkerServerAction.ts +59 -37
  558. package/plugin/react-client/index.ts +4 -1
  559. package/plugin/react-client/plugin.ts +17 -18
  560. package/plugin/react-client/restartWorker.ts +75 -70
  561. package/plugin/react-server/configureReactServer.ts +200 -142
  562. package/plugin/react-server/handleServerAction.ts +156 -160
  563. package/plugin/react-server/plugin.ts +18 -25
  564. package/plugin/react-static/collectHtmlWorkerContent.ts +109 -102
  565. package/plugin/react-static/collectRscContent.ts +55 -51
  566. package/plugin/react-static/configurePreviewServer.ts +110 -100
  567. package/plugin/react-static/createBuildLoader.ts +157 -48
  568. package/plugin/react-static/plugin.ts +368 -357
  569. package/plugin/react-static/renderPage.ts +43 -24
  570. package/plugin/react-static/renderPages.ts +21 -14
  571. package/plugin/react-static/renderStreams.ts +13 -15
  572. package/plugin/react-static/rscToHtmlStream.ts +4 -6
  573. package/plugin/react-static/types.ts +0 -3
  574. package/plugin/transformer/README.md +82 -8
  575. package/plugin/transformer/plugin.server.ts +55 -82
  576. package/plugin/types/css-tracking.ts +1 -1
  577. package/plugin/types/global.d.ts +2 -2
  578. package/plugin/types/react-server-dom-esm.d.ts +12 -13
  579. package/plugin/types.ts +685 -309
  580. package/plugin/utils/createCallServer.ts +5 -5
  581. package/plugin/utils/createReactFetcher.ts +4 -6
  582. package/plugin/utils/index.ts +2 -1
  583. package/plugin/utils/routeToURL.ts +34 -0
  584. package/plugin/utils/urls.ts +9 -6
  585. package/plugin/worker/createWorker.ts +67 -34
  586. package/plugin/worker/html/README.md +10 -0
  587. package/plugin/worker/html/createHtmlWorkerRenderState.tsx +7 -4
  588. package/plugin/worker/html/html-worker.development.tsx +4 -3
  589. package/plugin/worker/html/index.ts +3 -1
  590. package/plugin/worker/html/messageHandler.tsx +10 -16
  591. package/plugin/worker/html/sendHtmlWorkerMessage.ts +8 -0
  592. package/plugin/worker/html/types.ts +67 -1
  593. package/plugin/worker/index.ts +2 -0
  594. package/plugin/worker/registerLoaders.ts +3 -3
  595. package/plugin/worker/rsc/README.md +203 -1
  596. package/plugin/worker/rsc/handleRender.ts +76 -39
  597. package/plugin/worker/rsc/handlers.ts +30 -22
  598. package/plugin/worker/rsc/index.ts +2 -0
  599. package/plugin/worker/rsc/messageHandler.tsx +17 -10
  600. package/plugin/worker/rsc/rsc-worker.development.ts +104 -17
  601. package/plugin/worker/rsc/sendRscWorkerMessage.ts +7 -0
  602. package/plugin/worker/rsc/state.ts +1 -1
  603. package/plugin/worker/rsc/types.ts +185 -0
  604. package/plugin/worker/rsc/userOptions.ts +2 -3
  605. package/plugin/worker/sendMessage.ts +23 -14
  606. package/plugin/worker/types.ts +131 -386
  607. package/scripts/check-react-version.mjs +3 -3
  608. package/scripts/fix-unused-imports.mjs +77 -0
  609. package/tsconfig.json +1 -1
  610. package/dist/_virtual/dynamic-import-helper.js.map +0 -1
  611. package/dist/client.js.map +0 -1
  612. package/dist/index.js.map +0 -1
  613. package/dist/plugin/components/css-collector-elements.d.ts.map +0 -1
  614. package/dist/plugin/components/css-collector-elements.js +0 -33
  615. package/dist/plugin/components/css-collector-elements.js.map +0 -1
  616. package/dist/plugin/components/css-collector.d.ts +0 -7
  617. package/dist/plugin/components/css-collector.d.ts.map +0 -1
  618. package/dist/plugin/components/css-collector.js +0 -18
  619. package/dist/plugin/components/css-collector.js.map +0 -1
  620. package/dist/plugin/components/html.js.map +0 -1
  621. package/dist/plugin/components.js +0 -9
  622. package/dist/plugin/components.js.map +0 -1
  623. package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js.map +0 -1
  624. package/dist/plugin/config/autoDiscover/customWorkerFiles.js.map +0 -1
  625. package/dist/plugin/config/autoDiscover/pageAndPropFiles.js.map +0 -1
  626. package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js.map +0 -1
  627. package/dist/plugin/config/autoDiscover/resolveBuildPages.js.map +0 -1
  628. package/dist/plugin/config/defaults.js.map +0 -1
  629. package/dist/plugin/config/extMap.js.map +0 -1
  630. package/dist/plugin/config/getCondition.js.map +0 -1
  631. package/dist/plugin/config/getPaths.js.map +0 -1
  632. package/dist/plugin/config/mimeTypes.js.map +0 -1
  633. package/dist/plugin/config/resolveAutoDiscoverMatcher.d.ts +0 -5
  634. package/dist/plugin/config/resolveAutoDiscoverMatcher.d.ts.map +0 -1
  635. package/dist/plugin/config/resolveAutoDiscoverMatcher.js +0 -25
  636. package/dist/plugin/config/resolveAutoDiscoverMatcher.js.map +0 -1
  637. package/dist/plugin/config/resolveEnv.js.map +0 -1
  638. package/dist/plugin/config/resolveOptions.js.map +0 -1
  639. package/dist/plugin/config/resolvePages.js.map +0 -1
  640. package/dist/plugin/config/resolveUrlOption.js.map +0 -1
  641. package/dist/plugin/config/resolveUserConfig.js.map +0 -1
  642. package/dist/plugin/config.js +0 -17
  643. package/dist/plugin/config.js.map +0 -1
  644. package/dist/plugin/env.js +0 -79
  645. package/dist/plugin/env.js.map +0 -1
  646. package/dist/plugin/error/toError.js.map +0 -1
  647. package/dist/plugin/file-preserver.js +0 -96
  648. package/dist/plugin/file-preserver.js.map +0 -1
  649. package/dist/plugin/helpers/cleanObject.js.map +0 -1
  650. package/dist/plugin/helpers/collectManifestCss.js.map +0 -1
  651. package/dist/plugin/helpers/collectViteModuleGraphCss.js.map +0 -1
  652. package/dist/plugin/helpers/createCssProps.js.map +0 -1
  653. package/dist/plugin/helpers/createEventHandler.js.map +0 -1
  654. package/dist/plugin/helpers/createHandler.js.map +0 -1
  655. package/dist/plugin/helpers/createRscStream.js.map +0 -1
  656. package/dist/plugin/helpers/formatMetrics.js.map +0 -1
  657. package/dist/plugin/helpers/getBundleManifest.js.map +0 -1
  658. package/dist/plugin/helpers/getRouteFiles.js.map +0 -1
  659. package/dist/plugin/helpers/handleServerAction.js.map +0 -1
  660. package/dist/plugin/helpers/inputNormalizer.js.map +0 -1
  661. package/dist/plugin/helpers/metrics.js.map +0 -1
  662. package/dist/plugin/helpers/moduleRefs.js.map +0 -1
  663. package/dist/plugin/helpers/requestInfo.js.map +0 -1
  664. package/dist/plugin/helpers/requestToRoute.js.map +0 -1
  665. package/dist/plugin/helpers/resolvePage.js.map +0 -1
  666. package/dist/plugin/helpers/resolvePageAndProps.js.map +0 -1
  667. package/dist/plugin/helpers/resolveProps.js.map +0 -1
  668. package/dist/plugin/helpers/serializeUserOptions.js.map +0 -1
  669. package/dist/plugin/helpers/sourceMap.d.ts +0 -8
  670. package/dist/plugin/helpers/sourceMap.d.ts.map +0 -1
  671. package/dist/plugin/helpers/sourceMap.js +0 -136
  672. package/dist/plugin/helpers/stashReturnValue.js.map +0 -1
  673. package/dist/plugin/helpers/tryManifest.js.map +0 -1
  674. package/dist/plugin/helpers.js +0 -27
  675. package/dist/plugin/helpers.js.map +0 -1
  676. package/dist/plugin/loader/css-loader.development.d.ts.map +0 -1
  677. package/dist/plugin/loader/css-loader.development.js +0 -76
  678. package/dist/plugin/loader/css-loader.development.js.map +0 -1
  679. package/dist/plugin/loader/css-loader.production.d.ts +0 -31
  680. package/dist/plugin/loader/css-loader.production.d.ts.map +0 -1
  681. package/dist/plugin/loader/css-loader.production.js +0 -45
  682. package/dist/plugin/loader/css-loader.production.js.map +0 -1
  683. package/dist/plugin/loader/env-loader.development.d.ts +0 -13
  684. package/dist/plugin/loader/env-loader.development.d.ts.map +0 -1
  685. package/dist/plugin/loader/env-loader.development.js +0 -68
  686. package/dist/plugin/loader/handleExports.d.ts +0 -40
  687. package/dist/plugin/loader/handleExports.d.ts.map +0 -1
  688. package/dist/plugin/loader/handleExports.js +0 -209
  689. package/dist/plugin/loader/handleExports.js.map +0 -1
  690. package/dist/plugin/loader/parse.js.map +0 -1
  691. package/dist/plugin/loader/react-loader.client.d.ts +0 -2
  692. package/dist/plugin/loader/react-loader.client.d.ts.map +0 -1
  693. package/dist/plugin/loader/react-loader.client.js +0 -2
  694. package/dist/plugin/loader/react-loader.js.map +0 -1
  695. package/dist/plugin/loader/react-loader.server.d.ts +0 -21
  696. package/dist/plugin/loader/react-loader.server.d.ts.map +0 -1
  697. package/dist/plugin/loader/react-loader.server.js +0 -131
  698. package/dist/plugin/loader/transformModuleIfNeeded.js.map +0 -1
  699. package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts +0 -48
  700. package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts.map +0 -1
  701. package/dist/plugin/loader/transformModuleWithPreservedFunctions.js +0 -431
  702. package/dist/plugin/loader/transformModuleWithPreservedFunctions.js.map +0 -1
  703. package/dist/plugin/metrics/formatMetrics.js.map +0 -1
  704. package/dist/plugin/metrics.js +0 -7
  705. package/dist/plugin/metrics.js.map +0 -1
  706. package/dist/plugin/plugin.client.js.map +0 -1
  707. package/dist/plugin/plugin.server.js.map +0 -1
  708. package/dist/plugin/preserver/plugin.js.map +0 -1
  709. package/dist/plugin/react-client/configureWorkerRequestHandler.js.map +0 -1
  710. package/dist/plugin/react-client/createMessageHandlers.js.map +0 -1
  711. package/dist/plugin/react-client/createWorkerStream.js.map +0 -1
  712. package/dist/plugin/react-client/handleWorkerRscStream.js.map +0 -1
  713. package/dist/plugin/react-client/handleWorkerServerAction.js.map +0 -1
  714. package/dist/plugin/react-client/plugin.js.map +0 -1
  715. package/dist/plugin/react-client/restartWorker.js.map +0 -1
  716. package/dist/plugin/react-server/configureReactServer.js.map +0 -1
  717. package/dist/plugin/react-server/handleServerAction.js.map +0 -1
  718. package/dist/plugin/react-server/plugin.js.map +0 -1
  719. package/dist/plugin/react-static/collectHtmlWorkerContent.js.map +0 -1
  720. package/dist/plugin/react-static/collectRscContent.js.map +0 -1
  721. package/dist/plugin/react-static/configurePreviewServer.js.map +0 -1
  722. package/dist/plugin/react-static/createBuildLoader.js.map +0 -1
  723. package/dist/plugin/react-static/fileWriter.js.map +0 -1
  724. package/dist/plugin/react-static/plugin.js.map +0 -1
  725. package/dist/plugin/react-static/renderPage.js.map +0 -1
  726. package/dist/plugin/react-static/renderPages.js.map +0 -1
  727. package/dist/plugin/react-static/renderStreams.js.map +0 -1
  728. package/dist/plugin/react-static/rscToHtmlStream.js.map +0 -1
  729. package/dist/plugin/react-static/temporaryReferences.js.map +0 -1
  730. package/dist/plugin/root.js.map +0 -1
  731. package/dist/plugin/source-map/createMappingsSerializer.d.ts +0 -2
  732. package/dist/plugin/source-map/createMappingsSerializer.d.ts.map +0 -1
  733. package/dist/plugin/source-map/createMappingsSerializer.js +0 -129
  734. package/dist/plugin/source-map/createMappingsSerializer.js.map +0 -1
  735. package/dist/plugin/source-map/readMappings.d.ts +0 -2
  736. package/dist/plugin/source-map/readMappings.d.ts.map +0 -1
  737. package/dist/plugin/source-map/readMappings.js +0 -200
  738. package/dist/plugin/transformer/plugin.client.d.ts +0 -2
  739. package/dist/plugin/transformer/plugin.client.d.ts.map +0 -1
  740. package/dist/plugin/transformer/plugin.js.map +0 -1
  741. package/dist/plugin/transformer/plugin.server.js.map +0 -1
  742. package/dist/plugin/utils/callServer.js.map +0 -1
  743. package/dist/plugin/utils/createCallServer.js.map +0 -1
  744. package/dist/plugin/utils/createReactFetcher.js.map +0 -1
  745. package/dist/plugin/utils/env.js.map +0 -1
  746. package/dist/plugin/utils/envUrls.node.js.map +0 -1
  747. package/dist/plugin/utils/urls.js.map +0 -1
  748. package/dist/plugin/utils.js +0 -11
  749. package/dist/plugin/utils.js.map +0 -1
  750. package/dist/plugin/vendor/vendor.client.js.map +0 -1
  751. package/dist/plugin/vendor/vendor.js.map +0 -1
  752. package/dist/plugin/vendor/vendor.server.js.map +0 -1
  753. package/dist/plugin/vendor.js +0 -7
  754. package/dist/plugin/vendor.js.map +0 -1
  755. package/dist/plugin/worker/createWorker.js.map +0 -1
  756. package/dist/plugin/worker/html/createHtmlWorkerRenderState.js.map +0 -1
  757. package/dist/plugin/worker/html/html-worker.development.js.map +0 -1
  758. package/dist/plugin/worker/html/html-worker.production.js.map +0 -1
  759. package/dist/plugin/worker/html/index.js.map +0 -1
  760. package/dist/plugin/worker/html/messageHandler.js.map +0 -1
  761. package/dist/plugin/worker/rsc/handleRender.js.map +0 -1
  762. package/dist/plugin/worker/rsc/handlers.js.map +0 -1
  763. package/dist/plugin/worker/rsc/index.js.map +0 -1
  764. package/dist/plugin/worker/rsc/messageHandler.js.map +0 -1
  765. package/dist/plugin/worker/rsc/rsc-worker.development.js.map +0 -1
  766. package/dist/plugin/worker/rsc/rsc-worker.production.js.map +0 -1
  767. package/dist/plugin/worker/rsc/state.js.map +0 -1
  768. package/dist/plugin/worker/rsc/userOptions.js.map +0 -1
  769. package/dist/plugin/worker/sendMessage.js.map +0 -1
  770. package/dist/server.js.map +0 -1
  771. package/plugin/components/css-collector.tsx +0 -20
  772. package/plugin/config/resolveAutoDiscoverMatcher.ts +0 -23
  773. package/plugin/helpers/sourceMap.ts +0 -182
  774. package/plugin/loader/css-loader.development.ts +0 -135
  775. package/plugin/loader/css-loader.production.ts +0 -84
  776. package/plugin/loader/handleExports.ts +0 -309
  777. package/plugin/loader/react-loader.client.ts +0 -1
  778. package/plugin/loader/react-loader.server.ts +0 -185
  779. package/plugin/loader/transformModuleWithPreservedFunctions.ts +0 -596
  780. package/plugin/source-map/createMappingsSerializer.ts +0 -181
  781. package/plugin/source-map/readMappings.ts +0 -194
  782. package/plugin/transformer/plugin.client.ts +0 -0
  783. /package/dist/plugin/{transformer/plugin.client.js → loader/directives/types.js} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderStreams.js","sources":["../../../plugin/react-static/renderStreams.ts"],"sourcesContent":["/**\n * renderStreams.ts\n *\n * PURPOSE: Creates specialized streams for React Server Components (RSC) rendering\n *\n * This module:\n * 1. Creates RSC stream (React.Fragment wrapper) for client-side navigation\n * - This stream is saved to .rsc files and used when navigating between pages\n * - The Fragment wrapper allows the browser to update only the necessary parts of the DOM\n * - This is more efficient than reloading the entire HTML document\n * 2. Creates Document stream (Html wrapper) for initial page loads\n * - This stream includes the full HTML document structure\n * - Used for the initial page load when the browser needs the complete HTML\n * 3. Sets up stream handlers with proper wrappers and options\n * 4. Returns streams for renderPages to process\n */\nimport { createHandler } from \"../helpers/createHandler.js\";\nimport type {\n CreateHandlerOptions,\n PagePropOpt\n} from \"../types.js\";\nimport React from \"react\";\n\n/**\n * Creates handlers for both document and RSC streams\n *\n * @param handler The handler options for creating streams\n * @param options The render options\n * @returns A tuple containing the document worker result and RSC direct result\n */\nexport function renderStreams<\n T extends PagePropOpt = PagePropOpt\n>(handler: CreateHandlerOptions<T>) {\n return Promise.all([\n /**\n * This stream goes to the document worker for client side rendering with full HTML structure,\n * links are already bubbled up in the static document which required us\n * to include the head in the stream as well\n */\n createHandler(handler),\n\n /**\n * This stream is saved to index.rsc file (if configured) and can be used\n * for navigating to pages (without the Html wrapper, but does contain\n * css/head information that can bubble up to the browser's dom)\n */\n createHandler({ ...handler, Html: React.Fragment }),\n ]);\n}\n"],"names":["React"],"mappings":";;;;;;;;AA8BO,SAAS,cAEd,OAAkC,EAAA;AAClC,EAAA,OAAO,QAAQ,GAAI,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMjB,cAAc,OAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOrB,cAAc,EAAE,GAAG,SAAS,IAAM,EAAAA,cAAA,CAAM,UAAU;AAAA,GACnD,CAAA;AACH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rscToHtmlStream.js","sources":["../../../plugin/react-static/rscToHtmlStream.ts"],"sourcesContent":["/**\n * rscToHtmlStream.ts\n *\n * PURPOSE: Transforms RSC stream to HTML stream via worker communication\n *\n * This module:\n * 1. Takes RSC stream as input\n * 2. Communicates with worker to transform RSC to HTML\n * 3. Returns a writeable stream of HTML content\n * 4. Handles worker message processing and error cases\n */\n\nimport { Transform } from \"node:stream\";\nimport type {\n HtmlWorkerInputMessage,\n} from \"../worker/types.js\";\nimport type { CreateHandlerOptions } from \"../types.js\";\nimport type { Worker } from \"node:worker_threads\";\nimport type { ViteDevServer } from \"vite\";\n\nexport type RscToHtmlOptions = Pick<\n CreateHandlerOptions,\n | \"worker\"\n | \"route\"\n | \"moduleRootPath\"\n | \"moduleBaseURL\"\n | \"pipeableStreamOptions\"\n | \"build\"\n | \"cssFiles\"\n | \"projectRoot\"\n>;\n\n/**\n * Creates a transform stream that converts RSC content to HTML via worker\n *\n * @param options The options for RSC to HTML transformation\n * @returns A transform stream that outputs HTML content\n */\nexport function createRscToHtmlStream(options: RscToHtmlOptions): Transform {\n const worker = options.worker as Worker | ViteDevServer;\n if (!(\"postMessage\" in worker)) {\n throw new Error(\"Worker is not a valid worker\");\n }\n let sequence = 0;\n const stream = new Transform({\n transform(chunk, _encoding, callback) {\n try {\n worker.postMessage({\n type: \"RSC_CHUNK\",\n id: options.route,\n chunk,\n sequence: sequence++,\n } satisfies HtmlWorkerInputMessage);\n callback();\n } catch (error) {\n callback(error as Error);\n }\n },\n flush(callback) {\n try {\n worker.postMessage({\n type: \"RSC_END\",\n id: options.route,\n } satisfies HtmlWorkerInputMessage);\n callback();\n } catch (error) {\n callback(error as Error);\n }\n },\n });\n\n // Signal ready to receive HTML\n worker.postMessage({\n type: \"ROUTE_READY\",\n id: options.route,\n // replace server with client\n moduleRootPath: options.moduleRootPath,\n moduleBaseURL: options.moduleBaseURL,\n cssFiles: options.cssFiles,\n pipeableStreamOptions: options.pipeableStreamOptions,\n projectRoot: options.projectRoot,\n } satisfies HtmlWorkerInputMessage);\n\n return stream;\n}\n"],"names":[],"mappings":";;;;;;;AAsCO,SAAS,sBAAsB,OAAsC,EAAA;AAC1E,EAAA,MAAM,SAAS,OAAQ,CAAA,MAAA;AACvB,EAAI,IAAA,EAAE,iBAAiB,MAAS,CAAA,EAAA;AAC9B,IAAM,MAAA,IAAI,MAAM,8BAA8B,CAAA;AAAA;AAEhD,EAAA,IAAI,QAAW,GAAA,CAAA;AACf,EAAM,MAAA,MAAA,GAAS,IAAI,SAAU,CAAA;AAAA,IAC3B,SAAA,CAAU,KAAO,EAAA,SAAA,EAAW,QAAU,EAAA;AACpC,MAAI,IAAA;AACF,QAAA,MAAA,CAAO,WAAY,CAAA;AAAA,UACjB,IAAM,EAAA,WAAA;AAAA,UACN,IAAI,OAAQ,CAAA,KAAA;AAAA,UACZ,KAAA;AAAA,UACA,QAAU,EAAA,QAAA;AAAA,SACsB,CAAA;AAClC,QAAS,QAAA,EAAA;AAAA,eACF,KAAO,EAAA;AACd,QAAA,QAAA,CAAS,KAAc,CAAA;AAAA;AACzB,KACF;AAAA,IACA,MAAM,QAAU,EAAA;AACd,MAAI,IAAA;AACF,QAAA,MAAA,CAAO,WAAY,CAAA;AAAA,UACjB,IAAM,EAAA,SAAA;AAAA,UACN,IAAI,OAAQ,CAAA;AAAA,SACoB,CAAA;AAClC,QAAS,QAAA,EAAA;AAAA,eACF,KAAO,EAAA;AACd,QAAA,QAAA,CAAS,KAAc,CAAA;AAAA;AACzB;AACF,GACD,CAAA;AAGD,EAAA,MAAA,CAAO,WAAY,CAAA;AAAA,IACjB,IAAM,EAAA,aAAA;AAAA,IACN,IAAI,OAAQ,CAAA,KAAA;AAAA;AAAA,IAEZ,gBAAgB,OAAQ,CAAA,cAAA;AAAA,IACxB,eAAe,OAAQ,CAAA,aAAA;AAAA,IACvB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,uBAAuB,OAAQ,CAAA,qBAAA;AAAA,IAC/B,aAAa,OAAQ,CAAA;AAAA,GACW,CAAA;AAElC,EAAO,OAAA,MAAA;AACT;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"temporaryReferences.js","sources":["../../../plugin/react-static/temporaryReferences.ts"],"sourcesContent":["import { createTemporaryReferenceSet } from \"react-server-dom-esm/server.node\";\n\nexport const temporaryReferences = createTemporaryReferenceSet();\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,sBAAsB,2BAA4B;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"root.js","sources":["../../plugin/root.ts"],"sourcesContent":["import { dirname } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nexport const pluginRoot = dirname(fileURLToPath(import.meta.url));\nexport const userProjectRoot =\n process.argv\n .find((arg) => arg.includes(\"node_modules\"))\n ?.match(/^(.+?)\\/node_modules\\/.+$/)?.[1] ||\n process.env[\"npm_config_local_prefix\"] ||\n process.cwd();\nexport const isLinked = !pluginRoot.startsWith(userProjectRoot);"],"names":[],"mappings":";;;;;;;;AAEO,MAAM,UAAa,GAAA,OAAA,CAAQ,aAAc,CAAA,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC;AACnD,MAAA,eAAA,GACX,QAAQ,IACL,CAAA,IAAA,CAAK,CAAC,GAAQ,KAAA,GAAA,CAAI,SAAS,cAAc,CAAC,GACzC,KAAM,CAAA,2BAA2B,IAAI,CAAC,CAAA,IAC1C,QAAQ,GAAI,CAAA,yBAAyB,CACrC,IAAA,OAAA,CAAQ,GAAI;AACU,CAAC,UAAW,CAAA,UAAA,CAAW,eAAe;;;;"}
@@ -1,2 +0,0 @@
1
- export declare function createMappingsSerializer(): (newGeneratedLine: number, newGeneratedColumn: number, newSourceIndex: number, newOriginalLine: number, newOriginalColumn: number, newNameIndex: number) => string;
2
- //# sourceMappingURL=createMappingsSerializer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createMappingsSerializer.d.ts","sourceRoot":"","sources":["../../../plugin/source-map/createMappingsSerializer.ts"],"names":[],"mappings":"AACA,wBAAgB,wBAAwB,KAUlC,kBAAkB,MAAM,EACxB,oBAAoB,MAAM,EAC1B,gBAAgB,MAAM,EACtB,iBAAiB,MAAM,EACvB,mBAAmB,MAAM,EACzB,cAAc,MAAM,YAoKvB"}
@@ -1,129 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- function createMappingsSerializer() {
7
- let generatedLine = 1;
8
- let generatedColumn = 0;
9
- let sourceIndex = 0;
10
- let originalLine = 1;
11
- let originalColumn = 0;
12
- let nameIndex = 0;
13
- let mappings = "";
14
- return function serializeMapping(newGeneratedLine, newGeneratedColumn, newSourceIndex, newOriginalLine, newOriginalColumn, newNameIndex) {
15
- if (newGeneratedLine !== generatedLine) {
16
- generatedLine = newGeneratedLine;
17
- generatedColumn = newGeneratedColumn;
18
- if (mappings) {
19
- mappings += ";";
20
- }
21
- } else if (mappings) {
22
- mappings += ",";
23
- }
24
- let value = newGeneratedColumn - generatedColumn;
25
- generatedColumn = newGeneratedColumn;
26
- let isNegative = value < 0;
27
- if (isNegative) {
28
- value = -value;
29
- }
30
- value = value << 1;
31
- if (isNegative) {
32
- value = value | 1;
33
- }
34
- while (value > 0) {
35
- let digit = value & 63;
36
- value = value >>> 6;
37
- if (value > 0) {
38
- digit = digit | 64;
39
- }
40
- mappings += String.fromCharCode(
41
- digit < 26 ? digit + 65 : digit < 52 ? digit + 97 - 26 : digit < 62 ? digit + 48 - 52 : digit === 62 ? 43 : 47
42
- );
43
- }
44
- value = newSourceIndex - sourceIndex;
45
- sourceIndex = newSourceIndex;
46
- isNegative = value < 0;
47
- if (isNegative) {
48
- value = -value;
49
- }
50
- value = value << 1;
51
- if (isNegative) {
52
- value = value | 1;
53
- }
54
- while (value > 0) {
55
- let digit = value & 63;
56
- value = value >>> 6;
57
- if (value > 0) {
58
- digit = digit | 64;
59
- }
60
- mappings += String.fromCharCode(
61
- digit < 26 ? digit + 65 : digit < 52 ? digit + 97 - 26 : digit < 62 ? digit + 48 - 52 : digit === 62 ? 43 : 47
62
- );
63
- }
64
- value = newOriginalLine - originalLine;
65
- originalLine = newOriginalLine;
66
- isNegative = value < 0;
67
- if (isNegative) {
68
- value = -value;
69
- }
70
- value = value << 1;
71
- if (isNegative) {
72
- value = value | 1;
73
- }
74
- while (value > 0) {
75
- let digit = value & 63;
76
- value = value >>> 6;
77
- if (value > 0) {
78
- digit = digit | 64;
79
- }
80
- mappings += String.fromCharCode(
81
- digit < 26 ? digit + 65 : digit < 52 ? digit + 97 - 26 : digit < 62 ? digit + 48 - 52 : digit === 62 ? 43 : 47
82
- );
83
- }
84
- value = newOriginalColumn - originalColumn;
85
- originalColumn = newOriginalColumn;
86
- isNegative = value < 0;
87
- if (isNegative) {
88
- value = -value;
89
- }
90
- value = value << 1;
91
- if (isNegative) {
92
- value = value | 1;
93
- }
94
- while (value > 0) {
95
- let digit = value & 63;
96
- value = value >>> 6;
97
- if (value > 0) {
98
- digit = digit | 64;
99
- }
100
- mappings += String.fromCharCode(
101
- digit < 26 ? digit + 65 : digit < 52 ? digit + 97 - 26 : digit < 62 ? digit + 48 - 52 : digit === 62 ? 43 : 47
102
- );
103
- }
104
- value = newNameIndex - nameIndex;
105
- nameIndex = newNameIndex;
106
- isNegative = value < 0;
107
- if (isNegative) {
108
- value = -value;
109
- }
110
- value = value << 1;
111
- if (isNegative) {
112
- value = value | 1;
113
- }
114
- while (value > 0) {
115
- let digit = value & 63;
116
- value = value >>> 6;
117
- if (value > 0) {
118
- digit = digit | 64;
119
- }
120
- mappings += String.fromCharCode(
121
- digit < 26 ? digit + 65 : digit < 52 ? digit + 97 - 26 : digit < 62 ? digit + 48 - 52 : digit === 62 ? 43 : 47
122
- );
123
- }
124
- return mappings;
125
- };
126
- }
127
-
128
- export { createMappingsSerializer };
129
- //# sourceMappingURL=createMappingsSerializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createMappingsSerializer.js","sources":["../../../plugin/source-map/createMappingsSerializer.ts"],"sourcesContent":["// alternative to webpack-sources/lib/helpers/createMappingsSerializer.js\nexport function createMappingsSerializer() {\n let generatedLine = 1;\n let generatedColumn = 0;\n let sourceIndex = 0;\n let originalLine = 1;\n let originalColumn = 0;\n let nameIndex = 0;\n let mappings = \"\";\n \n return function serializeMapping(\n newGeneratedLine: number,\n newGeneratedColumn: number,\n newSourceIndex: number,\n newOriginalLine: number,\n newOriginalColumn: number,\n newNameIndex: number\n ) {\n if (newGeneratedLine !== generatedLine) {\n generatedLine = newGeneratedLine;\n generatedColumn = newGeneratedColumn;\n if (mappings) {\n mappings += \";\";\n }\n } else if (mappings) {\n mappings += \",\";\n }\n \n // Encode the generated column.\n let value = newGeneratedColumn - generatedColumn;\n generatedColumn = newGeneratedColumn;\n let isNegative = value < 0;\n if (isNegative) {\n value = -value;\n }\n value = value << 1;\n if (isNegative) {\n value = value | 1;\n }\n while (value > 0) {\n let digit = value & 63;\n value = value >>> 6;\n if (value > 0) {\n digit = digit | 64;\n }\n mappings += String.fromCharCode(\n digit < 26\n ? digit + 65\n : digit < 52\n ? digit + 97 - 26\n : digit < 62\n ? digit + 48 - 52\n : digit === 62\n ? 43\n : 47\n );\n }\n \n // Encode the source index.\n value = newSourceIndex - sourceIndex;\n sourceIndex = newSourceIndex;\n isNegative = value < 0;\n if (isNegative) {\n value = -value;\n }\n value = value << 1;\n if (isNegative) {\n value = value | 1;\n }\n while (value > 0) {\n let digit = value & 63;\n value = value >>> 6;\n if (value > 0) {\n digit = digit | 64;\n }\n mappings += String.fromCharCode(\n digit < 26\n ? digit + 65\n : digit < 52\n ? digit + 97 - 26\n : digit < 62\n ? digit + 48 - 52\n : digit === 62\n ? 43\n : 47\n );\n }\n \n // Encode the original line.\n value = newOriginalLine - originalLine;\n originalLine = newOriginalLine;\n isNegative = value < 0;\n if (isNegative) {\n value = -value;\n }\n value = value << 1;\n if (isNegative) {\n value = value | 1;\n }\n while (value > 0) {\n let digit = value & 63;\n value = value >>> 6;\n if (value > 0) {\n digit = digit | 64;\n }\n mappings += String.fromCharCode(\n digit < 26\n ? digit + 65\n : digit < 52\n ? digit + 97 - 26\n : digit < 62\n ? digit + 48 - 52\n : digit === 62\n ? 43\n : 47\n );\n }\n \n // Encode the original column.\n value = newOriginalColumn - originalColumn;\n originalColumn = newOriginalColumn;\n isNegative = value < 0;\n if (isNegative) {\n value = -value;\n }\n value = value << 1;\n if (isNegative) {\n value = value | 1;\n }\n while (value > 0) {\n let digit = value & 63;\n value = value >>> 6;\n if (value > 0) {\n digit = digit | 64;\n }\n mappings += String.fromCharCode(\n digit < 26\n ? digit + 65\n : digit < 52\n ? digit + 97 - 26\n : digit < 62\n ? digit + 48 - 52\n : digit === 62\n ? 43\n : 47\n );\n }\n \n // Encode the name index.\n value = newNameIndex - nameIndex;\n nameIndex = newNameIndex;\n isNegative = value < 0;\n if (isNegative) {\n value = -value;\n }\n value = value << 1;\n if (isNegative) {\n value = value | 1;\n }\n while (value > 0) {\n let digit = value & 63;\n value = value >>> 6;\n if (value > 0) {\n digit = digit | 64;\n }\n mappings += String.fromCharCode(\n digit < 26\n ? digit + 65\n : digit < 52\n ? digit + 97 - 26\n : digit < 62\n ? digit + 48 - 52\n : digit === 62\n ? 43\n : 47\n );\n }\n \n return mappings;\n };\n }"],"names":[],"mappings":";;;;;AACO,SAAS,wBAA2B,GAAA;AACvC,EAAA,IAAI,aAAgB,GAAA,CAAA;AACpB,EAAA,IAAI,eAAkB,GAAA,CAAA;AACtB,EAAA,IAAI,WAAc,GAAA,CAAA;AAClB,EAAA,IAAI,YAAe,GAAA,CAAA;AACnB,EAAA,IAAI,cAAiB,GAAA,CAAA;AACrB,EAAA,IAAI,SAAY,GAAA,CAAA;AAChB,EAAA,IAAI,QAAW,GAAA,EAAA;AAEf,EAAA,OAAO,SAAS,gBACd,CAAA,gBAAA,EACA,oBACA,cACA,EAAA,eAAA,EACA,mBACA,YACA,EAAA;AACA,IAAA,IAAI,qBAAqB,aAAe,EAAA;AACtC,MAAgB,aAAA,GAAA,gBAAA;AAChB,MAAkB,eAAA,GAAA,kBAAA;AAClB,MAAA,IAAI,QAAU,EAAA;AACZ,QAAY,QAAA,IAAA,GAAA;AAAA;AACd,eACS,QAAU,EAAA;AACnB,MAAY,QAAA,IAAA,GAAA;AAAA;AAId,IAAA,IAAI,QAAQ,kBAAqB,GAAA,eAAA;AACjC,IAAkB,eAAA,GAAA,kBAAA;AAClB,IAAA,IAAI,aAAa,KAAQ,GAAA,CAAA;AACzB,IAAA,IAAI,UAAY,EAAA;AACd,MAAA,KAAA,GAAQ,CAAC,KAAA;AAAA;AAEX,IAAA,KAAA,GAAQ,KAAS,IAAA,CAAA;AACjB,IAAA,IAAI,UAAY,EAAA;AACd,MAAA,KAAA,GAAQ,KAAQ,GAAA,CAAA;AAAA;AAElB,IAAA,OAAO,QAAQ,CAAG,EAAA;AAChB,MAAA,IAAI,QAAQ,KAAQ,GAAA,EAAA;AACpB,MAAA,KAAA,GAAQ,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AAA,YAAA;AAAA,QACjB,QAAQ,EACJ,GAAA,KAAA,GAAQ,EACR,GAAA,KAAA,GAAQ,KACR,KAAQ,GAAA,EAAA,GAAK,EACb,GAAA,KAAA,GAAQ,KACR,KAAQ,GAAA,EAAA,GAAK,EACb,GAAA,KAAA,KAAU,KACV,EACA,GAAA;AAAA,OACN;AAAA;AAIF,IAAA,KAAA,GAAQ,YAAe,GAAA,SAAA;AACvB,IAAY,SAAA,GAAA,YAAA;AACZ,IAAA,UAAA,GAAa,KAAQ,GAAA,CAAA;AACrB,IAAA,IAAI,UAAY,EAAA;AACd,MAAA,KAAA,GAAQ,CAAC,KAAA;AAAA;AAEX,IAAA,KAAA,GAAQ,KAAS,IAAA,CAAA;AACjB,IAAA,IAAI,UAAY,EAAA;AACd,MAAA,KAAA,GAAQ,KAAQ,GAAA,CAAA;AAAA;AAElB,IAAA,OAAO,QAAQ,CAAG,EAAA;AAChB,MAAA,IAAI,QAAQ,KAAQ,GAAA,EAAA;AACpB,MAAA,KAAA,GAAQ,KAAU,KAAA,CAAA;AAClB,MAAA,IAAI,QAAQ,CAAG,EAAA;AACb,QAAA,KAAA,GAAQ,KAAQ,GAAA,EAAA;AAAA;AAElB,MAAA,QAAA,IAAY,MAAO,CAAA,YAAA;AAAA,QACjB,QAAQ,EACJ,GAAA,KAAA,GAAQ,EACR,GAAA,KAAA,GAAQ,KACR,KAAQ,GAAA,EAAA,GAAK,EACb,GAAA,KAAA,GAAQ,KACR,KAAQ,GAAA,EAAA,GAAK,EACb,GAAA,KAAA,KAAU,KACV,EACA,GAAA;AAAA,OACN;AAAA;AAGF,IAAO,OAAA,QAAA;AAAA,GACT;AACF;;;;"}
@@ -1,2 +0,0 @@
1
- export declare function readMappings(mappings: string, onMapping: (generatedLine: number, generatedColumn: number, sourceIndex: number, originalLine: number, originalColumn: number, nameIndex: number) => void): void;
2
- //# sourceMappingURL=readMappings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readMappings.d.ts","sourceRoot":"","sources":["../../../plugin/source-map/readMappings.ts"],"names":[],"mappings":"AACA,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,CACT,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,KACd,IAAI,QAuLV"}
@@ -1,200 +0,0 @@
1
- // alternative to webpack-sources/lib/helpers/readMappings.js
2
- export function readMappings(mappings, onMapping) {
3
- let generatedLine = 1;
4
- let generatedColumn = 0;
5
- let sourceIndex = 0;
6
- let originalLine = 1;
7
- let originalColumn = 0;
8
- let nameIndex = 0;
9
- let i = 0;
10
- while (i < mappings.length) {
11
- if (mappings[i] === ";") {
12
- generatedLine++;
13
- generatedColumn = 0;
14
- i++;
15
- }
16
- else if (mappings[i] === ",") {
17
- i++;
18
- }
19
- else {
20
- let value = 0;
21
- let shift = 0;
22
- let hasMore = true;
23
- while (hasMore) {
24
- const c = mappings.charCodeAt(i++);
25
- if (c >= 65 && c <= 90) {
26
- value += (c - 65) << shift;
27
- }
28
- else if (c >= 97 && c <= 122) {
29
- value += (c - 97) << shift;
30
- }
31
- else if (c >= 48 && c <= 57) {
32
- value += (c - 48 + 26) << shift;
33
- }
34
- else if (c === 43) {
35
- value += 62 << shift;
36
- }
37
- else if (c === 47) {
38
- value += 63 << shift;
39
- }
40
- else {
41
- hasMore = false;
42
- }
43
- if (hasMore) {
44
- shift += 6;
45
- }
46
- }
47
- let isNegative = value & 1;
48
- value = value >> 1;
49
- if (isNegative) {
50
- value = -value;
51
- }
52
- generatedColumn += value;
53
- if (i < mappings.length && mappings[i] !== ";" && mappings[i] !== ",") {
54
- value = 0;
55
- shift = 0;
56
- hasMore = true;
57
- while (hasMore) {
58
- const c = mappings.charCodeAt(i++);
59
- if (c >= 65 && c <= 90) {
60
- value += (c - 65) << shift;
61
- }
62
- else if (c >= 97 && c <= 122) {
63
- value += (c - 97) << shift;
64
- }
65
- else if (c >= 48 && c <= 57) {
66
- value += (c - 48 + 26) << shift;
67
- }
68
- else if (c === 43) {
69
- value += 62 << shift;
70
- }
71
- else if (c === 47) {
72
- value += 63 << shift;
73
- }
74
- else {
75
- hasMore = false;
76
- }
77
- if (hasMore) {
78
- shift += 6;
79
- }
80
- }
81
- isNegative = value & 1;
82
- value = value >> 1;
83
- if (isNegative) {
84
- value = -value;
85
- }
86
- sourceIndex += value;
87
- if (i < mappings.length && mappings[i] !== ";" && mappings[i] !== ",") {
88
- value = 0;
89
- shift = 0;
90
- hasMore = true;
91
- while (hasMore) {
92
- const c = mappings.charCodeAt(i++);
93
- if (c >= 65 && c <= 90) {
94
- value += (c - 65) << shift;
95
- }
96
- else if (c >= 97 && c <= 122) {
97
- value += (c - 97) << shift;
98
- }
99
- else if (c >= 48 && c <= 57) {
100
- value += (c - 48 + 26) << shift;
101
- }
102
- else if (c === 43) {
103
- value += 62 << shift;
104
- }
105
- else if (c === 47) {
106
- value += 63 << shift;
107
- }
108
- else {
109
- hasMore = false;
110
- }
111
- if (hasMore) {
112
- shift += 6;
113
- }
114
- }
115
- isNegative = value & 1;
116
- value = value >> 1;
117
- if (isNegative) {
118
- value = -value;
119
- }
120
- originalLine += value;
121
- if (i < mappings.length &&
122
- mappings[i] !== ";" &&
123
- mappings[i] !== ",") {
124
- value = 0;
125
- shift = 0;
126
- hasMore = true;
127
- while (hasMore) {
128
- const c = mappings.charCodeAt(i++);
129
- if (c >= 65 && c <= 90) {
130
- value += (c - 65) << shift;
131
- }
132
- else if (c >= 97 && c <= 122) {
133
- value += (c - 97) << shift;
134
- }
135
- else if (c >= 48 && c <= 57) {
136
- value += (c - 48 + 26) << shift;
137
- }
138
- else if (c === 43) {
139
- value += 62 << shift;
140
- }
141
- else if (c === 47) {
142
- value += 63 << shift;
143
- }
144
- else {
145
- hasMore = false;
146
- }
147
- if (hasMore) {
148
- shift += 6;
149
- }
150
- }
151
- isNegative = value & 1;
152
- value = value >> 1;
153
- if (isNegative) {
154
- value = -value;
155
- }
156
- originalColumn += value;
157
- if (i < mappings.length &&
158
- mappings[i] !== ";" &&
159
- mappings[i] !== ",") {
160
- value = 0;
161
- shift = 0;
162
- hasMore = true;
163
- while (hasMore) {
164
- const c = mappings.charCodeAt(i++);
165
- if (c >= 65 && c <= 90) {
166
- value += (c - 65) << shift;
167
- }
168
- else if (c >= 97 && c <= 122) {
169
- value += (c - 97) << shift;
170
- }
171
- else if (c >= 48 && c <= 57) {
172
- value += (c - 48 + 26) << shift;
173
- }
174
- else if (c === 43) {
175
- value += 62 << shift;
176
- }
177
- else if (c === 47) {
178
- value += 63 << shift;
179
- }
180
- else {
181
- hasMore = false;
182
- }
183
- if (hasMore) {
184
- shift += 6;
185
- }
186
- }
187
- isNegative = value & 1;
188
- value = value >> 1;
189
- if (isNegative) {
190
- value = -value;
191
- }
192
- nameIndex += value;
193
- }
194
- }
195
- }
196
- }
197
- onMapping(generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex);
198
- }
199
- }
200
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=plugin.client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.client.d.ts","sourceRoot":"","sources":["../../../plugin/transformer/plugin.client.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sources":["../../../plugin/transformer/plugin.ts"],"sourcesContent":["import { getCondition } from '../config/getCondition.js';\n\nexport const { reactTransformPlugin } = await import(`./plugin.${getCondition('')}.js`);"],"names":[],"mappings":";;;;;;;;AAEa,MAAA,EAAE,sBAAyB,GAAA,MAAM,oCAAmC,kBAAA,MAAA,CAAA,MAAA,CAAA,EAAA,CAAA,GAAA,CAAA,SAAA,EAAA,YAAA,CAAA,EAAA,CAAA,CAAA,GAAA,CAAA,EAAA,CAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.server.js","sources":["../../../plugin/transformer/plugin.server.ts"],"sourcesContent":["import { resolveOptions } from \"../config/resolveOptions.js\";\nimport type {\n InlineCssOpt,\n PagePropOpt,\n ResolvedUserOptions,\n StreamPluginOptions,\n} from \"../types.js\";\nimport type { Manifest, Plugin } from \"vite\";\nimport { tryManifest } from \"../helpers/tryManifest.js\";\nimport { join } from \"node:path\";\nimport { setStashedResolve } from \"../helpers/moduleResolver.js\";\nimport { transformModuleIfNeeded } from \"../loader/transformModuleIfNeeded.js\";\nimport { logError } from \"../error/toError.js\";\n\n/**\n * Plugin for transforming React Client Components.\n *\n * Core responsibilities:\n * 1. Detects \"use client\" directives\n * 2. Transforms client components for RSC boundaries\n * 3. Adds client reference metadata for RSC\n *\n * When a component is marked with \"use client\", it:\n * - Gets transformed into a client reference\n * - Maintains module ID for RSC boundaries\n * - Preserves class/function behavior\n *\n * @example\n * ```ts\n * export default defineConfig({\n * plugins: [\n * viteReactClientTransformPlugin({\n * projectRoot: process.cwd(),\n * })\n * ]\n * });\n * ```\n */\n\nexport function reactTransformPlugin<\n T extends PagePropOpt = PagePropOpt,\n InlineCSS extends InlineCssOpt = InlineCssOpt\n>(options: StreamPluginOptions<T, InlineCSS>): Plugin {\n let userOptions: ResolvedUserOptions<T, InlineCSS>;\n\n const resolvedOptionsResult = resolveOptions(options);\n\n if (resolvedOptionsResult.type === \"error\") throw resolvedOptionsResult.error;\n\n userOptions = resolvedOptionsResult.userOptions;\n\n let staticManifest: Manifest = {};\n let isBuild = true;\n let isSSR = false;\n\n return {\n name: \"vite:react-server-transform\",\n enforce: \"post\", // Run after Vite's transforms\n async configResolved(config) {\n isBuild = config.command === \"build\";\n isSSR = config.build?.ssr === true;\n\n if (isBuild && isSSR) {\n const staticManifestResult = await tryManifest({\n root: userOptions.projectRoot,\n ssrManifest: false,\n outDir: join(userOptions.build.outDir, userOptions.build.static),\n manifestPath: config.build.manifest,\n });\n\n if (staticManifestResult.type === \"error\") {\n throw staticManifestResult.error;\n }\n if (staticManifestResult.type === \"success\") {\n staticManifest = staticManifestResult.manifest;\n }\n }\n },\n async resolveId(\n _id: string,\n importer: string | undefined,\n options: {\n attributes: Record<string, string>;\n custom?: any;\n ssr?: boolean;\n isEntry: boolean;\n }\n ) {\n if (!options?.ssr) {\n return null;\n }\n // Set stashedResolve before any transform operations\n setStashedResolve(async (specifier: string) => {\n try {\n const resolved = await this.resolve(specifier, importer, {\n custom: { conditions: [\"react-server\"] },\n });\n if (!resolved) return null;\n return { id: resolved.id };\n } catch (error) {\n logError(error, this.environment.logger);\n return null;\n }\n });\n return null; // Let Vite handle the resolution\n },\n async transform(code, id, options) {\n if (!options?.ssr || !userOptions.autoDiscover.modulePattern(id)) {\n return null;\n }\n const isServerFunctionCode = userOptions.autoDiscover.isServerFunctionCode(code);\n const isClientComponentCode = userOptions.autoDiscover.isClientComponentCode(code);\n if(!isServerFunctionCode && !isClientComponentCode) {\n return null;\n }\n let [, moduleID] = userOptions.normalizer(id);\n if (isBuild) {\n if (staticManifest) {\n if (moduleID in staticManifest) {\n moduleID = staticManifest[moduleID].file;\n }\n } else {\n throw new Error(`Static manifest not found during dev build.`);\n }\n }\n let finalID = userOptions.moduleID(moduleID);\n // Always transform in server context\n const transformed = transformModuleIfNeeded(\n code,\n finalID,\n isServerFunctionCode,\n isClientComponentCode,\n true\n );\n if (userOptions.verbose)\n if (transformed !== code) {\n if (id !== finalID) {\n this.environment.logger.info(\n \"[react-server-transform] \" +\n id.split(\"/\").pop() +\n \" -> \" +\n finalID\n );\n } else {\n this.environment.logger.info(\n \"[react-server-transform] \" +\n id.split(\"/\").pop() +\n (code.startsWith('\"use client\"') ? \" (client)\" : \"\")\n );\n }\n this.environment.logger.info(\n \"[react-server-transform] \" + transformed\n );\n }\n if (!transformed) {\n return {\n code: \"\",\n map: null,\n };\n }\n\n return {\n code: transformed,\n map: null,\n };\n },\n };\n}\n"],"names":["options"],"mappings":";;;;;;;;;;AAuCO,SAAS,qBAGd,OAAoD,EAAA;AACpD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,WACK,MAAA;AACL,YAAA,IAAA,CAAK,YAAY,MAAO,CAAA,IAAA;AAAA,cACtB,2BAAA,GACE,EAAG,CAAA,KAAA,CAAM,GAAG,CAAA,CAAE,GAAI,EAAA,IACjB,IAAK,CAAA,UAAA,CAAW,cAAc,CAAA,GAAI,WAAc,GAAA,EAAA;AAAA,aACrD;AAAA;AAEF,UAAA,IAAA,CAAK,YAAY,MAAO,CAAA,IAAA;AAAA,YACtB,2BAA8B,GAAA;AAAA,WAChC;AAAA;AACF;AACF,MAAA,IAAI,CAAC,WAAa,EAAA;AAChB,QAAO,OAAA;AAAA,UACL,IAAM,EAAA,EAAA;AAAA,UACN,GAAK,EAAA;AAAA,SACP;AAAA;AAGF,MAAO,OAAA;AAAA,QACL,IAAM,EAAA,WAAA;AAAA,QACN,GAAK,EAAA;AAAA,OACP;AAAA;AACF,GACF;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"callServer.js","sources":["../../../plugin/utils/callServer.ts"],"sourcesContent":["import { env } from \"./env.js\";\nimport { createCallServer } from \"./createCallServer.js\";\n\nexport const callServer = createCallServer(env?.BASE_URL ?? \"/\");\n"],"names":[],"mappings":";;;;;;;;AAGO,MAAM,UAAa,GAAA,gBAAA,CAAiB,GAAK,EAAA,QAAA,IAAY,GAAG;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createCallServer.js","sources":["../../../plugin/utils/createCallServer.ts"],"sourcesContent":["import {\n createFromFetch,\n encodeReply,\n} from \"react-server-dom-esm/client.browser\";\n\ninterface ServerActionResponse {\n returnValue: unknown;\n type: 'server-action-response';\n error?: string;\n}\n\nexport const createCallServer = (moduleBaseURL: string) => {\n const callServer = async (id: string, args: unknown[]): Promise<unknown> => {\n const response = await createFromFetch(\n fetch(moduleBaseURL, {\n method: \"POST\",\n body: await encodeReply({\n id,\n args\n }),\n headers: {\n Accept: \"text/x-component\",\n },\n }),\n { callServer, moduleBaseURL }\n );\n \n // Check if this is a server action response\n if (response && typeof response === 'object' && 'returnValue' in response) {\n const serverResponse = response as ServerActionResponse;\n if (serverResponse.error) {\n throw new Error(serverResponse.error);\n }\n return serverResponse.returnValue;\n }\n \n return response;\n };\n return callServer;\n};\n"],"names":[],"mappings":";;;;;;;AAWa,MAAA,gBAAA,GAAmB,CAAC,aAA0B,KAAA;AACzD,EAAM,MAAA,UAAA,GAAa,OAAO,EAAA,EAAY,IAAsC,KAAA;AAC1E,IAAA,MAAM,WAAW,MAAM,eAAA;AAAA,MACrB,MAAM,aAAe,EAAA;AAAA,QACnB,MAAQ,EAAA,MAAA;AAAA,QACR,IAAA,EAAM,MAAM,WAAY,CAAA;AAAA,UACtB,EAAA;AAAA,UACA;AAAA,SACD,CAAA;AAAA,QACD,OAAS,EAAA;AAAA,UACP,MAAQ,EAAA;AAAA;AACV,OACD,CAAA;AAAA,MACD,EAAE,YAAY,aAAc;AAAA,KAC9B;AAGA,IAAA,IAAI,QAAY,IAAA,OAAO,QAAa,KAAA,QAAA,IAAY,iBAAiB,QAAU,EAAA;AACzE,MAAA,MAAM,cAAiB,GAAA,QAAA;AACvB,MAAA,IAAI,eAAe,KAAO,EAAA;AACxB,QAAM,MAAA,IAAI,KAAM,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA;AAEtC,MAAA,OAAO,cAAe,CAAA,WAAA;AAAA;AAGxB,IAAO,OAAA,QAAA;AAAA,GACT;AACA,EAAO,OAAA,UAAA;AACT;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createReactFetcher.js","sources":["../../../plugin/utils/createReactFetcher.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n// @ts-ignore\nimport { createFromFetch } from \"react-server-dom-esm/client.browser\";\nimport { createCallServer } from \"./createCallServer.js\";\nimport { env } from \"./env.js\";\nimport { createPageURL } from \"./urls.js\";\n\nexport function createReactFetcher({\n moduleBaseURL = env.BASE_URL,\n publicOrigin = env.PUBLIC_ORIGIN,\n url = window.location.pathname,\n indexRSC = \"index.rsc\",\n headers = {\n Accept: \"text/x-component\",\n },\n}: {\n url?: string;\n moduleBaseURL?: string;\n publicOrigin?: string;\n indexRSC?: string;\n headers?: HeadersInit;\n} = {}): Promise<ReactNode> {\n const parsedURL = createPageURL(moduleBaseURL, publicOrigin, env.DEV)(url, indexRSC);\n return createFromFetch(\n fetch(parsedURL.indexRSC, {\n headers: headers,\n }),\n {\n callServer: createCallServer(parsedURL.moduleBaseURL),\n moduleBaseURL: parsedURL.moduleBaseURL,\n }\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAOO,SAAS,kBAAmB,CAAA;AAAA,EACjC,gBAAgB,GAAI,CAAA,QAAA;AAAA,EACpB,eAAe,GAAI,CAAA,aAAA;AAAA,EACnB,GAAA,GAAM,OAAO,QAAS,CAAA,QAAA;AAAA,EACtB,QAAW,GAAA,WAAA;AAAA,EACX,OAAU,GAAA;AAAA,IACR,MAAQ,EAAA;AAAA;AAEZ,CAAA,GAMI,EAAwB,EAAA;AAC1B,EAAM,MAAA,SAAA,GAAY,cAAc,aAAe,EAAA,YAAA,EAAc,IAAI,GAAG,CAAA,CAAE,KAAK,QAAQ,CAAA;AACnF,EAAO,OAAA,eAAA;AAAA,IACL,KAAA,CAAM,UAAU,QAAU,EAAA;AAAA,MACxB;AAAA,KACD,CAAA;AAAA,IACD;AAAA,MACE,UAAA,EAAY,gBAAiB,CAAA,SAAA,CAAU,aAAa,CAAA;AAAA,MACpD,eAAe,SAAU,CAAA;AAAA;AAC3B,GACF;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/nico/code/vite-react-stream/plugin/utils/envUrls.node.ts"],"sourcesContent":["import { createAbsoluteURL, createBaseURL, createPageURL } from \"./urls.js\";\n\nexport const absoluteURL = (path: string) =>\n createAbsoluteURL(\n process.env.VITE_BASE_URL ?? \"/\",\n process.env.VITE_PUBLIC_ORIGIN ?? \"\"\n )(path);\n\nexport const baseURL = (path: string) =>\n createBaseURL(process.env.VITE_BASE_URL ?? \"/\")(path);\n\nexport const pageURL = (path: string) =>\n createPageURL(\n process.env.VITE_BASE_URL ?? \"/\",\n process.env.VITE_PUBLIC_ORIGIN ?? \"\",\n typeof process.env.VITE_DEV === \"string\"\n ? process.env.VITE_DEV === \"true\" || process.env.VITE_DEV === \"1\"\n : process.env[\"NODE_ENV\"] === \"development\"\n )(path);\n"],"mappings":"AAAA,SAAS,mBAAmB,eAAe,qBAAqB;AAEzD,MAAM,cAAc,CAAC,SAC1B;AAAA,EACE,QAAQ,IAAI,iBAAiB;AAAA,EAC7B,QAAQ,IAAI,sBAAsB;AACpC,EAAE,IAAI;AAED,MAAM,UAAU,CAAC,SACtB,cAAc,QAAQ,IAAI,iBAAiB,GAAG,EAAE,IAAI;AAE/C,MAAM,UAAU,CAAC,SACtB;AAAA,EACE,QAAQ,IAAI,iBAAiB;AAAA,EAC7B,QAAQ,IAAI,sBAAsB;AAAA,EAClC,OAAO,QAAQ,IAAI,aAAa,WAC5B,QAAQ,IAAI,aAAa,UAAU,QAAQ,IAAI,aAAa,MAC5D,QAAQ,IAAI,UAAU,MAAM;AAClC,EAAE,IAAI;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/nico/code/vite-react-stream/plugin/utils/envUrls.node.ts"],"sourcesContent":["import { createAbsoluteURL, createBaseURL, createPageURL } from \"./urls.js\";\n\nexport const absoluteURL = (path: string) =>\n createAbsoluteURL(\n process.env.VITE_BASE_URL ?? \"/\",\n process.env.VITE_PUBLIC_ORIGIN ?? \"\"\n )(path);\n\nexport const baseURL = (path: string) =>\n createBaseURL(process.env.VITE_BASE_URL ?? \"/\")(path);\n\nexport const pageURL = (path: string) =>\n createPageURL(\n process.env.VITE_BASE_URL ?? \"/\",\n process.env.VITE_PUBLIC_ORIGIN ?? \"\",\n typeof process.env.VITE_DEV === \"string\"\n ? process.env.VITE_DEV === \"true\" || process.env.VITE_DEV === \"1\"\n : process.env[\"NODE_ENV\"] === \"development\"\n )(path);\n"],"mappings":"AAAA,SAAS,mBAAmB,eAAe,qBAAqB;AAEzD,MAAM,cAAc,CAAC,SAC1B;AAAA,EACE,QAAQ,IAAI,iBAAiB;AAAA,EAC7B,QAAQ,IAAI,sBAAsB;AACpC,EAAE,IAAI;AAED,MAAM,UAAU,CAAC,SACtB,cAAc,QAAQ,IAAI,iBAAiB,GAAG,EAAE,IAAI;AAE/C,MAAM,UAAU,CAAC,SACtB;AAAA,EACE,QAAQ,IAAI,iBAAiB;AAAA,EAC7B,QAAQ,IAAI,sBAAsB;AAAA,EAClC,OAAO,QAAQ,IAAI,aAAa,WAC5B,QAAQ,IAAI,aAAa,UAAU,QAAQ,IAAI,aAAa,MAC5D,QAAQ,IAAI,UAAU,MAAM;AAClC,EAAE,IAAI;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"urls.js","sources":["../../../plugin/utils/urls.ts"],"sourcesContent":["\n/**\n * # createAbsoluteUrl\n *\n * This function takes a baseURL and a public origin and returns a function that takes a path and returns the path with the baseURL attached to it.\n *\n * @example\n * ```ts\n * const absoluteURL = createAbsoluteURL(\"/mmc\", \"https://bidoof.com\")\n * console.log(absoluteURL(\"/test\")) // \"https://bidoof.com/mmc/test\"\n * ```\n *\n * @example\n * ```ts\n * const absoluteURL = createAbsoluteURL(\"/mmc\", \"https://bidoof.com\")\n * console.log(absoluteURL(\"/test\")) // \"https://bidoof.com/mmc/test\"\n * ```\n *\n * This can replace code like `${process.env.VITE_PUBLIC_ORIGIN}/test` with `absoluteUrl('/test')`, and you can be sure that it will work after\n * changing the plugin settings.\n */\nexport const createAbsoluteURL = (\n withBaseURL: string,\n withPublicOrigin: string\n) => {\n const baseURL = createBaseURL(withBaseURL);\n if (withPublicOrigin === \"\" || typeof withPublicOrigin !== \"string\")\n return baseURL;\n return (path: string) => {\n const pathWithBaseURL = baseURL(path);\n try {\n return new URL(pathWithBaseURL, withPublicOrigin).toString();\n } catch (error) {\n return withPublicOrigin + pathWithBaseURL;\n }\n };\n};\n\n/**\n * # createBaseURL\n *\n * This function takes a baseURL and returns a function that takes a path and returns the path with the baseURL attached to it.\n *\n * @example\n * ```ts\n * const baseURL = createBaseURL(\"/mmc\")\n * console.log(baseURL(\"/test\")) // \"/mmc/test\"\n * ```\n *\n * @example\n * ```ts\n * const baseURL = createBaseURL(\"/mmc/\")\n * console.log(baseURL(\"/test\")) // \"/mmc/test\"\n * ```\n *\n * This can replace code like `${import.meta.env.test` with `baseURL(path)`, and you can be sure that it will work after\n * changing the plugin settings.\n *\n * Path handling logic:\n * 1. For baseURL ending with \"/\":\n * - If path starts with \"/\", slice off the leading slash to avoid double slashes\n * - If path doesn't start with \"/\", keep it as is\n *\n * 2. For baseURL not ending with \"/\":\n * - If path starts with \"/\", directly concatenate with baseURL\n * - If path doesn't start with \"/\", add a slash between baseURL and path\n *\n * baseURL \"src\" + path \"src/test\" -> should not concatenate to src/src/test\n * baseURL \"/\" + path \"https://bidoof.com\" -> should not concatenate to /https://bidoof.com\"\n */\nexport const createBaseURL = (withBaseURL: string) => {\n if (withBaseURL.endsWith(\"/\")) {\n return (path: string) => {\n if (path === \"\") return withBaseURL;\n if (path.startsWith(withBaseURL) || isAbsoluteURL(path)) return path;\n return `${withBaseURL}${removeLeadingSlash(path)}`;\n };\n } else {\n return (path: string) => {\n if (path === \"\") return withBaseURL;\n if (isAbsoluteURL(path)) return path;\n if (path.startsWith(\"/\")) return withBaseURL + path;\n if (path.startsWith(withBaseURL)) return path;\n return `${withBaseURL}/${path}`;\n };\n }\n};\n\n/** Remove a single trailing slash from the URL if it ends with one */\nexport const removeTrailingSlash = (url: string) =>\n url.endsWith(\"/\") ? url.slice(0, -1) : url;\n\n/** Add a single trailing slash to the URL if it doesn't end with one */\nexport const addTrailingSlash = (url: string) =>\n url.endsWith(\"/\") ? url : `${url}/`;\n\nexport const removeLeadingSlash = (url: string) =>\n url.startsWith(\"/\") ? url.slice(1) : url;\n\nexport const addLeadingSlash = (url: string) =>\n url.startsWith(\"/\") ? url : `/${url}`;\n\nexport const isBlankRegex = /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\\/\\//;\nexport const isAbsoluteURL = (url: string) =>\n isBlankRegex.test(url) || url.startsWith(\"//\");\n\n\nexport const folderName = (path: string, withBaseURL: string) => {\n const baseURL = createBaseURL(withBaseURL);\n return baseURL(path.replace(/\\[index.(html?|rsc|HTML?)]$/, \"\"));\n}\n\n/**\n * # createPageURL\n *\n * This function takes a baseURL, public origin and a optional normalizer function that mirrors the baseURL's format.\n * If baseURL ends with a slash, we continue it using the URL itself (must end with a slash)\n *\n * - `indexRSC`: The path to the index.rsc file\n * - `moduleBaseURL`: The baseURL to use for the module\n *\n * These can be passed in directly to the createReactFetcher and also determine the defaults when no input are provided.\n *\n * @example\n * ```ts\n * import { createFromFetch } from \"react-server-dom-esm/client.browser\";\n * const parsedURL = pageURL(window.location.pathname ?? \"/\");\n * const data = createFromFetch(\n * fetch(parsedURL.indexRSC, {\n * headers: {\n * Accept: \"text/x-component\",\n * }\n * }),\n * {\n * callServer: callServer,\n * moduleBaseURL: parsedURL.moduleBaseURL,\n * }\n * );\n * ```\n *\n * The moduleBasePath being set at the config level as \"/\",\n * then we pass it to create a stream `renderToPipeableStream(elements, moduleBasePath)`, and we see\n * ```text\n * 2:I[\"src/components/Clickable.client-Dx9diOqr.js\",\"ClientClickable\"]\n * ```\n *\n */\nexport const createPageURL = (\n withBaseURL: string,\n withPublicOrigin: string,\n isDev = false,\n normalizer = !withBaseURL.endsWith(\"/\")\n ? removeTrailingSlash\n : addTrailingSlash,\n) => {\n return (to: string, fileName: string = \"index.rsc\") => {\n try {\n // Create the base URL first\n const folderName = addTrailingSlash(\n to.replace(/\\[index.(html?|rsc|HTML?)]$/, \"\")\n );\n const baseURL = createBaseURL(withBaseURL);\n const rscPath = baseURL(folderName) + fileName;\n // Create moduleBaseURL and normalize it to match input format\n const moduleBaseURL = parseURL(withBaseURL, withPublicOrigin);\n if (moduleBaseURL.type === \"error\") {\n throw moduleBaseURL.error;\n }\n const indexRSC = parseURL(rscPath, withPublicOrigin);\n if (indexRSC.type === \"error\") {\n throw indexRSC.error;\n }\n return {\n indexRSC: indexRSC.url.toString(),\n moduleBaseURL: normalizer(moduleBaseURL.url.toString()),\n };\n } catch (error) {\n if (isDev) console.error(\"Error parsing pageURL\", error);\n return {\n indexRSC: withBaseURL + \"index.rsc\",\n moduleBaseURL: withBaseURL,\n };\n }\n };\n};\n\n/**\n * # moduleBaseURL\n *\n * This function takes a baseURL, public origin and a optional normalizer function that mirrors the baseURL's format.\n *\n * @example\n * ```ts\n * const moduleBaseURL = parseURL(\"/mmc\", \"https://bidoof.com\")\n * if(moduleBaseURL.type === \"error\") {\n * console.error(moduleBaseURL.error)\n * } else {\n * console.log(moduleBaseURL.url)\n * }\n * ```\n *\n **/\nexport const parseURL = (\n url: string,\n base: string\n):\n | { type: \"success\"; url: URL; error?: never; base?: never }\n | { type: \"error\"; url: string; base: string; error: Error } => {\n try {\n return {\n type: \"success\",\n url: new URL(url, base),\n };\n } catch (error) {\n return { type: \"error\", url: url, base: base, error: error as Error };\n }\n};\n"],"names":["folderName"],"mappings":";;;;;AAqBa,MAAA,iBAAA,GAAoB,CAC/B,WAAA,EACA,gBACG,KAAA;AACH,EAAM,MAAA,OAAA,GAAU,cAAc,WAAW,CAAA;AACzC,EAAI,IAAA,gBAAA,KAAqB,EAAM,IAAA,OAAO,gBAAqB,KAAA,QAAA;AACzD,IAAO,OAAA,OAAA;AACT,EAAA,OAAO,CAAC,IAAiB,KAAA;AACvB,IAAM,MAAA,eAAA,GAAkB,QAAQ,IAAI,CAAA;AACpC,IAAI,IAAA;AACF,MAAA,OAAO,IAAI,GAAA,CAAI,eAAiB,EAAA,gBAAgB,EAAE,QAAS,EAAA;AAAA,aACpD,KAAO,EAAA;AACd,MAAA,OAAO,gBAAmB,GAAA,eAAA;AAAA;AAC5B,GACF;AACF;AAkCa,MAAA,aAAA,GAAgB,CAAC,WAAwB,KAAA;AACpD,EAAI,IAAA,WAAA,CAAY,QAAS,CAAA,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A,GAAA,CAAI,UAAU;AAAA,OACxD;AAAA,aACO,KAAO,EAAA;AACd,MAAA,IAAI,KAAO,EAAA,OAAA,CAAQ,KAAM,CAAA,uBAAA,EAAyB,KAAK,CAAA;AACvD,MAAO,OAAA;AAAA,QACL,UAAU,WAAc,GAAA,WAAA;AAAA,QACxB,aAAe,EAAA;AAAA,OACjB;AAAA;AACF,GACF;AACF;AAkBa,MAAA,QAAA,GAAW,CACtB,GAAA,EACA,IAGgE,KAAA;AAChE,EAAI,IAAA;AACF,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,SAAA;AAAA,MACN,GAAK,EAAA,IAAI,GAAI,CAAA,GAAA,EAAK,IAAI;AAAA,KACxB;AAAA,WACO,KAAO,EAAA;AACd,IAAA,OAAO,EAAE,IAAA,EAAM,OAAS,EAAA,GAAA,EAAU,MAAY,KAAsB,EAAA;AAAA;AAExE;;;;"}
@@ -1,11 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- export { createReactFetcher } from './utils/createReactFetcher.js';
7
- export { callServer } from './utils/callServer.js';
8
- export { addLeadingSlash, addTrailingSlash, createAbsoluteURL, createBaseURL, createPageURL, folderName, isAbsoluteURL, isBlankRegex, parseURL, removeLeadingSlash, removeTrailingSlash } from './utils/urls.js';
9
- export { env } from './utils/env.js';
10
- export { createCallServer } from './utils/createCallServer.js';
11
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vendor.client.js","sources":["../../../plugin/vendor/vendor.client.ts"],"sourcesContent":["import { workerData } from \"node:worker_threads\";\nimport { createRequire } from \"node:module\";\nimport { join } from \"node:path\";\n\nconst projectRoot = workerData?.projectRoot || process.cwd();\nconst nodeRequire = createRequire(join(projectRoot, \"package.json\"));\n\n// Import ReactDOM from the project's node_modules\nconst ReactDOMServer = nodeRequire(\"react-dom/server\");\nconst ReactDOMClient = nodeRequire(\"react-server-dom-esm/client\");\nconst React = nodeRequire(\"react\");\n\nexport { ReactDOMServer, React, ReactDOMClient };\n"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,WAAc,GAAA,UAAA,EAAY,WAAe,IAAA,OAAA,CAAQ,GAAI,EAAA;AAC3D,MAAM,WAAc,GAAA,aAAA,CAAc,IAAK,CAAA,WAAA,EAAa,cAAc,CAAC,CAAA;AAG7D,MAAA,cAAA,GAAiB,YAAY,kBAAkB;AAC/C,MAAA,cAAA,GAAiB,YAAY,6BAA6B;AAClD,YAAY,OAAO;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vendor.js","sources":["../../../plugin/vendor/vendor.ts"],"sourcesContent":["import { getCondition } from '../config/getCondition.js';\n\nexport const {\n React,\n ReactDOMServer,\n} = await import(`./vendor.${getCondition('')}.js`);"],"names":[],"mappings":";;;;;;;;AAEa,MAAA;AAAA,EACT,KAAA;AAAA,EACA;AACJ,CAAA,GAAI,MAAM,oCAAmC,kBAAA,MAAA,CAAA,MAAA,CAAA,EAAA,CAAA,GAAA,CAAA,SAAA,EAAA,YAAA,CAAA,EAAA,CAAA,CAAA,GAAA,CAAA,EAAA,CAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vendor.server.js","sources":["../../../plugin/vendor/vendor.server.ts"],"sourcesContent":["import { workerData } from \"node:worker_threads\";\nimport { createRequire } from \"node:module\";\nimport { join } from \"node:path\";\n\nconst projectRoot = workerData?.projectRoot || process.env[\"npm_config_local_prefix\"] || process.cwd();\nconst nodeRequire = createRequire(join(projectRoot, \"package.json\"));\n\n// Import ReactDOM from the project's node_modules\nconst ReactDOMServer = nodeRequire(\"react-server-dom-esm/server.node\");\nconst React = nodeRequire(\"react\");\n\nexport { ReactDOMServer, React };\n"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,WAAA,GAAc,YAAY,WAAe,IAAA,OAAA,CAAQ,IAAI,yBAAyB,CAAA,IAAK,QAAQ,GAAI,EAAA;AACrG,MAAM,WAAc,GAAA,aAAA,CAAc,IAAK,CAAA,WAAA,EAAa,cAAc,CAAC,CAAA;AAG7D,MAAA,cAAA,GAAiB,YAAY,kCAAkC;AAC/D,MAAA,KAAA,GAAQ,YAAY,OAAO;;;;"}
@@ -1,7 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- export { React, ReactDOMServer } from './vendor/vendor.js';
7
- //# sourceMappingURL=vendor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vendor.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createWorker.js","sources":["../../../plugin/worker/createWorker.ts"],"sourcesContent":["import {\n Worker,\n type ResourceLimits,\n type TransferListItem,\n} from \"node:worker_threads\";\nimport { getMode, getNodePath } from \"../config/getPaths.js\";\nimport { getCondition } from \"../config/getCondition.js\";\nimport { join } from \"node:path\";\nimport { pluginRoot } from \"../root.js\";\nimport * as React from \"react\";\nimport { DEFAULT_CONFIG } from \"../config/defaults.js\";\nimport { createLogger, type Logger } from \"vite\";\nimport type { HtmlWorkerOutputMessage } from \"./types.js\";\nimport type { RscWorkerOutputMessage } from \"./types.js\";\nimport { toError } from \"../error/toError.js\";\n\nexport type CreateWorkerOptions = {\n projectRoot?: string;\n currentCondition?: \"react-server\" | \"react-client\";\n nodePath?: string;\n nodeOptions?: string[];\n envPrefix?: string;\n mode?: \"production\" | \"development\";\n reverseCondition?: string;\n maxListeners?: number;\n workerPath?: string;\n resourceLimits?: ResourceLimits;\n typescript?: boolean;\n htmlChunkSize?: number; // Size of HTML chunks in bytes\n workerData?: any;\n transferList?: TransferListItem[];\n logger?: Logger;\n verbose?: boolean;\n};\n\ntype CreateWorkerSuccess = {\n type: \"success\";\n workerPath: string;\n worker: Worker;\n};\n\ntype CreateWorkerError = {\n type: \"error\";\n workerPath: string;\n error: Error;\n};\n\ntype CreateWorkerSkip = {\n type: \"skip\";\n reason: string;\n workerPath: string;\n};\n\nexport async function createWorker(\n options: CreateWorkerOptions\n): Promise<CreateWorkerSuccess | CreateWorkerError | CreateWorkerSkip> {\n const {\n projectRoot = process.cwd(),\n nodePath = getNodePath(projectRoot),\n currentCondition = getCondition(),\n envPrefix = DEFAULT_CONFIG.ENV_PREFIX,\n reverseCondition = currentCondition === \"react-server\"\n ? \"react-client\"\n : \"react-server\",\n maxListeners = 100,\n mode = getMode(),\n workerPath,\n resourceLimits = {\n maxOldGenerationSizeMb: 128,\n maxYoungGenerationSizeMb: 64,\n },\n htmlChunkSize = 8 * 1024,\n transferList = [],\n logger = createLogger(),\n verbose = false,\n } = options;\n const id = reverseCondition === \"react-server\" ? \"worker/rsc\" : \"worker/html\";\n let workerPathWithDefault =\n typeof workerPath === \"string\" ? workerPath : undefined;\n if (!workerPathWithDefault) {\n workerPathWithDefault = join(pluginRoot, id);\n }\n if (!workerPathWithDefault.startsWith(\"/\")) {\n workerPathWithDefault = join(\"./\", workerPathWithDefault);\n }\n // Ensure worker uses the same React version\n const workerData = {\n ...options.workerData,\n reactVersion: React.version,\n id: id,\n };\n\n try {\n // Ensure consistent NODE_ENV between main thread and worker\n const isTestEnv =\n process.env[\"VITEST\"] || process.env[\"NODE_ENV\"] === \"test\";\n const nodeEnv = isTestEnv ? \"test\" : mode;\n\n const env = {\n [envPrefix + \"DEV\"]: mode === \"development\" ? \"1\" : \"0\",\n [envPrefix + \"MODE\"]: mode,\n [envPrefix + \"PROD\"]: mode === \"production\" ? \"1\" : \"0\",\n [envPrefix + \"SSR\"]: \"true\",\n [envPrefix + \"BASE_URL\"]: options.workerData.userOptions.moduleBaseURL,\n [envPrefix + \"PUBLIC_ORIGIN\"]:\n options.workerData.userOptions.publicOrigin,\n NODE_ENV: nodeEnv,\n NODE_PATH: nodePath,\n NODE_OPTIONS: process.env[\"NODE_OPTIONS\"]?.includes(reverseCondition)\n ? process.env[\"NODE_OPTIONS\"]\n : process.env[\"NODE_OPTIONS\"]?.includes(currentCondition)\n ? process.env[\"NODE_OPTIONS\"]?.replace(\n currentCondition,\n reverseCondition\n )\n : `${\n process.env[\"NODE_OPTIONS\"] ?? \"\"\n } --conditions ${reverseCondition}`,\n HTML_CHUNK_SIZE: htmlChunkSize.toString(),\n };\n\n // Create worker with proper environment and loaders\n const worker = new Worker(workerPathWithDefault, {\n env,\n resourceLimits,\n workerData,\n transferList,\n });\n\n worker.setMaxListeners(maxListeners);\n\n // Wait for worker to be ready\n return await new Promise<CreateWorkerSuccess | CreateWorkerSkip>(\n (resolve, reject) => {\n const timeout = setTimeout(() => {\n reject({ type: \"error\", error: new Error(\"Worker ready timeout\") });\n }, 5000);\n const exitHandler = (code: number) => {\n clearTimeout(timeout);\n worker.removeListener(\"message\", messageHandler);\n worker.removeListener(\"exit\", exitHandler);\n if (code === 0) {\n resolve({\n type: \"skip\",\n reason: \"Worker exited with code 0\",\n workerPath: workerPathWithDefault,\n } satisfies CreateWorkerSkip);\n } else {\n const error = `[create:${id}] exited with code ${code}`;\n resolve({\n type: \"skip\",\n reason: error,\n workerPath: workerPathWithDefault,\n } satisfies CreateWorkerSkip);\n }\n };\n const messageHandler = (\n msg: HtmlWorkerOutputMessage | RscWorkerOutputMessage\n ) => {\n if (verbose) logger.info(`[create:${id}] Initial worker message ${msg.type}`);\n if (msg.type === \"READY\") {\n if (verbose) logger.info(`[create:${id}] Worker running for ${msg.env}`);\n clearTimeout(timeout);\n worker.removeListener(\"message\", messageHandler);\n worker.removeListener(\"exit\", exitHandler);\n if (msg.env !== nodeEnv) {\n if (verbose) logger.info(`[create:${id}] Worker environment mismatch.`);\n reject({\n type: \"error\",\n error: new Error(\n `Worker environment mismatch: ${msg.env} !== ${nodeEnv}`\n ),\n workerPath: workerPathWithDefault,\n } satisfies CreateWorkerError);\n }\n resolve({\n type: \"success\",\n worker,\n workerPath: workerPathWithDefault,\n } satisfies CreateWorkerSuccess);\n }\n };\n worker.once(\"message\", messageHandler);\n worker.once(\"exit\", exitHandler);\n }\n );\n } catch (error) {\n return {\n type: \"error\",\n error: toError(error),\n workerPath: workerPathWithDefault,\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqDA,eAAsB,aACpB,OACqE,EAAA;AACrE,EAAM,MAAA;AAAA,IACJ,WAAA,GAAc,QAAQ,GAAI,EAAA;AAAA,IAC1B,QAAA,GAAW,YAAY,WAAW,CAAA;AAAA,IAClC,mBAAmB,YAAa,EAAA;AAAA,IAChC,YAAY,cAAe,CAAA,UAAA;AAAA,IAC3B,gBAAA,GAAmB,gBAAqB,KAAA,cAAA,GACpC,cACA,GAAA,cAAA;AAAA,IACJ,YAAe,GAAA,GAAA;AAAA,IACf,OAAO,OAAQ,EAAA;AAAA,IACf,UAAA;AAAA,IACA,cAAiB,GAAA;AAAA,MACf,sBAAwB,EAAA,GAAA;AAAA,MACxB,wBAA0B,EAAA;AAAA,KAC5B;AAAA,IACA,gBAAgB,CAAI,GAAA,IAAA;AAAA,IACpB,eAAe,EAAC;AAAA,IAChB,SAAS,YAAa,EAAA;AAAA,IACtB,OAAU,GAAA;AAAA,GACR,GAAA,OAAA;AACJ,EAAM,MAAA,EAAA,GAAK,gBAAqB,KAAA,cAAA,GAAiB,YAAe,GAAA,aAAA;AAChE,EAAA,IAAI,qBACF,GAAA,OAAO,UAAe,KAAA,QAAA,GAAW,UAAa,GAAA,MAAA;AAChD,EAAA,IAAI,CAAC,qBAAuB,EAAA;AAC1B,IAAwB,qBAAA,GAAA,IAAA,CAAK,YAAY,EAAE,CAAA;AAAA;AAE7C,EAAA,IAAI,CAAC,qBAAA,CAAsB,UAAW,CAAA,GAAG,CAAG,EAAA;AAC1C,IAAwB,qBAAA,GAAA,IAAA,CAAK,MAAM,qBAAqB,CAAA;AAAA;AAG1D,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB,GAAG,OAAQ,CAAA,UAAA;AAAA,I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AAA,QAAA,EAAW,EAAE,CAAwB,qBAAA,EAAA,GAAA,CAAI,GAAG,CAAE,CAAA,CAAA;AACvE,YAAA,YAAA,CAAa,OAAO,CAAA;AACpB,YAAO,MAAA,CAAA,cAAA,CAAe,WAAW,cAAc,CAAA;AAC/C,YAAO,MAAA,CAAA,cAAA,CAAe,QAAQ,WAAW,CAAA;AACzC,YAAI,IAAA,GAAA,CAAI,QAAQ,OAAS,EAAA;AACvB,cAAA,IAAI,OAAS,EAAA,MAAA,CAAO,IAAK,CAAA,CAAA,QAAA,EAAW,EAAE,CAAgC,8BAAA,CAAA,CAAA;AACtE,cAAO,MAAA,CAAA;AAAA,gBACL,IAAM,EAAA,OAAA;AAAA,gBACN,OAAO,IAAI,KAAA;AAAA,kBACT,CAAgC,6BAAA,EAAA,GAAA,CAAI,GAAG,CAAA,KAAA,EAAQ,OAAO,CAAA;AAAA,iBACxD;AAAA,gBACA,UAAY,EAAA;AAAA,eACe,CAAA;AAAA;AAE/B,YAAQ,OAAA,CAAA;AAAA,cACN,IAAM,EAAA,SAAA;AAAA,cACN,MAAA;AAAA,cACA,UAAY,EAAA;AAAA,aACiB,CAAA;AAAA;AACjC,SACF;AACA,QAAO,MAAA,CAAA,IAAA,CAAK,WAAW,cAAc,CAAA;AACrC,QAAO,MAAA,CAAA,IAAA,CAAK,QAAQ,WAAW,CAAA;AAAA;AACjC,KACF;AAAA,WACO,KAAO,EAAA;AACd,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,OAAA;AAAA,MACN,KAAA,EAAO,QAAQ,KAAK,CAAA;AAAA,MACpB,UAAY,EAAA;AAAA,KACd;AAAA;AAEJ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createHtmlWorkerRenderState.js","sources":["../../../../plugin/worker/html/createHtmlWorkerRenderState.tsx"],"sourcesContent":["import type { HtmlWorkerRenderState } from \"./types.js\";\nimport { PassThrough } from \"stream\";\nimport { workerData, parentPort } from \"node:worker_threads\";\nimport type { SerializeableRenderToPipeableStreamOptions } from \"../types.js\";\nimport { type ErrorInfo } from \"react\";\nimport { Transform } from \"node:stream\";\nimport type { HtmlWorkerOutputMessage } from \"../types.js\";\nimport { join } from \"node:path\";\nimport type { StreamMetrics } from \"../../types.js\";\nimport { ReactDOMServer, ReactDOMClient } from \"../../vendor/vendor.client.js\";\n\ntype CallServerCallback = (id: string, args: unknown[]) => Promise<unknown>;\n\nconst createMetrics = (): StreamMetrics => {\n return {\n chunks: 0,\n bytes: 0,\n backpressureCount: 0,\n drainCount: 0,\n errorCount: 0,\n duration: 0,\n startTime: 0,\n };\n};\nexport function createHtmlWorkerRenderState(\n {\n projectRoot = workerData.userOptions.projectRoot,\n moduleRootPath = workerData.userOptions.moduleRootPath,\n moduleBaseURL = workerData.userOptions.moduleBaseURL,\n pipeableStreamOptions = workerData.userOptions.pipeableStreamOptions,\n id = workerData.id,\n }: {\n projectRoot?: string;\n moduleRootPath?: string;\n moduleBaseURL?: string;\n pipeableStreamOptions?: SerializeableRenderToPipeableStreamOptions;\n id?: string;\n },\n sendMessage: (msg: HtmlWorkerOutputMessage) => void,\n rscStream = new PassThrough()\n): HtmlWorkerRenderState {\n if (typeof moduleRootPath !== \"string\") {\n throw new Error(\"moduleRootPath is required\");\n } else if (!moduleRootPath.startsWith(projectRoot)) {\n moduleRootPath = join(projectRoot, moduleRootPath);\n }\n if(!moduleRootPath.endsWith('/')) {\n moduleRootPath = moduleRootPath + '/';\n }\n const elements = ReactDOMClient.createFromNodeStream(rscStream, moduleRootPath, moduleBaseURL, {\n callServer: (async (id: string, args: unknown[]) => {\n // Forward server action calls back to the main thread\n sendMessage({\n type: \"SERVER_ACTION\",\n id,\n args\n } as HtmlWorkerOutputMessage);\n console.log('[html-worker] callServer', id, args);\n // Wait for response\n return new Promise((resolve, reject) => {\n const handler = (msg: any) => {\n if (msg.type === \"SERVER_ACTION_RESPONSE\" && msg.id === id) {\n parentPort?.removeListener(\"message\", handler);\n if (msg.error) {\n reject(new Error(msg.error));\n } else {\n resolve(msg.result);\n }\n }\n };\n parentPort?.on(\"message\", handler);\n });\n }) as CallServerCallback\n });\n const metrics = createMetrics();\n const htmlTransform = new Transform({\n transform(chunk, encoding, callback) {\n metrics.chunks++;\n metrics.bytes += chunk.length;\n\n // Send HTML chunks\n sendMessage({\n type: \"HTML_CHUNK\",\n id: id,\n chunk: chunk,\n encoding,\n } satisfies HtmlWorkerOutputMessage);\n callback();\n },\n flush(callback) {\n sendMessage({\n type: \"HTML_COMPLETE\",\n id,\n success: true,\n metrics: metrics,\n } satisfies HtmlWorkerOutputMessage);\n callback();\n },\n })\n const stream = ReactDOMServer.renderToPipeableStream(elements, {\n ...pipeableStreamOptions,\n onAllReady: () => {\n rscStream.end();\n sendMessage({\n type: \"ALL_READY\",\n id,\n } satisfies HtmlWorkerOutputMessage);\n },\n onError: (error: unknown, errorInfo: ErrorInfo) => {\n sendMessage({\n type: \"ERROR\",\n id,\n error: error instanceof Error ? error : new Error(String(error)),\n errorInfo: errorInfo,\n });\n },\n onShellReady: () => {\n sendMessage({\n type: \"SHELL_READY\",\n id,\n });\n },\n onShellError: (error: unknown) => {\n sendMessage({\n type: \"SHELL_ERROR\",\n id,\n error: error instanceof Error ? error : new Error(String(error)),\n });\n },\n });\n stream.pipe(htmlTransform);\n return {\n rscStream: rscStream,\n metrics,\n isReady: false,\n htmlTransform: htmlTransform,\n stream: stream,\n };\n}\n"],"names":["id"],"mappings":";;;;;;;;;;;;AAaA,MAAM,gBAAgB,MAAqB;AACzC,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA,CAAA;AAAA,IACR,KAAO,EAAA,CAAA;AAAA,IACP,iBAAmB,EAAA,CAAA;AAAA,IACnB,UAAY,EAAA,CAAA;AAAA,IACZ,UAAY,EAAA,CAAA;AAAA,IACZ,QAAU,EAAA,CAAA;AAAA,IACV,SAAW,EAAA;AAAA,GACb;AACF,CAAA;AACO,SAAS,2BACd,CAAA;AAAA,EACE,WAAA,GAAc,WAAW,WAAY,CAAA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iB,KAAQ,GAAA,KAAA,GAAQ,IAAI,KAAM,CAAA,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,QAC/D;AAAA,OACD,CAAA;AAAA,KACH;AAAA,IACA,cAAc,MAAM;AAClB,MAAY,WAAA,CAAA;AAAA,QACV,IAAM,EAAA,aAAA;AAAA,QACN;AAAA,OACD,CAAA;AAAA,KACH;AAAA,IACA,YAAA,EAAc,CAAC,KAAmB,KAAA;AAChC,MAAY,WAAA,CAAA;AAAA,QACV,IAAM,EAAA,aAAA;AAAA,QACN,EAAA;AAAA,QACA,KAAA,EAAO,iBAAiB,KAAQ,GAAA,KAAA,GAAQ,IAAI,KAAM,CAAA,MAAA,CAAO,KAAK,CAAC;AAAA,OAChE,CAAA;AAAA;AACH,GACD,CAAA;AACD,EAAA,MAAA,CAAO,KAAK,aAAa,CAAA;AACzB,EAAO,OAAA;AAAA,IACL,SAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAS,EAAA,KAAA;AAAA,IACT,aAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"html-worker.development.js","sources":["../../../../plugin/worker/html/html-worker.development.tsx"],"sourcesContent":["import { messageHandler } from \"./messageHandler.js\";\nimport { parentPort, workerData } from \"node:worker_threads\";\nimport type { ReadyMessage } from \"../types.js\";\n\nconst verbose = workerData.verbose;\n\nfunction developmentMessageHandler(msg: any) {\n if (verbose) {\n if (\"chunk\" in msg) {\n let preview = Buffer.from(msg.chunk).toString(\"utf-8\");\n console.log(`[html-worker:${msg.type}] ${preview}`);\n } else {\n console.log(`[html-worker:${msg.type}] ${JSON.stringify(msg)}`);\n }\n }\n messageHandler(msg);\n}\n\n// Signal ready with environment\nparentPort?.on(\"message\", developmentMessageHandler);\nparentPort?.postMessage({\n type: \"READY\",\n id: \"html-worker\",\n env: process.env[\"NODE_ENV\"],\n pid: process.pid,\n} satisfies ReadyMessage);\n"],"names":[],"mappings":";;;;;;;;AAIA,MAAM,UAAU,UAAW,CAAA,OAAA;AAE3B,SAAS,0BAA0B,GAAU,EAAA;AAC3C,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,IAAI,WAAW,GAAK,EAAA;AAClB,MAAA,IAAI,UAAU,MAAO,CAAA,IAAA,CAAK,IAAI,KAAK,CAAA,CAAE,SAAS,OAAO,CAAA;AACrD,MAAA,OAAA,CAAQ,IAAI,CAAgB,aAAA,EAAA,GAAA,CAAI,IAAI,CAAA,EAAA,EAAK,OAAO,CAAE,CAAA,CAAA;AAAA,KAC7C,MAAA;AACL,MAAQ,OAAA,CAAA,GAAA,CAAI,gBAAgB,GAAI,CAAA,IAAI,KAAK,IAAK,CAAA,SAAA,CAAU,GAAG,CAAC,CAAE,CAAA,CAAA;AAAA;AAChE;AAEF,EAAA,cAAA,CAAe,GAAG,CAAA;AACpB;AAGA,UAAY,EAAA,EAAA,CAAG,WAAW,yBAAyB,CAAA;AACnD,UAAA,EAAY,WAAY,CAAA;AAAA,EACtB,IAAM,EAAA,OAAA;AAAA,EACN,EAAI,EAAA,aAAA;AAAA,EACJ,GAAA,EAAK,OAAQ,CAAA,GAAA,CAAI,UAAU,CAAA;AAAA,EAC3B,KAAK,OAAQ,CAAA;AACf,CAAwB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"html-worker.production.js","sources":["../../../../plugin/worker/html/html-worker.production.tsx"],"sourcesContent":["import { messageHandler } from \"./messageHandler.js\";\nimport { parentPort } from \"node:worker_threads\";\nimport type { ReadyMessage } from \"../types.js\";\n\n// Signal ready with environment\nparentPort?.on(\"message\", messageHandler);\nparentPort?.postMessage({\n type: \"READY\",\n id: \"html-worker\",\n env: process.env[\"NODE_ENV\"],\n pid: process.pid,\n} satisfies ReadyMessage);\n"],"names":[],"mappings":";;;;;;;;AAKA,UAAY,EAAA,EAAA,CAAG,WAAW,cAAc,CAAA;AACxC,UAAA,EAAY,WAAY,CAAA;AAAA,EACtB,IAAM,EAAA,OAAA;AAAA,EACN,EAAI,EAAA,aAAA;AAAA,EACJ,GAAA,EAAK,OAAQ,CAAA,GAAA,CAAI,UAAU,CAAA;AAAA,EAC3B,KAAK,OAAQ,CAAA;AACf,CAAwB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../plugin/worker/html/index.ts"],"sourcesContent":["await (\n process.env['NODE_ENV'] === 'production' \n ? import('./html-worker.production.js') \n : import('./html-worker.development.js')\n);"],"names":[],"mappings":";;;;;AAAA,OACE,OAAA,CAAQ,IAAI,UAAU,CAAA,KAAM,eACxB,OAAO,6BAA6B,CACpC,GAAA,OAAO,8BAA8B,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"messageHandler.js","sources":["../../../../plugin/worker/html/messageHandler.tsx"],"sourcesContent":["import { parentPort } from \"node:worker_threads\";\nimport type {\n HtmlWorkerInputMessage,\n HtmlWorkerOutputMessage,\n} from \"../types.js\";\nimport type { HtmlWorkerRenderState } from \"./types.js\";\nimport { createHtmlWorkerRenderState } from \"./createHtmlWorkerRenderState.js\";\nimport { toError } from \"../../error/toError.js\";\n\n// Track active renders\nconst activeRenders = new Map<string, HtmlWorkerRenderState>();\n\nfunction sendMessage(msg: HtmlWorkerOutputMessage) {\n // Send the original message\n if (\"error\" in msg && msg.error instanceof Error) {\n parentPort?.postMessage({\n ...msg,\n error: {\n message: msg.error.message,\n stack: msg.error.stack,\n name: msg.error.name,\n cause: msg.error.cause,\n },\n });\n } else {\n parentPort?.postMessage(msg);\n }\n}\n\nfunction cleanup(id: string) {\n const renderState = activeRenders.get(id);\n if (renderState) {\n renderState.rscStream.destroy();\n renderState.htmlTransform?.destroy();\n activeRenders.delete(id);\n\n sendMessage({\n type: \"CLEANUP_COMPLETE\",\n id,\n });\n }\n}\nexport async function messageHandler(msg: HtmlWorkerInputMessage) {\n const { type, id } = msg;\n try {\n switch (type) {\n case \"ROUTE_READY\": {\n let renderState = activeRenders.get(id);\n if (!renderState) {\n renderState = createHtmlWorkerRenderState(msg, sendMessage);\n \n activeRenders.set(id, renderState);\n } else {\n throw new Error(\"Render state already exists\");\n }\n break;\n }\n case \"RSC_CHUNK\": {\n let renderState = activeRenders.get(id);\n if (!renderState) {\n throw new Error(`No render state found for id: ${id}`);\n }\n\n try {\n // Write RSC chunk to the RSC stream\n renderState.rscStream.write(msg.chunk);\n sendMessage({\n type: \"CHUNK_PROCESSED\",\n id,\n success: true,\n });\n } catch (error: any) {\n sendMessage({\n type: \"ERROR\",\n id,\n error: `Error writing chunk: ${error.message}`,\n });\n cleanup(id);\n }\n break;\n }\n case \"RSC_END\": {\n const renderState = activeRenders.get(id);\n if (!renderState) {\n sendMessage({\n type: \"ERROR\",\n id,\n error: \"No render state found\",\n });\n return;\n }\n\n // Pipe the rendered content to the HTML stream\n break;\n }\n case \"CLEANUP\": {\n cleanup(id);\n break;\n }\n case \"SHUTDOWN\": {\n // If id is \"*\", clean up all render states\n if (id === \"*\") {\n for (const [renderId] of activeRenders) {\n cleanup(renderId);\n }\n } else {\n cleanup(id);\n }\n // Send SHUTDOWN_COMPLETE message to signal that shutdown is complete\n sendMessage({\n type: \"SHUTDOWN_COMPLETE\",\n id,\n });\n break;\n }\n }\n } catch (error) {\n sendMessage({\n type: \"ERROR\",\n id,\n error: toError(error),\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAUA,MAAM,aAAA,uBAAoB,GAAmC,EAAA;AAE7D,SAAS,YAAY,GAA8B,EAAA;AAEjD,EAAA,IAAI,OAAW,IAAA,GAAA,IAAO,GAAI,CAAA,KAAA,YAAiB,KAAO,EAAA;AAChD,IAAA,UAAA,EAAY,WAAY,CAAA;AAAA,MACtB,GAAG,GAAA;AAAA,MACH,KAAO,EAAA;AAAA,QACL,OAAA,EAAS,IAAI,KAAM,CAAA,OAAA;AAAA,QACnB,KAAA,EAAO,IAAI,KAAM,CAAA,KAAA;AAAA,QACjB,IAAA,EAAM,IAAI,KAAM,CAAA,IAAA;AAAA,QAChB,KAAA,EAAO,IAAI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