vite-plugin-react-server 1.0.2 → 1.1.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 (490) hide show
  1. package/README.md +49 -76
  2. package/bin/patch.mjs +27 -20
  3. package/dist/_virtual/dynamic-import-helper.js +24 -0
  4. package/dist/_virtual/dynamic-import-helper.js.map +1 -0
  5. package/dist/client.d.ts +1 -1
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +1 -1
  8. package/dist/index.d.ts +2 -4
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +9 -26
  11. package/dist/index.js.map +1 -1
  12. package/dist/package.json +24 -14
  13. package/dist/plugin/components.d.ts +1 -1
  14. package/dist/plugin/components.d.ts.map +1 -1
  15. package/dist/plugin/components.js +1 -1
  16. package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.d.ts +6 -0
  17. package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.d.ts.map +1 -0
  18. package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js +30 -0
  19. package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js.map +1 -0
  20. package/dist/plugin/config/autoDiscover/customWorkerFiles.d.ts +13 -0
  21. package/dist/plugin/config/autoDiscover/customWorkerFiles.d.ts.map +1 -0
  22. package/dist/plugin/config/autoDiscover/customWorkerFiles.js +24 -0
  23. package/dist/plugin/config/autoDiscover/customWorkerFiles.js.map +1 -0
  24. package/dist/plugin/config/autoDiscover/pageAndPropFiles.d.ts +11 -0
  25. package/dist/plugin/config/autoDiscover/pageAndPropFiles.d.ts.map +1 -0
  26. package/dist/plugin/config/autoDiscover/pageAndPropFiles.js +29 -0
  27. package/dist/plugin/config/autoDiscover/pageAndPropFiles.js.map +1 -0
  28. package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts +6 -0
  29. package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts.map +1 -0
  30. package/dist/plugin/config/autoDiscover/resolveBuildPages.js +83 -0
  31. package/dist/plugin/config/autoDiscover/resolveBuildPages.js.map +1 -0
  32. package/dist/plugin/config/defaults.d.ts +18 -14
  33. package/dist/plugin/config/defaults.d.ts.map +1 -1
  34. package/dist/plugin/config/defaults.js +42 -21
  35. package/dist/plugin/config/defaults.js.map +1 -1
  36. package/dist/plugin/config/getCondition.d.ts +1 -1
  37. package/dist/plugin/config/getCondition.d.ts.map +1 -1
  38. package/dist/plugin/config/getCondition.js +2 -2
  39. package/dist/plugin/config/getCondition.js.map +1 -1
  40. package/dist/plugin/config/getPaths.d.ts +0 -1
  41. package/dist/plugin/config/getPaths.d.ts.map +1 -1
  42. package/dist/plugin/config/getPaths.js.map +1 -1
  43. package/dist/plugin/config/index.d.ts +0 -1
  44. package/dist/plugin/config/index.d.ts.map +1 -1
  45. package/dist/plugin/config/index.js +0 -1
  46. package/dist/plugin/config/resolveAutoDiscover.d.ts +20 -0
  47. package/dist/plugin/config/resolveAutoDiscover.d.ts.map +1 -0
  48. package/dist/plugin/config/resolveAutoDiscover.js +128 -0
  49. package/dist/plugin/config/resolveAutoDiscover.js.map +1 -0
  50. package/dist/plugin/config/resolveOptions.d.ts +1 -1
  51. package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
  52. package/dist/plugin/config/resolveOptions.js +109 -77
  53. package/dist/plugin/config/resolveOptions.js.map +1 -1
  54. package/dist/plugin/config/resolvePages.d.ts +0 -1
  55. package/dist/plugin/config/resolvePages.d.ts.map +1 -1
  56. package/dist/plugin/config/resolvePages.js +6 -8
  57. package/dist/plugin/config/resolvePages.js.map +1 -1
  58. package/dist/plugin/config/resolveUrlOption.d.ts +16 -0
  59. package/dist/plugin/config/resolveUrlOption.d.ts.map +1 -0
  60. package/dist/plugin/config/resolveUrlOption.js +37 -0
  61. package/dist/plugin/config/resolveUrlOption.js.map +1 -0
  62. package/dist/plugin/config/resolveUserConfig.d.ts +4 -5
  63. package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
  64. package/dist/plugin/config/resolveUserConfig.js +80 -132
  65. package/dist/plugin/config/resolveUserConfig.js.map +1 -1
  66. package/dist/plugin/copy.d.ts +7 -0
  67. package/dist/plugin/copy.d.ts.map +1 -0
  68. package/dist/plugin/copy.js +30 -0
  69. package/dist/plugin/css-collector-elements.d.ts +4 -0
  70. package/dist/plugin/css-collector-elements.d.ts.map +1 -0
  71. package/dist/plugin/css-collector-elements.js +19 -0
  72. package/dist/plugin/css-collector-elements.js.map +1 -0
  73. package/dist/plugin/css-collector.d.ts +2 -8
  74. package/dist/plugin/css-collector.d.ts.map +1 -1
  75. package/dist/plugin/css-collector.js +9 -36
  76. package/dist/plugin/css-collector.js.map +1 -1
  77. package/dist/plugin/helpers/cleanObject.d.ts +3 -0
  78. package/dist/plugin/helpers/cleanObject.d.ts.map +1 -0
  79. package/dist/plugin/helpers/cleanObject.js +47 -0
  80. package/dist/plugin/helpers/cleanObject.js.map +1 -0
  81. package/dist/plugin/helpers/collectBundleManifestCss.d.ts +8 -0
  82. package/dist/plugin/helpers/collectBundleManifestCss.d.ts.map +1 -0
  83. package/dist/plugin/helpers/collectBundleManifestCss.js +110 -0
  84. package/dist/plugin/helpers/collectManifestCss.d.ts +7 -0
  85. package/dist/plugin/helpers/collectManifestCss.d.ts.map +1 -0
  86. package/dist/plugin/helpers/collectManifestCss.js +44 -0
  87. package/dist/plugin/helpers/collectManifestCss.js.map +1 -0
  88. package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts +31 -0
  89. package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts.map +1 -0
  90. package/dist/plugin/helpers/collectViteModuleGraphCss.js +104 -0
  91. package/dist/plugin/helpers/collectViteModuleGraphCss.js.map +1 -0
  92. package/dist/plugin/helpers/createCssProps.d.ts +25 -0
  93. package/dist/plugin/helpers/createCssProps.d.ts.map +1 -0
  94. package/dist/plugin/helpers/createCssProps.js +57 -0
  95. package/dist/plugin/helpers/createCssProps.js.map +1 -0
  96. package/dist/plugin/helpers/createEventHandler.d.ts +22 -0
  97. package/dist/plugin/helpers/createEventHandler.d.ts.map +1 -0
  98. package/dist/plugin/helpers/createEventHandler.js +36 -0
  99. package/dist/plugin/helpers/createEventHandler.js.map +1 -0
  100. package/dist/plugin/helpers/createHandler.d.ts +7 -13
  101. package/dist/plugin/helpers/createHandler.d.ts.map +1 -1
  102. package/dist/plugin/helpers/createHandler.js +54 -96
  103. package/dist/plugin/helpers/createHandler.js.map +1 -1
  104. package/dist/plugin/helpers/createRscStream.d.ts +12 -26
  105. package/dist/plugin/helpers/createRscStream.d.ts.map +1 -1
  106. package/dist/plugin/helpers/createRscStream.js +105 -51
  107. package/dist/plugin/helpers/createRscStream.js.map +1 -1
  108. package/dist/plugin/helpers/defaultFileWriter.d.ts +2 -0
  109. package/dist/plugin/helpers/defaultFileWriter.d.ts.map +1 -0
  110. package/dist/plugin/helpers/defaultFileWriter.js +1 -0
  111. package/dist/plugin/helpers/getBundleManifest.d.ts +10 -16
  112. package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
  113. package/dist/plugin/helpers/getBundleManifest.js +30 -22
  114. package/dist/plugin/helpers/getBundleManifest.js.map +1 -1
  115. package/dist/plugin/helpers/getRouteFiles.d.ts +14 -0
  116. package/dist/plugin/helpers/getRouteFiles.d.ts.map +1 -0
  117. package/dist/plugin/helpers/getRouteFiles.js +36 -0
  118. package/dist/plugin/helpers/getRouteFiles.js.map +1 -0
  119. package/dist/plugin/helpers/inputNormalizer.d.ts.map +1 -1
  120. package/dist/plugin/helpers/inputNormalizer.js +38 -32
  121. package/dist/plugin/helpers/inputNormalizer.js.map +1 -1
  122. package/dist/plugin/helpers/metrics.d.ts +11 -0
  123. package/dist/plugin/helpers/metrics.d.ts.map +1 -0
  124. package/dist/plugin/helpers/metrics.js +35 -0
  125. package/dist/plugin/helpers/metrics.js.map +1 -0
  126. package/dist/plugin/helpers/resolvePageAndProps.d.ts +27 -0
  127. package/dist/plugin/helpers/resolvePageAndProps.d.ts.map +1 -0
  128. package/dist/plugin/helpers/resolvePageAndProps.js +51 -0
  129. package/dist/plugin/helpers/resolvePageAndProps.js.map +1 -0
  130. package/dist/plugin/helpers/serializeUserOptions.d.ts +8 -0
  131. package/dist/plugin/helpers/serializeUserOptions.d.ts.map +1 -0
  132. package/dist/plugin/helpers/serializeUserOptions.js +182 -0
  133. package/dist/plugin/helpers/serializeUserOptions.js.map +1 -0
  134. package/dist/plugin/helpers/stashReturnValue.d.ts +2 -0
  135. package/dist/plugin/helpers/stashReturnValue.d.ts.map +1 -0
  136. package/dist/plugin/helpers/stashReturnValue.js +14 -0
  137. package/dist/plugin/helpers/tryManifest.d.ts +5 -3
  138. package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
  139. package/dist/plugin/helpers/tryManifest.js +16 -7
  140. package/dist/plugin/helpers/tryManifest.js.map +1 -1
  141. package/dist/plugin/html.d.ts +2 -3
  142. package/dist/plugin/html.d.ts.map +1 -1
  143. package/dist/plugin/html.js +7 -1
  144. package/dist/plugin/html.js.map +1 -1
  145. package/dist/plugin/index.d.ts +1 -2
  146. package/dist/plugin/index.d.ts.map +1 -1
  147. package/dist/plugin/index.js +3 -1
  148. package/dist/plugin/loader/createBuildLoader.d.ts +26 -4
  149. package/dist/plugin/loader/createBuildLoader.d.ts.map +1 -1
  150. package/dist/plugin/loader/createBuildLoader.js +98 -33
  151. package/dist/plugin/loader/createBuildLoader.js.map +1 -1
  152. package/dist/plugin/loader/css-loader.development.d.ts +57 -0
  153. package/dist/plugin/loader/css-loader.development.d.ts.map +1 -0
  154. package/dist/plugin/loader/css-loader.development.js +81 -0
  155. package/dist/plugin/loader/css-loader.development.js.map +1 -0
  156. package/dist/plugin/loader/css-loader.production.d.ts +31 -0
  157. package/dist/plugin/loader/css-loader.production.d.ts.map +1 -0
  158. package/dist/plugin/loader/css-loader.production.js +45 -0
  159. package/dist/plugin/loader/css-loader.production.js.map +1 -0
  160. package/dist/plugin/loader/index.d.ts +2 -0
  161. package/dist/plugin/loader/index.d.ts.map +1 -0
  162. package/dist/plugin/loader/index.js +1 -0
  163. package/dist/plugin/loader/plugin.d.ts +22 -0
  164. package/dist/plugin/loader/plugin.d.ts.map +1 -0
  165. package/dist/plugin/loader/plugin.js +27 -0
  166. package/dist/plugin/loader/react-loader.d.ts +3 -7
  167. package/dist/plugin/loader/react-loader.d.ts.map +1 -1
  168. package/dist/plugin/loader/react-loader.js +85 -30
  169. package/dist/plugin/loader/react-loader.js.map +1 -1
  170. package/dist/plugin/loader/temporaryReferences.d.ts +2 -0
  171. package/dist/plugin/loader/temporaryReferences.d.ts.map +1 -0
  172. package/dist/plugin/loader/temporaryReferences.js +11 -0
  173. package/dist/plugin/loader/temporaryReferences.js.map +1 -0
  174. package/dist/plugin/moduleRefs.d.ts +7 -0
  175. package/dist/plugin/moduleRefs.d.ts.map +1 -0
  176. package/dist/plugin/moduleRefs.js +17 -0
  177. package/dist/plugin/moduleRefs.js.map +1 -0
  178. package/dist/plugin/plugin.client.d.ts +3 -0
  179. package/dist/plugin/plugin.client.d.ts.map +1 -0
  180. package/dist/plugin/plugin.client.js +19 -0
  181. package/dist/plugin/plugin.client.js.map +1 -0
  182. package/dist/plugin/plugin.d.ts +1 -5
  183. package/dist/plugin/plugin.d.ts.map +1 -1
  184. package/dist/plugin/plugin.js +3 -9
  185. package/dist/plugin/plugin.server.d.ts +3 -0
  186. package/dist/plugin/plugin.server.d.ts.map +1 -0
  187. package/dist/plugin/plugin.server.js +28 -0
  188. package/dist/plugin/plugin.server.js.map +1 -0
  189. package/dist/plugin/preserver/plugin.js +1 -1
  190. package/dist/plugin/preserver/plugin.js.map +1 -1
  191. package/dist/plugin/react-client/index.d.ts +1 -2
  192. package/dist/plugin/react-client/index.d.ts.map +1 -1
  193. package/dist/plugin/react-client/index.js +1 -19
  194. package/dist/plugin/react-client/plugin.d.ts.map +1 -1
  195. package/dist/plugin/react-client/plugin.js +60 -219
  196. package/dist/plugin/react-client/plugin.js.map +1 -1
  197. package/dist/plugin/react-client/server.d.ts +27 -0
  198. package/dist/plugin/react-client/server.d.ts.map +1 -0
  199. package/dist/plugin/react-client/server.js +197 -0
  200. package/dist/plugin/react-client/server.js.map +1 -0
  201. package/dist/plugin/react-server/index.d.ts +1 -2
  202. package/dist/plugin/react-server/index.d.ts.map +1 -1
  203. package/dist/plugin/react-server/index.js +1 -21
  204. package/dist/plugin/react-server/plugin.d.ts +0 -1
  205. package/dist/plugin/react-server/plugin.d.ts.map +1 -1
  206. package/dist/plugin/react-server/plugin.js +60 -186
  207. package/dist/plugin/react-server/plugin.js.map +1 -1
  208. package/dist/plugin/react-server/server.d.ts +9 -0
  209. package/dist/plugin/react-server/server.d.ts.map +1 -0
  210. package/dist/plugin/react-server/server.js +120 -0
  211. package/dist/plugin/react-server/server.js.map +1 -0
  212. package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts +23 -0
  213. package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts.map +1 -0
  214. package/dist/plugin/react-static/collectHtmlWorkerContent.js +85 -0
  215. package/dist/plugin/react-static/collectHtmlWorkerContent.js.map +1 -0
  216. package/dist/plugin/react-static/collectRscContent.d.ts +24 -0
  217. package/dist/plugin/react-static/collectRscContent.d.ts.map +1 -0
  218. package/dist/plugin/react-static/collectRscContent.js +49 -0
  219. package/dist/plugin/react-static/collectRscContent.js.map +1 -0
  220. package/dist/plugin/react-static/configurePreviewServer.d.ts +7 -0
  221. package/dist/plugin/react-static/configurePreviewServer.d.ts.map +1 -0
  222. package/dist/plugin/react-static/configurePreviewServer.js +67 -0
  223. package/dist/plugin/react-static/configurePreviewServer.js.map +1 -0
  224. package/dist/plugin/react-static/fileWriter.d.ts +23 -0
  225. package/dist/plugin/react-static/fileWriter.d.ts.map +1 -0
  226. package/dist/plugin/react-static/fileWriter.js +65 -0
  227. package/dist/plugin/react-static/fileWriter.js.map +1 -0
  228. package/dist/plugin/react-static/plugin.d.ts +15 -0
  229. package/dist/plugin/react-static/plugin.d.ts.map +1 -1
  230. package/dist/plugin/react-static/plugin.js +248 -149
  231. package/dist/plugin/react-static/plugin.js.map +1 -1
  232. package/dist/plugin/react-static/renderPage.d.ts +3 -0
  233. package/dist/plugin/react-static/renderPage.d.ts.map +1 -0
  234. package/dist/plugin/react-static/renderPage.js +116 -0
  235. package/dist/plugin/react-static/renderPage.js.map +1 -0
  236. package/dist/plugin/react-static/renderPages.d.ts +3 -0
  237. package/dist/plugin/react-static/renderPages.d.ts.map +1 -0
  238. package/dist/plugin/react-static/renderPages.js +125 -0
  239. package/dist/plugin/react-static/renderPages.js.map +1 -0
  240. package/dist/plugin/react-static/renderStreams.d.ts +26 -0
  241. package/dist/plugin/react-static/renderStreams.d.ts.map +1 -0
  242. package/dist/plugin/react-static/renderStreams.js +27 -0
  243. package/dist/plugin/react-static/renderStreams.js.map +1 -0
  244. package/dist/plugin/react-static/rscToHtmlStream.d.ts +22 -0
  245. package/dist/plugin/react-static/rscToHtmlStream.d.ts.map +1 -0
  246. package/dist/plugin/react-static/rscToHtmlStream.js +54 -0
  247. package/dist/plugin/react-static/rscToHtmlStream.js.map +1 -0
  248. package/dist/plugin/react-static/streamHandler.d.ts +2 -0
  249. package/dist/plugin/react-static/streamHandler.d.ts.map +1 -0
  250. package/dist/plugin/react-static/streamHandler.js +1 -0
  251. package/dist/plugin/react-static/types.d.ts +11 -0
  252. package/dist/plugin/react-static/types.d.ts.map +1 -1
  253. package/dist/plugin/resolvePage.d.ts +26 -9
  254. package/dist/plugin/resolvePage.d.ts.map +1 -1
  255. package/dist/plugin/resolvePage.js +41 -39
  256. package/dist/plugin/resolvePage.js.map +1 -1
  257. package/dist/plugin/resolveProps.d.ts +40 -7
  258. package/dist/plugin/resolveProps.d.ts.map +1 -1
  259. package/dist/plugin/resolveProps.js +100 -75
  260. package/dist/plugin/resolveProps.js.map +1 -1
  261. package/dist/plugin/root.d.ts +1 -0
  262. package/dist/plugin/root.d.ts.map +1 -1
  263. package/dist/plugin/root.js +1 -0
  264. package/dist/plugin/root.js.map +1 -1
  265. package/dist/plugin/transformer/index.d.ts +2 -1
  266. package/dist/plugin/transformer/index.d.ts.map +1 -1
  267. package/dist/plugin/transformer/index.js +2 -1
  268. package/dist/plugin/transformer/plugin.client.d.ts +4 -0
  269. package/dist/plugin/transformer/plugin.client.d.ts.map +1 -0
  270. package/dist/plugin/transformer/plugin.client.js +83 -0
  271. package/dist/plugin/transformer/plugin.client.js.map +1 -0
  272. package/dist/plugin/transformer/plugin.d.ts +1 -27
  273. package/dist/plugin/transformer/plugin.d.ts.map +1 -1
  274. package/dist/plugin/transformer/plugin.js +3 -87
  275. package/dist/plugin/transformer/plugin.js.map +1 -1
  276. package/dist/plugin/transformer/plugin.server.d.ts +4 -0
  277. package/dist/plugin/transformer/plugin.server.d.ts.map +1 -0
  278. package/dist/plugin/transformer/plugin.server.js +76 -0
  279. package/dist/plugin/transformer/plugin.server.js.map +1 -0
  280. package/dist/plugin/transformer/upgradeCssModuleCode.d.ts +11 -0
  281. package/dist/plugin/transformer/upgradeCssModuleCode.d.ts.map +1 -0
  282. package/dist/plugin/transformer/upgradeCssModuleCode.js +38 -0
  283. package/dist/plugin/types/css-tracking.d.ts +6 -0
  284. package/dist/plugin/types/css-tracking.d.ts.map +1 -0
  285. package/dist/plugin/types/css-tracking.js +1 -0
  286. package/dist/plugin/types.d.ts +372 -86
  287. package/dist/plugin/types.d.ts.map +1 -1
  288. package/dist/plugin/types.js +1 -1
  289. package/dist/plugin/vendor.client.d.ts +4 -0
  290. package/dist/plugin/vendor.client.d.ts.map +1 -0
  291. package/dist/plugin/vendor.client.js +16 -0
  292. package/dist/plugin/vendor.client.js.map +1 -0
  293. package/dist/plugin/vendor.server.d.ts +4 -0
  294. package/dist/plugin/vendor.server.d.ts.map +1 -0
  295. package/dist/plugin/vendor.server.js +16 -0
  296. package/dist/plugin/vendor.server.js.map +1 -0
  297. package/dist/plugin/worker/createWorker.d.ts +25 -7
  298. package/dist/plugin/worker/createWorker.d.ts.map +1 -1
  299. package/dist/plugin/worker/createWorker.js +108 -33
  300. package/dist/plugin/worker/createWorker.js.map +1 -1
  301. package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts +12 -0
  302. package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts.map +1 -0
  303. package/dist/plugin/worker/html/createHtmlWorkerRenderState.js +103 -0
  304. package/dist/plugin/worker/html/createHtmlWorkerRenderState.js.map +1 -0
  305. package/dist/plugin/worker/html/html-worker.development.d.ts +0 -30
  306. package/dist/plugin/worker/html/html-worker.development.d.ts.map +1 -1
  307. package/dist/plugin/worker/html/html-worker.development.js +3 -17
  308. package/dist/plugin/worker/html/html-worker.development.js.map +1 -1
  309. package/dist/plugin/worker/html/html-worker.production.js +12 -5
  310. package/dist/plugin/worker/html/html-worker.production.js.map +1 -1
  311. package/dist/plugin/worker/html/messageHandler.d.ts +2 -2
  312. package/dist/plugin/worker/html/messageHandler.d.ts.map +1 -1
  313. package/dist/plugin/worker/html/messageHandler.js +87 -84
  314. package/dist/plugin/worker/html/messageHandler.js.map +1 -1
  315. package/dist/plugin/worker/html/types.d.ts +18 -0
  316. package/dist/plugin/worker/html/types.d.ts.map +1 -0
  317. package/dist/plugin/worker/html/types.js +1 -0
  318. package/dist/plugin/worker/registerLoaders.d.ts +9 -0
  319. package/dist/plugin/worker/registerLoaders.d.ts.map +1 -0
  320. package/dist/plugin/worker/registerLoaders.js +45 -0
  321. package/dist/plugin/worker/rsc/handleRender.d.ts +4 -0
  322. package/dist/plugin/worker/rsc/handleRender.d.ts.map +1 -0
  323. package/dist/plugin/worker/rsc/handleRender.js +147 -0
  324. package/dist/plugin/worker/rsc/handleRender.js.map +1 -0
  325. package/dist/plugin/worker/rsc/messageHandler.d.ts +2 -2
  326. package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -1
  327. package/dist/plugin/worker/rsc/messageHandler.js +47 -112
  328. package/dist/plugin/worker/rsc/messageHandler.js.map +1 -1
  329. package/dist/plugin/worker/rsc/rsc-worker.development.d.ts +0 -30
  330. package/dist/plugin/worker/rsc/rsc-worker.development.d.ts.map +1 -1
  331. package/dist/plugin/worker/rsc/rsc-worker.development.js +29 -4
  332. package/dist/plugin/worker/rsc/rsc-worker.development.js.map +1 -1
  333. package/dist/plugin/worker/rsc/rsc-worker.production.js +3 -3
  334. package/dist/plugin/worker/rsc/rsc-worker.production.js.map +1 -1
  335. package/dist/plugin/worker/rsc/state.d.ts +73 -2
  336. package/dist/plugin/worker/rsc/state.d.ts.map +1 -1
  337. package/dist/plugin/worker/rsc/state.js +40 -3
  338. package/dist/plugin/worker/rsc/state.js.map +1 -1
  339. package/dist/plugin/worker/sendMessage.d.ts +3 -0
  340. package/dist/plugin/worker/sendMessage.d.ts.map +1 -0
  341. package/dist/plugin/worker/sendMessage.js +48 -0
  342. package/dist/plugin/worker/types.d.ts +218 -76
  343. package/dist/plugin/worker/types.d.ts.map +1 -1
  344. package/dist/server.d.ts +1 -1
  345. package/dist/server.d.ts.map +1 -1
  346. package/dist/server.js +6 -1
  347. package/dist/server.js.map +1 -1
  348. package/dist/tsconfig.tsbuildinfo +1 -1
  349. package/package.json +24 -14
  350. package/plugin/components.ts +1 -1
  351. package/plugin/config/autoDiscover/createGlobAutoDiscover.ts +29 -0
  352. package/plugin/config/autoDiscover/customWorkerFiles.ts +27 -0
  353. package/plugin/config/autoDiscover/pageAndPropFiles.ts +36 -0
  354. package/plugin/config/autoDiscover/resolveBuildPages.ts +98 -0
  355. package/plugin/config/defaults.tsx +38 -29
  356. package/plugin/config/getCondition.ts +7 -3
  357. package/plugin/config/getPaths.ts +1 -7
  358. package/plugin/config/index.ts +0 -1
  359. package/plugin/config/resolveAutoDiscover.ts +177 -0
  360. package/plugin/config/resolveOptions.ts +220 -118
  361. package/plugin/config/resolvePages.ts +5 -7
  362. package/plugin/config/resolveUrlOption.ts +43 -0
  363. package/plugin/config/resolveUserConfig.ts +116 -166
  364. package/plugin/copy.ts +39 -0
  365. package/plugin/css-collector-elements.tsx +21 -0
  366. package/plugin/css-collector.tsx +20 -53
  367. package/plugin/helpers/cleanObject.ts +50 -0
  368. package/plugin/helpers/collectBundleManifestCss.ts +160 -0
  369. package/plugin/helpers/collectManifestCss.ts +61 -0
  370. package/plugin/helpers/collectViteModuleGraphCss.ts +158 -0
  371. package/plugin/helpers/createCssProps.tsx +85 -0
  372. package/plugin/helpers/createEventHandler.ts +44 -0
  373. package/plugin/helpers/createHandler.ts +57 -126
  374. package/plugin/helpers/createRscStream.tsx +156 -0
  375. package/plugin/helpers/defaultFileWriter.ts +0 -0
  376. package/plugin/helpers/getBundleManifest.ts +42 -37
  377. package/plugin/helpers/getRouteFiles.ts +47 -0
  378. package/plugin/helpers/inputNormalizer.ts +16 -10
  379. package/plugin/helpers/metrics.ts +64 -0
  380. package/plugin/helpers/resolvePageAndProps.ts +81 -0
  381. package/plugin/helpers/serializeUserOptions.ts +209 -0
  382. package/plugin/helpers/stashReturnValue.ts +16 -0
  383. package/plugin/helpers/tryManifest.ts +35 -18
  384. package/plugin/html.tsx +14 -3
  385. package/plugin/index.ts +5 -2
  386. package/plugin/loader/createBuildLoader.ts +152 -47
  387. package/plugin/loader/css-loader.development.ts +157 -0
  388. package/plugin/loader/css-loader.production.ts +86 -0
  389. package/plugin/loader/index.ts +1 -0
  390. package/plugin/loader/plugin.ts +33 -0
  391. package/plugin/loader/react-loader.ts +109 -41
  392. package/plugin/loader/temporaryReferences.ts +3 -0
  393. package/plugin/moduleRefs.ts +11 -0
  394. package/plugin/plugin.client.ts +12 -0
  395. package/plugin/plugin.server.ts +25 -0
  396. package/plugin/plugin.ts +5 -9
  397. package/plugin/preserver/plugin.ts +1 -1
  398. package/plugin/react-client/index.ts +1 -12
  399. package/plugin/react-client/plugin.ts +70 -259
  400. package/plugin/react-client/server.ts +276 -0
  401. package/plugin/react-server/index.ts +1 -14
  402. package/plugin/react-server/plugin.ts +69 -220
  403. package/plugin/react-server/server.ts +128 -0
  404. package/plugin/react-static/collectHtmlWorkerContent.ts +120 -0
  405. package/plugin/react-static/collectRscContent.ts +77 -0
  406. package/plugin/react-static/configurePreviewServer.ts +68 -0
  407. package/plugin/react-static/fileWriter.ts +103 -0
  408. package/plugin/react-static/plugin.ts +308 -181
  409. package/plugin/react-static/renderPage.ts +151 -0
  410. package/plugin/react-static/renderPages.ts +154 -0
  411. package/plugin/react-static/renderStreams.ts +48 -0
  412. package/plugin/react-static/rscToHtmlStream.ts +85 -0
  413. package/plugin/react-static/streamHandler.ts +0 -0
  414. package/plugin/react-static/types.ts +10 -0
  415. package/plugin/resolvePage.ts +67 -57
  416. package/plugin/resolveProps.ts +148 -104
  417. package/plugin/root.ts +1 -1
  418. package/plugin/transformer/index.ts +2 -1
  419. package/plugin/transformer/plugin.client.ts +109 -0
  420. package/plugin/transformer/plugin.server.ts +98 -0
  421. package/plugin/transformer/plugin.ts +2 -115
  422. package/plugin/transformer/upgradeCssModuleCode.ts +42 -0
  423. package/plugin/types/css-tracking.ts +5 -0
  424. package/plugin/types/react-server-dom-esm.d.ts +54 -0
  425. package/plugin/types.ts +508 -97
  426. package/plugin/vendor.client.ts +12 -0
  427. package/plugin/vendor.server.ts +12 -0
  428. package/plugin/worker/createWorker.ts +158 -53
  429. package/plugin/worker/html/createHtmlWorkerRenderState.tsx +112 -0
  430. package/plugin/worker/html/html-worker.development.tsx +5 -75
  431. package/plugin/worker/html/html-worker.production.tsx +18 -7
  432. package/plugin/worker/html/messageHandler.tsx +126 -0
  433. package/plugin/worker/html/types.ts +19 -0
  434. package/plugin/worker/registerLoaders.ts +54 -0
  435. package/plugin/worker/rsc/handleRender.ts +180 -0
  436. package/plugin/worker/rsc/messageHandler.tsx +58 -132
  437. package/plugin/worker/rsc/rsc-worker.development.ts +49 -63
  438. package/plugin/worker/rsc/rsc-worker.production.ts +5 -5
  439. package/plugin/worker/rsc/state.ts +79 -2
  440. package/plugin/worker/sendMessage.ts +49 -0
  441. package/plugin/worker/types.ts +299 -100
  442. package/scripts/check-react-version.mjs +60 -48
  443. package/scripts/react+0.0.0-experimental-0ca8420f-20250504.patch +57 -0
  444. package/scripts/react-dom+0.0.0-experimental-0ca8420f-20250504.patch +819 -0
  445. package/scripts/{react-server-dom-esm+0.0.0-experimental-eda36a1c-20250228.patch → react-server-dom-esm+0.0.0-experimental-0ca8420f-20250504.patch} +1702 -2820
  446. package/tsconfig.json +7 -2
  447. package/dist/plugin/assertServerCondition.d.ts +0 -6
  448. package/dist/plugin/assertServerCondition.d.ts.map +0 -1
  449. package/dist/plugin/assertServerCondition.js +0 -13
  450. package/dist/plugin/checkFilesExist.d.ts +0 -3
  451. package/dist/plugin/checkFilesExist.d.ts.map +0 -1
  452. package/dist/plugin/checkFilesExist.js +0 -67
  453. package/dist/plugin/checkFilesExist.js.map +0 -1
  454. package/dist/plugin/collect-manifest-client-files.d.ts +0 -23
  455. package/dist/plugin/collect-manifest-client-files.d.ts.map +0 -1
  456. package/dist/plugin/collect-manifest-client-files.js +0 -131
  457. package/dist/plugin/collect-manifest-client-files.js.map +0 -1
  458. package/dist/plugin/config/getWorkerPath.d.ts +0 -2
  459. package/dist/plugin/config/getWorkerPath.d.ts.map +0 -1
  460. package/dist/plugin/config/getWorkerPath.js +0 -4
  461. package/dist/plugin/copy-dir.d.ts +0 -4
  462. package/dist/plugin/copy-dir.d.ts.map +0 -1
  463. package/dist/plugin/copy-dir.js +0 -25
  464. package/dist/plugin/copy-dir.js.map +0 -1
  465. package/dist/plugin/css-collector-inline.d.ts +0 -10
  466. package/dist/plugin/css-collector-inline.d.ts.map +0 -1
  467. package/dist/plugin/css-collector-inline.js +0 -55
  468. package/dist/plugin/css-collector-inline.js.map +0 -1
  469. package/dist/plugin/loader/css-loader.d.ts +0 -16
  470. package/dist/plugin/loader/css-loader.d.ts.map +0 -1
  471. package/dist/plugin/loader/css-loader.js +0 -70
  472. package/dist/plugin/loader/css-loader.js.map +0 -1
  473. package/dist/plugin/react-client/index.js.map +0 -1
  474. package/dist/plugin/react-server/index.js.map +0 -1
  475. package/dist/plugin/worker/html/renderPages.d.ts +0 -26
  476. package/dist/plugin/worker/html/renderPages.d.ts.map +0 -1
  477. package/dist/plugin/worker/html/renderPages.js +0 -241
  478. package/dist/plugin/worker/html/renderPages.js.map +0 -1
  479. package/plugin/assertServerCondition.ts +0 -12
  480. package/plugin/checkFilesExist.ts +0 -66
  481. package/plugin/collect-manifest-client-files.ts +0 -167
  482. package/plugin/config/getWorkerPath.ts +0 -5
  483. package/plugin/copy-dir.ts +0 -27
  484. package/plugin/css-collector-inline.tsx +0 -60
  485. package/plugin/helpers/createRscStream.ts +0 -109
  486. package/plugin/loader/css-loader.ts +0 -94
  487. package/plugin/worker/html/messageHandler.ts +0 -130
  488. package/plugin/worker/html/renderPages.ts +0 -293
  489. package/scripts/react+0.0.0-experimental-eda36a1c-20250228.patch +0 -159
  490. package/scripts/react-dom+0.0.0-experimental-eda36a1c-20250228.patch +0 -12508
