@module-federation/enhanced 2.0.1 → 2.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 (285) hide show
  1. package/dist/CHANGELOG.md +2357 -0
  2. package/dist/README.md +213 -0
  3. package/dist/rstestmigrate.md +140 -0
  4. package/dist/src/_virtual/_rolldown/runtime.js +47 -0
  5. package/dist/src/index.d.ts +22 -19
  6. package/dist/src/index.js +47 -43
  7. package/dist/src/index.js.map +1 -1
  8. package/dist/src/lib/Constants.d.ts +25 -29
  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 +28 -23
  15. package/dist/src/lib/container/ContainerEntryDependency.js +39 -39
  16. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
  17. package/dist/src/lib/container/ContainerEntryModule.d.ts +93 -84
  18. package/dist/src/lib/container/ContainerEntryModule.js +219 -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 +29 -24
  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 +147 -211
  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 +74 -102
  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 +125 -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 +143 -180
  49. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
  50. package/dist/src/lib/container/RemoteModule.d.ts +79 -74
  51. package/dist/src/lib/container/RemoteModule.js +143 -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 +7 -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 +71 -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 +55 -47
  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 +266 -345
  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/utils.d.ts +24 -13
  87. package/dist/src/lib/container/runtime/utils.js +83 -101
  88. package/dist/src/lib/container/runtime/utils.js.map +1 -1
  89. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +15 -10
  90. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +27 -25
  91. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -1
  92. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +77 -68
  93. package/dist/src/lib/sharing/ConsumeSharedModule.js +186 -214
  94. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
  95. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +13 -9
  96. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +308 -475
  97. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
  98. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +16 -11
  99. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +107 -125
  100. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
  101. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +14 -9
  102. package/dist/src/lib/sharing/ProvideForSharedDependency.js +25 -25
  103. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -1
  104. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +44 -39
  105. package/dist/src/lib/sharing/ProvideSharedDependency.js +72 -76
  106. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
  107. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +91 -82
  108. package/dist/src/lib/sharing/ProvideSharedModule.js +177 -184
  109. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
  110. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +14 -9
  111. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +19 -25
  112. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
  113. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +27 -21
  114. package/dist/src/lib/sharing/ProvideSharedPlugin.js +341 -550
  115. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
  116. package/dist/src/lib/sharing/SharePlugin.d.ts +53 -49
  117. package/dist/src/lib/sharing/SharePlugin.js +86 -100
  118. package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
  119. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
  120. package/dist/src/lib/sharing/ShareRuntimeModule.js +81 -100
  121. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
  122. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +11 -7
  123. package/dist/src/lib/sharing/resolveMatchedConfigs.js +58 -71
  124. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -1
  125. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.d.ts +18 -14
  126. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js +74 -128
  127. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js.map +1 -1
  128. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.d.ts +39 -34
  129. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js +234 -322
  130. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js.map +1 -1
  131. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.d.ts +16 -11
  132. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js +30 -28
  133. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js.map +1 -1
  134. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.d.ts +28 -24
  135. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js +91 -95
  136. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js.map +1 -1
  137. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.d.ts +29 -24
  138. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js +47 -43
  139. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js.map +1 -1
  140. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.d.ts +20 -15
  141. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js +33 -29
  142. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js.map +1 -1
  143. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.d.ts +85 -77
  144. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js +141 -153
  145. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js.map +1 -1
  146. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.d.ts +15 -10
  147. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js +20 -24
  148. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js.map +1 -1
  149. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.d.ts +21 -16
  150. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js +157 -231
  151. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js.map +1 -1
  152. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.d.ts +14 -9
  153. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js +26 -27
  154. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js.map +1 -1
  155. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.d.ts +18 -13
  156. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js +41 -49
  157. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js.map +1 -1
  158. package/dist/src/lib/sharing/utils.d.ts +27 -24
  159. package/dist/src/lib/sharing/utils.js +224 -367
  160. package/dist/src/lib/sharing/utils.js.map +1 -1
  161. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.d.ts +11 -7
  162. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js +56 -75
  163. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js.map +1 -1
  164. package/dist/src/lib/startup/StartupHelpers.d.ts +11 -6
  165. package/dist/src/lib/startup/StartupHelpers.js +128 -178
  166. package/dist/src/lib/startup/StartupHelpers.js.map +1 -1
  167. package/dist/src/prefetch.d.ts +3 -2
  168. package/dist/src/prefetch.js +17 -8
  169. package/dist/src/rspack.d.ts +3 -2
  170. package/dist/src/rspack.js +35 -11
  171. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +8 -4
  172. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -16
  173. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -1
  174. package/dist/src/runtime.d.ts +1 -1
  175. package/dist/src/runtime.js +11 -18
  176. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +13 -5
  177. package/dist/src/schemas/container/ContainerPlugin.check.js +958 -1218
  178. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -1
  179. package/dist/src/schemas/container/ContainerPlugin.d.ts +271 -268
  180. package/dist/src/schemas/container/ContainerPlugin.js +273 -361
  181. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -1
  182. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +13 -5
  183. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +335 -443
  184. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -1
  185. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +102 -99
  186. package/dist/src/schemas/container/ContainerReferencePlugin.js +122 -162
  187. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -1
  188. package/dist/src/schemas/container/ExternalsType.check.d.ts +13 -5
  189. package/dist/src/schemas/container/ExternalsType.check.js +36 -62
  190. package/dist/src/schemas/container/ExternalsType.check.js.map +1 -1
  191. package/dist/src/schemas/container/ExternalsType.d.ts +5 -2
  192. package/dist/src/schemas/container/ExternalsType.js +8 -11
  193. package/dist/src/schemas/container/ExternalsType.js.map +1 -1
  194. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3001 -4812
  195. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
  196. package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +819 -814
  197. package/dist/src/schemas/container/ModuleFederationPlugin.js +780 -1053
  198. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
  199. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.d.ts +13 -5
  200. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js +568 -768
  201. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js.map +1 -1
  202. package/dist/src/schemas/sharing/ConsumeSharedPlugin.d.ts +197 -194
  203. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js +212 -238
  204. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js.map +1 -1
  205. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.d.ts +13 -5
  206. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js +598 -804
  207. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js.map +1 -1
  208. package/dist/src/schemas/sharing/ProvideSharedPlugin.d.ts +184 -181
  209. package/dist/src/schemas/sharing/ProvideSharedPlugin.js +196 -229
  210. package/dist/src/schemas/sharing/ProvideSharedPlugin.js.map +1 -1
  211. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +12 -4
  212. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +285 -482
  213. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -1
  214. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +103 -100
  215. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +104 -126
  216. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -1
  217. package/dist/src/schemas/sharing/SharePlugin.check.d.ts +13 -5
  218. package/dist/src/schemas/sharing/SharePlugin.check.js +749 -965
  219. package/dist/src/schemas/sharing/SharePlugin.check.js.map +1 -1
  220. package/dist/src/schemas/sharing/SharePlugin.d.ts +245 -242
  221. package/dist/src/schemas/sharing/SharePlugin.js +256 -293
  222. package/dist/src/schemas/sharing/SharePlugin.js.map +1 -1
  223. package/dist/src/utils.d.ts +3 -0
  224. package/dist/src/utils.js +35 -26
  225. package/dist/src/utils.js.map +1 -1
  226. package/dist/src/webpack.d.ts +2 -2
  227. package/dist/src/webpack.js +6 -40
  228. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +9 -4
  229. package/dist/src/wrapper/AsyncBoundaryPlugin.js +12 -11
  230. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -1
  231. package/dist/src/wrapper/BaseWrapperPlugin.d.ts +18 -13
  232. package/dist/src/wrapper/BaseWrapperPlugin.js +39 -39
  233. package/dist/src/wrapper/BaseWrapperPlugin.js.map +1 -1
  234. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +10 -4
  235. package/dist/src/wrapper/ConsumeSharedPlugin.js +12 -11
  236. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -1
  237. package/dist/src/wrapper/ContainerPlugin.d.ts +9 -4
  238. package/dist/src/wrapper/ContainerPlugin.js +12 -11
  239. package/dist/src/wrapper/ContainerPlugin.js.map +1 -1
  240. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +9 -4
  241. package/dist/src/wrapper/ContainerReferencePlugin.js +12 -11
  242. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -1
  243. package/dist/src/wrapper/FederationModulesPlugin.d.ts +18 -10
  244. package/dist/src/wrapper/FederationModulesPlugin.js +19 -19
  245. package/dist/src/wrapper/FederationModulesPlugin.js.map +1 -1
  246. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +11 -6
  247. package/dist/src/wrapper/FederationRuntimePlugin.js +18 -17
  248. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -1
  249. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +8 -3
  250. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +12 -11
  251. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -1
  252. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +12 -7
  253. package/dist/src/wrapper/ModuleFederationPlugin.js +73 -99
  254. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -1
  255. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +10 -4
  256. package/dist/src/wrapper/ProvideSharedPlugin.js +12 -11
  257. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -1
  258. package/dist/src/wrapper/SharePlugin.d.ts +10 -4
  259. package/dist/src/wrapper/SharePlugin.js +12 -11
  260. package/dist/src/wrapper/SharePlugin.js.map +1 -1
  261. package/dist/src/wrapper/TreeShakingSharedPlugin.d.ts +9 -4
  262. package/dist/src/wrapper/TreeShakingSharedPlugin.js +12 -11
  263. package/dist/src/wrapper/TreeShakingSharedPlugin.js.map +1 -1
  264. package/package.json +21 -14
  265. package/dist/package.json +0 -110
  266. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +0 -57
  267. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +0 -33
  268. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +0 -4
  269. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +0 -28
  270. package/dist/src/declarations/plugins/container/Template.d.ts +0 -198
  271. package/dist/src/declarations/plugins/container/WebpackError.d.ts +0 -33
  272. package/dist/src/declarations/plugins/sharing/ConsumeSharedModule.d.ts +0 -86
  273. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +0 -100
  274. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +0 -102
  275. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +0 -116
  276. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.d.ts +0 -20
  277. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js +0 -219
  278. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js.map +0 -1
  279. package/dist/src/prefetch.js.map +0 -1
  280. package/dist/src/rspack.js.map +0 -1
  281. package/dist/src/runtime.js.map +0 -1
  282. package/dist/src/types/runtime.d.ts +0 -10
  283. package/dist/src/types/runtime.js +0 -3
  284. package/dist/src/types/runtime.js.map +0 -1
  285. package/dist/src/webpack.js.map +0 -1
