remote-components 0.1.2 → 0.2.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 (470) hide show
  1. package/dist/{next/config.cjs → config/nextjs.cjs} +76 -101
  2. package/dist/config/nextjs.cjs.map +1 -0
  3. package/dist/{next/config.d.ts → config/nextjs.d.ts} +4 -4
  4. package/dist/{next/config.js → config/nextjs.js} +72 -97
  5. package/dist/config/nextjs.js.map +1 -0
  6. package/dist/{webpack.cjs → config/webpack.cjs} +13 -29
  7. package/dist/config/webpack.cjs.map +1 -0
  8. package/dist/{webpack.js → config/webpack.js} +12 -28
  9. package/dist/config/webpack.js.map +1 -0
  10. package/dist/{shared/remote → host/defaults}/app.cjs +2 -2
  11. package/dist/host/defaults/app.cjs.map +1 -0
  12. package/dist/host/defaults/app.js +8 -0
  13. package/dist/host/defaults/app.js.map +1 -0
  14. package/dist/{shared/remote → host/defaults}/pages.cjs +2 -2
  15. package/dist/host/defaults/pages.cjs.map +1 -0
  16. package/dist/host/defaults/pages.js +8 -0
  17. package/dist/host/defaults/pages.js.map +1 -0
  18. package/dist/{html/host.cjs → host/html.cjs} +1012 -1075
  19. package/dist/host/html.cjs.map +1 -0
  20. package/dist/{html/host.d.ts → host/html.d.ts} +0 -2
  21. package/dist/{html/host.js → host/html.js} +1009 -1071
  22. package/dist/host/html.js.map +1 -0
  23. package/dist/{next/host/client/index.cjs → host/nextjs/app/client-only.cjs} +681 -617
  24. package/dist/host/nextjs/app/client-only.cjs.map +1 -0
  25. package/dist/host/nextjs/app/client-only.d.ts +16 -0
  26. package/dist/{next/host/client/index.js → host/nextjs/app/client-only.js} +682 -611
  27. package/dist/host/nextjs/app/client-only.js.map +1 -0
  28. package/dist/{next/host/app-router-server.cjs → host/nextjs/app.cjs} +11 -10
  29. package/dist/host/nextjs/app.cjs.map +1 -0
  30. package/dist/host/nextjs/app.d.ts +29 -0
  31. package/dist/{next/host/app-router-server.js → host/nextjs/app.js} +7 -6
  32. package/dist/host/nextjs/app.js.map +1 -0
  33. package/dist/{next/host/pages-router-client.cjs → host/nextjs/pages/client-only.cjs} +8 -8
  34. package/dist/host/nextjs/pages/client-only.cjs.map +1 -0
  35. package/dist/host/nextjs/pages/client-only.d.ts +31 -0
  36. package/dist/{next/host/pages-router-client.js → host/nextjs/pages/client-only.js} +4 -4
  37. package/dist/host/nextjs/pages/client-only.js.map +1 -0
  38. package/dist/{next/host/pages-router-server.cjs → host/nextjs/pages.cjs} +44 -55
  39. package/dist/host/nextjs/pages.cjs.map +1 -0
  40. package/dist/{next/host/pages-router-server.d.ts → host/nextjs/pages.d.ts} +11 -13
  41. package/dist/{next/host/pages-router-server.js → host/nextjs/pages.js} +38 -49
  42. package/dist/host/nextjs/pages.js.map +1 -0
  43. package/dist/host/proxy/client.cjs +57 -0
  44. package/dist/host/proxy/client.cjs.map +1 -0
  45. package/dist/host/proxy/client.d.ts +31 -0
  46. package/dist/host/proxy/client.js +30 -0
  47. package/dist/host/proxy/client.js.map +1 -0
  48. package/dist/{shared/host/proxy.cjs → host/proxy/protected-fetch.cjs} +6 -6
  49. package/dist/host/proxy/protected-fetch.cjs.map +1 -0
  50. package/dist/{shared/host/proxy.js → host/proxy/protected-fetch.js} +3 -3
  51. package/dist/host/proxy/protected-fetch.js.map +1 -0
  52. package/dist/{next → host}/proxy.cjs +12 -92
  53. package/dist/host/proxy.cjs.map +1 -0
  54. package/dist/host/proxy.d.ts +30 -0
  55. package/dist/{next → host}/proxy.js +11 -88
  56. package/dist/host/proxy.js.map +1 -0
  57. package/dist/{react/index.cjs → host/react.cjs} +515 -548
  58. package/dist/host/react.cjs.map +1 -0
  59. package/dist/{component-loader-21865da3.d.ts → host/react.d.ts} +141 -99
  60. package/dist/{react/index.js → host/react.js} +514 -545
  61. package/dist/host/react.js.map +1 -0
  62. package/dist/internal/{webpack/shared-modules.cjs → config/webpack/apply-shared-modules.cjs} +12 -15
  63. package/dist/internal/config/webpack/apply-shared-modules.cjs.map +1 -0
  64. package/dist/internal/{webpack/shared-modules.js → config/webpack/apply-shared-modules.js} +9 -12
  65. package/dist/internal/config/webpack/apply-shared-modules.js.map +1 -0
  66. package/dist/internal/{webpack → config/webpack}/next-client-pages-loader.cjs +1 -1
  67. package/dist/internal/config/webpack/next-client-pages-loader.cjs.map +1 -0
  68. package/dist/internal/{webpack → config/webpack}/next-client-pages-loader.js +1 -1
  69. package/dist/internal/config/webpack/next-client-pages-loader.js.map +1 -0
  70. package/dist/internal/{next/host/app-router-client.cjs → host/nextjs/app-client.cjs} +29 -24
  71. package/dist/internal/host/nextjs/app-client.cjs.map +1 -0
  72. package/dist/internal/host/nextjs/app-client.d.ts +25 -0
  73. package/dist/internal/{next/host/app-router-client.js → host/nextjs/app-client.js} +19 -19
  74. package/dist/internal/host/nextjs/app-client.js.map +1 -0
  75. package/dist/internal/{next/host/app-router-compat.cjs → host/nextjs/app-compat.cjs} +5 -22
  76. package/dist/internal/host/nextjs/app-compat.cjs.map +1 -0
  77. package/dist/internal/{next/host/app-router-compat.d.ts → host/nextjs/app-compat.d.ts} +1 -7
  78. package/dist/internal/{next/host/app-router-compat.js → host/nextjs/app-compat.js} +2 -18
  79. package/dist/internal/host/nextjs/app-compat.js.map +1 -0
  80. package/dist/internal/host/nextjs/dom-flight.cjs.map +1 -0
  81. package/dist/internal/host/nextjs/dom-flight.d.ts +39 -0
  82. package/dist/internal/host/nextjs/dom-flight.js.map +1 -0
  83. package/dist/internal/host/nextjs/image-impl.cjs +60 -0
  84. package/dist/internal/host/nextjs/image-impl.cjs.map +1 -0
  85. package/dist/internal/host/nextjs/image-impl.d.ts +10 -0
  86. package/dist/internal/host/nextjs/image-impl.js +36 -0
  87. package/dist/internal/host/nextjs/image-impl.js.map +1 -0
  88. package/dist/internal/host/nextjs/image-shared.cjs +43 -0
  89. package/dist/internal/host/nextjs/image-shared.cjs.map +1 -0
  90. package/dist/internal/host/nextjs/image-shared.d.ts +9 -0
  91. package/dist/internal/host/nextjs/image-shared.js +19 -0
  92. package/dist/internal/host/nextjs/image-shared.js.map +1 -0
  93. package/dist/internal/{next/host → host/nextjs}/remote-component-links.cjs +2 -2
  94. package/dist/internal/host/nextjs/remote-component-links.cjs.map +1 -0
  95. package/dist/internal/{next/host → host/nextjs}/remote-component-links.d.ts +1 -1
  96. package/dist/internal/{next/host → host/nextjs}/remote-component-links.js +2 -2
  97. package/dist/internal/host/nextjs/remote-component-links.js.map +1 -0
  98. package/dist/internal/host/nextjs/skeleton.cjs.map +1 -0
  99. package/dist/internal/host/nextjs/skeleton.js.map +1 -0
  100. package/dist/internal/{react → host/react}/context.cjs +3 -3
  101. package/dist/internal/host/react/context.cjs.map +1 -0
  102. package/dist/internal/{react → host/react}/context.d.ts +4 -4
  103. package/dist/internal/{react → host/react}/context.js +2 -2
  104. package/dist/internal/host/react/context.js.map +1 -0
  105. package/dist/internal/{react → host/react}/hooks/use-resolve-client-url.cjs +2 -2
  106. package/dist/internal/host/react/hooks/use-resolve-client-url.cjs.map +1 -0
  107. package/dist/internal/{react → host/react}/hooks/use-resolve-client-url.d.ts +1 -1
  108. package/dist/internal/{react → host/react}/hooks/use-resolve-client-url.js +2 -2
  109. package/dist/internal/host/react/hooks/use-resolve-client-url.js.map +1 -0
  110. package/dist/internal/host/server/fetch-headers.cjs.map +1 -0
  111. package/dist/internal/host/server/fetch-headers.js.map +1 -0
  112. package/dist/internal/{shared/ssr → host/server}/fetch-remote-component.cjs +6 -6
  113. package/dist/internal/host/server/fetch-remote-component.cjs.map +1 -0
  114. package/dist/internal/{shared/ssr → host/server}/fetch-remote-component.d.ts +6 -1
  115. package/dist/internal/{shared/ssr → host/server}/fetch-remote-component.js +9 -9
  116. package/dist/internal/host/server/fetch-remote-component.js.map +1 -0
  117. package/dist/internal/{shared/ssr → host/server}/fetch-with-hooks.cjs +11 -15
  118. package/dist/internal/host/server/fetch-with-hooks.cjs.map +1 -0
  119. package/dist/internal/host/server/fetch-with-hooks.d.ts +21 -0
  120. package/dist/internal/{shared/ssr → host/server}/fetch-with-hooks.js +11 -15
  121. package/dist/internal/host/server/fetch-with-hooks.js.map +1 -0
  122. package/dist/internal/host/server/get-client-or-server-url.cjs.map +1 -0
  123. package/dist/internal/host/server/get-client-or-server-url.js.map +1 -0
  124. package/dist/internal/{shared/client → host/server}/get-client-src.cjs +1 -1
  125. package/dist/internal/host/server/get-client-src.cjs.map +1 -0
  126. package/dist/internal/{shared/client → host/server}/get-client-src.js +1 -1
  127. package/dist/internal/host/server/get-client-src.js.map +1 -0
  128. package/dist/internal/host/server/get-ssr-relative-path-base-url.cjs.map +1 -0
  129. package/dist/internal/host/server/get-ssr-relative-path-base-url.js.map +1 -0
  130. package/dist/{next/remote/server.cjs → internal/host/server/types.cjs} +3 -15
  131. package/dist/internal/host/server/types.cjs.map +1 -0
  132. package/dist/internal/host/server/types.d.ts +33 -0
  133. package/dist/internal/host/server/types.js +1 -0
  134. package/dist/internal/host/server/types.js.map +1 -0
  135. package/dist/internal/host/shared/asset-descriptors.cjs +17 -0
  136. package/dist/internal/host/shared/asset-descriptors.cjs.map +1 -0
  137. package/dist/internal/host/shared/asset-descriptors.d.ts +21 -0
  138. package/dist/internal/host/shared/asset-descriptors.js +1 -0
  139. package/dist/internal/host/shared/asset-descriptors.js.map +1 -0
  140. package/dist/internal/host/shared/config.cjs +17 -0
  141. package/dist/internal/host/shared/config.cjs.map +1 -0
  142. package/dist/{host-config-58cdccea.d.ts → internal/host/shared/config.d.ts} +32 -19
  143. package/dist/internal/host/shared/config.js +1 -0
  144. package/dist/internal/host/shared/config.js.map +1 -0
  145. package/dist/internal/host/shared/fetch-interceptors.cjs +17 -0
  146. package/dist/internal/host/shared/fetch-interceptors.cjs.map +1 -0
  147. package/dist/{types-2b26a246.d.ts → internal/host/shared/fetch-interceptors.d.ts} +4 -87
  148. package/dist/internal/host/shared/fetch-interceptors.js +1 -0
  149. package/dist/internal/host/shared/fetch-interceptors.js.map +1 -0
  150. package/dist/internal/{shared/client → host/shared}/polyfill.cjs +7 -6
  151. package/dist/internal/host/shared/polyfill.cjs.map +1 -0
  152. package/dist/internal/{shared/client → host/shared}/polyfill.d.ts +2 -1
  153. package/dist/internal/{shared/client → host/shared}/polyfill.js +7 -6
  154. package/dist/internal/host/shared/polyfill.js.map +1 -0
  155. package/dist/internal/host/shared/resolved-data.cjs +17 -0
  156. package/dist/internal/host/shared/resolved-data.cjs.map +1 -0
  157. package/dist/internal/host/shared/resolved-data.d.ts +48 -0
  158. package/dist/internal/host/shared/resolved-data.js +1 -0
  159. package/dist/internal/host/shared/resolved-data.js.map +1 -0
  160. package/dist/internal/{shared/contract/host-state.cjs → host/shared/state.cjs} +4 -4
  161. package/dist/internal/host/shared/state.cjs.map +1 -0
  162. package/dist/internal/{shared/contract/host-state.js → host/shared/state.js} +1 -1
  163. package/dist/internal/host/shared/state.js.map +1 -0
  164. package/dist/internal/host/utils/resolve-name-from-src.cjs.map +1 -0
  165. package/dist/internal/host/utils/resolve-name-from-src.js.map +1 -0
  166. package/dist/internal/{next/remote/render-client.cjs → remote/nextjs/app-client.cjs} +8 -8
  167. package/dist/internal/remote/nextjs/app-client.cjs.map +1 -0
  168. package/dist/internal/{next/remote/render-client.js → remote/nextjs/app-client.js} +4 -4
  169. package/dist/internal/remote/nextjs/app-client.js.map +1 -0
  170. package/dist/internal/runtime/constants.cjs +50 -0
  171. package/dist/internal/runtime/constants.cjs.map +1 -0
  172. package/dist/internal/runtime/constants.d.ts +10 -0
  173. package/dist/internal/runtime/constants.js +20 -0
  174. package/dist/internal/runtime/constants.js.map +1 -0
  175. package/dist/internal/{shared/client → runtime/html}/apply-origin.cjs.map +1 -1
  176. package/dist/internal/{shared/client → runtime/html}/apply-origin.d.ts +1 -1
  177. package/dist/internal/{shared/client → runtime/html}/apply-origin.js.map +1 -1
  178. package/dist/internal/runtime/html/parse-remote-html.cjs +140 -0
  179. package/dist/internal/runtime/html/parse-remote-html.cjs.map +1 -0
  180. package/dist/internal/runtime/html/parse-remote-html.d.ts +88 -0
  181. package/dist/internal/runtime/html/parse-remote-html.js +110 -0
  182. package/dist/internal/runtime/html/parse-remote-html.js.map +1 -0
  183. package/dist/internal/runtime/html/set-attributes-from-props.cjs +68 -0
  184. package/dist/internal/runtime/html/set-attributes-from-props.cjs.map +1 -0
  185. package/dist/internal/runtime/html/set-attributes-from-props.d.ts +3 -0
  186. package/dist/internal/runtime/html/set-attributes-from-props.js +44 -0
  187. package/dist/internal/runtime/html/set-attributes-from-props.js.map +1 -0
  188. package/dist/internal/runtime/loaders/component-loader.cjs +184 -0
  189. package/dist/internal/runtime/loaders/component-loader.cjs.map +1 -0
  190. package/dist/internal/runtime/loaders/component-loader.d.ts +31 -0
  191. package/dist/internal/runtime/loaders/component-loader.js +150 -0
  192. package/dist/internal/runtime/loaders/component-loader.js.map +1 -0
  193. package/dist/internal/runtime/loaders/script-loader.cjs +69 -0
  194. package/dist/internal/runtime/loaders/script-loader.cjs.map +1 -0
  195. package/dist/internal/runtime/loaders/script-loader.d.ts +10 -0
  196. package/dist/internal/runtime/loaders/script-loader.js +48 -0
  197. package/dist/internal/runtime/loaders/script-loader.js.map +1 -0
  198. package/dist/internal/runtime/loaders/static-loader.cjs +177 -0
  199. package/dist/internal/runtime/loaders/static-loader.cjs.map +1 -0
  200. package/dist/internal/runtime/loaders/static-loader.d.ts +10 -0
  201. package/dist/internal/runtime/loaders/static-loader.js +153 -0
  202. package/dist/internal/runtime/loaders/static-loader.js.map +1 -0
  203. package/dist/internal/runtime/metadata.cjs +17 -0
  204. package/dist/internal/runtime/metadata.cjs.map +1 -0
  205. package/dist/internal/runtime/metadata.d.ts +16 -0
  206. package/dist/internal/runtime/metadata.js +1 -0
  207. package/dist/internal/runtime/metadata.js.map +1 -0
  208. package/dist/internal/runtime/rsc.cjs +92 -0
  209. package/dist/internal/runtime/rsc.cjs.map +1 -0
  210. package/dist/internal/runtime/rsc.d.ts +8 -0
  211. package/dist/internal/runtime/rsc.js +68 -0
  212. package/dist/internal/runtime/rsc.js.map +1 -0
  213. package/dist/internal/runtime/turbopack/chunk-loader.cjs +244 -0
  214. package/dist/internal/runtime/turbopack/chunk-loader.cjs.map +1 -0
  215. package/dist/internal/runtime/turbopack/chunk-loader.d.ts +11 -0
  216. package/dist/internal/runtime/turbopack/chunk-loader.js +227 -0
  217. package/dist/internal/runtime/turbopack/chunk-loader.js.map +1 -0
  218. package/dist/internal/runtime/turbopack/module.cjs +257 -0
  219. package/dist/internal/runtime/turbopack/module.cjs.map +1 -0
  220. package/dist/internal/runtime/turbopack/module.d.ts +61 -0
  221. package/dist/internal/runtime/turbopack/module.js +233 -0
  222. package/dist/internal/runtime/turbopack/module.js.map +1 -0
  223. package/dist/internal/runtime/turbopack/patterns.cjs +44 -0
  224. package/dist/internal/runtime/turbopack/patterns.cjs.map +1 -0
  225. package/dist/internal/runtime/turbopack/patterns.d.ts +109 -0
  226. package/dist/internal/runtime/turbopack/patterns.js +15 -0
  227. package/dist/internal/runtime/turbopack/patterns.js.map +1 -0
  228. package/dist/internal/runtime/turbopack/shared-modules.cjs +152 -0
  229. package/dist/internal/runtime/turbopack/shared-modules.cjs.map +1 -0
  230. package/dist/internal/runtime/turbopack/shared-modules.d.ts +17 -0
  231. package/dist/internal/runtime/turbopack/shared-modules.js +133 -0
  232. package/dist/internal/runtime/turbopack/shared-modules.js.map +1 -0
  233. package/dist/internal/runtime/turbopack/webpack-runtime.cjs +137 -0
  234. package/dist/internal/runtime/turbopack/webpack-runtime.cjs.map +1 -0
  235. package/dist/internal/runtime/turbopack/webpack-runtime.d.ts +20 -0
  236. package/dist/internal/runtime/turbopack/webpack-runtime.js +107 -0
  237. package/dist/internal/runtime/turbopack/webpack-runtime.js.map +1 -0
  238. package/dist/internal/runtime/types.cjs +17 -0
  239. package/dist/internal/runtime/types.cjs.map +1 -0
  240. package/dist/internal/runtime/types.d.ts +40 -0
  241. package/dist/internal/runtime/types.js +1 -0
  242. package/dist/internal/runtime/types.js.map +1 -0
  243. package/dist/internal/{shared/client → runtime/url}/default-resolve-client-url.cjs +2 -2
  244. package/dist/internal/runtime/url/default-resolve-client-url.cjs.map +1 -0
  245. package/dist/internal/{shared/client → runtime/url}/default-resolve-client-url.d.ts +1 -1
  246. package/dist/internal/{shared/client → runtime/url}/default-resolve-client-url.js +1 -1
  247. package/dist/internal/runtime/url/default-resolve-client-url.js.map +1 -0
  248. package/dist/internal/{shared/client → runtime/url}/protected-rc-fallback.cjs +1 -1
  249. package/dist/internal/runtime/url/protected-rc-fallback.cjs.map +1 -0
  250. package/dist/internal/{shared/client → runtime/url}/protected-rc-fallback.js +1 -1
  251. package/dist/internal/runtime/url/protected-rc-fallback.js.map +1 -0
  252. package/dist/internal/{shared/client/proxy-through-host.cjs → runtime/url/resolve-client-url.cjs} +4 -24
  253. package/dist/internal/runtime/url/resolve-client-url.cjs.map +1 -0
  254. package/dist/internal/{shared/client/proxy-through-host.d.ts → runtime/url/resolve-client-url.d.ts} +1 -25
  255. package/dist/internal/runtime/url/resolve-client-url.js +21 -0
  256. package/dist/internal/runtime/url/resolve-client-url.js.map +1 -0
  257. package/dist/internal/utils/abort.cjs.map +1 -0
  258. package/dist/internal/utils/abort.js.map +1 -0
  259. package/dist/internal/{shared → utils}/constants.cjs +3 -0
  260. package/dist/internal/utils/constants.cjs.map +1 -0
  261. package/dist/internal/utils/constants.d.ts +5 -0
  262. package/dist/internal/{shared → utils}/constants.js +2 -0
  263. package/dist/internal/utils/constants.js.map +1 -0
  264. package/dist/internal/{shared → utils}/error.cjs +4 -4
  265. package/dist/internal/utils/error.cjs.map +1 -0
  266. package/dist/internal/{shared → utils}/error.js +4 -4
  267. package/dist/internal/utils/error.js.map +1 -0
  268. package/dist/internal/{shared/utils → utils}/logger.cjs +3 -3
  269. package/dist/internal/utils/logger.cjs.map +1 -0
  270. package/dist/internal/{shared/utils → utils}/logger.d.ts +2 -2
  271. package/dist/internal/{shared/utils → utils}/logger.js +3 -3
  272. package/dist/internal/utils/logger.js.map +1 -0
  273. package/dist/internal/utils.cjs.map +1 -0
  274. package/dist/internal/utils.js.map +1 -0
  275. package/dist/{shared/host → remote/defaults}/app.cjs +2 -6
  276. package/dist/remote/defaults/app.cjs.map +1 -0
  277. package/dist/remote/defaults/app.js +8 -0
  278. package/dist/remote/defaults/app.js.map +1 -0
  279. package/dist/{shared/host → remote/defaults}/pages.cjs +2 -6
  280. package/dist/remote/defaults/pages.cjs.map +1 -0
  281. package/dist/remote/defaults/pages.js +8 -0
  282. package/dist/remote/defaults/pages.js.map +1 -0
  283. package/dist/{shared/remote → remote/defaults}/wrapper.cjs +12 -10
  284. package/dist/remote/defaults/wrapper.cjs.map +1 -0
  285. package/dist/remote/defaults/wrapper.js +27 -0
  286. package/dist/remote/defaults/wrapper.js.map +1 -0
  287. package/dist/{html/remote.cjs → remote/html.cjs} +16 -16
  288. package/dist/remote/html.cjs.map +1 -0
  289. package/dist/{html/remote.js → remote/html.js} +16 -16
  290. package/dist/remote/html.js.map +1 -0
  291. package/dist/{shared/remote/proxy.cjs → remote/middleware.cjs} +37 -12
  292. package/dist/remote/middleware.cjs.map +1 -0
  293. package/dist/remote/middleware.d.ts +27 -0
  294. package/dist/{shared/remote/proxy.js → remote/middleware.js} +32 -5
  295. package/dist/remote/middleware.js.map +1 -0
  296. package/dist/{internal/next/remote/render-server.cjs → remote/nextjs/app.cjs} +14 -16
  297. package/dist/remote/nextjs/app.cjs.map +1 -0
  298. package/dist/{internal/next/remote/render-server.d.ts → remote/nextjs/app.d.ts} +12 -13
  299. package/dist/{internal/next/remote/render-server.js → remote/nextjs/app.js} +9 -11
  300. package/dist/remote/nextjs/app.js.map +1 -0
  301. package/dist/{next/remote/pages-router.cjs → remote/nextjs/pages.cjs} +8 -8
  302. package/dist/remote/nextjs/pages.cjs.map +1 -0
  303. package/dist/{next/remote/pages-router.d.ts → remote/nextjs/pages.d.ts} +8 -8
  304. package/dist/{next/remote/pages-router.js → remote/nextjs/pages.js} +4 -4
  305. package/dist/remote/nextjs/pages.js.map +1 -0
  306. package/dist/server-handoff-8c89b856.d.ts +46 -0
  307. package/package.json +126 -157
  308. package/dist/html/host.cjs.map +0 -1
  309. package/dist/html/host.js.map +0 -1
  310. package/dist/html/remote.cjs.map +0 -1
  311. package/dist/html/remote.js.map +0 -1
  312. package/dist/internal/next/host/app-router-client.cjs.map +0 -1
  313. package/dist/internal/next/host/app-router-client.d.ts +0 -79
  314. package/dist/internal/next/host/app-router-client.js.map +0 -1
  315. package/dist/internal/next/host/app-router-compat.cjs.map +0 -1
  316. package/dist/internal/next/host/app-router-compat.js.map +0 -1
  317. package/dist/internal/next/host/remote-component-links.cjs.map +0 -1
  318. package/dist/internal/next/host/remote-component-links.js.map +0 -1
  319. package/dist/internal/next/remote/render-client.cjs.map +0 -1
  320. package/dist/internal/next/remote/render-client.js.map +0 -1
  321. package/dist/internal/next/remote/render-server.cjs.map +0 -1
  322. package/dist/internal/next/remote/render-server.js.map +0 -1
  323. package/dist/internal/react/context.cjs.map +0 -1
  324. package/dist/internal/react/context.js.map +0 -1
  325. package/dist/internal/react/hooks/use-resolve-client-url.cjs.map +0 -1
  326. package/dist/internal/react/hooks/use-resolve-client-url.js.map +0 -1
  327. package/dist/internal/shared/client/default-resolve-client-url.cjs.map +0 -1
  328. package/dist/internal/shared/client/default-resolve-client-url.js.map +0 -1
  329. package/dist/internal/shared/client/get-client-src.cjs.map +0 -1
  330. package/dist/internal/shared/client/get-client-src.js.map +0 -1
  331. package/dist/internal/shared/client/polyfill.cjs.map +0 -1
  332. package/dist/internal/shared/client/polyfill.js.map +0 -1
  333. package/dist/internal/shared/client/protected-rc-fallback.cjs.map +0 -1
  334. package/dist/internal/shared/client/protected-rc-fallback.js.map +0 -1
  335. package/dist/internal/shared/client/proxy-through-host.cjs.map +0 -1
  336. package/dist/internal/shared/client/proxy-through-host.js +0 -40
  337. package/dist/internal/shared/client/proxy-through-host.js.map +0 -1
  338. package/dist/internal/shared/client/remote-component.cjs +0 -1436
  339. package/dist/internal/shared/client/remote-component.cjs.map +0 -1
  340. package/dist/internal/shared/client/remote-component.d.ts +0 -62
  341. package/dist/internal/shared/client/remote-component.js +0 -1385
  342. package/dist/internal/shared/client/remote-component.js.map +0 -1
  343. package/dist/internal/shared/constants.cjs.map +0 -1
  344. package/dist/internal/shared/constants.d.ts +0 -4
  345. package/dist/internal/shared/constants.js.map +0 -1
  346. package/dist/internal/shared/contract/host-state.cjs.map +0 -1
  347. package/dist/internal/shared/contract/host-state.js.map +0 -1
  348. package/dist/internal/shared/contract/resolve-name-from-src.cjs.map +0 -1
  349. package/dist/internal/shared/contract/resolve-name-from-src.js.map +0 -1
  350. package/dist/internal/shared/error.cjs.map +0 -1
  351. package/dist/internal/shared/error.js.map +0 -1
  352. package/dist/internal/shared/ssr/dom-flight.cjs.map +0 -1
  353. package/dist/internal/shared/ssr/dom-flight.d.ts +0 -2
  354. package/dist/internal/shared/ssr/dom-flight.js.map +0 -1
  355. package/dist/internal/shared/ssr/fetch-headers.cjs.map +0 -1
  356. package/dist/internal/shared/ssr/fetch-headers.js.map +0 -1
  357. package/dist/internal/shared/ssr/fetch-remote-component.cjs.map +0 -1
  358. package/dist/internal/shared/ssr/fetch-remote-component.js.map +0 -1
  359. package/dist/internal/shared/ssr/fetch-with-hooks.cjs.map +0 -1
  360. package/dist/internal/shared/ssr/fetch-with-hooks.d.ts +0 -56
  361. package/dist/internal/shared/ssr/fetch-with-hooks.js.map +0 -1
  362. package/dist/internal/shared/ssr/get-client-or-server-url.cjs.map +0 -1
  363. package/dist/internal/shared/ssr/get-client-or-server-url.js.map +0 -1
  364. package/dist/internal/shared/ssr/get-ssr-relative-path-base-url.cjs.map +0 -1
  365. package/dist/internal/shared/ssr/get-ssr-relative-path-base-url.js.map +0 -1
  366. package/dist/internal/shared/ssr/skeleton.cjs.map +0 -1
  367. package/dist/internal/shared/ssr/skeleton.js.map +0 -1
  368. package/dist/internal/shared/utils/abort.cjs.map +0 -1
  369. package/dist/internal/shared/utils/abort.js.map +0 -1
  370. package/dist/internal/shared/utils/logger.cjs.map +0 -1
  371. package/dist/internal/shared/utils/logger.js.map +0 -1
  372. package/dist/internal/shared/utils.cjs.map +0 -1
  373. package/dist/internal/shared/utils.js.map +0 -1
  374. package/dist/internal/webpack/next-client-pages-loader.cjs.map +0 -1
  375. package/dist/internal/webpack/next-client-pages-loader.js.map +0 -1
  376. package/dist/internal/webpack/shared-modules.cjs.map +0 -1
  377. package/dist/internal/webpack/shared-modules.js.map +0 -1
  378. package/dist/next/config.cjs.map +0 -1
  379. package/dist/next/config.js.map +0 -1
  380. package/dist/next/host/app-router-server.cjs.map +0 -1
  381. package/dist/next/host/app-router-server.d.ts +0 -30
  382. package/dist/next/host/app-router-server.js.map +0 -1
  383. package/dist/next/host/client/index.cjs.map +0 -1
  384. package/dist/next/host/client/index.d.ts +0 -19
  385. package/dist/next/host/client/index.js.map +0 -1
  386. package/dist/next/host/pages-router-client.cjs.map +0 -1
  387. package/dist/next/host/pages-router-client.d.ts +0 -33
  388. package/dist/next/host/pages-router-client.js.map +0 -1
  389. package/dist/next/host/pages-router-server.cjs.map +0 -1
  390. package/dist/next/host/pages-router-server.js.map +0 -1
  391. package/dist/next/index.cjs +0 -53
  392. package/dist/next/index.cjs.map +0 -1
  393. package/dist/next/index.d.ts +0 -30
  394. package/dist/next/index.js +0 -19
  395. package/dist/next/index.js.map +0 -1
  396. package/dist/next/proxy.cjs.map +0 -1
  397. package/dist/next/proxy.d.ts +0 -56
  398. package/dist/next/proxy.js.map +0 -1
  399. package/dist/next/remote/pages-router.cjs.map +0 -1
  400. package/dist/next/remote/pages-router.js.map +0 -1
  401. package/dist/next/remote/server.cjs.map +0 -1
  402. package/dist/next/remote/server.d.ts +0 -5
  403. package/dist/next/remote/server.js +0 -5
  404. package/dist/next/remote/server.js.map +0 -1
  405. package/dist/proxy-through-host-a676a522.d.ts +0 -52
  406. package/dist/react/index.cjs.map +0 -1
  407. package/dist/react/index.d.ts +0 -86
  408. package/dist/react/index.js.map +0 -1
  409. package/dist/shared/host/app.cjs.map +0 -1
  410. package/dist/shared/host/app.js +0 -12
  411. package/dist/shared/host/app.js.map +0 -1
  412. package/dist/shared/host/pages.cjs.map +0 -1
  413. package/dist/shared/host/pages.js +0 -12
  414. package/dist/shared/host/pages.js.map +0 -1
  415. package/dist/shared/host/proxy.cjs.map +0 -1
  416. package/dist/shared/host/proxy.js.map +0 -1
  417. package/dist/shared/remote/app.cjs.map +0 -1
  418. package/dist/shared/remote/app.js +0 -8
  419. package/dist/shared/remote/app.js.map +0 -1
  420. package/dist/shared/remote/pages.cjs.map +0 -1
  421. package/dist/shared/remote/pages.js +0 -8
  422. package/dist/shared/remote/pages.js.map +0 -1
  423. package/dist/shared/remote/proxy.cjs.map +0 -1
  424. package/dist/shared/remote/proxy.d.ts +0 -44
  425. package/dist/shared/remote/proxy.js.map +0 -1
  426. package/dist/shared/remote/wrapper.cjs.map +0 -1
  427. package/dist/shared/remote/wrapper.js +0 -25
  428. package/dist/shared/remote/wrapper.js.map +0 -1
  429. package/dist/webpack.cjs.map +0 -1
  430. package/dist/webpack.js.map +0 -1
  431. /package/dist/{webpack.d.ts → config/webpack.d.ts} +0 -0
  432. /package/dist/{shared/host → host/defaults}/app.d.ts +0 -0
  433. /package/dist/{shared/host → host/defaults}/pages.d.ts +0 -0
  434. /package/dist/{shared/host/proxy.d.ts → host/proxy/protected-fetch.d.ts} +0 -0
  435. /package/dist/internal/{webpack/shared-modules.d.ts → config/webpack/apply-shared-modules.d.ts} +0 -0
  436. /package/dist/internal/{webpack → config/webpack}/next-client-pages-loader.d.ts +0 -0
  437. /package/dist/internal/{shared/ssr → host/nextjs}/dom-flight.cjs +0 -0
  438. /package/dist/internal/{shared/ssr → host/nextjs}/dom-flight.js +0 -0
  439. /package/dist/internal/{shared/ssr → host/nextjs}/skeleton.cjs +0 -0
  440. /package/dist/internal/{shared/ssr → host/nextjs}/skeleton.d.ts +0 -0
  441. /package/dist/internal/{shared/ssr → host/nextjs}/skeleton.js +0 -0
  442. /package/dist/internal/{shared/ssr → host/server}/fetch-headers.cjs +0 -0
  443. /package/dist/internal/{shared/ssr → host/server}/fetch-headers.d.ts +0 -0
  444. /package/dist/internal/{shared/ssr → host/server}/fetch-headers.js +0 -0
  445. /package/dist/internal/{shared/ssr → host/server}/get-client-or-server-url.cjs +0 -0
  446. /package/dist/internal/{shared/ssr → host/server}/get-client-or-server-url.d.ts +0 -0
  447. /package/dist/internal/{shared/ssr → host/server}/get-client-or-server-url.js +0 -0
  448. /package/dist/internal/{shared/client → host/server}/get-client-src.d.ts +0 -0
  449. /package/dist/internal/{shared/ssr → host/server}/get-ssr-relative-path-base-url.cjs +0 -0
  450. /package/dist/internal/{shared/ssr → host/server}/get-ssr-relative-path-base-url.d.ts +0 -0
  451. /package/dist/internal/{shared/ssr → host/server}/get-ssr-relative-path-base-url.js +0 -0
  452. /package/dist/internal/{shared/contract/host-state.d.ts → host/shared/state.d.ts} +0 -0
  453. /package/dist/internal/{shared/contract → host/utils}/resolve-name-from-src.cjs +0 -0
  454. /package/dist/internal/{shared/contract → host/utils}/resolve-name-from-src.d.ts +0 -0
  455. /package/dist/internal/{shared/contract → host/utils}/resolve-name-from-src.js +0 -0
  456. /package/dist/internal/{next/remote/render-client.d.ts → remote/nextjs/app-client.d.ts} +0 -0
  457. /package/dist/internal/{shared/client → runtime/html}/apply-origin.cjs +0 -0
  458. /package/dist/internal/{shared/client → runtime/html}/apply-origin.js +0 -0
  459. /package/dist/internal/{shared/client → runtime/url}/protected-rc-fallback.d.ts +0 -0
  460. /package/dist/internal/{shared/utils → utils}/abort.cjs +0 -0
  461. /package/dist/internal/{shared/utils → utils}/abort.d.ts +0 -0
  462. /package/dist/internal/{shared/utils → utils}/abort.js +0 -0
  463. /package/dist/internal/{shared → utils}/error.d.ts +0 -0
  464. /package/dist/internal/{shared/utils.cjs → utils.cjs} +0 -0
  465. /package/dist/internal/{shared/utils.d.ts → utils.d.ts} +0 -0
  466. /package/dist/internal/{shared/utils.js → utils.js} +0 -0
  467. /package/dist/{shared/remote → remote/defaults}/app.d.ts +0 -0
  468. /package/dist/{shared/remote → remote/defaults}/pages.d.ts +0 -0
  469. /package/dist/{shared/remote → remote/defaults}/wrapper.d.ts +0 -0
  470. /package/dist/{html/remote.d.ts → remote/html.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- // src/next/config/index.ts
1
+ // src/config/nextjs/index.ts
2
2
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { basename, dirname, join as join2, relative as relative2 } from "node:path";
4
4
  import enhancedResolve from "enhanced-resolve";
@@ -6,7 +6,7 @@ import { findUpSync } from "find-up";
6
6
  import { configSchema } from "next/dist/server/config-schema.js";
7
7
  import TsConfigPathsWebpackPlugin from "tsconfig-paths-webpack-plugin";
8
8
 
9
- // src/shared/error.ts
9
+ // src/utils/error.ts
10
10
  var RemoteComponentsError = class extends Error {
11
11
  code = "REMOTE_COMPONENTS_ERROR";
12
12
  constructor(message, options) {
@@ -15,7 +15,7 @@ var RemoteComponentsError = class extends Error {
15
15
  }
16
16
  };
17
17
 
18
- // src/shared/utils/logger.ts
18
+ // src/utils/logger.ts
19
19
  var PREFIX = "remote-components";
20
20
  var DEBUG = typeof window !== "undefined" && localStorage.getItem("RC_DEBUG") === "true";
21
21
  function logError(location2, message, cause) {
@@ -26,10 +26,10 @@ function logError(location2, message, cause) {
26
26
  );
27
27
  }
28
28
 
29
- // src/next/config/webpack/index.ts
29
+ // src/config/webpack/nextjs.ts
30
30
  import { join } from "node:path";
31
31
 
32
- // src/next/config/webpack/plugins/conditional-exec.ts
32
+ // src/config/webpack/plugins/conditional-exec.ts
33
33
  var ConditionalExecPlugin = class {
34
34
  appName;
35
35
  constructor(appName) {
@@ -65,10 +65,10 @@ var ConditionalExecPlugin = class {
65
65
  }
66
66
  };
67
67
 
68
- // src/next/config/webpack/plugins/module-id-embed.ts
68
+ // src/config/webpack/plugins/module-id-embed.ts
69
69
  import { relative } from "node:path";
70
70
 
71
- // src/next/config/webpack/plugins/module-id-embed-runtime-module.ts
71
+ // src/config/webpack/plugins/module-id-embed-runtime-module.ts
72
72
  function createModuleIdEmbedRuntimeModule(webpack) {
73
73
  return class ModuleIdEmbedRuntimeModule extends webpack.RuntimeModule {
74
74
  appName;
@@ -84,14 +84,16 @@ function createModuleIdEmbedRuntimeModule(webpack) {
84
84
  };
85
85
  }
86
86
 
87
- // src/next/config/webpack/plugins/module-id-embed.ts
87
+ // src/config/webpack/plugins/module-id-embed.ts
88
88
  var cwd = process.cwd();
89
89
  var ModuleIdEmbedPlugin = class {
90
90
  appName;
91
91
  includeAllModules;
92
+ isServer;
92
93
  constructor(appName, options) {
93
94
  this.appName = appName;
94
95
  this.includeAllModules = options?.includeAllModules ?? false;
96
+ this.isServer = options?.isServer ?? false;
95
97
  }
96
98
  apply(compiler) {
97
99
  const ModuleIdEmbedRuntimeModule = createModuleIdEmbedRuntimeModule(
@@ -100,27 +102,9 @@ var ModuleIdEmbedPlugin = class {
100
102
  compiler.hooks.thisCompilation.tap("ModuleIdEmbedPlugin", (compilation) => {
101
103
  const moduleMap = {};
102
104
  compilation.hooks.runtimeRequirementInTree.for(compiler.webpack.RuntimeGlobals.require).tap("ModuleIdEmbedPlugin", (chunk, set) => {
103
- for (const [key, entry] of compilation.entrypoints) {
104
- for (const entryChunk of entry.chunks) {
105
- if (key.includes("nextjs-pages-remote")) {
106
- for (const mod of compilation.chunkGraph.getChunkModulesIterable(
107
- entryChunk
108
- )) {
109
- const id = compilation.chunkGraph.getModuleId(mod);
110
- const normalModule = mod;
111
- if (id && (normalModule.resource || normalModule.request)) {
112
- moduleMap[relative(
113
- cwd,
114
- normalModule.resource || normalModule.request
115
- )] = id;
116
- }
117
- }
118
- }
119
- }
120
- }
121
105
  for (const mod of compilation.modules) {
122
106
  const id = compilation.chunkGraph.getModuleId(mod);
123
- if (id && (this.includeAllModules || mod.layer?.endsWith("browser"))) {
107
+ if (id && (this.includeAllModules || mod.layer?.endsWith("browser") || !this.isServer && mod.layer === null)) {
124
108
  const normalModule = mod;
125
109
  if (normalModule.resource || normalModule.request) {
126
110
  moduleMap[relative(cwd, normalModule.resource || normalModule.request)] = id;
@@ -142,7 +126,7 @@ var ModuleIdEmbedPlugin = class {
142
126
  }
143
127
  };
144
128
 
145
- // src/next/config/webpack/plugins/patch-require.ts
129
+ // src/config/webpack/plugins/patch-require.ts
146
130
  var PatchRequirePlugin = class {
147
131
  appName;
148
132
  constructor(appName) {
@@ -166,7 +150,7 @@ __webpack_require__ = function __remote_webpack_require__(remoteId) {
166
150
  return __webpack_require_orig__(remoteId);
167
151
  }
168
152
  if (typeof self.__remote_webpack_require__?.[bundle] !== 'function') {
169
- const error = new Error(\`Remote Components are not available in "\${bundle}". Did you forget to wrap the Next.js config with \\\`withRemoteComponents\\\` on both host and remote?\`);
153
+ const error = new Error(\`Remote Components are not available in "\${bundle}". Did you forget to wrap the Next.js config with \\\`withRemoteComponentsConfig\\\` on both host and remote?\`);
170
154
  error.name = 'RemoteComponentsError';
171
155
  error.code = 'REMOTE_COMPONENTS_ERROR';
172
156
  throw error;
@@ -211,7 +195,7 @@ __webpack_require__.e = function __remote_webpack_require_e__(chunkId) {
211
195
  }
212
196
  };
213
197
 
214
- // src/next/config/webpack/plugins/remote-webpack-require-runtime-module.ts
198
+ // src/config/webpack/plugins/remote-webpack-require-runtime-module.ts
215
199
  function createRemoteWebpackRequireRuntimeModule(webpack) {
216
200
  return class RemoteWebpackRequireRuntimeModule extends webpack.RuntimeModule {
217
201
  appName;
@@ -225,7 +209,7 @@ function createRemoteWebpackRequireRuntimeModule(webpack) {
225
209
  };
226
210
  }
227
211
 
228
- // src/next/config/webpack/plugins/remote-webpack-require.ts
212
+ // src/config/webpack/plugins/remote-webpack-require.ts
229
213
  var RemoteWebpackRequirePlugin = class {
230
214
  appName;
231
215
  constructor(appName) {
@@ -249,7 +233,7 @@ var RemoteWebpackRequirePlugin = class {
249
233
  }
250
234
  };
251
235
 
252
- // src/next/config/webpack/index.ts
236
+ // src/config/webpack/nextjs.ts
253
237
  function transform(nextConfig, {
254
238
  app,
255
239
  alias = {},
@@ -261,7 +245,7 @@ function transform(nextConfig, {
261
245
  const config = typeof webpackConfig === "function" ? webpackConfig(baseConfig, webpackContext) ?? baseConfig : baseConfig;
262
246
  config.plugins.push(
263
247
  new RemoteWebpackRequirePlugin(app.name),
264
- new ModuleIdEmbedPlugin(app.name),
248
+ new ModuleIdEmbedPlugin(app.name, { isServer: webpackContext.isServer }),
265
249
  new ConditionalExecPlugin(app.name),
266
250
  new PatchRequirePlugin(app.name)
267
251
  );
@@ -286,8 +270,39 @@ function transform(nextConfig, {
286
270
  return nextConfig;
287
271
  }
288
272
 
289
- // src/next/config/index.ts
290
- function withRemoteComponents(nextConfig, options) {
273
+ // src/config/nextjs/index.ts
274
+ function readProjectPackageJson() {
275
+ const defaults = { name: basename(process.cwd()), type: "module" };
276
+ try {
277
+ const packageJsonPath = findUpSync("package.json", {
278
+ cwd: process.cwd()
279
+ });
280
+ if (packageJsonPath) {
281
+ return {
282
+ ...defaults,
283
+ ...JSON.parse(readFileSync(packageJsonPath, "utf8"))
284
+ };
285
+ }
286
+ } catch {
287
+ }
288
+ return defaults;
289
+ }
290
+ function resolveProjectId(packageName) {
291
+ const fromEnv = process.env.REMOTE_COMPONENTS_PROJECT_ID || process.env.NEXT_PUBLIC_MFE_CURRENT_APPLICATION || process.env.VERCEL_PROJECT_ID;
292
+ if (fromEnv)
293
+ return fromEnv;
294
+ try {
295
+ const projectPath = findUpSync(".vercel/project.json", {
296
+ cwd: process.cwd()
297
+ });
298
+ if (projectPath) {
299
+ return JSON.parse(readFileSync(projectPath, "utf8")).projectId;
300
+ }
301
+ } catch {
302
+ }
303
+ return packageName;
304
+ }
305
+ function withRemoteComponentsConfig(nextConfig, options) {
291
306
  const virtualRemoteComponentAppSharedRemote = join2(
292
307
  process.cwd(),
293
308
  ".remote-components/shared/app-remote.tsx"
@@ -296,10 +311,6 @@ function withRemoteComponents(nextConfig, options) {
296
311
  process.cwd(),
297
312
  ".remote-components/shared/pages-remote.tsx"
298
313
  );
299
- const virtualRemoteComponentConfigWrapper = join2(
300
- process.cwd(),
301
- ".remote-components/shared/config-wrapper.ts"
302
- );
303
314
  const virtualRemoteComponentAppSharedHost = join2(
304
315
  process.cwd(),
305
316
  ".remote-components/shared/app-host.tsx"
@@ -362,41 +373,24 @@ function withRemoteComponents(nextConfig, options) {
362
373
  ]
363
374
  } : {}
364
375
  });
365
- let packageJson = {
366
- name: basename(process.cwd()),
367
- type: "module"
368
- };
369
- try {
370
- const packageJsonPath = findUpSync("package.json", {
371
- cwd: process.cwd()
372
- });
373
- if (packageJsonPath) {
374
- packageJson = {
375
- ...packageJson,
376
- ...JSON.parse(readFileSync(packageJsonPath, "utf8"))
377
- };
378
- }
379
- } catch {
380
- }
381
- let exportPre = "export const shared = { ";
382
- let exportPost = "};\n";
383
- if (packageJson.type !== "module") {
384
- exportPre = "module.exports = { shared: { ";
385
- exportPost = "} };\n";
386
- }
387
- const generateSharedRemote = (sharedRemote) => `'use client';
388
- ${exportPre}${Array.from(sharedRemote).reduce((acc, curr) => {
389
- let path;
376
+ const packageJson = readProjectPackageJson();
377
+ const exportPre = packageJson.type !== "module" ? "module.exports = { shared: { " : "export const shared = { ";
378
+ const exportPost = packageJson.type !== "module" ? "} };\n" : "};\n";
379
+ const resolveSharedPath = (moduleName) => {
390
380
  try {
391
- path = resolve(process.cwd(), curr);
392
- if (path) {
393
- path = relative2(process.cwd(), path).replace(
381
+ const resolved = resolve(process.cwd(), moduleName);
382
+ if (resolved) {
383
+ return relative2(process.cwd(), resolved).replace(
394
384
  /^(?<relative>\.\.\/)+/,
395
385
  ""
396
386
  );
397
387
  }
398
388
  } catch {
399
389
  }
390
+ };
391
+ const generateSharedRemote = (sharedRemote) => `'use client';
392
+ ${exportPre}${Array.from(sharedRemote).reduce((acc, curr) => {
393
+ const path = resolveSharedPath(curr);
400
394
  acc.push(
401
395
  `[${vendorShared[curr] ?? (path ? `'${path}'` : `require.resolve('${curr}')`)}]: '${curr}',`
402
396
  );
@@ -428,11 +422,6 @@ ${exportPre}${Array.from(sharedHost).reduce((acc, curr) => {
428
422
  pagesSharedRemote,
429
423
  "utf-8"
430
424
  );
431
- writeFileSync(
432
- virtualRemoteComponentConfigWrapper,
433
- "// withRemoteComponents enabled",
434
- "utf-8"
435
- );
436
425
  writeFileSync(virtualRemoteComponentAppSharedHost, appSharedHost, "utf-8");
437
426
  writeFileSync(
438
427
  virtualRemoteComponentPagesSharedHost,
@@ -444,43 +433,29 @@ ${exportPre}${Array.from(sharedHost).reduce((acc, curr) => {
444
433
  ...nextConfig.transpilePackages ?? [],
445
434
  "remote-components"
446
435
  ];
436
+ nextConfig.env = {
437
+ ...nextConfig.env,
438
+ REMOTE_COMPONENTS_CONFIGURED: "1"
439
+ };
447
440
  const alias = {
448
- "remote-components/shared/remote/app": `./${relative2(
441
+ "#remote-components/remote/defaults/app": `./${relative2(
449
442
  process.cwd(),
450
443
  virtualRemoteComponentAppSharedRemote
451
444
  )}`,
452
- "remote-components/shared/remote/pages": `./${relative2(
445
+ "#remote-components/remote/defaults/pages": `./${relative2(
453
446
  process.cwd(),
454
447
  virtualRemoteComponentPagesSharedRemote
455
448
  )}`,
456
- "remote-components/shared/remote/wrapper": `./${relative2(
457
- process.cwd(),
458
- virtualRemoteComponentConfigWrapper
459
- )}`,
460
- "remote-components/shared/host/app": `./${relative2(
449
+ "#remote-components/host/defaults/app": `./${relative2(
461
450
  process.cwd(),
462
451
  virtualRemoteComponentAppSharedHost
463
452
  )}`,
464
- "remote-components/shared/host/pages": `./${relative2(
453
+ "#remote-components/host/defaults/pages": `./${relative2(
465
454
  process.cwd(),
466
455
  virtualRemoteComponentPagesSharedHost
467
456
  )}`
468
457
  };
469
- let projectId = process.env.REMOTE_COMPONENTS_PROJECT_ID || process.env.NEXT_PUBLIC_MFE_CURRENT_APPLICATION || process.env.VERCEL_PROJECT_ID;
470
- if (!projectId) {
471
- try {
472
- const projectPath = findUpSync(".vercel/project.json", {
473
- cwd: process.cwd()
474
- });
475
- if (projectPath) {
476
- projectId = JSON.parse(readFileSync(projectPath, "utf8")).projectId;
477
- }
478
- } catch {
479
- }
480
- }
481
- if (!projectId) {
482
- projectId = packageJson.name;
483
- }
458
+ const projectId = resolveProjectId(packageJson.name);
484
459
  process.env.REMOTE_COMPONENTS_PROJECT_ID = projectId;
485
460
  if (process.env.TURBOPACK) {
486
461
  if (!configSchema.safeParse({
@@ -525,6 +500,6 @@ ${exportPre}${Array.from(sharedHost).reduce((acc, curr) => {
525
500
  });
526
501
  }
527
502
  export {
528
- withRemoteComponents
503
+ withRemoteComponentsConfig
529
504
  };
530
- //# sourceMappingURL=config.js.map
505
+ //# sourceMappingURL=nextjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/nextjs/index.ts","../../src/utils/error.ts","../../src/utils/logger.ts","../../src/config/webpack/nextjs.ts","../../src/config/webpack/plugins/conditional-exec.ts","../../src/config/webpack/plugins/module-id-embed.ts","../../src/config/webpack/plugins/module-id-embed-runtime-module.ts","../../src/config/webpack/plugins/patch-require.ts","../../src/config/webpack/plugins/remote-webpack-require-runtime-module.ts","../../src/config/webpack/plugins/remote-webpack-require.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { basename, dirname, join, relative } from 'node:path';\nimport enhancedResolve from 'enhanced-resolve';\nimport { findUpSync } from 'find-up';\nimport type { NextConfig } from 'next';\nimport { configSchema } from 'next/dist/server/config-schema.js';\nimport TsConfigPathsWebpackPlugin from 'tsconfig-paths-webpack-plugin';\nimport { logError } from '#internal/utils/logger';\nimport { transform as webpackTransform } from '../webpack/nextjs';\n\ninterface ZodSchema {\n safeParse: (data: unknown) => { success: boolean };\n}\n\nfunction readProjectPackageJson(): { name: string; type: string } {\n const defaults = { name: basename(process.cwd()), type: 'module' };\n try {\n const packageJsonPath = findUpSync('package.json', {\n cwd: process.cwd(),\n });\n if (packageJsonPath) {\n return {\n ...defaults,\n ...(JSON.parse(readFileSync(packageJsonPath, 'utf8')) as {\n name: string;\n type: string;\n }),\n };\n }\n } catch {\n // noop\n }\n return defaults;\n}\n\nfunction resolveProjectId(packageName: string): string {\n const fromEnv =\n process.env.REMOTE_COMPONENTS_PROJECT_ID ||\n process.env.NEXT_PUBLIC_MFE_CURRENT_APPLICATION ||\n process.env.VERCEL_PROJECT_ID;\n if (fromEnv) return fromEnv;\n\n try {\n const projectPath = findUpSync('.vercel/project.json', {\n cwd: process.cwd(),\n });\n if (projectPath) {\n return (\n JSON.parse(readFileSync(projectPath, 'utf8')) as { projectId: string }\n ).projectId;\n }\n } catch {\n // fallback below\n }\n\n return packageName;\n}\n\ninterface WithRemoteComponentsOptions {\n /**\n * An array of package names that should be shared between the host and remote components.\n * This is useful for ensuring that both the host and remote components use the same version\n * of shared libraries.\n *\n * Essential packages are included by default: `react`, `react-dom`, `next/navigation`, `next/link`, `next/form`, `next/image`, and `next/script`.\n */\n shared?: string[];\n}\n\n/**\n * This function configures Next.js to support Remote Components.\n * You need to also use the `withMicrofrontends` function to extend your Next.js configuration.\n *\n * @param nextConfig - The Next.js configuration object.\n * @param options - Optional configuration for remote components.\n * @returns The modified Next.js configuration object with remote components support.\n *\n * @example\n *\n * ```js\n * import { withMicrofrontends } from '@vercel/microfrontends/next/config';\n * import { withRemoteComponentsConfig } from 'remote-components/config/nextjs';\n *\n * const nextConfig = {\n * // your Next.js configuration\n * };\n *\n * export default withRemoteComponentsConfig(\n * withMicrofrontends(nextConfig),\n * {\n * shared: ['some-package', 'another-package'],\n * },\n * );\n * ```\n */\nexport function withRemoteComponentsConfig(\n nextConfig: NextConfig,\n options?: WithRemoteComponentsOptions,\n) {\n const virtualRemoteComponentAppSharedRemote = join(\n process.cwd(),\n '.remote-components/shared/app-remote.tsx',\n );\n const virtualRemoteComponentPagesSharedRemote = join(\n process.cwd(),\n '.remote-components/shared/pages-remote.tsx',\n );\n const virtualRemoteComponentAppSharedHost = join(\n process.cwd(),\n '.remote-components/shared/app-host.tsx',\n );\n const virtualRemoteComponentPagesSharedHost = join(\n process.cwd(),\n '.remote-components/shared/pages-host.tsx',\n );\n\n const appShared = new Set([\n ...[\n 'react',\n 'react/jsx-dev-runtime',\n 'react/jsx-runtime',\n 'react-dom',\n 'react-dom/client',\n 'next/navigation',\n 'next/dist/client/components/navigation',\n 'next/link',\n 'next/dist/client/app-dir/link',\n 'next/form',\n 'next/dist/client/app-dir/form',\n 'next/image',\n 'next/dist/client/image-component',\n 'next/dist/api/image',\n 'next/script',\n 'next/dist/client/script',\n 'next/dist/build/polyfills/process',\n ],\n ...(options?.shared ?? []),\n ]);\n const pagesShared = new Set([\n ...[\n 'react',\n 'react/jsx-dev-runtime',\n 'react/jsx-runtime',\n 'react-dom',\n 'react-dom/client',\n 'next/router',\n 'next/link',\n 'next/image',\n 'next/script',\n 'next/form',\n ],\n ...(options?.shared ?? []),\n ]);\n\n const vendorShared: Record<string, string> = {\n react: `'/react/index.js'`,\n 'react/jsx-dev-runtime': `'/react/jsx-dev-runtime.js'`,\n 'react/jsx-runtime': `'/react/jsx-runtime.js'`,\n 'react-dom': `'/react-dom/index.js'`,\n };\n\n // resolve using enhanced-resolve\n // named import does not work with enhanced-resolve when using cjs\n // eslint-disable-next-line import/no-named-as-default-member\n const resolve = enhancedResolve.create.sync({\n conditionNames: ['browser', 'import', 'module', 'require'],\n ...(existsSync(join(process.cwd(), 'tsconfig.json'))\n ? {\n extensions: ['.js', '.jsx', '.ts', '.tsx'],\n plugins: [\n new TsConfigPathsWebpackPlugin({\n configFile: join(process.cwd(), 'tsconfig.json'),\n }) as unknown as enhancedResolve.Plugin,\n ],\n }\n : {}),\n });\n\n const packageJson = readProjectPackageJson();\n\n const exportPre =\n packageJson.type !== 'module'\n ? 'module.exports = { shared: { '\n : 'export const shared = { ';\n const exportPost = packageJson.type !== 'module' ? '} };\\n' : '};\\n';\n\n const resolveSharedPath = (moduleName: string): string | undefined => {\n try {\n const resolved = resolve(process.cwd(), moduleName);\n if (resolved) {\n return relative(process.cwd(), resolved).replace(\n /^(?<relative>\\.\\.\\/)+/,\n '',\n );\n }\n } catch {\n // if module resolution using enhanced-resolve fails, fallback to require.resolve called in the shared/remote file\n }\n };\n\n const generateSharedRemote = (sharedRemote: Set<string>) =>\n `'use client';\\n${exportPre}${Array.from(sharedRemote)\n .reduce<string[]>((acc, curr) => {\n const path = resolveSharedPath(curr);\n acc.push(\n `[${\n vendorShared[curr] ??\n (path ? `'${path}'` : `require.resolve('${curr}')`)\n }]: '${curr}',`,\n );\n acc.push(\n `['__remote_shared_module_${curr}']: () => import('${curr}'),`,\n );\n return acc;\n }, [])\n .join('\\n')}${exportPost}`;\n const generateSharedHost = (sharedHost: Set<string>) =>\n `'use client';\\n${exportPre}${Array.from(sharedHost)\n .reduce<string[]>((acc, curr) => {\n acc.push(`['${curr}']: () => import('${curr}'),`);\n return acc;\n }, [])\n .join('\\n')}${exportPost}`;\n\n const appSharedRemote = generateSharedRemote(appShared);\n const pagesSharedRemote = generateSharedRemote(pagesShared);\n\n const appSharedHost = generateSharedHost(appShared);\n const pagesSharedHost = generateSharedHost(pagesShared);\n\n const emitSharedFiles = () => {\n mkdirSync(dirname(virtualRemoteComponentAppSharedRemote), {\n recursive: true,\n });\n\n writeFileSync(\n virtualRemoteComponentAppSharedRemote,\n appSharedRemote,\n 'utf-8',\n );\n writeFileSync(\n virtualRemoteComponentPagesSharedRemote,\n pagesSharedRemote,\n 'utf-8',\n );\n writeFileSync(virtualRemoteComponentAppSharedHost, appSharedHost, 'utf-8');\n writeFileSync(\n virtualRemoteComponentPagesSharedHost,\n pagesSharedHost,\n 'utf-8',\n );\n };\n\n nextConfig.transpilePackages = [\n ...(nextConfig.transpilePackages ?? []),\n 'remote-components',\n ];\n\n nextConfig.env = {\n ...nextConfig.env,\n REMOTE_COMPONENTS_CONFIGURED: '1',\n };\n\n const alias = {\n '#remote-components/remote/defaults/app': `./${relative(\n process.cwd(),\n virtualRemoteComponentAppSharedRemote,\n )}`,\n '#remote-components/remote/defaults/pages': `./${relative(\n process.cwd(),\n virtualRemoteComponentPagesSharedRemote,\n )}`,\n '#remote-components/host/defaults/app': `./${relative(\n process.cwd(),\n virtualRemoteComponentAppSharedHost,\n )}`,\n '#remote-components/host/defaults/pages': `./${relative(\n process.cwd(),\n virtualRemoteComponentPagesSharedHost,\n )}`,\n };\n\n const projectId = resolveProjectId(packageJson.name);\n process.env.REMOTE_COMPONENTS_PROJECT_ID = projectId;\n\n if (process.env.TURBOPACK) {\n if (\n !(configSchema as ZodSchema).safeParse({\n turbopack: {\n resolveAlias: {\n ...alias,\n },\n },\n compiler: {\n defineServer: {\n REMOTE_COMPONENTS_PROJECT_ID: projectId,\n },\n },\n }).success\n ) {\n logError(\n 'Config',\n 'You need to use a Next.js version which supports the `turbopack` and `compiler.defineServer` configuration for Turbopack support with Remote Components.',\n );\n process.exit(1);\n }\n nextConfig.turbopack = {\n ...nextConfig.turbopack,\n resolveAlias: {\n ...nextConfig.turbopack?.resolveAlias,\n ...alias,\n },\n };\n nextConfig.compiler = {\n ...nextConfig.compiler,\n defineServer: {\n ...nextConfig.compiler?.defineServer,\n 'process.env.REMOTE_COMPONENTS_PROJECT_ID': projectId,\n },\n };\n emitSharedFiles();\n return nextConfig;\n }\n\n // apply the webpack transform\n return webpackTransform(nextConfig, {\n app: { name: projectId },\n alias,\n emitSharedFiles,\n });\n}\n","import { isProxiedUrl } from '#internal/runtime/url/protected-rc-fallback';\nimport { isAbortError } from '#internal/utils/abort';\nimport {\n CORS_DOCS_URL,\n RC_PROTECTED_REMOTE_FETCH_PATHNAME,\n} from '#internal/utils/constants';\n\nexport class RemoteComponentsError extends Error {\n code = 'REMOTE_COMPONENTS_ERROR';\n\n constructor(message: string, options?: { cause?: unknown }) {\n super(message, options);\n this.name = 'RemoteComponentsError';\n }\n}\n\nexport function multipleRemoteComponentsError(url: string | undefined) {\n return new RemoteComponentsError(\n `Multiple Remote Components found at \"${url}\". When a page exposes multiple Remote Components you must specify the \"name\" prop to select which one to load.`,\n );\n}\n\nexport function failedToFetchRemoteComponentError(\n url: string,\n { status, statusText }: { status: number; statusText: string },\n help: string = 'Is the URL correct and accessible?',\n) {\n return new RemoteComponentsError(\n `Failed to fetch Remote Component from \"${url}\". ${help}`,\n { cause: new Error(`${status} ${statusText}`) },\n );\n}\n\nexport async function errorFromFailedFetch(\n originalUrl: string,\n resolvedUrl: URL,\n res: Response | null | undefined,\n): Promise<RemoteComponentsError> {\n const isProxied = isProxiedUrl(resolvedUrl.href);\n\n if (isProxied && res) {\n const body = await res.text().catch(() => '');\n return failedProxyFetchError(\n originalUrl,\n resolvedUrl.href,\n res.status,\n body,\n );\n }\n\n const fallback = failedToFetchRemoteComponentError(\n originalUrl,\n res ?? { status: 0, statusText: 'No Response' },\n );\n\n if (!res) return fallback;\n\n try {\n const body = await res.text();\n const parser = new DOMParser();\n const doc = parser.parseFromString(body, 'text/html');\n const errorTemplate = doc.querySelector(\n 'template[data-next-error-message]',\n );\n const errorMessage = errorTemplate?.getAttribute('data-next-error-message');\n if (errorMessage) {\n const error = new RemoteComponentsError(errorMessage);\n const errorStack = errorTemplate?.getAttribute('data-next-error-stack');\n if (errorStack) {\n error.stack = errorStack;\n }\n return error;\n }\n } catch (parseError) {\n // Re-throw abort errors, ignore parse errors\n if (isAbortError(parseError)) throw parseError;\n }\n\n return fallback;\n}\n\nexport function failedProxyFetchError(\n originalUrl: string,\n proxyUrl: string,\n status: number,\n responseBody?: string,\n): RemoteComponentsError {\n if (status === 404) {\n return new RemoteComponentsError(\n `Could not proxy the request to \"${originalUrl}\" — the proxy endpoint \"${RC_PROTECTED_REMOTE_FETCH_PATHNAME}\" returned 404.\\n\\n` +\n `The host server needs middleware or a route that handles \"${RC_PROTECTED_REMOTE_FETCH_PATHNAME}\".\\n\\n` +\n `Proxying requires two pieces:\\n` +\n ` 1. resolveClientUrl={routeThroughHostProxy} on <RemoteComponent>\\n` +\n ` 2. Middleware or a route for \"${RC_PROTECTED_REMOTE_FETCH_PATHNAME}\" on the host server\\n\\n` +\n `Docs: ${CORS_DOCS_URL}`,\n );\n }\n if (status === 403) {\n const detail = responseBody ? ` ${responseBody}` : '';\n return new RemoteComponentsError(\n `Proxied request to \"${proxyUrl}\" was forbidden.${detail} ` +\n `See: ${CORS_DOCS_URL}`,\n );\n }\n return new RemoteComponentsError(\n `Proxied request for \"${originalUrl}\" via \"${proxyUrl}\" failed with status ${status}. ` +\n `See: ${CORS_DOCS_URL}`,\n );\n}\n","import { CORS_DOCS_URL } from '#internal/utils/constants';\nimport { RemoteComponentsError } from '#internal/utils/error';\n\ntype LogLocation =\n | 'ChunkLoader'\n | 'ComponentLoader'\n | 'SharedModules'\n | 'WebpackRuntime'\n | 'TurbopackModule'\n | 'StaticLoader'\n | 'ScriptLoader'\n | 'Polyfill'\n | 'HtmlRemote'\n | 'HtmlHost'\n | 'Config'\n | 'NextAppRouter'\n | 'NextAppRouterCompat'\n | 'FetchRemoteComponent';\n\nconst PREFIX = 'remote-components';\nconst DEBUG =\n typeof window !== 'undefined' && localStorage.getItem('RC_DEBUG') === 'true';\n\nexport function logDebug(location: LogLocation, message: string) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.debug(`[${PREFIX}:${location}]: ${message}`);\n }\n}\n\nexport function logInfo(location: LogLocation, message: string) {\n // eslint-disable-next-line no-console\n console.info(`[${PREFIX}:${location}]: ${message}`);\n}\n\nexport function logWarn(location: LogLocation, message: string) {\n // eslint-disable-next-line no-console\n console.warn(`[${PREFIX}:${location}]: ${message}`);\n}\n\nexport function logError(\n location: LogLocation,\n message: string,\n cause?: unknown,\n) {\n // eslint-disable-next-line no-console\n console.error(\n new RemoteComponentsError(`[${PREFIX}:${location}]: ${message}`, {\n cause,\n }),\n );\n}\n\n/**\n * Logs a warning when a cross-origin asset request fails, guiding users\n * to configure the withRemoteComponentsHostProxy middleware on their host.\n */\nexport function warnCrossOriginFetchError(\n logLocation: LogLocation,\n url: string | URL,\n): void {\n try {\n const parsed = typeof url === 'string' ? new URL(url) : url;\n if (typeof location === 'undefined' || parsed.origin === location.origin) {\n return;\n }\n logWarn(\n logLocation,\n `Failed to fetch cross-origin resource \"${parsed.href}\". ` +\n 'If this is a protected deployment, ensure withRemoteComponentsHostProxy middleware ' +\n 'is configured in your host and that the remote URL is included in allowedProxyUrls. ' +\n `See: ${CORS_DOCS_URL}`,\n );\n } catch {\n // URL parsing failed — skip the warning\n }\n}\n","import { join } from 'node:path';\nimport type { NextConfig } from 'next';\nimport type { WebpackOptionsNormalized } from 'webpack';\nimport { ConditionalExecPlugin } from './plugins/conditional-exec';\nimport { ModuleIdEmbedPlugin } from './plugins/module-id-embed';\nimport { PatchRequirePlugin } from './plugins/patch-require';\nimport { RemoteWebpackRequirePlugin } from './plugins/remote-webpack-require';\n\nexport function transform(\n nextConfig: NextConfig,\n {\n app,\n alias = {},\n emitSharedFiles = () => {\n // no-op by default\n },\n }: {\n app: { name: string };\n alias?: Record<string, string>;\n emitSharedFiles?: () => void;\n },\n) {\n const webpackConfig = nextConfig.webpack;\n\n nextConfig.webpack = (\n baseConfig: WebpackOptionsNormalized,\n webpackContext,\n ) => {\n // execute the client config first, otherwise their config may accidentally\n // overwrite our required config - leading to unexpected errors.\n const config = (\n typeof webpackConfig === 'function'\n ? (webpackConfig(baseConfig, webpackContext) ?? baseConfig)\n : baseConfig\n ) as WebpackOptionsNormalized;\n\n // remote component specific plugins\n config.plugins.push(\n new RemoteWebpackRequirePlugin(app.name),\n new ModuleIdEmbedPlugin(app.name, { isServer: webpackContext.isServer }),\n new ConditionalExecPlugin(app.name),\n new PatchRequirePlugin(app.name),\n );\n if (!webpackContext.isServer) {\n // change the chunk loading global to avoid conflicts with other remote components\n config.output.chunkLoadingGlobal = `__remote_chunk_loading_global_${app.name}__`;\n }\n\n config.resolve = {\n ...config.resolve,\n alias: {\n ...config.resolve.alias,\n ...Object.fromEntries(\n Object.entries(alias).map(([key, value]) => [\n key,\n join(process.cwd(), value),\n ]),\n ),\n },\n };\n\n emitSharedFiles();\n return config;\n };\n\n return nextConfig;\n}\n","import type { Compiler } from 'webpack';\n\nexport class ConditionalExecPlugin {\n appName: string;\n\n constructor(appName: string) {\n this.appName = appName;\n }\n\n apply(compiler: Compiler) {\n const { Compilation, sources } = compiler.webpack;\n\n compiler.hooks.thisCompilation.tap(\n 'ConditionalExecPlugin',\n (compilation) => {\n compilation.hooks.processAssets.tap(\n {\n name: 'ConditionalExecPlugin',\n stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n (assets) => {\n for (const [name, source] of Object.entries(assets)) {\n if (name.endsWith('.js')) {\n const patchedSource = source\n .source()\n .toString()\n .replace(\n `var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))`,\n `var __webpack_exec__ = (moduleId) => { if (globalThis.__DISABLE_WEBPACK_EXEC__ && globalThis.__DISABLE_WEBPACK_EXEC__[\"${this.appName}\"]) return; return __webpack_require__(__webpack_require__.s = moduleId); }`,\n );\n compilation.updateAsset(\n name,\n new sources.RawSource(patchedSource),\n );\n }\n }\n },\n );\n },\n );\n }\n}\n","import { relative } from 'node:path';\nimport type { Compiler, NormalModule, RuntimeModule } from 'webpack';\nimport { createModuleIdEmbedRuntimeModule } from './module-id-embed-runtime-module';\n\nconst cwd = process.cwd();\n\nexport class ModuleIdEmbedPlugin {\n appName: string;\n includeAllModules: boolean;\n isServer: boolean;\n\n constructor(\n appName: string,\n options?: { includeAllModules?: boolean; isServer?: boolean },\n ) {\n this.appName = appName;\n this.includeAllModules = options?.includeAllModules ?? false;\n this.isServer = options?.isServer ?? false;\n }\n\n apply(compiler: Compiler) {\n const ModuleIdEmbedRuntimeModule = createModuleIdEmbedRuntimeModule(\n compiler.webpack,\n );\n\n compiler.hooks.thisCompilation.tap('ModuleIdEmbedPlugin', (compilation) => {\n const moduleMap = {} as Record<string, string | number>;\n\n compilation.hooks.runtimeRequirementInTree\n .for(compiler.webpack.RuntimeGlobals.require)\n .tap('ModuleIdEmbedPlugin', (chunk, set) => {\n for (const mod of compilation.modules) {\n const id = compilation.chunkGraph.getModuleId(mod);\n if (\n id &&\n (this.includeAllModules ||\n mod.layer?.endsWith('browser') ||\n (!this.isServer && mod.layer === null))\n ) {\n const normalModule = mod as NormalModule;\n if (normalModule.resource || normalModule.request) {\n moduleMap[\n relative(cwd, normalModule.resource || normalModule.request)\n ] = id;\n }\n }\n }\n\n if (Object.keys(moduleMap).length > 0) {\n compilation.addRuntimeModule(\n chunk,\n new ModuleIdEmbedRuntimeModule(\n this.appName,\n moduleMap,\n ) as unknown as RuntimeModule,\n );\n\n set.add(compiler.webpack.RuntimeGlobals.require);\n }\n });\n });\n }\n}\n","export function createModuleIdEmbedRuntimeModule(webpack: {\n RuntimeModule: new (name: string, stage?: number) => object;\n}) {\n return class ModuleIdEmbedRuntimeModule extends webpack.RuntimeModule {\n appName: string;\n moduleMap: Record<string | number, unknown>;\n\n constructor(appName: string, moduleMap: Record<string | number, unknown>) {\n super('remote-webpack-module-id-embed');\n this.appName = appName;\n this.moduleMap = moduleMap;\n }\n\n generate(): null | string {\n return `globalThis.__remote_webpack_module_map__ = globalThis.__remote_webpack_module_map__ || {}; globalThis.__remote_webpack_module_map__[\"${this.appName}\"] = ${JSON.stringify(this.moduleMap)};`;\n }\n };\n}\n","import type { Compiler } from 'webpack';\n\n// This plugin patches the webpack require function to support loading remote components in Next.js\nexport class PatchRequirePlugin {\n appName: string;\n\n constructor(appName: string) {\n this.appName = appName;\n }\n\n apply(compiler: Compiler) {\n const { sources } = compiler.webpack;\n\n compiler.hooks.thisCompilation.tap('PatchRequirePlugin', (compilation) => {\n compilation.mainTemplate.hooks.requireExtensions.tap(\n 'PatchRequirePlugin',\n (source) => {\n return new sources.ConcatSource(\n source,\n `const __webpack_require_orig__ = __webpack_require__;\nconst REMOTE_RE = /\\\\[(?<bundle>[^\\\\]]+)\\\\] (?<id>.*)/;\n__webpack_require__ = function __remote_webpack_require__(remoteId) {\n const match = REMOTE_RE.exec(remoteId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_orig__(remoteId);\n }\n if (typeof self.__remote_webpack_require__?.[bundle] !== 'function') {\n const error = new Error(\\`Remote Components are not available in \"\\${bundle}\". Did you forget to wrap the Next.js config with \\\\\\`withRemoteComponentsConfig\\\\\\` on both host and remote?\\`);\n error.name = 'RemoteComponentsError';\n error.code = 'REMOTE_COMPONENTS_ERROR';\n throw error;\n }\n return self.__remote_webpack_require__[bundle](self.__remote_webpack_require__[bundle].type === 'turbopack' ? remoteId : id);\n};\nObject.assign(__webpack_require__, __webpack_require_orig__);\nconst __webpack_require_l__ = __webpack_require__.l;\n__webpack_require__.l = function __remote_webpack_require_l__(url, done, key, chunkId) {\n const match = REMOTE_RE.exec(chunkId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_l__(new URL(url, globalThis.__remote_bundle_url__?.[\"${this.appName}\"] ?? location.origin).href, done, key, chunkId);\n }\n return done();\n};\nconst __webpack_require_o__ = __webpack_require__.o;\n__webpack_require__.o = function __remote_webpack_require_o__(installedChunks, chunkId) {\n const match = REMOTE_RE.exec(chunkId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_o__(installedChunks, chunkId);\n }\n return installedChunks[chunkId] = 0;\n};\nconst __webpack_require_e__ = __webpack_require__.e;\n__webpack_require__.e = function __remote_webpack_require_e__(chunkId) {\n const match = REMOTE_RE.exec(chunkId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_e__(chunkId);\n }\n return Promise.resolve([]);\n};`,\n )\n .source()\n .toString();\n },\n );\n });\n }\n}\n","export function createRemoteWebpackRequireRuntimeModule(webpack: {\n RuntimeModule: new (name: string, stage?: number) => object;\n}) {\n return class RemoteWebpackRequireRuntimeModule extends webpack.RuntimeModule {\n appName: string;\n\n constructor(appName: string) {\n super('remote-webpack-require');\n this.appName = appName;\n }\n\n generate(): null | string {\n return `globalThis.__remote_webpack_require__ = globalThis.__remote_webpack_require__ || {}; globalThis.__remote_webpack_require__[\"${this.appName}\"] = __webpack_require__;`;\n }\n };\n}\n","import type { Compiler, RuntimeModule } from 'webpack';\nimport { createRemoteWebpackRequireRuntimeModule } from './remote-webpack-require-runtime-module';\n\nexport class RemoteWebpackRequirePlugin {\n appName: string;\n\n constructor(appName: string) {\n this.appName = appName;\n }\n\n apply(compiler: Compiler) {\n const RemoteWebpackRequireRuntimeModule =\n createRemoteWebpackRequireRuntimeModule(compiler.webpack);\n\n compiler.hooks.thisCompilation.tap(\n 'RemoteWebpackRequirePlugin',\n (compilation) => {\n compilation.hooks.runtimeRequirementInTree\n .for('__webpack_require__')\n .tap('RemoteWebpackRequirePlugin', (chunk) => {\n compilation.addRuntimeModule(\n chunk,\n new RemoteWebpackRequireRuntimeModule(\n this.appName,\n ) as unknown as RuntimeModule,\n );\n });\n },\n );\n }\n}\n"],"mappings":";AAAA,SAAS,YAAY,WAAW,cAAc,qBAAqB;AACnE,SAAS,UAAU,SAAS,QAAAA,OAAM,YAAAC,iBAAgB;AAClD,OAAO,qBAAqB;AAC5B,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB;AAC7B,OAAO,gCAAgC;;;ACChC,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAC/C,OAAO;AAAA,EAEP,YAAY,SAAiB,SAA+B;AAC1D,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AAAA,EACd;AACF;;;ACKA,IAAM,SAAS;AACf,IAAM,QACJ,OAAO,WAAW,eAAe,aAAa,QAAQ,UAAU,MAAM;AAmBjE,SAAS,SACdC,WACA,SACA,OACA;AAEA,UAAQ;AAAA,IACN,IAAI,sBAAsB,IAAI,UAAUA,eAAc,WAAW;AAAA,MAC/D;AAAA,IACF,CAAC;AAAA,EACH;AACF;;;ACnDA,SAAS,YAAY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,WAAW,WAAW;AAAA,QACzB,GAAG;AAAA,MACL;AAAA,IACF;AACA,eAAW,WAAW;AAAA,MACpB,GAAG,WAAW;AAAA,MACd,cAAc;AAAA,QACZ,GAAG,WAAW,UAAU;AAAA,QACxB,4CAA4C;AAAA,MAC9C;AAAA,IACF;AACA,oBAAgB;AAChB,WAAO;AAAA,EACT;AAGA,SAAO,UAAiB,YAAY;AAAA,IAClC,KAAK,EAAE,MAAM,UAAU;AAAA,IACvB;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":["join","relative","location","join","relative"]}
@@ -17,14 +17,14 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // src/webpack/index.ts
20
+ // src/config/webpack/index.ts
21
21
  var webpack_exports = {};
22
22
  __export(webpack_exports, {
23
23
  RemoteComponentsWebpackPlugin: () => RemoteComponentsWebpackPlugin
24
24
  });
25
25
  module.exports = __toCommonJS(webpack_exports);
26
26
 
27
- // src/next/config/webpack/plugins/conditional-exec.ts
27
+ // src/config/webpack/plugins/conditional-exec.ts
28
28
  var ConditionalExecPlugin = class {
29
29
  appName;
30
30
  constructor(appName) {
@@ -60,10 +60,10 @@ var ConditionalExecPlugin = class {
60
60
  }
61
61
  };
62
62
 
63
- // src/next/config/webpack/plugins/module-id-embed.ts
63
+ // src/config/webpack/plugins/module-id-embed.ts
64
64
  var import_node_path = require("path");
65
65
 
66
- // src/next/config/webpack/plugins/module-id-embed-runtime-module.ts
66
+ // src/config/webpack/plugins/module-id-embed-runtime-module.ts
67
67
  function createModuleIdEmbedRuntimeModule(webpack) {
68
68
  return class ModuleIdEmbedRuntimeModule extends webpack.RuntimeModule {
69
69
  appName;
@@ -79,14 +79,16 @@ function createModuleIdEmbedRuntimeModule(webpack) {
79
79
  };
80
80
  }
81
81
 
82
- // src/next/config/webpack/plugins/module-id-embed.ts
82
+ // src/config/webpack/plugins/module-id-embed.ts
83
83
  var cwd = process.cwd();
84
84
  var ModuleIdEmbedPlugin = class {
85
85
  appName;
86
86
  includeAllModules;
87
+ isServer;
87
88
  constructor(appName, options) {
88
89
  this.appName = appName;
89
90
  this.includeAllModules = options?.includeAllModules ?? false;
91
+ this.isServer = options?.isServer ?? false;
90
92
  }
91
93
  apply(compiler) {
92
94
  const ModuleIdEmbedRuntimeModule = createModuleIdEmbedRuntimeModule(
@@ -95,27 +97,9 @@ var ModuleIdEmbedPlugin = class {
95
97
  compiler.hooks.thisCompilation.tap("ModuleIdEmbedPlugin", (compilation) => {
96
98
  const moduleMap = {};
97
99
  compilation.hooks.runtimeRequirementInTree.for(compiler.webpack.RuntimeGlobals.require).tap("ModuleIdEmbedPlugin", (chunk, set) => {
98
- for (const [key, entry] of compilation.entrypoints) {
99
- for (const entryChunk of entry.chunks) {
100
- if (key.includes("nextjs-pages-remote")) {
101
- for (const mod of compilation.chunkGraph.getChunkModulesIterable(
102
- entryChunk
103
- )) {
104
- const id = compilation.chunkGraph.getModuleId(mod);
105
- const normalModule = mod;
106
- if (id && (normalModule.resource || normalModule.request)) {
107
- moduleMap[(0, import_node_path.relative)(
108
- cwd,
109
- normalModule.resource || normalModule.request
110
- )] = id;
111
- }
112
- }
113
- }
114
- }
115
- }
116
100
  for (const mod of compilation.modules) {
117
101
  const id = compilation.chunkGraph.getModuleId(mod);
118
- if (id && (this.includeAllModules || mod.layer?.endsWith("browser"))) {
102
+ if (id && (this.includeAllModules || mod.layer?.endsWith("browser") || !this.isServer && mod.layer === null)) {
119
103
  const normalModule = mod;
120
104
  if (normalModule.resource || normalModule.request) {
121
105
  moduleMap[(0, import_node_path.relative)(cwd, normalModule.resource || normalModule.request)] = id;
@@ -137,7 +121,7 @@ var ModuleIdEmbedPlugin = class {
137
121
  }
138
122
  };
139
123
 
140
- // src/next/config/webpack/plugins/patch-require.ts
124
+ // src/config/webpack/plugins/patch-require.ts
141
125
  var PatchRequirePlugin = class {
142
126
  appName;
143
127
  constructor(appName) {
@@ -161,7 +145,7 @@ __webpack_require__ = function __remote_webpack_require__(remoteId) {
161
145
  return __webpack_require_orig__(remoteId);
162
146
  }
163
147
  if (typeof self.__remote_webpack_require__?.[bundle] !== 'function') {
164
- const error = new Error(\`Remote Components are not available in "\${bundle}". Did you forget to wrap the Next.js config with \\\`withRemoteComponents\\\` on both host and remote?\`);
148
+ const error = new Error(\`Remote Components are not available in "\${bundle}". Did you forget to wrap the Next.js config with \\\`withRemoteComponentsConfig\\\` on both host and remote?\`);
165
149
  error.name = 'RemoteComponentsError';
166
150
  error.code = 'REMOTE_COMPONENTS_ERROR';
167
151
  throw error;
@@ -206,7 +190,7 @@ __webpack_require__.e = function __remote_webpack_require_e__(chunkId) {
206
190
  }
207
191
  };
208
192
 
209
- // src/next/config/webpack/plugins/remote-webpack-require-runtime-module.ts
193
+ // src/config/webpack/plugins/remote-webpack-require-runtime-module.ts
210
194
  function createRemoteWebpackRequireRuntimeModule(webpack) {
211
195
  return class RemoteWebpackRequireRuntimeModule extends webpack.RuntimeModule {
212
196
  appName;
@@ -220,7 +204,7 @@ function createRemoteWebpackRequireRuntimeModule(webpack) {
220
204
  };
221
205
  }
222
206
 
223
- // src/next/config/webpack/plugins/remote-webpack-require.ts
207
+ // src/config/webpack/plugins/remote-webpack-require.ts
224
208
  var RemoteWebpackRequirePlugin = class {
225
209
  appName;
226
210
  constructor(appName) {
@@ -244,7 +228,7 @@ var RemoteWebpackRequirePlugin = class {
244
228
  }
245
229
  };
246
230
 
247
- // src/webpack/index.ts
231
+ // src/config/webpack/index.ts
248
232
  var RemoteComponentsWebpackPlugin = class {
249
233
  appName;
250
234
  chunkLoadingGlobal;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/webpack/index.ts","../../src/config/webpack/plugins/conditional-exec.ts","../../src/config/webpack/plugins/module-id-embed.ts","../../src/config/webpack/plugins/module-id-embed-runtime-module.ts","../../src/config/webpack/plugins/patch-require.ts","../../src/config/webpack/plugins/remote-webpack-require-runtime-module.ts","../../src/config/webpack/plugins/remote-webpack-require.ts"],"sourcesContent":["import type { Compiler } from 'webpack';\nimport { ConditionalExecPlugin } from './plugins/conditional-exec';\nimport { ModuleIdEmbedPlugin } from './plugins/module-id-embed';\nimport { PatchRequirePlugin } from './plugins/patch-require';\nimport { RemoteWebpackRequirePlugin } from './plugins/remote-webpack-require';\n\nexport type RemoteComponentsWebpackPluginOptions = {\n appName: string;\n chunkLoadingGlobal?: string;\n};\n\nexport class RemoteComponentsWebpackPlugin {\n private readonly appName: string;\n private readonly chunkLoadingGlobal?: string;\n\n constructor({\n appName,\n chunkLoadingGlobal,\n }: RemoteComponentsWebpackPluginOptions) {\n this.appName = appName;\n this.chunkLoadingGlobal = chunkLoadingGlobal;\n }\n\n apply(compiler: Compiler) {\n new RemoteWebpackRequirePlugin(this.appName).apply(compiler);\n new ModuleIdEmbedPlugin(this.appName, { includeAllModules: true }).apply(\n compiler,\n );\n new ConditionalExecPlugin(this.appName).apply(compiler);\n new PatchRequirePlugin(this.appName).apply(compiler);\n\n if (compiler.options.output) {\n compiler.options.output.chunkLoadingGlobal =\n this.chunkLoadingGlobal ??\n compiler.options.output.chunkLoadingGlobal ??\n `__remote_chunk_loading_global_${this.appName}__`;\n }\n }\n}\n","import type { Compiler } from 'webpack';\n\nexport class ConditionalExecPlugin {\n appName: string;\n\n constructor(appName: string) {\n this.appName = appName;\n }\n\n apply(compiler: Compiler) {\n const { Compilation, sources } = compiler.webpack;\n\n compiler.hooks.thisCompilation.tap(\n 'ConditionalExecPlugin',\n (compilation) => {\n compilation.hooks.processAssets.tap(\n {\n name: 'ConditionalExecPlugin',\n stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n (assets) => {\n for (const [name, source] of Object.entries(assets)) {\n if (name.endsWith('.js')) {\n const patchedSource = source\n .source()\n .toString()\n .replace(\n `var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))`,\n `var __webpack_exec__ = (moduleId) => { if (globalThis.__DISABLE_WEBPACK_EXEC__ && globalThis.__DISABLE_WEBPACK_EXEC__[\"${this.appName}\"]) return; return __webpack_require__(__webpack_require__.s = moduleId); }`,\n );\n compilation.updateAsset(\n name,\n new sources.RawSource(patchedSource),\n );\n }\n }\n },\n );\n },\n );\n }\n}\n","import { relative } from 'node:path';\nimport type { Compiler, NormalModule, RuntimeModule } from 'webpack';\nimport { createModuleIdEmbedRuntimeModule } from './module-id-embed-runtime-module';\n\nconst cwd = process.cwd();\n\nexport class ModuleIdEmbedPlugin {\n appName: string;\n includeAllModules: boolean;\n isServer: boolean;\n\n constructor(\n appName: string,\n options?: { includeAllModules?: boolean; isServer?: boolean },\n ) {\n this.appName = appName;\n this.includeAllModules = options?.includeAllModules ?? false;\n this.isServer = options?.isServer ?? false;\n }\n\n apply(compiler: Compiler) {\n const ModuleIdEmbedRuntimeModule = createModuleIdEmbedRuntimeModule(\n compiler.webpack,\n );\n\n compiler.hooks.thisCompilation.tap('ModuleIdEmbedPlugin', (compilation) => {\n const moduleMap = {} as Record<string, string | number>;\n\n compilation.hooks.runtimeRequirementInTree\n .for(compiler.webpack.RuntimeGlobals.require)\n .tap('ModuleIdEmbedPlugin', (chunk, set) => {\n for (const mod of compilation.modules) {\n const id = compilation.chunkGraph.getModuleId(mod);\n if (\n id &&\n (this.includeAllModules ||\n mod.layer?.endsWith('browser') ||\n (!this.isServer && mod.layer === null))\n ) {\n const normalModule = mod as NormalModule;\n if (normalModule.resource || normalModule.request) {\n moduleMap[\n relative(cwd, normalModule.resource || normalModule.request)\n ] = id;\n }\n }\n }\n\n if (Object.keys(moduleMap).length > 0) {\n compilation.addRuntimeModule(\n chunk,\n new ModuleIdEmbedRuntimeModule(\n this.appName,\n moduleMap,\n ) as unknown as RuntimeModule,\n );\n\n set.add(compiler.webpack.RuntimeGlobals.require);\n }\n });\n });\n }\n}\n","export function createModuleIdEmbedRuntimeModule(webpack: {\n RuntimeModule: new (name: string, stage?: number) => object;\n}) {\n return class ModuleIdEmbedRuntimeModule extends webpack.RuntimeModule {\n appName: string;\n moduleMap: Record<string | number, unknown>;\n\n constructor(appName: string, moduleMap: Record<string | number, unknown>) {\n super('remote-webpack-module-id-embed');\n this.appName = appName;\n this.moduleMap = moduleMap;\n }\n\n generate(): null | string {\n return `globalThis.__remote_webpack_module_map__ = globalThis.__remote_webpack_module_map__ || {}; globalThis.__remote_webpack_module_map__[\"${this.appName}\"] = ${JSON.stringify(this.moduleMap)};`;\n }\n };\n}\n","import type { Compiler } from 'webpack';\n\n// This plugin patches the webpack require function to support loading remote components in Next.js\nexport class PatchRequirePlugin {\n appName: string;\n\n constructor(appName: string) {\n this.appName = appName;\n }\n\n apply(compiler: Compiler) {\n const { sources } = compiler.webpack;\n\n compiler.hooks.thisCompilation.tap('PatchRequirePlugin', (compilation) => {\n compilation.mainTemplate.hooks.requireExtensions.tap(\n 'PatchRequirePlugin',\n (source) => {\n return new sources.ConcatSource(\n source,\n `const __webpack_require_orig__ = __webpack_require__;\nconst REMOTE_RE = /\\\\[(?<bundle>[^\\\\]]+)\\\\] (?<id>.*)/;\n__webpack_require__ = function __remote_webpack_require__(remoteId) {\n const match = REMOTE_RE.exec(remoteId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_orig__(remoteId);\n }\n if (typeof self.__remote_webpack_require__?.[bundle] !== 'function') {\n const error = new Error(\\`Remote Components are not available in \"\\${bundle}\". Did you forget to wrap the Next.js config with \\\\\\`withRemoteComponentsConfig\\\\\\` on both host and remote?\\`);\n error.name = 'RemoteComponentsError';\n error.code = 'REMOTE_COMPONENTS_ERROR';\n throw error;\n }\n return self.__remote_webpack_require__[bundle](self.__remote_webpack_require__[bundle].type === 'turbopack' ? remoteId : id);\n};\nObject.assign(__webpack_require__, __webpack_require_orig__);\nconst __webpack_require_l__ = __webpack_require__.l;\n__webpack_require__.l = function __remote_webpack_require_l__(url, done, key, chunkId) {\n const match = REMOTE_RE.exec(chunkId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_l__(new URL(url, globalThis.__remote_bundle_url__?.[\"${this.appName}\"] ?? location.origin).href, done, key, chunkId);\n }\n return done();\n};\nconst __webpack_require_o__ = __webpack_require__.o;\n__webpack_require__.o = function __remote_webpack_require_o__(installedChunks, chunkId) {\n const match = REMOTE_RE.exec(chunkId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_o__(installedChunks, chunkId);\n }\n return installedChunks[chunkId] = 0;\n};\nconst __webpack_require_e__ = __webpack_require__.e;\n__webpack_require__.e = function __remote_webpack_require_e__(chunkId) {\n const match = REMOTE_RE.exec(chunkId);\n const bundle = match?.groups?.bundle;\n const id = match?.groups?.id;\n if (!(id && bundle)) {\n return __webpack_require_e__(chunkId);\n }\n return Promise.resolve([]);\n};`,\n )\n .source()\n .toString();\n },\n );\n });\n }\n}\n","export function createRemoteWebpackRequireRuntimeModule(webpack: {\n RuntimeModule: new (name: string, stage?: number) => object;\n}) {\n return class RemoteWebpackRequireRuntimeModule extends webpack.RuntimeModule {\n appName: string;\n\n constructor(appName: string) {\n super('remote-webpack-require');\n this.appName = appName;\n }\n\n generate(): null | string {\n return `globalThis.__remote_webpack_require__ = globalThis.__remote_webpack_require__ || {}; globalThis.__remote_webpack_require__[\"${this.appName}\"] = __webpack_require__;`;\n }\n };\n}\n","import type { Compiler, RuntimeModule } from 'webpack';\nimport { createRemoteWebpackRequireRuntimeModule } from './remote-webpack-require-runtime-module';\n\nexport class RemoteWebpackRequirePlugin {\n appName: string;\n\n constructor(appName: string) {\n this.appName = appName;\n }\n\n apply(compiler: Compiler) {\n const RemoteWebpackRequireRuntimeModule =\n createRemoteWebpackRequireRuntimeModule(compiler.webpack);\n\n compiler.hooks.thisCompilation.tap(\n 'RemoteWebpackRequirePlugin',\n (compilation) => {\n compilation.hooks.runtimeRequirementInTree\n .for('__webpack_require__')\n .tap('RemoteWebpackRequirePlugin', (chunk) => {\n compilation.addRuntimeModule(\n chunk,\n new RemoteWebpackRequireRuntimeModule(\n this.appName,\n ) as unknown as RuntimeModule,\n );\n });\n },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,wBAAN,MAA4B;AAAA,EACjC;AAAA,EAEA,YAAY,SAAiB;AAC3B,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAM,UAAoB;AACxB,UAAM,EAAE,aAAa,QAAQ,IAAI,SAAS;AAE1C,aAAS,MAAM,gBAAgB;AAAA,MAC7B;AAAA,MACA,CAAC,gBAAgB;AACf,oBAAY,MAAM,cAAc;AAAA,UAC9B;AAAA,YACE,MAAM;AAAA,YACN,OAAO,YAAY;AAAA,UACrB;AAAA,UACA,CAAC,WAAW;AACV,uBAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,MAAM,GAAG;AACnD,kBAAI,KAAK,SAAS,KAAK,GAAG;AACxB,sBAAM,gBAAgB,OACnB,OAAO,EACP,SAAS,EACT;AAAA,kBACC;AAAA,kBACA,0HAA0H,KAAK;AAAA,gBACjI;AACF,4BAAY;AAAA,kBACV;AAAA,kBACA,IAAI,QAAQ,UAAU,aAAa;AAAA,gBACrC;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ACzCA,uBAAyB;;;ACAlB,SAAS,iCAAiC,SAE9C;AACD,SAAO,MAAM,mCAAmC,QAAQ,cAAc;AAAA,IACpE;AAAA,IACA;AAAA,IAEA,YAAY,SAAiB,WAA6C;AACxE,YAAM,gCAAgC;AACtC,WAAK,UAAU;AACf,WAAK,YAAY;AAAA,IACnB;AAAA,IAEA,WAA0B;AACxB,aAAO,wIAAwI,KAAK,eAAe,KAAK,UAAU,KAAK,SAAS;AAAA,IAClM;AAAA,EACF;AACF;;;ADbA,IAAM,MAAM,QAA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