package/tsconfig.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  // when we extend a tsconfig.json file, it will merge and override the compilerOptions but not the arrays like lib, rootDirs, etc.
3
3
  "compilerOptions": {
4
+ // this file can work as a composite project
4
5
  "composite": true,
6
+ // this file can emit declarations
5
7
  "declaration": true,
8
+ // this file can emit declaration maps
6
9
  "declarationMap": true,
7
- // idk whatever this does but strict sounds like a good idea. (https://www.typescriptlang.org/tsconfig/#strict)
10
+ // strict mode family checks https://www.typescriptlang.org/tsconfig/#strict
8
11
  "strict": true,
9
12
  // Should you want to just import a js file anyway. You can use type comments in a .js file like: /* @type {string} */
10
13
  "allowJs": true,
@@ -18,7 +21,6 @@
18
21
  "jsxFragmentFactory": "React.Fragment",
19
22
  // We force module detection to be sure that the module system is detected correctly.
20
23
  "moduleDetection": "force",
21
- // To indicate that we are NOT going to be emitting files
22
24
  // This just means that when you write a switch statement, you will get an error once you forget to add a break statement.
23
25
  "noFallthroughCasesInSwitch": true,
24
26
  // We don't allow property access from index signatures. In this case we prefer to write record['images'] instead of record.images
@@ -42,11 +44,14 @@
42
44
  "react/canary",
43
45
  "react-dom/canary"
44
46
  ],