@@ -1,202 +1,143 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /*
4
- MIT License http://www.opensource.org/licenses/mit-license.php
5
- Author Zackary Jackson @ScriptedAlchemy
6
- */
7
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
8
- const SortableSet = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/SortableSet'));
9
- class AsyncEntryStartupPlugin {
10
- constructor(options) {
11
- this._runtimeChunks = new Map();
12
- this._options = options || {};
13
- }
14
- apply(compiler) {
15
- compiler.hooks.thisCompilation.tap('AsyncEntryStartupPlugin', (compilation) => {
16
- this._collectRuntimeChunks(compilation);
17
- this._handleRenderStartup(compiler, compilation);
18
- });
19
- }
20
- _collectRuntimeChunks(compilation) {
21
- compilation.hooks.beforeChunkAssets.tap('AsyncEntryStartupPlugin', () => {
22
- for (const chunk of compilation.chunks) {
23
- if (chunk.hasRuntime() && chunk.id !== null) {
24
- this._runtimeChunks.set(chunk.id, chunk);
25
- for (const dependentChunk of compilation.chunkGraph.getChunkEntryDependentChunksIterable(chunk)) {
26
- if (dependentChunk.id !== null) {
27
- this._runtimeChunks.set(dependentChunk.id, dependentChunk);
28
- }
29
- }
30
- }
31
- }
32
- });
33
- }
34
- getChunkByName(compilation, dependOn, byname) {
35
- for (const name of dependOn) {
36
- const chunk = compilation.namedChunks.get(name);
37
- if (chunk) {
38
- byname.add(chunk);
39
- }
40
- }
41
- }
42
- _handleRenderStartup(compiler, compilation) {
43
- compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation).renderStartup.tap('AsyncEntryStartupPlugin', (source, _renderContext, upperContext) => {
44
- const isSingleRuntime = compiler.options?.optimization?.runtimeChunk;
45
- if (upperContext?.chunk.id && isSingleRuntime) {
46
- if (upperContext?.chunk.hasRuntime()) {
47
- this._runtimeChunks.set(upperContext.chunk.id, upperContext.chunk);
48
- return source;
49
- }
50
- }
51
- if (this._options.excludeChunk &&
52
- this._options.excludeChunk(upperContext.chunk)) {
53
- return source;
54
- }
55
- const runtime = this._getChunkRuntime(upperContext);
56
- let remotes = '';
57
- let shared = '';
58
- for (const runtimeItem of runtime) {
59
- if (!runtimeItem) {
60
- continue;
61
- }
62
- const requirements = compilation.chunkGraph.getTreeRuntimeRequirements(runtimeItem);
63
- const entryOptions = upperContext.chunk.getEntryOptions();
64
- const chunkInitialsSet = new Set(compilation.chunkGraph.getChunkEntryDependentChunksIterable(upperContext.chunk));
65
- chunkInitialsSet.add(upperContext.chunk);
66
- const dependOn = entryOptions?.dependOn || [];
67
- this.getChunkByName(compilation, dependOn, chunkInitialsSet);
68
- const initialChunks = [];
69
- let hasRemoteModules = false;
70
- let consumeShares = false;
71
- for (const chunk of chunkInitialsSet) {
72
- initialChunks.push(chunk.id);
73
- if (!hasRemoteModules) {
74
- hasRemoteModules = Boolean(compilation.chunkGraph.getChunkModulesIterableBySourceType(chunk, 'remote'));
75
- }
76
- if (!consumeShares) {
77
- consumeShares = Boolean(compilation.chunkGraph.getChunkModulesIterableBySourceType(chunk, 'consume-shared'));
78
- }
79
- if (hasRemoteModules && consumeShares) {
80
- break;
81
- }
82
- }
83
- remotes = this._getRemotes(compiler.webpack.RuntimeGlobals, requirements, hasRemoteModules, initialChunks, remotes);
84
- shared = this._getShared(compiler.webpack.RuntimeGlobals, requirements, consumeShares, initialChunks, shared);
85
- }
86
- if (!remotes && !shared) {
87
- return source;
88
- }
89
- const initialEntryModules = this._getInitialEntryModules(compilation, upperContext);
90
- const templateString = this._getTemplateString(compiler, initialEntryModules, shared, remotes, source);
91
- return new compiler.webpack.sources.ConcatSource(templateString);
92
- });
93
- }
94
- _getChunkRuntime(upperContext) {
95
- const runtime = new Set();
96
- const chunkRuntime = upperContext.chunk.runtime;
97
- if (chunkRuntime) {
98
- const runtimeItems = chunkRuntime instanceof SortableSet ? chunkRuntime : [chunkRuntime];
99
- for (const runtimeItem of runtimeItems) {
100
- const chunk = this._runtimeChunks.get(runtimeItem);
101
- if (chunk) {
102
- runtime.add(chunk);
103
- }
104
- }
105
- }
106
- if (runtime.size === 0) {
107
- runtime.add(upperContext.chunk);
108
- }
109
- return runtime;
110
- }
111
- _getRemotes(runtimeGlobals, requirements, hasRemoteModules, chunksToRef, remotes) {
112
- if (!requirements.has(runtimeGlobals.currentRemoteGetScope) &&
113
- !hasRemoteModules &&
114
- !requirements.has('__webpack_require__.vmok')) {
115
- return remotes;
116
- }
117
- const remotesParts = remotes.startsWith('if(__webpack_require__.f && __webpack_require__.f.remotes) {')
118
- ? [remotes]
119
- : [
120
- remotes,
121
- 'if(__webpack_require__.f && __webpack_require__.f.remotes) {',
122
- ];
123
- for (const chunkId of chunksToRef) {
124
- if (chunkId !== null && chunkId !== undefined) {
125
- remotesParts.push(` __webpack_require__.f.remotes(${JSON.stringify(chunkId)}, promiseTrack);`);
126
- }
127
- }
128
- remotesParts.push('}');
129
- return remotesParts.join('');
130
- }
131
- _getShared(runtimeGlobals, requirements, consumeShares, chunksToRef, shared) {
132
- if (!requirements.has(runtimeGlobals.shareScopeMap) &&
133
- !consumeShares &&
134
- !requirements.has(runtimeGlobals.initializeSharing)) {
135
- return shared;
136
- }
137
- const sharedParts = shared.startsWith('if(__webpack_require__.f && __webpack_require__.f.consumes) {')
138
- ? [shared]
139
- : [
140
- shared,
141
- 'if(__webpack_require__.f && __webpack_require__.f.consumes) {',
142
- ];
143
- for (const chunkId of chunksToRef) {
144
- if (chunkId !== null && chunkId !== undefined) {
145
- sharedParts.push(` __webpack_require__.f.consumes(${JSON.stringify(chunkId)}, promiseTrack);`);
146
- }
147
- }
148
- sharedParts.push('}');
149
- return sharedParts.join('');
150
- }
151
- _getInitialEntryModules(compilation, upperContext) {
152
- const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(upperContext.chunk);
153
- const initialEntryModules = [];
154
- for (const entryModule of entryModules) {
155
- const entryModuleID = compilation.chunkGraph.getModuleId(entryModule);
156
- if (entryModuleID) {
157
- let shouldInclude = false;
158
- if (typeof this._options.eager === 'function') {
159
- shouldInclude = this._options.eager(entryModule);
160
- }
161
- else if (this._options.eager &&
162
- this._options.eager.test(entryModule.identifier())) {
163
- shouldInclude = true;
164
- }
165
- if (shouldInclude) {
166
- initialEntryModules.push(`if(__webpack_require__.m[${JSON.stringify(entryModuleID)}]) {
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
3
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
4
+
5
+ //#region src/lib/container/AsyncBoundaryPlugin.ts
6
+ const SortableSet = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/SortableSet"));
7
+ var AsyncEntryStartupPlugin = class {
8
+ constructor(options) {
9
+ this._runtimeChunks = /* @__PURE__ */ new Map();
10
+ this._options = options || {};
11
+ }
12
+ apply(compiler) {
13
+ compiler.hooks.thisCompilation.tap("AsyncEntryStartupPlugin", (compilation) => {
14
+ this._collectRuntimeChunks(compilation);
15
+ this._handleRenderStartup(compiler, compilation);
16
+ });
17
+ }
18
+ _collectRuntimeChunks(compilation) {
19
+ compilation.hooks.beforeChunkAssets.tap("AsyncEntryStartupPlugin", () => {
20
+ for (const chunk of compilation.chunks) if (chunk.hasRuntime() && chunk.id !== null) {
21
+ this._runtimeChunks.set(chunk.id, chunk);
22
+ for (const dependentChunk of compilation.chunkGraph.getChunkEntryDependentChunksIterable(chunk)) if (dependentChunk.id !== null) this._runtimeChunks.set(dependentChunk.id, dependentChunk);
23
+ }
24
+ });
25
+ }
26
+ getChunkByName(compilation, dependOn, byname) {
27
+ for (const name of dependOn) {
28
+ const chunk = compilation.namedChunks.get(name);
29
+ if (chunk) byname.add(chunk);
30
+ }
31
+ }
32
+ _handleRenderStartup(compiler, compilation) {
33
+ compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation).renderStartup.tap("AsyncEntryStartupPlugin", (source, _renderContext, upperContext) => {
34
+ const isSingleRuntime = compiler.options?.optimization?.runtimeChunk;
35
+ if (upperContext?.chunk.id && isSingleRuntime) {
36
+ if (upperContext?.chunk.hasRuntime()) {
37
+ this._runtimeChunks.set(upperContext.chunk.id, upperContext.chunk);
38
+ return source;
39
+ }
40
+ }
41
+ if (this._options.excludeChunk && this._options.excludeChunk(upperContext.chunk)) return source;
42
+ const runtime = this._getChunkRuntime(upperContext);
43
+ let remotes = "";
44
+ let shared = "";
45
+ for (const runtimeItem of runtime) {
46
+ if (!runtimeItem) continue;
47
+ const requirements = compilation.chunkGraph.getTreeRuntimeRequirements(runtimeItem);
48
+ const entryOptions = upperContext.chunk.getEntryOptions();
49
+ const chunkInitialsSet = new Set(compilation.chunkGraph.getChunkEntryDependentChunksIterable(upperContext.chunk));
50
+ chunkInitialsSet.add(upperContext.chunk);
51
+ const dependOn = entryOptions?.dependOn || [];
52
+ this.getChunkByName(compilation, dependOn, chunkInitialsSet);
53
+ const initialChunks = [];
54
+ let hasRemoteModules = false;
55
+ let consumeShares = false;
56
+ for (const chunk of chunkInitialsSet) {
57
+ initialChunks.push(chunk.id);
58
+ if (!hasRemoteModules) hasRemoteModules = Boolean(compilation.chunkGraph.getChunkModulesIterableBySourceType(chunk, "remote"));
59
+ if (!consumeShares) consumeShares = Boolean(compilation.chunkGraph.getChunkModulesIterableBySourceType(chunk, "consume-shared"));
60
+ if (hasRemoteModules && consumeShares) break;
61
+ }
62
+ remotes = this._getRemotes(compiler.webpack.RuntimeGlobals, requirements, hasRemoteModules, initialChunks, remotes);
63
+ shared = this._getShared(compiler.webpack.RuntimeGlobals, requirements, consumeShares, initialChunks, shared);
64
+ }
65
+ if (!remotes && !shared) return source;
66
+ const initialEntryModules = this._getInitialEntryModules(compilation, upperContext);
67
+ const templateString = this._getTemplateString(compiler, initialEntryModules, shared, remotes, source);
68
+ return new compiler.webpack.sources.ConcatSource(templateString);
69
+ });
70
+ }
71
+ _getChunkRuntime(upperContext) {
72
+ const runtime = /* @__PURE__ */ new Set();
73
+ const chunkRuntime = upperContext.chunk.runtime;
74
+ if (chunkRuntime) {
75
+ const runtimeItems = chunkRuntime instanceof SortableSet ? chunkRuntime : [chunkRuntime];
76
+ for (const runtimeItem of runtimeItems) {
77
+ const chunk = this._runtimeChunks.get(runtimeItem);
78
+ if (chunk) runtime.add(chunk);
79
+ }
80
+ }
81
+ if (runtime.size === 0) runtime.add(upperContext.chunk);
82
+ return runtime;
83
+ }
84
+ _getRemotes(runtimeGlobals, requirements, hasRemoteModules, chunksToRef, remotes) {
85
+ if (!requirements.has(runtimeGlobals.currentRemoteGetScope) && !hasRemoteModules && !requirements.has("__webpack_require__.vmok")) return remotes;
86
+ const remotesParts = remotes.startsWith("if(__webpack_require__.f && __webpack_require__.f.remotes) {") ? [remotes] : [remotes, "if(__webpack_require__.f && __webpack_require__.f.remotes) {"];
87
+ for (const chunkId of chunksToRef) if (chunkId !== null && chunkId !== void 0) remotesParts.push(` __webpack_require__.f.remotes(${JSON.stringify(chunkId)}, promiseTrack);`);
88
+ remotesParts.push("}");
89
+ return remotesParts.join("");
90
+ }
91
+ _getShared(runtimeGlobals, requirements, consumeShares, chunksToRef, shared) {
92
+ if (!requirements.has(runtimeGlobals.shareScopeMap) && !consumeShares && !requirements.has(runtimeGlobals.initializeSharing)) return shared;
93
+ const sharedParts = shared.startsWith("if(__webpack_require__.f && __webpack_require__.f.consumes) {") ? [shared] : [shared, "if(__webpack_require__.f && __webpack_require__.f.consumes) {"];
94
+ for (const chunkId of chunksToRef) if (chunkId !== null && chunkId !== void 0) sharedParts.push(` __webpack_require__.f.consumes(${JSON.stringify(chunkId)}, promiseTrack);`);
95
+ sharedParts.push("}");
96
+ return sharedParts.join("");
97
+ }
98
+ _getInitialEntryModules(compilation, upperContext) {
99
+ const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(upperContext.chunk);
100
+ const initialEntryModules = [];
101
+ for (const entryModule of entryModules) {
102
+ const entryModuleID = compilation.chunkGraph.getModuleId(entryModule);
103
+ if (entryModuleID) {
104
+ let shouldInclude = false;
105
+ if (typeof this._options.eager === "function") shouldInclude = this._options.eager(entryModule);
106
+ else if (this._options.eager && this._options.eager.test(entryModule.identifier())) shouldInclude = true;
107
+ if (shouldInclude) initialEntryModules.push(`if(__webpack_require__.m[${JSON.stringify(entryModuleID)}]) {
167
108
  __webpack_require__(${JSON.stringify(entryModuleID)});
168
109
  } else {
169
110
  console.warn('Federation Runtime Module not found. In the current runtime');
170
111
  }`);
171
- }
172
- }
173
- }
174
- return initialEntryModules;
175
- }
176
- _getTemplateString(compiler, initialEntryModules, shared, remotes, source) {
177
- const { Template } = compiler.webpack;
178
- if (compiler.options?.experiments?.topLevelAwait &&
179
- compiler.options?.experiments?.outputModule) {
180
- return Template.asString([
181
- 'var promiseTrack = [];',
182
- Template.asString(initialEntryModules),
183
- shared,
184
- remotes,
185
- 'await Promise.all(promiseTrack)',
186
- Template.indent(source.source().toString()),
187
- ]);
188
- }
189
- return Template.asString([
190
- 'var promiseTrack = [];',
191
- Template.asString(initialEntryModules),
192
- shared,
193
- remotes,
194
- 'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',
195
- Template.indent(source.source().toString()),
196
- Template.indent('return __webpack_exports__'),
197
- '});',
198
- ]);
199
- }
200
- }
112
+ }
113
+ }
114
+ return initialEntryModules;
115
+ }
116
+ _getTemplateString(compiler, initialEntryModules, shared, remotes, source) {
117
+ const { Template } = compiler.webpack;
118
+ const experiments = compiler.options?.experiments;
119
+ const experimentsRecord = experiments && typeof experiments === "object" ? experiments : null;
120
+ if (!!experimentsRecord && !!experimentsRecord["topLevelAwait"] && compiler.options?.experiments?.outputModule) return Template.asString([
121
+ "var promiseTrack = [];",
122
+ Template.asString(initialEntryModules),
123
+ shared,
124
+ remotes,
125
+ "await Promise.all(promiseTrack)",
126
+ Template.indent(source.source().toString())
127
+ ]);
128
+ return Template.asString([
129
+ "var promiseTrack = [];",
130
+ Template.asString(initialEntryModules),
131
+ shared,
132
+ remotes,
133
+ "var __webpack_exports__ = Promise.all(promiseTrack).then(function() {",
134
+ Template.indent(source.source().toString()),
135
+ Template.indent("return __webpack_exports__"),
136
+ "});"
137
+ ]);
138
+ }
139
+ };
140
+
141
+ //#endregion
201
142
  exports.default = AsyncEntryStartupPlugin;
202
143
  //# sourceMappingURL=AsyncBoundaryPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncBoundaryPlugin.js","sourceRoot":"","sources":["../../../../src/lib/container/AsyncBoundaryPlugin.ts"],"names":[],"mappings":";;AAAA;;;EAGE;AACF,0FAAqF;AAarF,MAAM,WAAW,GAAG,OAAO,CACzB,IAAA,6CAAoB,EAAC,8BAA8B,CAAC,CACJ,CAAC;AAiBnD,MAAM,uBAAuB;IAI3B,YAAY,OAAiB;QAFrB,mBAAc,GAAG,IAAI,GAAG,EAAsC,CAAC;QAGrE,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAChC,yBAAyB,EACzB,CAAC,WAAwB,EAAE,EAAE;YAC3B,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;YACxC,IAAI,CAAC,oBA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C,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;aAC5C,CAAC,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC;YACvB,wBAAwB;YACxB,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YACtC,MAAM;YACN,OAAO;YACP,uEAAuE;YACvE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC3C,QAAQ,CAAC,MAAM,CAAC,4BAA4B,CAAC;YAC7C,KAAK;SACN,CAAC,CAAC;IACL,CAAC;CACF;AAED,kBAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"AsyncBoundaryPlugin.js","names":[],"sources":["../../../../src/lib/container/AsyncBoundaryPlugin.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Zackary Jackson @ScriptedAlchemy\n*/\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport { moduleFederationPlugin } from '@module-federation/sdk';\nimport type {\n Compiler,\n Compilation,\n Chunk,\n sources,\n Module,\n RuntimeGlobals,\n javascript,\n} from 'webpack';\nimport type { SyncWaterfallHook } from 'tapable';\n\nconst SortableSet = require(\n normalizeWebpackPath('webpack/lib/util/SortableSet'),\n) as typeof import('webpack/lib/util/SortableSet');\n\ntype CompilationHooksJavascriptModulesPlugin = ReturnType<\n typeof javascript.JavascriptModulesPlugin.getCompilationHooks\n>;\ntype RenderStartup = CompilationHooksJavascriptModulesPlugin['renderStartup'];\n\ntype InferStartupRenderContext<T> =\n T extends SyncWaterfallHook<\n [infer Source, infer Module, infer StartupRenderContext]\n >\n ? StartupRenderContext\n : never;\n\ntype StartupRenderContext = InferStartupRenderContext<RenderStartup>;\n\nexport type Options = moduleFederationPlugin.AsyncBoundaryOptions;\nclass AsyncEntryStartupPlugin {\n private _options: Options;\n private _runtimeChunks = new Map<string | number, Chunk | undefined>();\n\n constructor(options?: Options) {\n this._options = options || {};\n }\n\n apply(compiler: Compiler) {\n compiler.hooks.thisCompilation.tap(\n 'AsyncEntryStartupPlugin',\n (compilation: Compilation) => {\n this._collectRuntimeChunks(compilation);\n this._handleRenderStartup(compiler, compilation);\n },\n );\n }\n\n private _collectRuntimeChunks(compilation: Compilation) {\n compilation.hooks.beforeChunkAssets.tap('AsyncEntryStartupPlugin', () => {\n for (const chunk of compilation.chunks) {\n if (chunk.hasRuntime() && chunk.id !== null) {\n this._runtimeChunks.set(chunk.id, chunk);\n for (const dependentChunk of compilation.chunkGraph.getChunkEntryDependentChunksIterable(\n chunk,\n )) {\n if (dependentChunk.id !== null) {\n this._runtimeChunks.set(dependentChunk.id, dependentChunk);\n }\n }\n }\n }\n });\n }\n\n getChunkByName(\n compilation: Compilation,\n dependOn: string[],\n byname: Set<Chunk>,\n ) {\n for (const name of dependOn) {\n const chunk = compilation.namedChunks.get(name);\n if (chunk) {\n byname.add(chunk);\n }\n }\n }\n\n private _handleRenderStartup(compiler: Compiler, compilation: Compilation) {\n compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(\n compilation,\n ).renderStartup.tap(\n 'AsyncEntryStartupPlugin',\n (\n source: sources.Source,\n _renderContext: Module,\n upperContext: StartupRenderContext,\n ) => {\n const isSingleRuntime = compiler.options?.optimization?.runtimeChunk;\n if (upperContext?.chunk.id && isSingleRuntime) {\n if (upperContext?.chunk.hasRuntime()) {\n this._runtimeChunks.set(upperContext.chunk.id, upperContext.chunk);\n return source;\n }\n }\n\n if (\n this._options.excludeChunk &&\n this._options.excludeChunk(upperContext.chunk)\n ) {\n return source;\n }\n\n const runtime = this._getChunkRuntime(upperContext);\n\n let remotes = '';\n let shared = '';\n\n for (const runtimeItem of runtime) {\n if (!runtimeItem) {\n continue;\n }\n\n const requirements =\n compilation.chunkGraph.getTreeRuntimeRequirements(runtimeItem);\n\n const entryOptions = upperContext.chunk.getEntryOptions();\n const chunkInitialsSet = new Set(\n compilation.chunkGraph.getChunkEntryDependentChunksIterable(\n upperContext.chunk,\n ),\n );\n\n chunkInitialsSet.add(upperContext.chunk);\n const dependOn = entryOptions?.dependOn || [];\n this.getChunkByName(compilation, dependOn, chunkInitialsSet);\n\n const initialChunks = [];\n\n let hasRemoteModules = false;\n let consumeShares = false;\n\n for (const chunk of chunkInitialsSet) {\n initialChunks.push(chunk.id);\n if (!hasRemoteModules) {\n hasRemoteModules = Boolean(\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n chunk,\n 'remote',\n ),\n );\n }\n if (!consumeShares) {\n consumeShares = Boolean(\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n chunk,\n 'consume-shared',\n ),\n );\n }\n if (hasRemoteModules && consumeShares) {\n break;\n }\n }\n\n remotes = this._getRemotes(\n compiler.webpack.RuntimeGlobals,\n requirements,\n hasRemoteModules,\n initialChunks,\n remotes,\n );\n\n shared = this._getShared(\n compiler.webpack.RuntimeGlobals,\n requirements,\n consumeShares,\n initialChunks,\n shared,\n );\n }\n\n if (!remotes && !shared) {\n return source;\n }\n\n const initialEntryModules = this._getInitialEntryModules(\n compilation,\n upperContext,\n );\n const templateString = this._getTemplateString(\n compiler,\n initialEntryModules,\n shared,\n remotes,\n source,\n );\n\n return new compiler.webpack.sources.ConcatSource(templateString);\n },\n );\n }\n\n private _getChunkRuntime(upperContext: StartupRenderContext) {\n const runtime = new Set<Chunk>();\n const chunkRuntime = upperContext.chunk.runtime;\n if (chunkRuntime) {\n const runtimeItems =\n chunkRuntime instanceof SortableSet ? chunkRuntime : [chunkRuntime];\n for (const runtimeItem of runtimeItems) {\n const chunk = this._runtimeChunks.get(runtimeItem);\n if (chunk) {\n runtime.add(chunk);\n }\n }\n }\n if (runtime.size === 0) {\n runtime.add(upperContext.chunk);\n }\n return runtime;\n }\n private _getRemotes(\n runtimeGlobals: typeof RuntimeGlobals,\n requirements: ReadonlySet<string>,\n hasRemoteModules: boolean,\n chunksToRef: (Chunk['id'] | null | undefined)[],\n remotes: string,\n ): string {\n if (\n !requirements.has(runtimeGlobals.currentRemoteGetScope) &&\n !hasRemoteModules &&\n !requirements.has('__webpack_require__.vmok')\n ) {\n return remotes;\n }\n\n const remotesParts = remotes.startsWith(\n 'if(__webpack_require__.f && __webpack_require__.f.remotes) {',\n )\n ? [remotes]\n : [\n remotes,\n 'if(__webpack_require__.f && __webpack_require__.f.remotes) {',\n ];\n\n for (const chunkId of chunksToRef) {\n if (chunkId !== null && chunkId !== undefined) {\n remotesParts.push(\n ` __webpack_require__.f.remotes(${JSON.stringify(\n chunkId,\n )}, promiseTrack);`,\n );\n }\n }\n\n remotesParts.push('}');\n return remotesParts.join('');\n }\n\n private _getShared(\n runtimeGlobals: typeof RuntimeGlobals,\n requirements: ReadonlySet<string>,\n consumeShares: boolean,\n chunksToRef: (Chunk['id'] | null | undefined)[],\n shared: string,\n ): string {\n if (\n !requirements.has(runtimeGlobals.shareScopeMap) &&\n !consumeShares &&\n !requirements.has(runtimeGlobals.initializeSharing)\n ) {\n return shared;\n }\n\n const sharedParts = shared.startsWith(\n 'if(__webpack_require__.f && __webpack_require__.f.consumes) {',\n )\n ? [shared]\n : [\n shared,\n 'if(__webpack_require__.f && __webpack_require__.f.consumes) {',\n ];\n\n for (const chunkId of chunksToRef) {\n if (chunkId !== null && chunkId !== undefined) {\n sharedParts.push(\n ` __webpack_require__.f.consumes(${JSON.stringify(\n chunkId,\n )}, promiseTrack);`,\n );\n }\n }\n\n sharedParts.push('}');\n return sharedParts.join('');\n }\n\n private _getInitialEntryModules(\n compilation: Compilation,\n upperContext: { chunk: Chunk },\n ): string[] {\n const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(\n upperContext.chunk,\n );\n const initialEntryModules = [];\n\n for (const entryModule of entryModules) {\n const entryModuleID = compilation.chunkGraph.getModuleId(entryModule);\n if (entryModuleID) {\n let shouldInclude = false;\n\n if (typeof this._options.eager === 'function') {\n shouldInclude = this._options.eager(entryModule);\n } else if (\n this._options.eager &&\n this._options.eager.test(entryModule.identifier())\n ) {\n shouldInclude = true;\n }\n\n if (shouldInclude) {\n initialEntryModules.push(\n `if(__webpack_require__.m[${JSON.stringify(entryModuleID)}]) {\n __webpack_require__(${JSON.stringify(entryModuleID)});\n } else {\n console.warn('Federation Runtime Module not found. In the current runtime');\n }`,\n );\n }\n }\n }\n return initialEntryModules;\n }\n\n private _getTemplateString(\n compiler: Compiler,\n initialEntryModules: string[],\n shared: string,\n remotes: string,\n source: sources.Source,\n ) {\n const { Template } = compiler.webpack;\n const experiments = compiler.options?.experiments;\n const experimentsRecord =\n experiments && typeof experiments === 'object'\n ? (experiments as Record<string, unknown>)\n : null;\n const hasTopLevelAwait =\n !!experimentsRecord && !!experimentsRecord['topLevelAwait'];\n if (hasTopLevelAwait && compiler.options?.experiments?.outputModule) {\n return Template.asString([\n 'var promiseTrack = [];',\n Template.asString(initialEntryModules),\n shared,\n remotes,\n 'await Promise.all(promiseTrack)',\n Template.indent(source.source().toString()),\n ]);\n }\n return Template.asString([\n 'var promiseTrack = [];',\n Template.asString(initialEntryModules),\n shared,\n remotes,\n 'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',\n Template.indent(source.source().toString()),\n Template.indent('return __webpack_exports__'),\n '});',\n ]);\n }\n}\n\nexport default AsyncEntryStartupPlugin;\n"],"mappings":";;;;;AAiBA,MAAM,cAAc,gFACG,+BAA+B,CACrD;AAiBD,IAAM,0BAAN,MAA8B;CAI5B,YAAY,SAAmB;wCAFN,IAAI,KAAyC;AAGpE,OAAK,WAAW,WAAW,EAAE;;CAG/B,MAAM,UAAoB;AACxB,WAAS,MAAM,gBAAgB,IAC7B,4BACC,gBAA6B;AAC5B,QAAK,sBAAsB,YAAY;AACvC,QAAK,qBAAqB,UAAU,YAAY;IAEnD;;CAGH,AAAQ,sBAAsB,aAA0B;AACtD,cAAY,MAAM,kBAAkB,IAAI,iCAAiC;AACvE,QAAK,MAAM,SAAS,YAAY,OAC9B,KAAI,M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,CAAC;GAC5C,CAAC;AAEJ,SAAO,SAAS,SAAS;GACvB;GACA,SAAS,SAAS,oBAAoB;GACtC;GACA;GACA;GACA,SAAS,OAAO,OAAO,QAAQ,CAAC,UAAU,CAAC;GAC3C,SAAS,OAAO,6BAA6B;GAC7C;GACD,CAAC"}
@@ -1,25 +1,30 @@
1
- import { ExposeOptions } from './ContainerEntryModule';
2
- import type { containerPlugin } from '@module-federation/sdk';
3
- declare const Dependency: typeof import("webpack").Dependency;
1
+ import { ExposeOptions } from "./ContainerEntryModule.js";
2
+ import { containerPlugin } from "@module-federation/sdk";
3
+ import * as webpack$1 from "webpack";
4
+
5
+ //#region src/lib/container/ContainerEntryDependency.d.ts
6
+ declare const Dependency: typeof webpack$1.Dependency;
4
7
  declare class ContainerEntryDependency extends Dependency {
5
- name: string;
6
- exposes: [string, ExposeOptions][];
7
- shareScope: string | string[];
8
- injectRuntimeEntry: string;
9
- dataPrefetch: containerPlugin.ContainerPluginOptions['dataPrefetch'];
10
- /**
11
- * @param {string} name entry name
12
- * @param {[string, ExposeOptions][]} exposes list of exposed modules
13
- * @param {string|string[]} shareScope name of the share scope
14
- * @param {string[]} injectRuntimeEntry the path of injectRuntime file.
15
- * @param {containerPlugin.ContainerPluginOptions['dataPrefetch']} dataPrefetch whether enable dataPrefetch
16
- */
17
- constructor(name: string, exposes: [string, ExposeOptions][], shareScope: string | string[], injectRuntimeEntry: string, dataPrefetch: containerPlugin.ContainerPluginOptions['dataPrefetch']);
18
- /**
19
- * @returns {string | null} an identifier to merge equal requests
20
- */
21
- getResourceIdentifier(): string | null;
22
- get type(): string;
23
- get category(): string;
8
+ name: string;
9
+ exposes: [string, ExposeOptions][];
10
+ shareScope: string | string[];
11
+ injectRuntimeEntry: string;
12
+ dataPrefetch: containerPlugin.ContainerPluginOptions['dataPrefetch'];
13
+ /**
14
+ * @param {string} name entry name
15
+ * @param {[string, ExposeOptions][]} exposes list of exposed modules
16
+ * @param {string|string[]} shareScope name of the share scope
17
+ * @param {string[]} injectRuntimeEntry the path of injectRuntime file.
18
+ * @param {containerPlugin.ContainerPluginOptions['dataPrefetch']} dataPrefetch whether enable dataPrefetch
19
+ */
20
+ constructor(name: string, exposes: [string, ExposeOptions][], shareScope: string | string[], injectRuntimeEntry: string, dataPrefetch: containerPlugin.ContainerPluginOptions['dataPrefetch']);
21
+ /**
22
+ * @returns {string | null} an identifier to merge equal requests
23
+ */
24
+ getResourceIdentifier(): string | null;
25
+ get type(): string;
26
+ get category(): string;
24
27
  }
25
- export default ContainerEntryDependency;
28
+ //#endregion
29
+ export { ContainerEntryDependency as default };
30
+ //# sourceMappingURL=ContainerEntryDependency.d.ts.map
@@ -1,41 +1,41 @@
1
- "use strict";
2
- /*
3
- MIT License http://www.opensource.org/licenses/mit-license.php
4
- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
8
- const makeSerializable = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/makeSerializable'));
9
- const { Dependency } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
10
- class ContainerEntryDependency extends Dependency {
11
- /**
12
- * @param {string} name entry name
13
- * @param {[string, ExposeOptions][]} exposes list of exposed modules
14
- * @param {string|string[]} shareScope name of the share scope
15
- * @param {string[]} injectRuntimeEntry the path of injectRuntime file.
16
- * @param {containerPlugin.ContainerPluginOptions['dataPrefetch']} dataPrefetch whether enable dataPrefetch
17
- */
18
- constructor(name, exposes, shareScope, injectRuntimeEntry, dataPrefetch) {
19
- super();
20
- this.name = name;
21
- this.exposes = exposes;
22
- this.shareScope = shareScope;
23
- this.injectRuntimeEntry = injectRuntimeEntry;
24
- this.dataPrefetch = dataPrefetch;
25
- }
26
- /**
27
- * @returns {string | null} an identifier to merge equal requests
28
- */
29
- getResourceIdentifier() {
30
- return `container-entry-${this.name}`;
31
- }
32
- get type() {
33
- return 'container entry';
34
- }
35
- get category() {
36
- return 'esm';
37
- }
38
- }
39
- makeSerializable(ContainerEntryDependency, 'enhanced/lib/container/ContainerEntryDependency');
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
3
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
4
+
5
+ //#region src/lib/container/ContainerEntryDependency.ts
6
+ const makeSerializable = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/makeSerializable"));
7
+ const { Dependency } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
8
+ var ContainerEntryDependency = class extends Dependency {
9
+ /**
10
+ * @param {string} name entry name
11
+ * @param {[string, ExposeOptions][]} exposes list of exposed modules
12
+ * @param {string|string[]} shareScope name of the share scope
13
+ * @param {string[]} injectRuntimeEntry the path of injectRuntime file.
14
+ * @param {containerPlugin.ContainerPluginOptions['dataPrefetch']} dataPrefetch whether enable dataPrefetch
15
+ */
16
+ constructor(name, exposes, shareScope, injectRuntimeEntry, dataPrefetch) {
17
+ super();
18
+ this.name = name;
19
+ this.exposes = exposes;
20
+ this.shareScope = shareScope;
21
+ this.injectRuntimeEntry = injectRuntimeEntry;
22
+ this.dataPrefetch = dataPrefetch;
23
+ }
24
+ /**
25
+ * @returns {string | null} an identifier to merge equal requests
26
+ */
27
+ getResourceIdentifier() {
28
+ return `container-entry-${this.name}`;
29
+ }
30
+ get type() {
31
+ return "container entry";
32
+ }
33
+ get category() {
34
+ return "esm";
35
+ }
36
+ };
37
+ makeSerializable(ContainerEntryDependency, "enhanced/lib/container/ContainerEntryDependency");
38
+
39
+ //#endregion
40
40
  exports.default = ContainerEntryDependency;
41
41
  //# sourceMappingURL=ContainerEntryDependency.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContainerEntryDependency.js","sourceRoot":"","sources":["../../../../src/lib/container/ContainerEntryDependency.ts"],"names":[],"mappings":";AAAA;;;EAGE;;AAGF,0FAAqF;AAIrF,MAAM,gBAAgB,GAAG,OAAO,CAC9B,IAAA,6CAAoB,EAAC,mCAAmC,CAAC,CAC1D,CAAC;AACF,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAC5B,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAE9B,MAAM,wBAAyB,SAAQ,UAAU;IAO/C;;;;;;OAMG;IACH,YACE,IAAY,EACZ,OAAkC,EAClC,UAA6B,EAC7B,kBAA0B,EAC1B,YAAoE;QAEpE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;OAEG;IACM,qBAAqB;QAC5B,OAAO,mBAAmB,IAAI,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;IAED,IAAa,IAAI;QACf,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,IAAa,QAAQ;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,gBAAgB,CACd,wBAAwB,EACxB,iDAAiD,CAClD,CAAC;AAEF,kBAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"ContainerEntryDependency.js","names":[],"sources":["../../../../src/lib/container/ContainerEntryDependency.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr\n*/\n\nimport { ExposeOptions } from './ContainerEntryModule';\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\n\nimport type { containerPlugin } from '@module-federation/sdk';\n\nconst makeSerializable = require(\n normalizeWebpackPath('webpack/lib/util/makeSerializable'),\n);\nconst { Dependency } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\n\nclass ContainerEntryDependency extends Dependency {\n public name: string;\n public exposes: [string, ExposeOptions][];\n public shareScope: string | string[];\n public injectRuntimeEntry: string;\n public dataPrefetch: containerPlugin.ContainerPluginOptions['dataPrefetch'];\n\n /**\n * @param {string} name entry name\n * @param {[string, ExposeOptions][]} exposes list of exposed modules\n * @param {string|string[]} shareScope name of the share scope\n * @param {string[]} injectRuntimeEntry the path of injectRuntime file.\n * @param {containerPlugin.ContainerPluginOptions['dataPrefetch']} dataPrefetch whether enable dataPrefetch\n */\n constructor(\n name: string,\n exposes: [string, ExposeOptions][],\n shareScope: string | string[],\n injectRuntimeEntry: string,\n dataPrefetch: containerPlugin.ContainerPluginOptions['dataPrefetch'],\n ) {\n super();\n this.name = name;\n this.exposes = exposes;\n this.shareScope = shareScope;\n this.injectRuntimeEntry = injectRuntimeEntry;\n this.dataPrefetch = dataPrefetch;\n }\n\n /**\n * @returns {string | null} an identifier to merge equal requests\n */\n override getResourceIdentifier(): string | null {\n return `container-entry-${this.name}`;\n }\n\n override get type(): string {\n return 'container entry';\n }\n\n override get category(): string {\n return 'esm';\n }\n}\n\nmakeSerializable(\n ContainerEntryDependency,\n 'enhanced/lib/container/ContainerEntryDependency',\n);\n\nexport default ContainerEntryDependency;\n"],"mappings":";;;;;AAUA,MAAM,mBAAmB,gFACF,oCAAoC,CAC1D;AACD,MAAM,EAAE,eAAe,gFACA,UAAU,CAChC;AAED,IAAM,2BAAN,cAAuC,WAAW;;;;;;;;CAchD,YACE,MACA,SACA,YACA,oBACA,cACA;AACA,SAAO;AACP,OAAK,OAAO;AACZ,OAAK,UAAU;AACf,OAAK,aAAa;AAClB,OAAK,qBAAqB;AAC1B,OAAK,eAAe;;;;;CAMtB,AAAS,wBAAuC;AAC9C,SAAO,mBAAmB,KAAK;;CAGjC,IAAa,OAAe;AAC1B,SAAO;;CAGT,IAAa,WAAmB;AAC9B,SAAO;;;AAIX,iBACE,0BACA,kDACD"}