@module-federation/enhanced 0.0.0-perf-devtools-20260107043700 → 0.0.0-perf-website-code-usage-20260914033703

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 (289) hide show
  1. package/README.md +1 -1
  2. package/dist/CHANGELOG.md +2678 -0
  3. package/dist/README.md +213 -0
  4. package/dist/rstestmigrate.md +140 -0
  5. package/dist/src/_virtual/_rolldown/runtime.js +47 -0
  6. package/dist/src/index.d.ts +22 -18
  7. package/dist/src/index.js +47 -41
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/lib/Constants.js +136 -116
  10. package/dist/src/lib/Constants.js.map +1 -1
  11. package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -16
  12. package/dist/src/lib/container/AsyncBoundaryPlugin.js +137 -196
  13. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
  14. package/dist/src/lib/container/ContainerEntryDependency.d.ts +25 -23
  15. package/dist/src/lib/container/ContainerEntryDependency.js +37 -39
  16. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
  17. package/dist/src/lib/container/ContainerEntryModule.d.ts +104 -79
  18. package/dist/src/lib/container/ContainerEntryModule.js +213 -234
  19. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -1
  20. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -10
  21. package/dist/src/lib/container/ContainerEntryModuleFactory.js +21 -25
  22. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
  23. package/dist/src/lib/container/ContainerExposedDependency.d.ts +26 -23
  24. package/dist/src/lib/container/ContainerExposedDependency.js +47 -47
  25. package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -1
  26. package/dist/src/lib/container/ContainerPlugin.d.ts +12 -8
  27. package/dist/src/lib/container/ContainerPlugin.js +144 -213
  28. package/dist/src/lib/container/ContainerPlugin.js.map +1 -1
  29. package/dist/src/lib/container/ContainerReferencePlugin.d.ts +16 -12
  30. package/dist/src/lib/container/ContainerReferencePlugin.js +72 -101
  31. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -1
  32. package/dist/src/lib/container/FallbackDependency.d.ts +24 -19
  33. package/dist/src/lib/container/FallbackDependency.js +46 -44
  34. package/dist/src/lib/container/FallbackDependency.js.map +1 -1
  35. package/dist/src/lib/container/FallbackItemDependency.d.ts +13 -8
  36. package/dist/src/lib/container/FallbackItemDependency.js +24 -24
  37. package/dist/src/lib/container/FallbackItemDependency.js.map +1 -1
  38. package/dist/src/lib/container/FallbackModule.d.ts +82 -71
  39. package/dist/src/lib/container/FallbackModule.js +133 -145
  40. package/dist/src/lib/container/FallbackModule.js.map +1 -1
  41. package/dist/src/lib/container/FallbackModuleFactory.d.ts +15 -10
  42. package/dist/src/lib/container/FallbackModuleFactory.js +20 -24
  43. package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -1
  44. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +11 -7
  45. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +124 -188
  46. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -1
  47. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +20 -16
  48. package/dist/src/lib/container/ModuleFederationPlugin.js +151 -170
  49. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
  50. package/dist/src/lib/container/RemoteModule.d.ts +83 -74
  51. package/dist/src/lib/container/RemoteModule.js +149 -153
  52. package/dist/src/lib/container/RemoteModule.js.map +1 -1
  53. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -7
  54. package/dist/src/lib/container/RemoteRuntimeModule.js +86 -120
  55. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -1
  56. package/dist/src/lib/container/RemoteToExternalDependency.d.ts +13 -8
  57. package/dist/src/lib/container/RemoteToExternalDependency.js +25 -23
  58. package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -1
  59. package/dist/src/lib/container/constant.d.ts +3 -0
  60. package/dist/src/lib/container/constant.js +11 -14
  61. package/dist/src/lib/container/constant.js.map +1 -1
  62. package/dist/src/lib/container/options.d.ts +12 -3
  63. package/dist/src/lib/container/options.js +51 -69
  64. package/dist/src/lib/container/options.js.map +1 -1
  65. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.d.ts +14 -9
  66. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js +56 -64
  67. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js.map +1 -1
  68. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.d.ts +23 -19
  69. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js +70 -101
  70. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js.map +1 -1
  71. package/dist/src/lib/container/runtime/FederationModulesPlugin.d.ts +20 -16
  72. package/dist/src/lib/container/runtime/FederationModulesPlugin.js +38 -46
  73. package/dist/src/lib/container/runtime/FederationModulesPlugin.js.map +1 -1
  74. package/dist/src/lib/container/runtime/FederationRuntimeDependency.d.ts +9 -4
  75. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js +16 -12
  76. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js.map +1 -1
  77. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +16 -11
  78. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +39 -46
  79. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -1
  80. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +31 -18
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +263 -293
  82. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -1
  83. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +9 -4
  84. package/dist/src/lib/container/runtime/getFederationGlobal.js +43 -41
  85. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -1
  86. package/dist/src/lib/container/runtime/normalizeToPosixPath.d.ts +5 -0
  87. package/dist/src/lib/container/runtime/normalizeToPosixPath.js +20 -0
  88. package/dist/src/lib/container/runtime/normalizeToPosixPath.js.map +1 -0
  89. package/dist/src/lib/container/runtime/utils.d.ts +22 -7
  90. package/dist/src/lib/container/runtime/utils.js +80 -102
  91. package/dist/src/lib/container/runtime/utils.js.map +1 -1
  92. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +15 -10
  93. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +27 -25
  94. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -1
  95. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +77 -67
  96. package/dist/src/lib/sharing/ConsumeSharedModule.js +190 -214
  97. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
  98. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +13 -9
  99. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +308 -472
  100. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
  101. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +16 -11
  102. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +108 -123
  103. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
  104. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +14 -9
  105. package/dist/src/lib/sharing/ProvideForSharedDependency.js +25 -25
  106. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -1
  107. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +44 -38
  108. package/dist/src/lib/sharing/ProvideSharedDependency.js +72 -74
  109. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
  110. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +91 -81
  111. package/dist/src/lib/sharing/ProvideSharedModule.js +177 -181
  112. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
  113. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +14 -9
  114. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +19 -25
  115. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
  116. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +27 -21
  117. package/dist/src/lib/sharing/ProvideSharedPlugin.js +341 -548
  118. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
  119. package/dist/src/lib/sharing/SharePlugin.d.ts +55 -12
  120. package/dist/src/lib/sharing/SharePlugin.js +91 -91
  121. package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
  122. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
  123. package/dist/src/lib/sharing/ShareRuntimeModule.js +81 -99
  124. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
  125. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +11 -7
  126. package/dist/src/lib/sharing/resolveMatchedConfigs.js +58 -71
  127. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -1
  128. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.d.ts +25 -0
  129. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js +85 -0
  130. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js.map +1 -0
  131. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.d.ts +41 -0
  132. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js +227 -0
  133. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js.map +1 -0
  134. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.d.ts +26 -0
  135. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js +32 -0
  136. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js.map +1 -0
  137. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.d.ts +32 -0
  138. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js +94 -0
  139. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js.map +1 -0
  140. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.d.ts +31 -0
  141. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js +49 -0
  142. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js.map +1 -0
  143. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.d.ts +22 -0
  144. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js +35 -0
  145. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js.map +1 -0
  146. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.d.ts +87 -0
  147. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js +144 -0
  148. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js.map +1 -0
  149. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.d.ts +16 -0
  150. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js +23 -0
  151. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js.map +1 -0
  152. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.d.ts +23 -0
  153. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js +163 -0
  154. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js.map +1 -0
  155. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.d.ts +22 -0
  156. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js +28 -0
  157. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js.map +1 -0
  158. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.d.ts +20 -0
  159. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js +44 -0
  160. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js.map +1 -0
  161. package/dist/src/lib/sharing/utils.d.ts +27 -23
  162. package/dist/src/lib/sharing/utils.js +224 -366
  163. package/dist/src/lib/sharing/utils.js.map +1 -1
  164. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.d.ts +11 -7
  165. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js +56 -75
  166. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js.map +1 -1
  167. package/dist/src/lib/startup/StartupHelpers.d.ts +11 -6
  168. package/dist/src/lib/startup/StartupHelpers.js +128 -178
  169. package/dist/src/lib/startup/StartupHelpers.js.map +1 -1
  170. package/dist/src/rspack.d.ts +3 -2
  171. package/dist/src/rspack.js +35 -10
  172. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +8 -4
  173. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -16
  174. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -1
  175. package/dist/src/runtime.d.ts +1 -1
  176. package/dist/src/runtime.js +11 -18
  177. package/dist/src/runtime.mjs +3 -0
  178. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +13 -5
  179. package/dist/src/schemas/container/ContainerPlugin.check.js +767 -1220
  180. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -1
  181. package/dist/src/schemas/container/ContainerPlugin.d.ts +267 -268
  182. package/dist/src/schemas/container/ContainerPlugin.js +269 -361
  183. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -1
  184. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +13 -5
  185. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +335 -443
  186. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -1
  187. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +102 -99
  188. package/dist/src/schemas/container/ContainerReferencePlugin.js +122 -162
  189. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -1
  190. package/dist/src/schemas/container/ExternalsType.check.d.ts +13 -5
  191. package/dist/src/schemas/container/ExternalsType.check.js +36 -62
  192. package/dist/src/schemas/container/ExternalsType.check.js.map +1 -1
  193. package/dist/src/schemas/container/ExternalsType.d.ts +5 -2
  194. package/dist/src/schemas/container/ExternalsType.js +8 -11
  195. package/dist/src/schemas/container/ExternalsType.js.map +1 -1
  196. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3020 -4301
  197. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
  198. package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +828 -758
  199. package/dist/src/schemas/container/ModuleFederationPlugin.js +788 -993
  200. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
  201. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.d.ts +13 -5
  202. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js +568 -739
  203. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js.map +1 -1
  204. package/dist/src/schemas/sharing/ConsumeSharedPlugin.d.ts +197 -189
  205. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js +212 -233
  206. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js.map +1 -1
  207. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.d.ts +13 -5
  208. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js +598 -775
  209. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js.map +1 -1
  210. package/dist/src/schemas/sharing/ProvideSharedPlugin.d.ts +184 -176
  211. package/dist/src/schemas/sharing/ProvideSharedPlugin.js +196 -224
  212. package/dist/src/schemas/sharing/ProvideSharedPlugin.js.map +1 -1
  213. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +12 -4
  214. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +285 -482
  215. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -1
  216. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +103 -100
  217. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +104 -126
  218. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -1
  219. package/dist/src/schemas/sharing/SharePlugin.check.d.ts +13 -5
  220. package/dist/src/schemas/sharing/SharePlugin.check.js +749 -794
  221. package/dist/src/schemas/sharing/SharePlugin.check.js.map +1 -1
  222. package/dist/src/schemas/sharing/SharePlugin.d.ts +245 -205
  223. package/dist/src/schemas/sharing/SharePlugin.js +256 -253
  224. package/dist/src/schemas/sharing/SharePlugin.js.map +1 -1
  225. package/dist/src/utils.d.ts +3 -0
  226. package/dist/src/utils.js +35 -26
  227. package/dist/src/utils.js.map +1 -1
  228. package/dist/src/webpack.d.ts +2 -2
  229. package/dist/src/webpack.js +6 -40
  230. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +9 -7
  231. package/dist/src/wrapper/AsyncBoundaryPlugin.js +13 -17
  232. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -1
  233. package/dist/src/wrapper/BaseWrapperPlugin.d.ts +32 -0
  234. package/dist/src/wrapper/BaseWrapperPlugin.js +43 -0
  235. package/dist/src/wrapper/BaseWrapperPlugin.js.map +1 -0
  236. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +10 -7
  237. package/dist/src/wrapper/ConsumeSharedPlugin.js +13 -17
  238. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -1
  239. package/dist/src/wrapper/ContainerPlugin.d.ts +9 -7
  240. package/dist/src/wrapper/ContainerPlugin.js +13 -17
  241. package/dist/src/wrapper/ContainerPlugin.js.map +1 -1
  242. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +9 -7
  243. package/dist/src/wrapper/ContainerReferencePlugin.js +13 -17
  244. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -1
  245. package/dist/src/wrapper/FederationModulesPlugin.d.ts +18 -10
  246. package/dist/src/wrapper/FederationModulesPlugin.js +20 -21
  247. package/dist/src/wrapper/FederationModulesPlugin.js.map +1 -1
  248. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +11 -8
  249. package/dist/src/wrapper/FederationRuntimePlugin.js +19 -20
  250. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -1
  251. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +8 -5
  252. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +13 -16
  253. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -1
  254. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +12 -9
  255. package/dist/src/wrapper/ModuleFederationPlugin.js +71 -104
  256. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -1
  257. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +10 -7
  258. package/dist/src/wrapper/ProvideSharedPlugin.js +13 -17
  259. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -1
  260. package/dist/src/wrapper/SharePlugin.d.ts +10 -7
  261. package/dist/src/wrapper/SharePlugin.js +13 -17
  262. package/dist/src/wrapper/SharePlugin.js.map +1 -1
  263. package/dist/src/wrapper/TreeShakingSharedPlugin.d.ts +10 -0
  264. package/dist/src/wrapper/TreeShakingSharedPlugin.js +15 -0
  265. package/dist/src/wrapper/TreeShakingSharedPlugin.js.map +1 -0
  266. package/package.json +27 -29
  267. package/dist/package.json +0 -110
  268. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +0 -57
  269. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +0 -33
  270. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +0 -4
  271. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +0 -28
  272. package/dist/src/declarations/plugins/container/Template.d.ts +0 -198
  273. package/dist/src/declarations/plugins/container/WebpackError.d.ts +0 -33
  274. package/dist/src/declarations/plugins/sharing/ConsumeSharedModule.d.ts +0 -82
  275. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +0 -96
  276. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +0 -98
  277. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +0 -108
  278. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.d.ts +0 -20
  279. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js +0 -219
  280. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js.map +0 -1
  281. package/dist/src/prefetch.d.ts +0 -2
  282. package/dist/src/prefetch.js +0 -8
  283. package/dist/src/prefetch.js.map +0 -1
  284. package/dist/src/rspack.js.map +0 -1
  285. package/dist/src/runtime.js.map +0 -1
  286. package/dist/src/types/runtime.d.ts +0 -10
  287. package/dist/src/types/runtime.js +0 -3
  288. package/dist/src/types/runtime.js.map +0 -1
  289. package/dist/src/webpack.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/lib/sharing/utils.ts"],"names":[],"mappings":";AAAA;;;EAGE;;AA2UO,4CAAgB;AAoFhB,gDAAkB;AAO3B,sFAgCC;AAED,oEAsBC;AAED,8DAuBC;AAED,gDAwBC;AAED,8DAQC;AAED,kEAQC;AAniBD,gDAA2D;AAE3D,0FAAqF;AAIrF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CACzC,IAAA,6CAAoB,EAAC,qBAAqB,CAAC,CACJ,CAAC;AAE1C,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAC9B,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAE9B,iDAAiD;AACjD,MAAM,2BAA2B,GAAG,2CAA2C,CAAC;AAEhF,uDAAuD;AACvD,MAAM,gBAAgB,GAAG,+CAA+C,CAAC;AAEzE,gCAAgC;AAChC,MAAM,WAAW,GACf,kEAAkE,CA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IAErB,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAgB,2BAA2B,CAAC,QAAgB;IAC1D,0CAA0C;IAC1C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QACtC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC,CAAC,8BAA8B;QACxF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../../../src/lib/sharing/utils.ts"],"sourcesContent":["/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n\nimport { isRequiredVersion } from '@module-federation/sdk';\nimport type { ConsumeOptions } from '@module-federation/sdk';\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type { InputFileSystem } from 'webpack/lib/util/fs';\nimport type { Compilation } from 'webpack';\n\nconst { join, dirname, readJson } = require(\n normalizeWebpackPath('webpack/lib/util/fs'),\n) as typeof import('webpack/lib/util/fs');\n\nconst { WebpackError } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\n\n// Extreme shorthand only for github. eg: foo/bar\nconst RE_URL_GITHUB_EXTREME_SHORT = /^[^/@:.\\s][^/@:\\s]*\\/[^@:\\s]*[^/@:\\s]#\\S+/;\n\n// Short url with specific protocol. eg: github:foo/bar\nconst RE_GIT_URL_SHORT = /^(github|gitlab|bitbucket|gist):\\/?[^/.]+\\/?/i;\n\n// Currently supported protocols\nconst RE_PROTOCOL =\n /^((git\\+)?(ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/i;\n\n// Has custom protocol\nconst RE_CUSTOM_PROTOCOL = /^((git\\+)?(ssh|https?|file)|git):\\/\\//i;\n\n// Valid hash format for npm / yarn ...\nconst RE_URL_HASH_VERSION = /#(?:semver:)?(.+)/;\n\n// Simple hostname validate\nconst RE_HOSTNAME = /^(?:[^/.]+(\\.[^/]+)+|localhost)$/;\n\n// For hostname with colon. eg: ssh://user@github.com:foo/bar\nconst RE_HOSTNAME_WITH_COLON =\n /([^/@#:.]+(?:\\.[^/@#:.]+)+|localhost):([^#/0-9]+)/;\n\n// Reg for url without protocol\nconst RE_NO_PROTOCOL = /^([^/@#:.]+(?:\\.[^/@#:.]+)+)/;\n\n// Specific protocol for short url without normal hostname\nconst PROTOCOLS_FOR_SHORT = [\n 'github:',\n 'gitlab:',\n 'bitbucket:',\n 'gist:',\n 'file:',\n];\n\n// Default protocol for git url\nconst DEF_GIT_PROTOCOL = 'git+ssh://';\n\n// thanks to https://github.com/npm/hosted-git-info/blob/latest/git-host-info.js\nconst extractCommithashByDomain: {\n [key: string]: (pathname: string, hash: string) => string | undefined;\n} = {\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'github.com': (pathname: string, hash: string) => {\n const [, user, project, type, commithash] = pathname.split('/', 5);\n if (type && type !== 'tree') {\n return;\n }\n\n let commithashResult = commithash;\n if (!type) {\n commithashResult = hash;\n } else {\n commithashResult = '#' + commithash;\n }\n\n let projectResult = project;\n if (project && project.endsWith('.git')) {\n projectResult = project.slice(0, -4);\n }\n\n if (!user || !projectResult) {\n return;\n }\n\n return commithashResult;\n },\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'gitlab.com': (pathname: string, hash: string) => {\n const path = pathname.slice(1);\n if (path.includes('/-/') || path.includes('/archive.tar.gz')) {\n return;\n }\n\n const segments = path.split('/');\n let project = segments.pop();\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4);\n }\n\n const user = segments.join('/');\n if (!user || !project) {\n return;\n }\n\n return hash;\n },\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'bitbucket.org': (pathname: string, hash: string) => {\n const [, user, project, aux] = pathname.split('/', 4);\n if (['get'].includes(aux)) {\n return;\n }\n\n let projectResult = project;\n if (project && project.endsWith('.git')) {\n projectResult = project.slice(0, -4);\n }\n\n if (!user || !projectResult) {\n return;\n }\n\n return hash;\n },\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'gist.github.com': (pathname: string, hash: string) => {\n const [, user, project, aux] = pathname.split('/', 4);\n if (aux === 'raw') {\n return;\n }\n\n let projectResult = project;\n if (!projectResult) {\n if (!user) {\n return;\n }\n\n projectResult = user;\n }\n\n if (projectResult.endsWith('.git')) {\n projectResult = projectResult.slice(0, -4);\n }\n\n return hash;\n },\n};\n\n/**\n * extract commit hash from parsed url\n *\n * @inner\n * @param {URL} urlParsed parsed url\n * @returns {string} commithash\n */\nfunction getCommithash(urlParsed: URL): string {\n const { hostname, pathname, hash } = urlParsed;\n const hostnameResult = hostname.replace(/^www\\./, '');\n\n let hashResult = hash;\n try {\n hashResult = decodeURIComponent(hash);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n\n if (\n /** @type {keyof extractCommithashByDomain} */ extractCommithashByDomain[\n hostnameResult\n ]\n ) {\n return (\n extractCommithashByDomain\n /** @type {keyof extractCommithashByDomain} */ [hostnameResult](\n pathname,\n hashResult,\n ) || ''\n );\n }\n\n return hashResult;\n}\n\n/**\n * make url right for URL parse\n *\n * @inner\n * @param {string} gitUrl git url\n * @returns {string} fixed url\n */\nfunction correctUrl(gitUrl: string): string {\n // like:\n // proto://hostname.com:user/repo -> proto://hostname.com/user/repo\n return gitUrl.replace(RE_HOSTNAME_WITH_COLON, '$1/$2');\n}\n\n/**\n * make url protocol right for URL parse\n *\n * @inner\n * @param {string} gitUrl git url\n * @returns {string} fixed url\n */\nfunction correctProtocol(gitUrl: string): string {\n // eg: github:foo/bar#v1.0. Should not add double slash, in case of error parsed `pathname`\n if (RE_GIT_URL_SHORT.test(gitUrl)) {\n return gitUrl;\n }\n\n // eg: user@github.com:foo/bar\n if (!RE_CUSTOM_PROTOCOL.test(gitUrl)) {\n return `${DEF_GIT_PROTOCOL}${gitUrl}`;\n }\n\n return gitUrl;\n}\n\n/**\n * extract git dep version from hash\n *\n * @inner\n * @param {string} hash hash\n * @returns {string} git dep version\n */\nfunction getVersionFromHash(hash: string): string {\n const matched = hash.match(RE_URL_HASH_VERSION);\n\n return (matched && matched[1]) || '';\n}\n\n/**\n * if string can be decoded\n *\n * @inner\n * @param {string} str str to be checked\n * @returns {boolean} if can be decoded\n */\nfunction canBeDecoded(str: string): boolean {\n try {\n decodeURIComponent(str);\n } catch (e) {\n return false;\n }\n\n return true;\n}\n\n/**\n * get right dep version from git url\n *\n * @inner\n * @param {string} gitUrl git url\n * @returns {string} dep version\n */\nfunction getGitUrlVersion(gitUrl: string): string {\n const oriGitUrl = gitUrl;\n // github extreme shorthand\n if (RE_URL_GITHUB_EXTREME_SHORT.test(gitUrl)) {\n gitUrl = 'github:' + gitUrl;\n } else {\n gitUrl = correctProtocol(gitUrl);\n }\n\n gitUrl = correctUrl(gitUrl);\n\n let parsed;\n try {\n parsed = new URL(gitUrl);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n\n if (!parsed) {\n return '';\n }\n\n const { protocol, hostname, pathname, username, password } = parsed;\n if (!RE_PROTOCOL.test(protocol)) {\n return '';\n }\n\n // pathname shouldn't be empty or URL malformed\n if (!pathname || !canBeDecoded(pathname)) {\n return '';\n }\n\n // without protocol, there should have auth info\n if (RE_NO_PROTOCOL.test(oriGitUrl) && !username && !password) {\n return '';\n }\n\n if (!PROTOCOLS_FOR_SHORT.includes(protocol.toLowerCase())) {\n if (!RE_HOSTNAME.test(hostname)) {\n return '';\n }\n\n const commithash = getCommithash(parsed);\n return getVersionFromHash(commithash) || commithash;\n }\n\n // for protocol short\n return getVersionFromHash(gitUrl);\n}\n\n/**\n * @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies\n * @param {string} versionDesc version to be normalized\n * @returns {string} normalized version\n */\nfunction normalizeVersion(versionDesc: string): string {\n versionDesc = (versionDesc && versionDesc.trim()) || '';\n\n if (isRequiredVersion(versionDesc)) {\n return versionDesc;\n }\n\n // add handle for URL Dependencies\n return getGitUrlVersion(versionDesc.toLowerCase());\n}\n\nexport { normalizeVersion };\n\n/** @typedef {{ data: Record<string, any>, path: string }} DescriptionFile */\n\ninterface DescriptionFile {\n data: Record<string, any>;\n path: string;\n}\n\n/**\n *\n * @param {InputFileSystem} fs file system\n * @param {string} directory directory to start looking into\n * @param {string[]} descriptionFiles possible description filenames\n * @param {function((Error | null)=, {data?: DescriptionFile, path?: string}=, (checkedDescriptionFilePaths: string[])=): void} callback callback\n * @param {function({data: DescriptionFile}=): boolean} satisfiesDescriptionFileData file data compliance check\n * @param {Set<string>} [checkedFilePaths] optional set to track checked file paths\n */\nfunction getDescriptionFile(\n fs: InputFileSystem,\n directory: string,\n descriptionFiles: string[],\n callback: (\n err: Error | null,\n data?: DescriptionFile,\n checkedDescriptionFilePaths?: string[],\n ) => void,\n satisfiesDescriptionFileData?: (data?: DescriptionFile) => boolean,\n checkedFilePaths: Set<string> = new Set<string>(), // Default to a new Set if not provided\n) {\n let i = 0;\n\n // Create an object to hold the function and the shared checkedFilePaths\n const satisfiesDescriptionFileDataInternal = {\n check: satisfiesDescriptionFileData,\n checkedFilePaths: checkedFilePaths, // Use the passed Set instance\n };\n\n const tryLoadCurrent = () => {\n if (i >= descriptionFiles.length) {\n const parentDirectory = dirname(fs, directory);\n if (!parentDirectory || parentDirectory === directory) {\n return callback(\n null,\n undefined,\n Array.from(satisfiesDescriptionFileDataInternal.checkedFilePaths),\n );\n }\n return getDescriptionFile(\n fs,\n parentDirectory,\n descriptionFiles,\n callback,\n satisfiesDescriptionFileDataInternal.check,\n satisfiesDescriptionFileDataInternal.checkedFilePaths, // Pass the same Set\n );\n }\n const filePath = join(fs, directory, descriptionFiles[i]);\n readJson(fs, filePath, (err, data?: Record<string, any>) => {\n if (err) {\n if ('code' in err && err.code === 'ENOENT') {\n i++;\n return tryLoadCurrent();\n }\n return callback(err);\n }\n if (!data || typeof data !== 'object' || Array.isArray(data)) {\n return callback(\n new Error(`Description file ${filePath} is not an object`),\n );\n }\n if (\n typeof satisfiesDescriptionFileDataInternal.check === 'function' &&\n !satisfiesDescriptionFileDataInternal.check({ data, path: filePath })\n ) {\n i++;\n satisfiesDescriptionFileDataInternal.checkedFilePaths.add(filePath);\n return tryLoadCurrent();\n }\n callback(null, { data, path: filePath });\n });\n };\n tryLoadCurrent();\n}\nexport { getDescriptionFile };\n/**\n * Get required version from description file\n * @param {Record<string, any>} data - The data object\n * @param {string} packageName - The package name\n * @returns {string | undefined} The normalized version\n */\nexport function getRequiredVersionFromDescriptionFile(\n data: Record<string, any>,\n packageName: string,\n): string | undefined | void {\n if (\n data['optionalDependencies'] &&\n typeof data['optionalDependencies'] === 'object' &&\n packageName in data['optionalDependencies']\n ) {\n return normalizeVersion(data['optionalDependencies'][packageName]);\n }\n if (\n data['dependencies'] &&\n typeof data['dependencies'] === 'object' &&\n packageName in data['dependencies']\n ) {\n return normalizeVersion(data['dependencies'][packageName]);\n }\n if (\n data['peerDependencies'] &&\n typeof data['peerDependencies'] === 'object' &&\n packageName in data['peerDependencies']\n ) {\n return normalizeVersion(data['peerDependencies'][packageName]);\n }\n if (\n data['devDependencies'] &&\n typeof data['devDependencies'] === 'object' &&\n packageName in data['devDependencies']\n ) {\n return normalizeVersion(data['devDependencies'][packageName]);\n }\n}\n\nexport function normalizeConsumeShareOptions(consumeOptions: ConsumeOptions) {\n const {\n requiredVersion = false,\n strictVersion,\n singleton = false,\n eager,\n shareKey,\n shareScope,\n layer,\n treeShakingMode,\n } = consumeOptions;\n return {\n shareConfig: {\n fixedDependencies: false,\n requiredVersion,\n strictVersion,\n singleton,\n eager,\n layer,\n },\n shareScope,\n shareKey,\n treeShakingMode,\n };\n}\n\nexport function addSingletonFilterWarning(\n compilation: Compilation,\n shareKey: string, // The shareKey or a relevant identifier for the shared module\n filterType: 'include' | 'exclude',\n filterProperty: 'request' | 'version',\n filterValue: string | RegExp,\n moduleRequest: string, // original request that led to this shared module\n moduleResource?: string, // resolved path of the module\n): void {\n if (typeof compilation.warnings.push !== 'function') {\n return;\n }\n const filterValueStr =\n filterValue instanceof RegExp ? filterValue.toString() : `\"${filterValue}\"`;\n const warningMessage = `\"singleton: true\" is used together with \"${filterType}.${filterProperty}: ${filterValueStr}\". This might lead to multiple instances of the shared module \"${shareKey}\" in the shared scope.`;\n const warning = new WebpackError(warningMessage);\n\n if (moduleResource) {\n warning.file = `shared module ${moduleRequest} -> ${moduleResource}`;\n } else {\n warning.file = `shared module ${moduleRequest}`; // Fallback if resource is not available\n }\n compilation.warnings.push(warning);\n}\n\nexport function testRequestFilters(\n remainder: string,\n includeRequest?: string | RegExp,\n excludeRequest?: string | RegExp,\n): boolean {\n if (\n includeRequest &&\n !(includeRequest instanceof RegExp\n ? includeRequest.test(remainder)\n : remainder === includeRequest)\n ) {\n return false; // Skip if include doesn't match\n }\n\n if (\n excludeRequest &&\n (excludeRequest instanceof RegExp\n ? excludeRequest.test(remainder)\n : remainder === excludeRequest)\n ) {\n return false; // Skip if exclude matches\n }\n\n return true; // Process if no filters skip it\n}\n\nexport function createLookupKeyForSharing(\n request: string,\n layer?: string | null,\n): string {\n if (layer) {\n return `(${layer})${request}`;\n }\n return request;\n}\n\nexport function extractPathAfterNodeModules(filePath: string): string | null {\n // Fast check for 'node_modules' substring\n if (~filePath.indexOf('node_modules')) {\n const nodeModulesIndex = filePath.lastIndexOf('node_modules');\n const result = filePath.substring(nodeModulesIndex + 13); // 13 = 'node_modules/'.length\n return result;\n }\n return null;\n}\n"],"mappings":";;;;;;AAWA,MAAM,EAAE,MAAM,SAAS,aAAa,gFACb,sBAAsB,CAC5C;AAED,MAAM,EA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KAEpD,SAAQ,OAAO,iBAAiB;AAElC,aAAY,SAAS,KAAK,QAAQ;;AAGpC,SAAgB,mBACd,WACA,gBACA,gBACS;AACT,KACE,kBACA,EAAE,0BAA0B,SACxB,eAAe,KAAK,UAAU,GAC9B,cAAc,gBAElB,QAAO;AAGT,KACE,mBACC,0BAA0B,SACvB,eAAe,KAAK,UAAU,GAC9B,cAAc,gBAElB,QAAO;AAGT,QAAO;;AAGT,SAAgB,0BACd,SACA,OACQ;AACR,KAAI,MACF,QAAO,IAAI,MAAM,GAAG;AAEtB,QAAO;;AAGT,SAAgB,4BAA4B,UAAiC;AAE3E,KAAI,CAAC,SAAS,QAAQ,eAAe,EAAE;EACrC,MAAM,mBAAmB,SAAS,YAAY,eAAe;AAE7D,SADe,SAAS,UAAU,mBAAmB,GAAG;;AAG1D,QAAO"}