47
+ // we can use our own package imports internally e.g. import { vitePluginReactServer } from `vite-plugin-react-server`
45
48
  "resolvePackageJsonImports": true,
46
49
  "resolvePackageJsonExports": true,
50
+ // we want to use the verbatim module syntax
47
51
  "verbatimModuleSyntax": true,
48
52
  // The very latest ES features
49
53
  "target": "es2022",
54
+ // we want to use the latest node module resolution
50
55
  "module": "nodenext",
51
56
  "moduleResolution": "nodenext",
52
57
  "lib": [
@@ -1,6 +0,0 @@
1
- export declare function assertServerCondition<P extends typeof process>(p: P): asserts p is P & {
2
- env: {
3
- NODE_OPTIONS: string;
4
- };
5
- };
6
- //# sourceMappingURL=assertServerCondition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertServerCondition.d.ts","sourceRoot":"","sources":["../../plugin/assertServerCondition.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAWtH"}
@@ -1,13 +0,0 @@
1
- export function assertServerCondition(p) {
2
- const nodeOptions = p.env['NODE_OPTIONS'];
3
- if (!nodeOptions?.match(/--conditions[= ]react-server/)) {
4
- if (!nodeOptions?.match(/--conditions/)) {
5
- console.warn(`process.env['NODE_OPTIONS'] is missing \`--conditions\` flag, it should be like \`--conditions=react-server\` or \`--conditions react-server\`, but was ${JSON.stringify(process.env['NODE_OPTIONS'])}`);
6
- }
7
- if (!nodeOptions?.match(/react-server/)) {
8
- throw new Error(`process.env['NODE_OPTIONS'] is missing \`react-server\` flag, it should be like \`--conditions=react-server\` or \`--conditions react-server\`, but was ${JSON.stringify(process.env['NODE_OPTIONS'])}`);
9
- }
10
- }
11
- return undefined;
12
- }
13
- ;
@@ -1,3 +0,0 @@
1
- import type { CheckFilesExistReturn, ResolvedUserOptions } from "./types.js";
2
- export declare function checkFilesExist(pages: string[], options: ResolvedUserOptions, root: string): Promise<CheckFilesExistReturn>;
3
- //# sourceMappingURL=checkFilesExist.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkFilesExist.d.ts","sourceRoot":"","sources":["../../plugin/checkFilesExist.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAY7E,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,CAAC,CA+ChC"}
@@ -1,67 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- import { existsSync } from 'node:fs';
7
- import { join } from 'node:path';
8
- import { createInputNormalizer } from './helpers/inputNormalizer.js';
9
-
10
- let stashedFiles = null;
11
- const resolveFileOption = (pageOrProps) => {
12
- if (typeof pageOrProps === "string") {
13
- return () => pageOrProps;
14
- }
15
- return pageOrProps;
16
- };
17
- async function checkFilesExist(pages, options, root) {
18
- if (stashedFiles) {
19
- return stashedFiles;
20
- }
21
- if (!root || root === "") {
22
- throw new Error("Root not found");
23
- }
24
- const errors = [];
25
- const pageSet = /* @__PURE__ */ new Set();
26
- const propsSet = /* @__PURE__ */ new Set();
27
- const pageMap = /* @__PURE__ */ new Map();
28
- const propsMap = /* @__PURE__ */ new Map();
29
- const urlMap = /* @__PURE__ */ new Map();
30
- const normalizer = createInputNormalizer({
31
- root,
32
- preserveModulesRoot: options.build.preserveModulesRoot === true ? options.moduleBase : undefined,
33
- removeExtension: true
34
- });
35
- const pageFn = resolveFileOption(options.Page);
36
- const propsFn = resolveFileOption(options.props);
37
- for (const page of pages) {
38
- const pagePath = pageFn(page);
39
- const propsPath = propsFn(page);
40
- const [pageKey, pageValue] = normalizer(pagePath);
41
- const [propsKey, propsValue] = normalizer(propsPath);
42
- try {
43
- if (!existsSync(join(root, pageValue))) {
44
- errors.push(
45
- `Page file not found: ${pagePath}, ${join(root, pagePath)}`
46
- );
47
- }
48
- if (!existsSync(join(root, propsValue))) {
49
- errors.push(
50
- `Props file not found: ${propsPath}, ${join(root, propsPath)}`
51
- );
52
- }
53
- } catch (error) {
54
- errors.push(`Error checking files: ${error}`);
55
- }
56
- urlMap.set(page, { props: propsPath, page: pagePath });
57
- pageSet.add(pagePath);
58
- propsSet.add(propsPath);
59
- pageMap.set(pageKey, pageValue);
60
- propsMap.set(propsKey, propsValue);
61
- }
62
- stashedFiles = { pageMap, pageSet, propsMap, propsSet, urlMap, errors };
63
- return stashedFiles;
64
- }
65
-
66
- export { checkFilesExist };
67
- //# sourceMappingURL=checkFilesExist.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkFilesExist.js","sources":["../../plugin/checkFilesExist.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { CheckFilesExistReturn, ResolvedUserOptions } from \"./types.js\";\nimport { createInputNormalizer } from \"./helpers/inputNormalizer.js\";\n\nlet stashedFiles: CheckFilesExistReturn | null = null;\n\nconst resolveFileOption = (pageOrProps: string | ((url: string) => string)) => {\n if (typeof pageOrProps === \"string\") {\n return () => pageOrProps;\n }\n return pageOrProps;\n};\n\nexport async function checkFilesExist(\n pages: string[],\n options: ResolvedUserOptions,\n root: string\n): Promise<CheckFilesExistReturn> {\n if(stashedFiles){\n return stashedFiles;\n }\n if (!root || root === \"\") {\n throw new Error(\"Root not found\");\n }\n const errors: string[] = [];\n const pageSet = new Set<string>();\n const propsSet = new Set<string>();\n const pageMap = new Map<string, string>();\n const propsMap = new Map<string, string>();\n const urlMap = new Map<string, { props: string; page: string }>();\n const normalizer = createInputNormalizer({\n root,\n preserveModulesRoot: options.build.preserveModulesRoot === true ? options.moduleBase : undefined,\n removeExtension: true,\n });\n const pageFn = resolveFileOption(options.Page);\n const propsFn = resolveFileOption(options.props);\n for (const page of pages) {\n const pagePath = pageFn(page);\n const propsPath = propsFn(page);\n const [pageKey, pageValue] = normalizer(pagePath);\n const [propsKey, propsValue] = normalizer(propsPath);\n try {\n if (!existsSync(join(root, pageValue))) {\n errors.push(\n `Page file not found: ${pagePath}, ${join(root, pagePath)}`\n );\n }\n if (!existsSync(join(root, propsValue))) {\n errors.push(\n `Props file not found: ${propsPath}, ${join(root, propsPath)}`\n );\n }\n } catch (error) {\n errors.push(`Error checking files: ${error}`);\n }\n urlMap.set(page, { props: propsPath, page: pagePath });\n pageSet.add(pagePath);\n propsSet.add(propsPath);\n pageMap.set(pageKey, pageValue);\n propsMap.set(propsKey, propsValue);\n }\n stashedFiles = { pageMap, pageSet, propsMap, propsSet, urlMap, errors };\n return stashedFiles;\n}\n"],"names":[],"mappings":";;;;;;;;;AAKA,IAAI,YAA6C,GAAA,IAAA;AAEjD,MAAM,iBAAA,GAAoB,CAAC,WAAoD,KAAA;AAC7E,EAAI,IAAA,OAAO,gBAAgB,QAAU,EAAA;AACnC,IAAA,OAAO,MAAM,WAAA;AAAA;AAEf,EAAO,OAAA,WAAA;AACT,CAAA;AAEsB,eAAA,eAAA,CACpB,KACA,EAAA,OAAA,EACA,IACgC,EAAA;AAChC,EAAA,IAAG,YAAa,EAAA;AACd,IAAO,OAAA,YAAA;AAAA;AAET,EAAI,IAAA,CAAC,IAAQ,IAAA,IAAA,KAAS,EAAI,EAAA;AACxB,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA;AAAA;AAElC,EAAA,MAAM,SAAmB,EAAC;AAC1B,EAAM,MAAA,OAAA,uBAAc,GAAY,EAAA;AAChC,EAAM,MAAA,QAAA,uBAAe,GAAY,EAAA;AACjC,EAAM,MAAA,OAAA,uBAAc,GAAoB,EAAA;AACxC,EAAM,MAAA,QAAA,uBAAe,GAAoB,EAAA;AACzC,EAAM,MAAA,MAAA,uBAAa,GAA6C,EAAA;AAChE,EAAA,MAAM,aAAa,qBA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AA,EAAM,UAAU,CAAA;AACrD,IAAA,OAAA,CAAQ,IAAI,QAAQ,CAAA;AACpB,IAAA,QAAA,CAAS,IAAI,SAAS,CAAA;AACtB,IAAQ,OAAA,CAAA,GAAA,CAAI,SAAS,SAAS,CAAA;AAC9B,IAAS,QAAA,CAAA,GAAA,CAAI,UAAU,UAAU,CAAA;AAAA;AAEnC,EAAA,YAAA,GAAe,EAAE,OAAS,EAAA,OAAA,EAAS,QAAU,EAAA,QAAA,EAAU,QAAQ,MAAO,EAAA;AACtE,EAAO,OAAA,YAAA;AACT;;;;"}
@@ -1,23 +0,0 @@
1
- import type { Manifest, ModuleGraph } from "vite";
2
- export declare function collectModuleGraphCss({ moduleGraph, pagePath, onCss, parentUrl, }: {
3
- moduleGraph: ModuleGraph;
4
- pagePath: string;
5
- onCss?: (path: string, parentUrl: string) => void;
6
- parentUrl?: string;
7
- }): Promise<Map<string, string>>;
8
- export declare function collectManifestClientFiles({ manifest, root, pagePath, preserveModulesRoot, moduleBase, onCss, onClientModule, testClient, testJson, }: {
9
- manifest: Manifest;
10
- root: string;
11
- pagePath: string;
12
- preserveModulesRoot?: boolean;
13
- moduleBase?: string;
14
- onCss?: (path: string, parentUrl: string) => void;
15
- onClientModule?: (path: string, parentUrl: string) => void;
16
- parentUrl?: string;
17
- testClient?: (id: string) => boolean;
18
- testJson?: (id: string) => boolean;
19
- }): {
20
- cssFiles: Map<string, string>;
21
- clientFiles: Map<string, string>;
22
- };
23
- //# sourceMappingURL=collect-manifest-client-files.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collect-manifest-client-files.d.ts","sourceRoot":"","sources":["../../plugin/collect-manifest-client-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAIlD,wBAAsB,qBAAqB,CAAC,EAC1C,WAAW,EACX,QAAQ,EACR,KAAK,EACL,SAAS,GACV,EAAE;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,gCAoBA;AAED,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,KAAK,EACL,cAAc,EACd,UAA0D,EAC1D,QAAmD,GACpD,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CACpC;;;EA6GA"}
@@ -1,131 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- import { createInputNormalizer } from './helpers/inputNormalizer.js';
7
- import { DEFAULT_CONFIG } from './config/defaults.js';
8
-
9
- async function collectModuleGraphCss({
10
- moduleGraph,
11
- pagePath,
12
- onCss,
13
- parentUrl
14
- }) {
15
- if (!pagePath) return /* @__PURE__ */ new Map();
16
- const cssFiles = /* @__PURE__ */ new Map();
17
- const pageModule = await moduleGraph.getModuleByUrl(pagePath, true);
18
- if (!pageModule) {
19
- return /* @__PURE__ */ new Map();
20
- }
21
- const seen = /* @__PURE__ */ new Set();
22
- const walkModule = (mod) => {
23
- if (!mod?.id || seen.has(mod.id)) return;
24
- seen.add(mod.id);
25
- if (mod?.id?.endsWith(".css")) {
26
- cssFiles.set(mod?.url, mod?.id);
27
- }
28
- mod?.importedModules?.forEach((imp) => walkModule(imp));
29
- };
30
- walkModule(pageModule);
31
- return cssFiles;
32
- }
33
- function collectManifestClientFiles({
34
- manifest,
35
- root,
36
- pagePath,
37
- preserveModulesRoot,
38
- moduleBase,
39
- onCss,
40
- onClientModule,
41
- testClient = DEFAULT_CONFIG.AUTO_DISCOVER.clientComponents,
42
- testJson = DEFAULT_CONFIG.AUTO_DISCOVER.jsonPattern
43
- }) {
44
- const normalizer = createInputNormalizer({
45
- root,
46
- removeExtension: true,
47
- preserveModulesRoot: preserveModulesRoot ? moduleBase : undefined
48
- });
49
- const [_, value] = normalizer(pagePath);
50
- const cssFiles = /* @__PURE__ */ new Map();
51
- const clientFiles = /* @__PURE__ */ new Map();
52
- const seen = /* @__PURE__ */ new Set();
53
- const manifestValues = Object.values(manifest);
54
- const possibleKeys = [
55
- value
56
- // Relative path
57
- ];
58
- const walkManifestEntry = (id, parentUrl) => {
59
- if (seen.has(id)) return;
60
- seen.add(id);
61
- const entry = manifest[id] ?? manifestValues.find((e) => id === e.file);
62
- if (!entry) {
63
- const hasKey = Object.keys(manifest).find((key) => id === key);
64
- if (hasKey) {
65
- console.log(
66
- `Manifest entry found for ${id}, but it is ${typeof entry}`
67
- );
68
- return;
69
- } else {
70
- console.log(
71
- `No manifest entry found for ${id}, possible keys: ${Object.keys(
72
- manifest
73
- ).join(", ")}`
74
- );
75
- }
76
- return;
77
- }
78
- if (typeof testClient === "function" && typeof onClientModule === "function" && testClient(entry.file) || typeof testJson === "function" && testJson(entry.file)) {
79
- onClientModule?.(entry.file ?? "", parentUrl);
80
- clientFiles.set(id, entry.name ?? "");
81
- }
82
- if (entry.css) {
83
- entry.css.forEach((css) => {
84
- cssFiles.set(css, css);
85
- onCss?.(css, id);
86
- onClientModule?.(css, id);
87
- });
88
- }
89
- if (entry.imports) {
90
- entry.imports.forEach(
91
- (imp) => walkManifestEntry(imp, entry.file)
92
- );
93
- }
94
- if (entry.dynamicImports) {
95
- entry.dynamicImports.forEach(
96
- (imp) => walkManifestEntry(imp, entry.file)
97
- );
98
- }
99
- };
100
- for (const possibleKey of possibleKeys) {
101
- if (manifest[possibleKey]) {
102
- walkManifestEntry(possibleKey, pagePath);
103
- break;
104
- }
105
- }
106
- if (cssFiles.size === 0) {
107
- const entry = manifestValues.find(
108
- (e) => possibleKeys.includes(e.file) || e.src && possibleKeys.includes(e.src) || e.name && possibleKeys.includes(e.name)
109
- );
110
- if (entry) {
111
- walkManifestEntry(value, pagePath);
112
- } else {
113
- const hasKey = Object.keys(manifest).find((key) => value === key);
114
- if (hasKey) {
115
- console.warn(
116
- `Manifest entry found for ${value}, but it is ${typeof manifest[hasKey]}`
117
- );
118
- } else {
119
- console.warn(
120
- `No manifest entry found for ${value} (tried all possible keys: ${possibleKeys.join(
121
- ", "
122
- )} for manifest keys: ${Object.keys(manifest).join(", ")})`
123
- );
124
- }
125
- }
126
- }
127
- return { cssFiles, clientFiles };
128
- }
129
-
130
- export { collectManifestClientFiles, collectModuleGraphCss };
131
- //# sourceMappingURL=collect-manifest-client-files.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collect-manifest-client-files.js","sources":["../../plugin/collect-manifest-client-files.ts"],"sourcesContent":["import type { Manifest, ModuleGraph } from \"vite\";\nimport { createInputNormalizer } from \"./helpers/inputNormalizer.js\";\nimport { DEFAULT_CONFIG } from \"./config/defaults.js\";\n\nexport async function collectModuleGraphCss({\n moduleGraph,\n pagePath,\n onCss,\n parentUrl,\n}: {\n moduleGraph: ModuleGraph;\n pagePath: string;\n onCss?: (path: string, parentUrl: string) => void;\n parentUrl?: string;\n}) {\n if (!pagePath) return new Map<string, string>();\n\n const cssFiles = new Map<string, string>();\n const pageModule = await moduleGraph.getModuleByUrl(pagePath, true);\n if (!pageModule) {\n return new Map<string, string>();\n }\n const seen = new Set<string>();\n const walkModule = (mod: any) => {\n if (!mod?.id || seen.has(mod.id)) return;\n seen.add(mod.id);\n if (mod?.id?.endsWith(\".css\")) {\n cssFiles.set(mod?.url, mod?.id);\n onCss?.(mod?.url, parentUrl ?? pagePath);\n }\n mod?.importedModules?.forEach((imp: any) => walkModule(imp));\n };\n walkModule(pageModule);\n return cssFiles;\n}\n\nexport function collectManifestClientFiles({\n manifest,\n root,\n pagePath,\n preserveModulesRoot,\n moduleBase,\n onCss,\n onClientModule,\n testClient = DEFAULT_CONFIG.AUTO_DISCOVER.clientComponents,\n testJson = DEFAULT_CONFIG.AUTO_DISCOVER.jsonPattern,\n}: {\n manifest: Manifest;\n root: string;\n pagePath: string;\n preserveModulesRoot?: boolean;\n moduleBase?: string;\n onCss?: (path: string, parentUrl: string) => void;\n onClientModule?: (path: string, parentUrl: string) => void;\n parentUrl?: string;\n testClient?: (id: string) => boolean;\n testJson?: (id: string) => boolean;\n}) {\n const normalizer = createInputNormalizer({\n root,\n removeExtension: true,\n preserveModulesRoot: preserveModulesRoot ? moduleBase : undefined,\n });\n const [_, value] = normalizer(pagePath);\n\n const cssFiles = new Map<string, string>();\n const clientFiles = new Map<string, string>();\n const seen = new Set<string>();\n const manifestValues = Object.values(manifest);\n\n // Try different variations of the path\n const possibleKeys = [\n value, // Relative path\n ];\n\n const walkManifestEntry = (id: string, parentUrl: string) => {\n if (seen.has(id)) return;\n seen.add(id);\n\n // Get the manifest entry\n const entry = manifest[id] ?? manifestValues.find((e) => id === e.file);\n if (!entry) {\n const hasKey = Object.keys(manifest).find((key) => id === key);\n if (hasKey) {\n console.log(\n `Manifest entry found for ${id}, but it is ${typeof entry}`\n );\n return;\n } else {\n console.log(\n `No manifest entry found for ${id}, possible keys: ${Object.keys(\n manifest\n ).join(\", \")}`\n );\n }\n return;\n }\n if (\n (typeof testClient === \"function\" &&\n typeof onClientModule === \"function\" &&\n testClient(entry.file)) ||\n (typeof testJson === \"function\" && testJson(entry.file))\n ) {\n onClientModule?.(entry.file ?? \"\", parentUrl);\n clientFiles.set(id, entry.name ?? \"\");\n }\n\n // Add direct CSS from the css array\n if (entry.css) {\n entry.css.forEach((css: string) => {\n cssFiles.set(css, css);\n onCss?.(css, id);\n onClientModule?.(css, id);\n });\n }\n\n // Walk imports recursively\n if (entry.imports) {\n entry.imports.forEach((imp: string) =>\n walkManifestEntry(imp, entry.file)\n );\n }\n\n // Also check dynamicImports\n if (entry.dynamicImports) {\n entry.dynamicImports.forEach((imp: string) =>\n walkManifestEntry(imp, entry.file)\n );\n }\n };\n\n // Try all possible keys\n for (const possibleKey of possibleKeys) {\n if (manifest[possibleKey]) {\n walkManifestEntry(possibleKey, pagePath);\n break;\n }\n }\n\n // If no entry found by key, try matching by file\n if (cssFiles.size === 0) {\n const entry = manifestValues.find(\n (e) =>\n possibleKeys.includes(e.file) ||\n (e.src && possibleKeys.includes(e.src)) ||\n (e.name && possibleKeys.includes(e.name))\n );\n if (entry) {\n walkManifestEntry(value, pagePath);\n } else {\n const hasKey = Object.keys(manifest).find((key) => value === key);\n if (hasKey) {\n console.warn(\n `Manifest entry found for ${value}, but it is ${typeof manifest[hasKey]}`\n );\n } else {\n console.warn(\n `No manifest entry found for ${value} (tried all possible keys: ${possibleKeys.join(\n \", \"\n )} for manifest keys: ${Object.keys(manifest).join(\", \")})`\n );\n }\n }\n }\n\n return { cssFiles, clientFiles };\n}\n"],"names":[],"mappings":";;;;;;;;AAIA,eAAsB,qBAAsB,CAAA;AAAA,EAC1C,WAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAKG,EAAA;AACD,EAAA,IAAI,CAAC,QAAA,EAAiB,uBAAA,IAAI,GAAoB,EAAA;AAE9C,EAAM,MAAA,QAAA,uBAAe,GAAoB,EAAA;AACzC,EAAA,MAAM,UAAa,GAAA,MAAM,WAAY,CAAA,cAAA,C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I,KAAO,EAAA;AACT,MAAA,iBAAA,CAAkB,OAAO,QAAQ,CAAA;AAAA,KAC5B,MAAA;AACL,MAAM,MAAA,MAAA,GAAS,OAAO,IAAK,CAAA,QAAQ,EAAE,IAAK,CAAA,CAAC,GAAQ,KAAA,KAAA,KAAU,GAAG,CAAA;AAChE,MAAA,IAAI,MAAQ,EAAA;AACV,QAAQ,OAAA,CAAA,IAAA;AAAA,UACN,4BAA4B,KAAK,CAAA,YAAA,EAAe,OAAO,QAAA,CAAS,MAAM,CAAC,CAAA;AAAA,SACzE;AAAA,OACK,MAAA;AACL,QAAQ,OAAA,CAAA,IAAA;AAAA,UACN,CAAA,4BAAA,EAA+B,KAAK,CAAA,2BAAA,EAA8B,YAAa,CAAA,IAAA;AAAA,YAC7E;AAAA,WACD,uBAAuB,MAAO,CAAA,IAAA,CAAK,QAAQ,CAAE,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,SAC1D;AAAA;AACF;AACF;AAGF,EAAO,OAAA,EAAE,UAAU,WAAY,EAAA;AACjC;;;;"}
@@ -1,2 +0,0 @@
1
- export declare const getWorkerPath: (condition: "react-client" | "react-server") => string;
2
- //# sourceMappingURL=getWorkerPath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getWorkerPath.d.ts","sourceRoot":"","sources":["../../../plugin/config/getWorkerPath.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,cAAe,cAAc,GAAG,cAAc,KAAG,MAE1E,CAAA"}
@@ -1,4 +0,0 @@
1
- import { DEFAULT_CONFIG } from './defaults.js';
2
- export const getWorkerPath = (condition) => {
3
- return condition === 'react-server' ? DEFAULT_CONFIG.HTML_WORKER_PATH : DEFAULT_CONFIG.RSC_WORKER_PATH;
4
- };
@@ -1,4 +0,0 @@
1
- export declare function copyDir(src: string, dest: string, options?: {
2
- filter?: (file: string) => boolean;
3
- }): Promise<void>;
4
- //# sourceMappingURL=copy-dir.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-dir.d.ts","sourceRoot":"","sources":["../../plugin/copy-dir.ts"],"names":[],"mappings":"AAGA,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IACjE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;CACnC,iBAqBA"}
@@ -1,25 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- import { readdirSync, mkdirSync, statSync, copyFileSync } from 'node:fs';
7
- import { join } from 'node:path';
8
-
9
- async function copyDir(src, dest, options) {
10
- const entries = readdirSync(src);
11
- mkdirSync(dest, { recursive: true });
12
- for (const entry of entries) {
13
- const srcPath = join(src, entry);
14
- const destPath = join(dest, entry);
15
- const stat = statSync(srcPath);
16
- if (stat.isDirectory()) {
17
- await copyDir(srcPath, destPath);
18
- } else {
19
- copyFileSync(srcPath, destPath);
20
- }
21
- }
22
- }
23
-
24
- export { copyDir };
25
- //# sourceMappingURL=copy-dir.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-dir.js","sources":["../../plugin/copy-dir.ts"],"sourcesContent":["import { copyFileSync, mkdirSync, readdirSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nexport async function copyDir(src: string, dest: string, options?: { \n filter?: (file: string) => boolean \n}) {\n const entries = readdirSync(src);\n\n mkdirSync(dest, { recursive: true });\n\n for (const entry of entries) {\n const srcPath = join(src, entry);\n const destPath = join(dest, entry);\n\n const stat = statSync(srcPath);\n \n if (options?.filter && !options.filter(srcPath)) {\n continue;\n }\n\n if (stat.isDirectory()) {\n await copyDir(srcPath, destPath, options);\n } else {\n copyFileSync(srcPath, destPath);\n }\n }\n} "],"names":[],"mappings":";;;;;;;;AAGsB,eAAA,OAAA,CAAQ,GAAa,EAAA,IAAA,EAAc,OAEtD,EAAA;AACD,EAAM,MAAA,OAAA,GAAU,YAAY,GAAG,CAAA;AAE/B,EAAA,SAAA,CAAU,IAAM,EAAA,EAAE,SAAW,EAAA,IAAA,EAAM,CAAA;AAEnC,EAAA,KAAA,MAAW,SAAS,OAAS,EAAA;AAC3B,IAAM,MAAA,OAAA,GAAU,IAAK,CAAA,GAAA,EAAK,KAAK,CAAA;AAC/B,IAAM,MAAA,QAAA,GAAW,IAAK,CAAA,IAAA,EAAM,KAAK,CAAA;AAEjC,IAAM,MAAA,IAAA,GAAO,SAAS,OAAO,CAAA;AAM7B,IAAI,IAAA,IAAA,CAAK,aAAe,EAAA;AACtB,MAAM,MAAA,OAAA,CAAQ,OAAS,EAAA,QAAiB,CAAA;AAAA,KACnC,MAAA;AACL,MAAA,YAAA,CAAa,SAAS,QAAQ,CAAA;AAAA;AAChC;AAEJ;;;;"}
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import type { InlineCssCollectorProps } from "./types.js";
3
- /**
4
- * A component that inlines pre-transformed CSS content.
5
- * Expects cssFiles to be an array of CssContent objects with the content already loaded.
6
- */
7
- export declare function InlineCssCollector({ children, cssFiles, moduleRootPath, }: InlineCssCollectorProps): React.FunctionComponentElement<{
8
- children?: React.ReactNode | undefined;
9
- }>;
10
- //# sourceMappingURL=css-collector-inline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"css-collector-inline.d.ts","sourceRoot":"","sources":["../../plugin/css-collector-inline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAG,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAU3D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,QAAQ,EACR,cAAc,GACf,EAAE,uBAAuB;;GAuCzB"}
@@ -1,55 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- import React__default from 'react';
7
- import { join } from 'node:path';
8
- import { readFileSync } from 'node:fs';
9
-
10
- function InlineCssCollector({
11
- children,
12
- cssFiles,
13
- moduleRootPath
14
- }) {
15
- return React__default.createElement(
16
- React__default.Fragment,
17
- null,
18
- cssFiles.map((file, index) => {
19
- if (typeof file === "string") {
20
- let filePath = file;
21
- if (process.env["NODE_ENV"] === "development") {
22
- return React__default.createElement("link", {
23
- key: file,
24
- rel: "stylesheet",
25
- href: filePath
26
- });
27
- }
28
- return React__default.createElement(
29
- "style",
30
- {
31
- key: file,
32
- type: "text/css"
33
- },
34
- readFileSync(join(moduleRootPath, filePath), "utf-8")
35
- );
36
- }
37
- const { type, content, key, path } = file;
38
- return React__default.createElement(
39
- "style",
40
- {
41
- key: key ?? path ?? index,
42
- type: type ?? "text/css",
43
- ...process.env["NODE_ENV"] === "development" && {
44
- "data-vite-dev-id": join(moduleRootPath, path)
45
- }
46
- },
47
- content
48
- );
49
- }),
50
- children
51
- );
52
- }
53
-
54
- export { InlineCssCollector };
55
- //# sourceMappingURL=css-collector-inline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"css-collector-inline.js","sources":["../../plugin/css-collector-inline.tsx"],"sourcesContent":["import React from \"react\";\nimport { join } from \"node:path\";\nimport type { InlineCssCollectorProps } from \"./types.js\";\nimport { readFileSync } from \"node:fs\";\n\ninterface CssContent {\n type?: string;\n content: string;\n key?: string;\n path: string;\n}\n\n/**\n * A component that inlines pre-transformed CSS content.\n * Expects cssFiles to be an array of CssContent objects with the content already loaded.\n */\nexport function InlineCssCollector({\n children,\n cssFiles,\n moduleRootPath,\n}: InlineCssCollectorProps) {\n return React.createElement(\n React.Fragment,\n null,\n cssFiles.map((file, index) => {\n if (typeof file === \"string\") {\n let filePath = file as string;\n if(process.env[\"NODE_ENV\"] === \"development\") {\n return React.createElement(\"link\", {\n key: file,\n rel: \"stylesheet\",\n href: filePath,\n });\n }\n return React.createElement(\n \"style\",\n {\n key: file,\n type: \"text/css\",\n },\n readFileSync(join(moduleRootPath, filePath), \"utf-8\")\n );\n }\n\n const { type, content, key, path } = file as CssContent;\n return React.createElement(\n \"style\",\n {\n key: key ?? path ?? index,\n type: type ?? \"text/css\",\n ...(process.env[\"NODE_ENV\"] === \"development\" && {\n \"data-vite-dev-id\": join(moduleRootPath, path),\n }),\n },\n content\n );\n }),\n children\n );\n}\n"],"names":["React"],"mappings":";;;;;;;;;AAgBO,SAAS,kBAAmB,CAAA;AAAA,EACjC,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAA4B,EAAA;AAC1B,EAAA,OAAOA,cAAM,CAAA,aAAA;AAAA,IACXA,cAAM,CAAA,QAAA;AAAA,IACN,IAAA;AAAA,IACA,QAAS,CAAA,GAAA,CAAI,CAAC,IAAA,EAAM,KAAU,KAAA;AAC5B,MAAI,IAAA,OAAO,SAAS,QAAU,EAAA;AAC5B,QAAA,IAAI,QAAW,GAAA,IAAA;AACf,QAAA,IAAG,OAAQ,CAAA,GAAA,CAAI,UAAU,CAAA,KAAM,aAAe,EAAA;AAC5C,UAAO,OAAAA,cAAA,CAAM,cAAc,MAAQ,EAAA;AAAA,YACjC,GAAK,EAAA,IAAA;AAAA,YACL,GAAK,EAAA,YAAA;AAAA,YACL,IAAM,EAAA;AAAA,WACP,CAAA;AAAA;AAEH,QAAA,OAAOA,cAAM,CAAA,aAAA;AAAA,UACX,OAAA;AAAA,UACA;AAAA,YACE,GAAK,EAAA,IAAA;AAAA,YACL,IAAM,EAAA;AAAA,WACR;AAAA,UACA,YAAa,CAAA,IAAA,CAAK,cAAgB,EAAA,QAAQ,GAAG,OAAO;AAAA,SACtD;AAAA;AAGF,MAAA,MAAM,EAAE,IAAA,EAAM,OAAS,EAAA,GAAA,EAAK,MAAS,GAAA,IAAA;AACrC,MAAA,OAAOA,cAAM,CAAA,aAAA;AAAA,QACX,OAAA;AAAA,QACA;AAAA,UACE,GAAA,EAAK,OAAO,IAAQ,IAAA,KAAA;AAAA,UACpB,MAAM,IAAQ,IAAA,UAAA;AAAA,UACd,GAAI,OAAA,CAAQ,GAAI,CAAA,UAAU,MAAM,aAAiB,IAAA;AAAA,YAC/C,kBAAA,EAAoB,IAAK,CAAA,cAAA,EAAgB,IAAI;AAAA;AAC/C,SACF;AAAA,QACA;AAAA,OACF;AAAA,KACD,CAAA;AAAA,IACD;AAAA,GACF;AACF;;;;"}
@@ -1,16 +0,0 @@
1
- import type { MessagePort } from 'node:worker_threads';
2
- import type { LoadHookContext } from 'node:module';
3
- type LoaderContext = {
4
- data?: {
5
- port: MessagePort;
6
- };
7
- };
8
- export declare function initialize(data: {
9
- port: MessagePort;
10
- }): Promise<void>;
11
- export declare function setCurrentPage(page: string | null): void;
12
- export declare function getCssFilesForPage(page: string): string[];
13
- export declare function load(url: string, context: LoadHookContext & LoaderContext, defaultLoad: any): Promise<any>;
14
- export declare function resolve(specifier: string, context: any, defaultResolve: any): any;
15
- export {};
16
- //# sourceMappingURL=css-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"css-loader.d.ts","sourceRoot":"","sources":["../../../plugin/loader/css-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;CAC9B,CAAC;AAKF,wBAAsB,UAAU,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,iBAI3D;AAKD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,QAIjD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEzD;AAGD,wBAAsB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,EAAE,WAAW,EAAE,GAAG,gBAqDjG;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,OAE3E"}
@@ -1,70 +0,0 @@
1
- /**
2
- * vite-plugin-react-server
3
- * Copyright (c) Nico Brinkkemper
4
- * MIT License
5
- */
6
- import { readFile } from 'fs/promises';
7
- import { basename } from 'path';
8
- import postcss from 'postcss';
9
-
10
- let cssLoaderPort;
11
- async function initialize(data) {
12
- cssLoaderPort = data.port;
13
- data.port.postMessage({ type: "INITIALIZED" });
14
- data.port.unref();
15
- }
16
- const cssFilesByPage = /* @__PURE__ */ new Map();
17
- function setCurrentPage(page) {
18
- if (page && !cssFilesByPage.has(page)) {
19
- cssFilesByPage.set(page, /* @__PURE__ */ new Set());
20
- }
21
- }
22
- function getCssFilesForPage(page) {
23
- return Array.from(cssFilesByPage.get(page) || []);
24
- }
25
- async function load(url, context, defaultLoad) {
26
- if (url.endsWith(".css")) {
27
- const source = await readFile(new URL(url), "utf-8");
28
- const result = await postcss().process(source, {
29
- from: url,
30
- to: url,
31
- map: {
32
- inline: false,
33
- annotation: false
34
- }
35
- });
36
- const moduleName = basename(url, ".css").replace(".", "_");
37
- const classes = {};
38
- result.root.walkRules((rule) => {
39
- const selector = rule.selector.replace(".", "");
40
- const className = `${moduleName}_${selector}`;
41
- classes[selector] = className;
42
- rule.selector = `.${className}`;
43
- });
44
- const transformedCss = result.root.toString();
45
- if (cssLoaderPort) {
46
- cssLoaderPort.postMessage({
47
- type: "CSS_FILE",
48
- id: url,
49
- cssFile: transformedCss
50
- });
51
- }
52
- const moduleSource = `
53
- const styles = ${JSON.stringify(classes)};
54
- export default styles;
55
- export const css = ${JSON.stringify(transformedCss)};
56
- `;
57
- return {
58
- format: "module",
59
- source: moduleSource,
60
- shortCircuit: true
61
- };
62
- }
63
- return defaultLoad(url, context, defaultLoad);
64
- }
65
- function resolve(specifier, context, defaultResolve) {
66
- return defaultResolve(specifier, context, defaultResolve);
67
- }
68
-
69
- export { getCssFilesForPage, initialize, load, resolve, setCurrentPage };
70
- //# sourceMappingURL=css-loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"css-loader.js","sources":["../../../plugin/loader/css-loader.ts"],"sourcesContent":["import { readFile } from 'fs/promises';\nimport { basename } from 'path';\nimport postcss from 'postcss';\nimport type { MessagePort } from 'node:worker_threads';\nimport type { CssFileMessage } from '../worker/types.js';\nimport type { LoadHookContext } from 'node:module';\n\ntype LoaderContext = {\n data?: { port: MessagePort };\n};\n// Store port globally for CSS loader\nlet cssLoaderPort: MessagePort | undefined;\n\n// Initialize hook\nexport async function initialize(data: { port: MessagePort }) {\n cssLoaderPort = data.port; // Store port\n data.port.postMessage({ type: 'INITIALIZED' });\n data.port.unref();\n}\n\n// CSS file tracking per page\nconst cssFilesByPage = new Map<string, Set<string>>();\n\nexport function setCurrentPage(page: string | null) {\n if (page && !cssFilesByPage.has(page)) {\n cssFilesByPage.set(page, new Set());\n }\n}\n\nexport function getCssFilesForPage(page: string): string[] {\n return Array.from(cssFilesByPage.get(page) || []);\n}\n\n// Modify the CSS handling in the load function\nexport async function load(url: string, context: LoadHookContext & LoaderContext, defaultLoad: any) {\n // Handle CSS files\n if(url.endsWith(\".css\")) {\n const source = await readFile(new URL(url), 'utf-8');\n \n // Process CSS with PostCSS\n const result = await postcss().process(source, {\n from: url,\n to: url,\n map: {\n inline: false,\n annotation: false\n }\n });\n\n // Generate both transformed CSS and class mappings\n const moduleName = basename(url, '.css').replace('.', '_');\n const classes: Record<string, string> = {};\n\n // Transform selectors\n result.root.walkRules(rule => {\n const selector = rule.selector.replace('.', '');\n const className = `${moduleName}_${selector}`;\n classes[selector] = className;\n rule.selector = `.${className}`;\n });\n\n // Get transformed CSS using root.toString()\n const transformedCss = result.root.toString();\n\n // Send processed CSS to worker\n if (cssLoaderPort) {\n cssLoaderPort.postMessage({\n type: 'CSS_FILE',\n id: url,\n cssFile: transformedCss\n } satisfies CssFileMessage);\n }\n \n // Return CSS module\n const moduleSource = `\n const styles = ${JSON.stringify(classes)};\n export default styles;\n export const css = ${JSON.stringify(transformedCss)};\n `;\n\n return {\n format: 'module',\n source: moduleSource,\n shortCircuit: true\n };\n }\n return defaultLoad(url, context, defaultLoad);\n}\n\nexport function resolve(specifier: string, context: any, defaultResolve: any) {\n return defaultResolve(specifier, context, defaultResolve);\n}\n\n\n"],"names":[],"mappings":";;;;;;;;;AAWA,IAAI,aAAA;AAGJ,eAAsB,WAAW,IAA6B,EAAA;AAC5D,EAAA,aAAA,GAAgB,IAAK,CAAA,IAAA;AACrB,EAAA,IAAA,CAAK,IAAK,CAAA,WAAA,CAAY,EAAE,IAAA,EAAM,eAAe,CAAA;AAC7C,EAAA,IAAA,CAAK,KAAK,KAAM,EAAA;AAClB;AAGA,MAAM,cAAA,uBAAqB,GAAyB,EAAA;AAE7C,SAAS,eAAe,IAAqB,EAAA;AAClD,EAAA,IAAI,IAAQ,IAAA,CAAC,cAAe,CAAA,GAAA,CAAI,IAAI,CAAG,EAAA;AACrC,IAAA,cAAA,CAAe,GAAI,CAAA,IAAA,kBAAU,IAAA,GAAA,EAAK,CAAA;AAAA;AAEtC;AAEO,SAAS,mBAAmB,IAAwB,EAAA;AACzD,EAAA,OAAO,MAAM,IAAK,CAAA,cAAA,CAAe,IAAI,IAAI,CAAA,IAAK,EAAE,CAAA;AAClD;AAGsB,eAAA,IAAA,CAAK,GAAa,EAAA,OAAA,EAA0C,WAAkB,EAAA;AAElG,EAAG,IAAA,GAAA,CAAI,QAAS,CAAA,MAAM,CAAG,EAAA;AACvB,IAAA,MAAM,SAAS,MAAM,QAAA,CAAS,IAAI,GAAI,CAAA,GAAG,GAAG,OAAO,CAAA;AAGnD,IAAA,MAAM,MAAS,GAAA,MAAM,OAAQ,EAAA,CAAE,QAAQ,MAAQ,EAAA;AAAA,MAC7C,IAAM,EAAA,GAAA;AAAA,MACN,EAAI,EAAA,GAAA;AAAA,MACJ,GAAK,EAAA;AAAA,QACH,MAAQ,EAAA,KAAA;AAAA,QACR,UAAY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,SAAW,EAAA,OAAA,EAAS,cAAc,CAAA;AAC1D;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../plugin/react-client/index.ts"],"sourcesContent":["import { reactPreservePlugin } from \"../plugin.js\";\nimport { reactTransformPlugin } from \"../transformer/plugin.js\";\nimport type { StreamPluginOptions } from \"../types.js\";\nimport { reactClientPlugin } from \"./plugin.js\";\n\nexport function vitePluginReactClient(options = {} as StreamPluginOptions): import(\"vite\").Plugin[] {\n return [\n reactClientPlugin(options),\n reactTransformPlugin(options),\n reactPreservePlugin(options),\n ];\n } "],"names":[],"mappings":";;;;;;;;;AAKgB,SAAA,qBAAA,CAAsB,OAAU,GAAA,EAAoD,EAAA;AAChG,EAAO,OAAA;AAAA,IACL,kBAAkB,OAAO,CAAA;AAAA,IACzB,qBAAqB,OAAO,CAAA;AAAA,IAC5B,oBAA2B;AAAA,GAC7B;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../plugin/react-server/index.ts"],"sourcesContent":["import { reactPreservePlugin } from \"../preserver/plugin.js\";\nimport { reactStaticPlugin } from \"../react-static/plugin.js\";\nimport { reactTransformPlugin } from \"../transformer/plugin.js\";\nimport type { StreamPluginOptions } from \"../types.js\";\nimport { reactServerPlugin } from \"./plugin.js\";\n\nexport function vitePluginReactServer(options = {} as StreamPluginOptions): import(\"vite\").Plugin[] {\n return [\n reactTransformPlugin(options),\n reactServerPlugin(options),\n reactStaticPlugin(options),\n reactPreservePlugin(options),\n ];\n } "],"names":[],"mappings":";;;;;;;;;;AAMgB,SAAA,qBAAA,CAAsB,OAAU,GAAA,EAAoD,EAAA;AAChG,EAAO,OAAA;AAAA,IACL,qBAAqB,OAAO,CAAA;AAAA,IAC5B,kBAAkB,OAAO,CAAA;AAAA,IACzB,kBAAkB,OAAO,CAAA;AAAA,IACzB,oBAA2B;AAAA,GAC7B;AACF;;;;"}
@@ -1,26 +0,0 @@
1
- import type { Worker } from "node:worker_threads";
2
- import type { CheckFilesExistReturn, CreateHandlerOptions, PageData } from "../../types.js";
3
- import { type Manifest, type IndexHtmlTransformHook } from "vite";
4
- type RenderPagesOptions<T = any> = Omit<CreateHandlerOptions<T>, "url" | "route" | "getCss" | "propsPath" | "pagePath"> & {
5
- clientManifest: Manifest;
6
- serverManifest: Manifest;
7
- worker: Worker;
8
- loader: (id: string) => Promise<Record<string, any>>;
9
- onCssFile?: (url: string, parentUrl: string) => void;
10
- onClientJSFile?: (url: string, parentUrl: string) => void;
11
- onPage?: (pageData: PageData) => Promise<void>;
12
- clientCss?: string[];
13
- transformIndexHtml: IndexHtmlTransformHook;
14
- outDir: string;
15
- htmlOutputPath: string;
16
- server?: any;
17
- bundle?: any;
18
- chunk?: any;
19
- originalUrl?: string;
20
- };
21
- export declare function renderPages<T = any>(routes: string[], files: CheckFilesExistReturn, options: RenderPagesOptions<T>): Promise<{
22
- failedRoutes: Map<string, Error>;
23
- completedRoutes: Set<string>;
24
- }>;
25
- export {};
26
- //# sourceMappingURL=renderPages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderPages.d.ts","sourceRoot":"","sources":["../../../../plugin/worker/html/renderPages.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,sBAAsB,EAAgB,MAAM,MAAM,CAAC;AAIhF,KAAK,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC,GAAG;IACxH,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAA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