@@ -1,11 +1,15 @@
1
- import type { Compiler } from 'webpack';
1
+ import { Compiler } from "webpack";
2
+
3
+ //#region src/lib/startup/MfStartupChunkDependenciesPlugin.d.ts
2
4
  interface Options {
3
- asyncChunkLoading?: boolean;
5
+ asyncChunkLoading?: boolean;
4
6
  }
5
7
  declare class StartupChunkDependenciesPlugin {
6
- asyncChunkLoading: boolean;
7
- constructor(options: Options);
8
- private isEnabledForChunk;
9
- apply(compiler: Compiler): void;
8
+ asyncChunkLoading: boolean;
9
+ constructor(options: Options);
10
+ private isEnabledForChunk;
11
+ apply(compiler: Compiler): void;
10
12
  }
11
- export default StartupChunkDependenciesPlugin;
13
+ //#endregion
14
+ export { StartupChunkDependenciesPlugin as default };
15
+ //# sourceMappingURL=MfStartupChunkDependenciesPlugin.d.ts.map
@@ -1,79 +1,60 @@
1
1
  'use strict';
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
+ const require_lib_container_ContainerEntryModule = require('../container/ContainerEntryModule.js');
6
+ const require_lib_startup_StartupHelpers = require('./StartupHelpers.js');
7
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
8
+
9
+ //#region src/lib/startup/MfStartupChunkDependenciesPlugin.ts
10
+ const { RuntimeGlobals } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
11
+ const StartupEntrypointRuntimeModule = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/runtime/StartupEntrypointRuntimeModule"));
12
+ var StartupChunkDependenciesPlugin = class {
13
+ constructor(options) {
14
+ this.asyncChunkLoading = options.asyncChunkLoading ?? true;
15
+ }
16
+ isEnabledForChunk(chunk, compilation) {
17
+ if (chunk.id === "build time chunk") return false;
18
+ const [finalEntry] = Array.from(compilation.chunkGraph.getChunkEntryModulesIterable(chunk)).reverse() || [];
19
+ return !(finalEntry instanceof require_lib_container_ContainerEntryModule.default);
20
+ }
21
+ apply(compiler) {
22
+ compiler.hooks.thisCompilation.tap("MfStartupChunkDependenciesPlugin", (compilation) => {
23
+ compilation.hooks.additionalTreeRuntimeRequirements.tap("StartupChunkDependenciesPlugin", (chunk, set, { chunkGraph }) => {
24
+ if (!this.isEnabledForChunk(chunk, compilation)) return;
25
+ if (chunk.hasRuntime()) {
26
+ set.add(RuntimeGlobals.startupEntrypoint);
27
+ set.add(RuntimeGlobals.ensureChunk);
28
+ set.add(RuntimeGlobals.ensureChunkIncludeEntries);
29
+ }
30
+ });
31
+ compilation.hooks.additionalChunkRuntimeRequirements.tap("MfStartupChunkDependenciesPlugin", (chunk, set, { chunkGraph }) => {
32
+ if (!this.isEnabledForChunk(chunk, compilation)) return;
33
+ if (chunkGraph.getNumberOfEntryModules(chunk) === 0) return;
34
+ set.add(require_lib_startup_StartupHelpers.federationStartup);
35
+ });
36
+ compilation.hooks.runtimeRequirementInTree.for(RuntimeGlobals.startupEntrypoint).tap("StartupChunkDependenciesPlugin", (chunk, set, { chunkGraph }) => {
37
+ if (!this.isEnabledForChunk(chunk, compilation)) return;
38
+ set.add(RuntimeGlobals.require);
39
+ set.add(RuntimeGlobals.ensureChunk);
40
+ set.add(RuntimeGlobals.ensureChunkIncludeEntries);
41
+ compilation.addRuntimeModule(chunk, new StartupEntrypointRuntimeModule(this.asyncChunkLoading));
42
+ });
43
+ const { renderStartup } = compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);
44
+ renderStartup.tap("MfStartupChunkDependenciesPlugin", (startupSource, lastInlinedModule, renderContext) => {
45
+ const { chunk, chunkGraph, runtimeTemplate } = renderContext;
46
+ if (!this.isEnabledForChunk(chunk, compilation)) return startupSource;
47
+ if (chunkGraph.getNumberOfEntryModules(chunk) === 0) return startupSource;
48
+ const treeRuntimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
49
+ if (!(chunkGraph.getChunkRuntimeRequirements(chunk).has(require_lib_startup_StartupHelpers.federationStartup) || treeRuntimeRequirements.has(require_lib_startup_StartupHelpers.federationStartup))) return startupSource;
50
+ const entryModules = Array.from(chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk));
51
+ const entryGeneration = runtimeTemplate.outputOptions.module ? require_lib_startup_StartupHelpers.generateESMEntryStartup : require_lib_startup_StartupHelpers.generateEntryStartup;
52
+ return new compiler.webpack.sources.ConcatSource(entryGeneration(compilation, chunkGraph, runtimeTemplate, entryModules, chunk, false));
53
+ });
54
+ });
55
+ }
4
56
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
7
- const StartupHelpers_1 = require("./StartupHelpers");
8
- const ContainerEntryModule_1 = __importDefault(require("../container/ContainerEntryModule"));
9
- const { RuntimeGlobals } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
10
- const StartupEntrypointRuntimeModule = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/runtime/StartupEntrypointRuntimeModule'));
11
- class StartupChunkDependenciesPlugin {
12
- constructor(options) {
13
- this.asyncChunkLoading = options.asyncChunkLoading ?? true;
14
- }
15
- isEnabledForChunk(chunk, compilation) {
16
- if (chunk.id === 'build time chunk')
17
- return false;
18
- const [finalEntry] = Array.from(compilation.chunkGraph.getChunkEntryModulesIterable(chunk)).reverse() || [];
19
- return !(finalEntry instanceof ContainerEntryModule_1.default);
20
- }
21
- apply(compiler) {
22
- compiler.hooks.thisCompilation.tap('MfStartupChunkDependenciesPlugin', (compilation) => {
23
- // Add additional runtime requirements at the tree level.
24
- compilation.hooks.additionalTreeRuntimeRequirements.tap('StartupChunkDependenciesPlugin', (chunk, set, { chunkGraph }) => {
25
- if (!this.isEnabledForChunk(chunk, compilation))
26
- return;
27
- if (chunk.hasRuntime()) {
28
- set.add(RuntimeGlobals.startupEntrypoint);
29
- set.add(RuntimeGlobals.ensureChunk);
30
- set.add(RuntimeGlobals.ensureChunkIncludeEntries);
31
- }
32
- });
33
- // Add additional runtime requirements at the chunk level if there are entry modules.
34
- compilation.hooks.additionalChunkRuntimeRequirements.tap('MfStartupChunkDependenciesPlugin', (chunk, set, { chunkGraph }) => {
35
- if (!this.isEnabledForChunk(chunk, compilation))
36
- return;
37
- if (chunkGraph.getNumberOfEntryModules(chunk) === 0)
38
- return;
39
- set.add(StartupHelpers_1.federationStartup);
40
- });
41
- // When the startupEntrypoint requirement is present, add extra keys and a runtime module.
42
- compilation.hooks.runtimeRequirementInTree
43
- .for(RuntimeGlobals.startupEntrypoint)
44
- .tap('StartupChunkDependenciesPlugin', (chunk, set, { chunkGraph }) => {
45
- if (!this.isEnabledForChunk(chunk, compilation))
46
- return;
47
- set.add(RuntimeGlobals.require);
48
- set.add(RuntimeGlobals.ensureChunk);
49
- set.add(RuntimeGlobals.ensureChunkIncludeEntries);
50
- compilation.addRuntimeModule(chunk, new StartupEntrypointRuntimeModule(this.asyncChunkLoading));
51
- });
52
- // Replace the generated startup with a custom version if entry modules exist.
53
- const { renderStartup } = compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);
54
- renderStartup.tap('MfStartupChunkDependenciesPlugin', (startupSource, lastInlinedModule, renderContext) => {
55
- const { chunk, chunkGraph, runtimeTemplate } = renderContext;
56
- if (!this.isEnabledForChunk(chunk, compilation)) {
57
- return startupSource;
58
- }
59
- if (chunkGraph.getNumberOfEntryModules(chunk) === 0) {
60
- return startupSource;
61
- }
62
- const treeRuntimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
63
- const chunkRuntimeRequirements = chunkGraph.getChunkRuntimeRequirements(chunk);
64
- const federation = chunkRuntimeRequirements.has(StartupHelpers_1.federationStartup) ||
65
- treeRuntimeRequirements.has(StartupHelpers_1.federationStartup);
66
- if (!federation) {
67
- return startupSource;
68
- }
69
- const entryModules = Array.from(chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk));
70
- const entryGeneration = runtimeTemplate.outputOptions.module
71
- ? StartupHelpers_1.generateESMEntryStartup
72
- : StartupHelpers_1.generateEntryStartup;
73
- return new compiler.webpack.sources.ConcatSource(entryGeneration(compilation, chunkGraph, runtimeTemplate, entryModules, chunk, false));
74
- });
75
- });
76
- }
77
- }
57
+
58
+ //#endregion
78
59
  exports.default = StartupChunkDependenciesPlugin;
79
60
  //# sourceMappingURL=MfStartupChunkDependenciesPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MfStartupChunkDependenciesPlugin.js","sourceRoot":"","sources":["../../../../src/lib/startup/MfStartupChunkDependenciesPlugin.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,0FAAqF;AACrF,qDAI0B;AAE1B,6FAAqE;AAErE,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAChC,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAC9B,MAAM,8BAA8B,GAAG,OAAO,CAC5C,IAAA,6CAAoB,EAAC,oDAAoD,CAAC,CACJ,CAAC;AAMzE,MAAM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CAAC;gBAED,IAAI,UAAU,CAAC,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;oBACpD,OAAO,aAAa,CAAC;gBACvB,CAAC;gBAED,MAAM,uBAAuB,GAC3B,UAAU,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;gBAC/C,MAAM,wBAAwB,GAC5B,UAAU,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;gBAEhD,MAAM,UAAU,GACd,wBAAwB,CAAC,GAAG,CAAC,kCAAiB,CAAC;oBAC/C,uBAAuB,CAAC,GAAG,CAAC,kCAAiB,CAAC,CAAC;gBAEjD,IAAI,CAAC,UAAU,EAAE,CAAC;oBAChB,OAAO,aAAa,CAAC;gBACvB,CAAC;gBAED,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAC7B,UAAU,CAAC,0CAA0C,CAAC,KAAK,CAAC,CAC7D,CAAC;gBAEF,MAAM,eAAe,GAAG,eAAe,CAAC,aAAa,CAAC,MAAM;oBAC1D,CAAC,CAAC,wCAAuB;oBACzB,CAAC,CAAC,qCAAoB,CAAC;gBAEzB,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAC9C,eAAe,CACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,YAAY,EACZ,KAAK,EACL,KAAK,CACN,CACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,8BAA8B,CAAC"}
1
+ {"version":3,"file":"MfStartupChunkDependenciesPlugin.js","names":["ContainerEntryModule","federationStartup","generateESMEntryStartup","generateEntryStartup"],"sources":["../../../../src/lib/startup/MfStartupChunkDependenciesPlugin.ts"],"sourcesContent":["'use strict';\n\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport {\n federationStartup,\n generateEntryStartup,\n generateESMEntryStartup,\n} from './StartupHelpers';\nimport type { Compiler, Chunk } from 'webpack';\nimport ContainerEntryModule from '../container/ContainerEntryModule';\n\nconst { RuntimeGlobals } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\nconst StartupEntrypointRuntimeModule = require(\n normalizeWebpackPath('webpack/lib/runtime/StartupEntrypointRuntimeModule'),\n) as typeof import('webpack/lib/runtime/StartupEntrypointRuntimeModule');\n\ninterface Options {\n asyncChunkLoading?: boolean;\n}\n\nclass StartupChunkDependenciesPlugin {\n asyncChunkLoading: boolean;\n\n constructor(options: Options) {\n this.asyncChunkLoading = options.asyncChunkLoading ?? true;\n }\n\n private isEnabledForChunk(chunk: Chunk, compilation: any): boolean {\n if (chunk.id === 'build time chunk') return false;\n\n const [finalEntry] =\n Array.from(\n compilation.chunkGraph.getChunkEntryModulesIterable(chunk),\n ).reverse() || [];\n\n return !(finalEntry instanceof ContainerEntryModule);\n }\n\n apply(compiler: Compiler): void {\n compiler.hooks.thisCompilation.tap(\n 'MfStartupChunkDependenciesPlugin',\n (compilation) => {\n // Add additional runtime requirements at the tree level.\n compilation.hooks.additionalTreeRuntimeRequirements.tap(\n 'StartupChunkDependenciesPlugin',\n (chunk, set, { chunkGraph }) => {\n if (!this.isEnabledForChunk(chunk, compilation)) return;\n if (chunk.hasRuntime()) {\n set.add(RuntimeGlobals.startupEntrypoint);\n set.add(RuntimeGlobals.ensureChunk);\n set.add(RuntimeGlobals.ensureChunkIncludeEntries);\n }\n },\n );\n\n // Add additional runtime requirements at the chunk level if there are entry modules.\n compilation.hooks.additionalChunkRuntimeRequirements.tap(\n 'MfStartupChunkDependenciesPlugin',\n (chunk, set, { chunkGraph }) => {\n if (!this.isEnabledForChunk(chunk, compilation)) return;\n if (chunkGraph.getNumberOfEntryModules(chunk) === 0) return;\n set.add(federationStartup);\n },\n );\n\n // When the startupEntrypoint requirement is present, add extra keys and a runtime module.\n compilation.hooks.runtimeRequirementInTree\n .for(RuntimeGlobals.startupEntrypoint)\n .tap(\n 'StartupChunkDependenciesPlugin',\n (chunk, set, { chunkGraph }) => {\n if (!this.isEnabledForChunk(chunk, compilation)) return;\n set.add(RuntimeGlobals.require);\n set.add(RuntimeGlobals.ensureChunk);\n set.add(RuntimeGlobals.ensureChunkIncludeEntries);\n compilation.addRuntimeModule(\n chunk,\n new StartupEntrypointRuntimeModule(this.asyncChunkLoading),\n );\n },\n );\n\n // Replace the generated startup with a custom version if entry modules exist.\n const { renderStartup } =\n compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(\n compilation,\n );\n\n renderStartup.tap(\n 'MfStartupChunkDependenciesPlugin',\n (startupSource, lastInlinedModule, renderContext) => {\n const { chunk, chunkGraph, runtimeTemplate } = renderContext;\n\n if (!this.isEnabledForChunk(chunk, compilation)) {\n return startupSource;\n }\n\n if (chunkGraph.getNumberOfEntryModules(chunk) === 0) {\n return startupSource;\n }\n\n const treeRuntimeRequirements =\n chunkGraph.getTreeRuntimeRequirements(chunk);\n const chunkRuntimeRequirements =\n chunkGraph.getChunkRuntimeRequirements(chunk);\n\n const federation =\n chunkRuntimeRequirements.has(federationStartup) ||\n treeRuntimeRequirements.has(federationStartup);\n\n if (!federation) {\n return startupSource;\n }\n\n const entryModules = Array.from(\n chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk),\n );\n\n const entryGeneration = runtimeTemplate.outputOptions.module\n ? generateESMEntryStartup\n : generateEntryStartup;\n\n return new compiler.webpack.sources.ConcatSource(\n entryGeneration(\n compilation,\n chunkGraph,\n runtimeTemplate,\n entryModules,\n chunk,\n false,\n ),\n );\n },\n );\n },\n );\n }\n}\n\nexport default StartupChunkDependenciesPlugin;\n"],"mappings":";;;;;;;;;AAWA,MAAM,EAAE,mBAAmB,gFACJ,UAAU,CAChC;AACD,MAAM,iCAAiC,gFAChB,qDAAqD,CAC3E;AAMD,IAAM,iCAAN,MAAqC;CAGnC,YAAY,SAAkB;AAC5B,OAAK,oBAAoB,QAAQ,qBAAqB;;CAGxD,AAAQ,kBAAkB,OAAc,aAA2B;AACjE,MAAI,MAAM,OAAO,mB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,WAAW,2BAA2B,MAAM;AAQ9C,QAAI,EANF,WAAW,4BAA4B,MAAM,CAGpB,IAAIA,qDAAkB,IAC/C,wBAAwB,IAAIA,qDAAkB,EAG9C,QAAO;IAGT,MAAM,eAAe,MAAM,KACzB,WAAW,2CAA2C,MAAM,CAC7D;IAED,MAAM,kBAAkB,gBAAgB,cAAc,SAClDC,6DACAC;AAEJ,WAAO,IAAI,SAAS,QAAQ,QAAQ,aAClC,gBACE,aACA,YACA,iBACA,cACA,OACA,MACD,CACF;KAEJ;IAEJ"}
@@ -1,6 +1,11 @@
1
- import type { Compilation, Chunk, ChunkGraph } from 'webpack';
2
- import type { EntryModuleWithChunkGroup } from 'webpack/lib/ChunkGraph';
3
- import type RuntimeTemplate from 'webpack/lib/RuntimeTemplate';
4
- export declare const federationStartup = "federation-entry-startup";
5
- export declare const generateEntryStartup: (compilation: Compilation, chunkGraph: ChunkGraph, runtimeTemplate: RuntimeTemplate, entries: EntryModuleWithChunkGroup[], chunk: Chunk, passive: boolean) => string;
6
- export declare const generateESMEntryStartup: (compilation: Compilation, chunkGraph: ChunkGraph, runtimeTemplate: RuntimeTemplate, entries: EntryModuleWithChunkGroup[], chunk: Chunk, passive: boolean) => string;
1
+ import { Chunk, ChunkGraph, Compilation } from "webpack";
2
+ import { EntryModuleWithChunkGroup } from "webpack/lib/ChunkGraph";
3
+ import RuntimeTemplate from "webpack/lib/RuntimeTemplate";
4
+
5
+ //#region src/lib/startup/StartupHelpers.d.ts
6
+ declare const federationStartup = "federation-entry-startup";
7
+ declare const generateEntryStartup: (compilation: Compilation, chunkGraph: ChunkGraph, runtimeTemplate: RuntimeTemplate, entries: EntryModuleWithChunkGroup[], chunk: Chunk, passive: boolean) => string;
8
+ declare const generateESMEntryStartup: (compilation: Compilation, chunkGraph: ChunkGraph, runtimeTemplate: RuntimeTemplate, entries: EntryModuleWithChunkGroup[], chunk: Chunk, passive: boolean) => string;
9
+ //#endregion
10
+ export { federationStartup, generateESMEntryStartup, generateEntryStartup };
11
+ //# sourceMappingURL=StartupHelpers.d.ts.map
@@ -1,186 +1,136 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra, Zack Jackson @ScriptedAlchemy
4
- */
5
1
  'use strict';
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.generateESMEntryStartup = exports.generateEntryStartup = exports.federationStartup = void 0;
8
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
9
- const { RuntimeGlobals, Template } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
10
- const { isSubset } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/SetHelpers'));
11
- const { getAllChunks } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/javascript/ChunkHelpers'));
12
- const HotUpdateChunk = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/HotUpdateChunk'));
13
- const { getUndoPath } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/identifier'));
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
6
+
7
+ //#region src/lib/startup/StartupHelpers.ts
8
+ const { RuntimeGlobals, Template } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
9
+ const { isSubset } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/SetHelpers"));
10
+ const { getAllChunks } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/javascript/ChunkHelpers"));
11
+ const HotUpdateChunk = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/HotUpdateChunk"));
12
+ const { getUndoPath } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/identifier"));
14
13
  const EXPORT_PREFIX = `var ${RuntimeGlobals.exports} = `;
15
- exports.federationStartup = 'federation-entry-startup';
16
- // Abstracted from esm chunk format plugin in webpack, i only need the startup portion
17
- // https://github.com/webpack/webpack/blob/c802a98f58e26dbfd727ee757ebad7c38b3c77aa/lib/esm/ModuleChunkFormatPlugin.js#L138
14
+ const federationStartup = "federation-entry-startup";
18
15
  const generateEntryStartup = (compilation, chunkGraph, runtimeTemplate, entries, chunk, passive) => {
19
- /** @type {string[]} */
20
- const runtime = [
21
- `var __webpack_exec__ = ${runtimeTemplate.returningFunction(`${RuntimeGlobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)`, 'moduleId')}`,
22
- '',
23
- '\n',
24
- 'var promises = [];',
25
- 'if (typeof __webpack_require__.x === "function") {',
26
- ' __webpack_require__.x();',
27
- '} else {',
28
- ' console.warn("[Module Federation] __webpack_require__.x is not a function, skipping startup extension");',
29
- '}',
30
- ];
31
- const treeRuntimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
32
- const chunkRuntimeRequirements = chunkGraph.getChunkRuntimeRequirements(chunk);
33
- const federation = chunkRuntimeRequirements.has(exports.federationStartup) ||
34
- treeRuntimeRequirements.has(exports.federationStartup);
35
- const runModule = (id) => {
36
- return `__webpack_exec__(${JSON.stringify(id)})`;
37
- };
38
- const outputCombination = (chunks, moduleIds, final) => {
39
- if (chunks.size === 0 && !federation) {
40
- runtime.push(`${final ? EXPORT_PREFIX : ''}(${moduleIds.map(runModule).join(', ')});`);
41
- }
42
- else {
43
- const fn = runtimeTemplate.returningFunction(moduleIds.map(runModule).join(', '));
44
- if (federation) {
45
- const chunkIds = Array.from(chunks, (c) => c.id);
46
- const wrappedInit = (body) => Template.asString([
47
- 'Promise.all([',
48
- Template.indent([
49
- // may have other chunks who depend on federation, so best to just fallback
50
- // instead of try to figure out if consumes or remotes exists during build
51
- `${RuntimeGlobals.ensureChunkHandlers}.consumes || function(chunkId, promises) {},`,
52
- `${RuntimeGlobals.ensureChunkHandlers}.remotes || function(chunkId, promises) {},`,
53
- ]),
54
- `].reduce(${runtimeTemplate.returningFunction(`handler('${chunk.id}', p), p`, 'p, handler')}, promises)`,
55
- `).then(${runtimeTemplate.returningFunction(body)});`,
56
- ]);
57
- const wrap = wrappedInit(`${passive
58
- ? RuntimeGlobals.onChunksLoaded
59
- : RuntimeGlobals.startupEntrypoint}(0, ${JSON.stringify(chunkIds)}, ${fn})`);
60
- runtime.push(`${final && !passive ? EXPORT_PREFIX : ''}${wrap}`);
61
- }
62
- else {
63
- const chunkIds = Array.from(chunks, (c) => c.id);
64
- runtime.push(`${final && !passive ? EXPORT_PREFIX : ''}${passive
65
- ? RuntimeGlobals.onChunksLoaded
66
- : RuntimeGlobals.startupEntrypoint}(0, ${JSON.stringify(chunkIds)}, ${fn});`);
67
- if (final && passive) {
68
- runtime.push(`${EXPORT_PREFIX}${RuntimeGlobals.onChunksLoaded}();`);
69
- }
70
- }
71
- }
72
- };
73
- let currentChunks = undefined;
74
- let currentModuleIds = undefined;
75
- for (const [module, entrypoint] of entries) {
76
- if (!entrypoint)
77
- continue;
78
- const runtimeChunk = entrypoint.getRuntimeChunk();
79
- const moduleId = chunkGraph.getModuleId(module);
80
- const chunks = getAllChunks(entrypoint, chunk, runtimeChunk);
81
- if (currentChunks &&
82
- currentChunks.size === chunks.size &&
83
- isSubset(currentChunks, chunks)) {
84
- currentModuleIds.push(moduleId);
85
- }
86
- else {
87
- if (currentChunks) {
88
- outputCombination(currentChunks, currentModuleIds);
89
- }
90
- currentChunks = chunks;
91
- currentModuleIds = [moduleId];
92
- }
93
- }
94
- // output current modules with export prefix
95
- if (currentChunks) {
96
- outputCombination(currentChunks, currentModuleIds, true);
97
- }
98
- runtime.push('');
99
- return Template.asString(runtime);
16
+ /** @type {string[]} */
17
+ const runtime = [
18
+ `var __webpack_exec__ = ${runtimeTemplate.returningFunction(`${RuntimeGlobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)`, "moduleId")}`,
19
+ "",
20
+ "\n",
21
+ "var promises = [];",
22
+ "if (typeof __webpack_require__.x === \"function\") {",
23
+ " __webpack_require__.x();",
24
+ "} else {",
25
+ " console.warn(\"[Module Federation] __webpack_require__.x is not a function, skipping startup extension\");",
26
+ "}"
27
+ ];
28
+ const treeRuntimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
29
+ const federation = chunkGraph.getChunkRuntimeRequirements(chunk).has(federationStartup) || treeRuntimeRequirements.has(federationStartup);
30
+ const runModule = (id) => {
31
+ return `__webpack_exec__(${JSON.stringify(id)})`;
32
+ };
33
+ const outputCombination = (chunks, moduleIds, final) => {
34
+ if (chunks.size === 0 && !federation) runtime.push(`${final ? EXPORT_PREFIX : ""}(${moduleIds.map(runModule).join(", ")});`);
35
+ else {
36
+ const fn = runtimeTemplate.returningFunction(moduleIds.map(runModule).join(", "));
37
+ if (federation) {
38
+ const chunkIds = Array.from(chunks, (c) => c.id);
39
+ const wrappedInit = (body) => Template.asString([
40
+ "Promise.all([",
41
+ Template.indent([`${RuntimeGlobals.ensureChunkHandlers}.consumes || function(chunkId, promises) {},`, `${RuntimeGlobals.ensureChunkHandlers}.remotes || function(chunkId, promises) {},`]),
42
+ `].reduce(${runtimeTemplate.returningFunction(`handler('${chunk.id}', p), p`, "p, handler")}, promises)`,
43
+ `).then(${runtimeTemplate.returningFunction(body)});`
44
+ ]);
45
+ const wrap = wrappedInit(`${passive ? RuntimeGlobals.onChunksLoaded : RuntimeGlobals.startupEntrypoint}(0, ${JSON.stringify(chunkIds)}, ${fn})`);
46
+ runtime.push(`${final && !passive ? EXPORT_PREFIX : ""}${wrap}`);
47
+ } else {
48
+ const chunkIds = Array.from(chunks, (c) => c.id);
49
+ runtime.push(`${final && !passive ? EXPORT_PREFIX : ""}${passive ? RuntimeGlobals.onChunksLoaded : RuntimeGlobals.startupEntrypoint}(0, ${JSON.stringify(chunkIds)}, ${fn});`);
50
+ if (final && passive) runtime.push(`${EXPORT_PREFIX}${RuntimeGlobals.onChunksLoaded}();`);
51
+ }
52
+ }
53
+ };
54
+ let currentChunks = void 0;
55
+ let currentModuleIds = void 0;
56
+ for (const [module, entrypoint] of entries) {
57
+ if (!entrypoint) continue;
58
+ const runtimeChunk = entrypoint.getRuntimeChunk();
59
+ const moduleId = chunkGraph.getModuleId(module);
60
+ const chunks = getAllChunks(entrypoint, chunk, runtimeChunk);
61
+ if (currentChunks && currentChunks.size === chunks.size && isSubset(currentChunks, chunks)) currentModuleIds.push(moduleId);
62
+ else {
63
+ if (currentChunks) outputCombination(currentChunks, currentModuleIds);
64
+ currentChunks = chunks;
65
+ currentModuleIds = [moduleId];
66
+ }
67
+ }
68
+ if (currentChunks) outputCombination(currentChunks, currentModuleIds, true);
69
+ runtime.push("");
70
+ return Template.asString(runtime);
100
71
  };
101
- exports.generateEntryStartup = generateEntryStartup;
102
72
  const generateESMEntryStartup = (compilation, chunkGraph, runtimeTemplate, entries, chunk, passive) => {
103
- const { chunkHasJs, getChunkFilenameTemplate } = compilation.compiler.webpack?.javascript?.JavascriptModulesPlugin ||
104
- compilation.compiler.webpack.JavascriptModulesPlugin;
105
- const { ConcatSource } = compilation.compiler.webpack.sources;
106
- const hotUpdateChunk = chunk instanceof HotUpdateChunk ? chunk : null;
107
- if (hotUpdateChunk) {
108
- throw new Error('HMR is not implemented for module chunk format yet');
109
- }
110
- else {
111
- const treeRuntimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
112
- const chunkRuntimeRequirements = chunkGraph.getChunkRuntimeRequirements(chunk);
113
- const federation = chunkRuntimeRequirements.has(exports.federationStartup) ||
114
- treeRuntimeRequirements.has(exports.federationStartup);
115
- if (entries.length > 0) {
116
- const runtimeChunk = entries[0]?.[1]?.getRuntimeChunk?.();
117
- if (!runtimeChunk) {
118
- throw new Error('Runtime chunk is undefined');
119
- }
120
- const currentOutputName = compilation
121
- .getPath(getChunkFilenameTemplate(chunk, compilation.outputOptions), {
122
- chunk,
123
- contentHashType: 'javascript',
124
- })
125
- .replace(/^\/+/g, '')
126
- .split('/');
127
- /**
128
- * @param {Chunk} chunk the chunk
129
- * @returns {string} the relative path
130
- */
131
- const getRelativePath = (chunk) => {
132
- const baseOutputName = currentOutputName.slice();
133
- const chunkOutputName = compilation
134
- .getPath(getChunkFilenameTemplate(chunk, compilation.outputOptions), {
135
- chunk,
136
- contentHashType: 'javascript',
137
- })
138
- .replace(/^\/+/g, '')
139
- .split('/');
140
- // remove common parts except filename
141
- while (baseOutputName.length > 1 &&
142
- chunkOutputName.length > 1 &&
143
- baseOutputName[0] === chunkOutputName[0]) {
144
- baseOutputName.shift();
145
- chunkOutputName.shift();
146
- }
147
- const last = chunkOutputName.join('/');
148
- // create final path
149
- return getUndoPath(baseOutputName.join('/'), last, true) + last;
150
- };
151
- const startupSource = new ConcatSource();
152
- startupSource.add(`var __webpack_exec__ = ${runtimeTemplate.returningFunction(`${RuntimeGlobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)`, 'moduleId')}\n`);
153
- const loadedChunks = new Set();
154
- let index = 0;
155
- for (let i = 0; i < entries.length; i++) {
156
- const [module, entrypoint] = entries[i];
157
- if (!entrypoint)
158
- continue;
159
- const final = i + 1 === entries.length;
160
- const moduleId = chunkGraph.getModuleId(module);
161
- const chunks = getAllChunks(entrypoint, runtimeChunk, undefined);
162
- for (const chunk of chunks) {
163
- if (loadedChunks.has(chunk) || !chunkHasJs(chunk, chunkGraph))
164
- continue;
165
- loadedChunks.add(chunk);
166
- startupSource.add(`import * as __webpack_chunk_${index}__ from ${JSON.stringify(getRelativePath(chunk))};\n`);
167
- startupSource.add(`${RuntimeGlobals.externalInstallChunk}(__webpack_chunk_${index}__);\n`);
168
- index++;
169
- }
170
- // generateEntryStartup handles calling require and execution of the entry module.
171
- if (!federation) {
172
- startupSource.add(`${final ? EXPORT_PREFIX : ''}__webpack_exec__(${JSON.stringify(moduleId)});\n`);
173
- }
174
- }
175
- if (federation) {
176
- startupSource.add('\n');
177
- // call original entry startup, which will template out the startup code now that the chunk installs are done
178
- startupSource.add((0, exports.generateEntryStartup)(compilation, chunkGraph, runtimeTemplate, entries, chunk, passive));
179
- }
180
- return startupSource.source();
181
- }
182
- }
183
- return '';
73
+ const { chunkHasJs, getChunkFilenameTemplate } = compilation.compiler.webpack?.javascript?.JavascriptModulesPlugin || compilation.compiler.webpack.JavascriptModulesPlugin;
74
+ const { ConcatSource } = compilation.compiler.webpack.sources;
75
+ if (chunk instanceof HotUpdateChunk ? chunk : null) throw new Error("HMR is not implemented for module chunk format yet");
76
+ else {
77
+ const treeRuntimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
78
+ const federation = chunkGraph.getChunkRuntimeRequirements(chunk).has(federationStartup) || treeRuntimeRequirements.has(federationStartup);
79
+ if (entries.length > 0) {
80
+ const runtimeChunk = entries[0]?.[1]?.getRuntimeChunk?.();
81
+ if (!runtimeChunk) throw new Error("Runtime chunk is undefined");
82
+ const currentOutputName = compilation.getPath(getChunkFilenameTemplate(chunk, compilation.outputOptions), {
83
+ chunk,
84
+ contentHashType: "javascript"
85
+ }).replace(/^\/+/g, "").split("/");
86
+ /**
87
+ * @param {Chunk} chunk the chunk
88
+ * @returns {string} the relative path
89
+ */
90
+ const getRelativePath = (chunk) => {
91
+ const baseOutputName = currentOutputName.slice();
92
+ const chunkOutputName = compilation.getPath(getChunkFilenameTemplate(chunk, compilation.outputOptions), {
93
+ chunk,
94
+ contentHashType: "javascript"
95
+ }).replace(/^\/+/g, "").split("/");
96
+ while (baseOutputName.length > 1 && chunkOutputName.length > 1 && baseOutputName[0] === chunkOutputName[0]) {
97
+ baseOutputName.shift();
98
+ chunkOutputName.shift();
99
+ }
100
+ const last = chunkOutputName.join("/");
101
+ return getUndoPath(baseOutputName.join("/"), last, true) + last;
102
+ };
103
+ const startupSource = new ConcatSource();
104
+ startupSource.add(`var __webpack_exec__ = ${runtimeTemplate.returningFunction(`${RuntimeGlobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)`, "moduleId")}\n`);
105
+ const loadedChunks = /* @__PURE__ */ new Set();
106
+ let index = 0;
107
+ for (let i = 0; i < entries.length; i++) {
108
+ const [module, entrypoint] = entries[i];
109
+ if (!entrypoint) continue;
110
+ const final = i + 1 === entries.length;
111
+ const moduleId = chunkGraph.getModuleId(module);
112
+ const chunks = getAllChunks(entrypoint, runtimeChunk, void 0);
113
+ for (const chunk of chunks) {
114
+ if (loadedChunks.has(chunk) || !chunkHasJs(chunk, chunkGraph)) continue;
115
+ loadedChunks.add(chunk);
116
+ startupSource.add(`import * as __webpack_chunk_${index}__ from ${JSON.stringify(getRelativePath(chunk))};\n`);
117
+ startupSource.add(`${RuntimeGlobals.externalInstallChunk}(__webpack_chunk_${index}__);\n`);
118
+ index++;
119
+ }
120
+ if (!federation) startupSource.add(`${final ? EXPORT_PREFIX : ""}__webpack_exec__(${JSON.stringify(moduleId)});\n`);
121
+ }
122
+ if (federation) {
123
+ startupSource.add("\n");
124
+ startupSource.add(generateEntryStartup(compilation, chunkGraph, runtimeTemplate, entries, chunk, passive));
125
+ }
126
+ return startupSource.source();
127
+ }
128
+ }
129
+ return "";
184
130
  };
131
+
132
+ //#endregion
133
+ exports.federationStartup = federationStartup;
185
134
  exports.generateESMEntryStartup = generateESMEntryStartup;
135
+ exports.generateEntryStartup = generateEntryStartup;
186
136
  //# sourceMappingURL=StartupHelpers.js.map