@module-federation/enhanced 2.1.0 → 2.2.1

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 +2375 -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 -200
  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 -181
  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 -132
  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 -20
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +265 -358
  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 -137
  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 -103
  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 -328
  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 +23 -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 -222
  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
package/dist/package.json DELETED
@@ -1,110 +0,0 @@
1
- {
2
- "name": "@module-federation/enhanced",
3
- "version": "2.1.0",
4
- "main": "./dist/src/index.js",
5
- "types": "./dist/src/index.d.ts",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/module-federation/core.git",
9
- "directory": "packages/enhanced"
10
- },
11
- "files": [
12
- "bin",
13
- "dist/",
14
- "README.md"
15
- ],
16
- "bin": {
17
- "mf": "./bin/mf.js"
18
- },
19
- "license": "MIT",
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
- "peerDependencies": {
24
- "typescript": "^4.9.0 || ^5.0.0",
25
- "vue-tsc": ">=1.0.24",
26
- "webpack": "^5.0.0"
27
- },
28
- "peerDependenciesMeta": {
29
- "webpack": {
30
- "optional": true
31
- },
32
- "typescript": {
33
- "optional": true
34
- },
35
- "vue-tsc": {
36
- "optional": true
37
- }
38
- },
39
- "exports": {
40
- ".": {
41
- "types": "./dist/src/index.d.ts",
42
- "import": "./dist/src/index.js",
43
- "require": "./dist/src/index.js"
44
- },
45
- "./webpack": {
46
- "types": "./dist/src/webpack.d.ts",
47
- "import": "./dist/src/webpack.js",
48
- "require": "./dist/src/webpack.js"
49
- },
50
- "./rspack": {
51
- "types": "./dist/src/rspack.d.ts",
52
- "import": "./dist/src/rspack.js",
53
- "require": "./dist/src/rspack.js"
54
- },
55
- "./runtime": {
56
- "types": "./dist/src/runtime.d.ts",
57
- "import": "./dist/src/runtime.js",
58
- "require": "./dist/src/runtime.js"
59
- },
60
- "./prefetch": {
61
- "types": "./dist/src/prefetch.d.ts",
62
- "import": "./dist/src/prefetch.js",
63
- "require": "./dist/src/prefetch.js"
64
- }
65
- },
66
- "typesVersions": {
67
- "*": {
68
- ".": [
69
- "./dist/src/index.d.ts"
70
- ],
71
- "webpack": [
72
- "./dist/src/webpack.d.ts"
73
- ],
74
- "rspack": [
75
- "./dist/src/rspack.d.ts"
76
- ],
77
- "runtime": [
78
- "./dist/src/runtime.d.ts"
79
- ],
80
- "prefetch": [
81
- "./dist/src/prefetch.d.ts"
82
- ]
83
- }
84
- },
85
- "devDependencies": {
86
- "@module-federation/webpack-bundler-runtime": "workspace:*",
87
- "@types/btoa": "^1.2.5",
88
- "ajv": "^8.18.0",
89
- "enhanced-resolve": "^5.0.0",
90
- "terser": "^5.37.0",
91
- "memfs": "4.46.0"
92
- },
93
- "dependencies": {
94
- "@module-federation/bridge-react-webpack-plugin": "workspace:*",
95
- "@module-federation/data-prefetch": "workspace:*",
96
- "@module-federation/dts-plugin": "workspace:*",
97
- "@module-federation/error-codes": "workspace:*",
98
- "@module-federation/inject-external-runtime-core-plugin": "workspace:*",
99
- "@module-federation/managers": "workspace:*",
100
- "@module-federation/manifest": "workspace:*",
101
- "@module-federation/rspack": "workspace:*",
102
- "@module-federation/runtime-tools": "workspace:*",
103
- "@module-federation/sdk": "workspace:*",
104
- "@module-federation/cli": "workspace:*",
105
- "btoa": "^1.2.1",
106
- "upath": "2.0.1",
107
- "schema-utils": "^4.3.0"
108
- },
109
- "type": "commonjs"
110
- }
@@ -1,57 +0,0 @@
1
- export class AsyncDependenciesBlock extends DependenciesBlock {
2
- /**
3
- * @param {(ChunkGroupOptions & { entryOptions?: EntryOptions }) | null} groupOptions options for the group
4
- * @param {(DependencyLocation | null)=} loc the line of code
5
- * @param {(string | null)=} request the request
6
- */
7
- constructor(
8
- groupOptions:
9
- | (ChunkGroupOptions & {
10
- entryOptions?: EntryOptions;
11
- })
12
- | null,
13
- loc?: (DependencyLocation | null) | undefined,
14
- request?: (string | null) | undefined,
15
- );
16
- groupOptions: import('./ChunkGroup').RawChunkGroupOptions & {
17
- name?: string | undefined;
18
- } & {
19
- entryOptions?: import('./Entrypoint').EntryOptions | undefined;
20
- };
21
- loc: import('./Dependency').DependencyLocation | null | undefined;
22
- request: string | null | undefined;
23
- _stringifiedGroupOptions: string | undefined;
24
- /**
25
- * @param {string | undefined} value The new chunk name
26
- * @returns {void}
27
- */
28
- set chunkName(arg: string | undefined);
29
- /**
30
- * @returns {string | undefined} The name of the chunk
31
- */
32
- get chunkName(): string | undefined;
33
- set module(arg: any);
34
- get module(): any;
35
- }
36
- declare namespace AsyncDependenciesBlock {
37
- export {
38
- ChunkGraph,
39
- ChunkGroup,
40
- ChunkGroupOptions,
41
- DependencyLocation,
42
- UpdateHashContext,
43
- EntryOptions,
44
- Module,
45
- ObjectDeserializerContext,
46
- ObjectSerializerContext,
47
- Hash,
48
- };
49
- }
50
- import DependenciesBlock = require('./DependenciesBlock');
51
- type ChunkGroupOptions = import('./ChunkGroup').ChunkGroupOptions;
52
- type EntryOptions = import('./Entrypoint').EntryOptions;
53
- type DependencyLocation = import('./Dependency').DependencyLocation;
54
- type ChunkGraph = import('./ChunkGraph');
55
- type ChunkGroup = import('./ChunkGroup');
56
- type UpdateHashContext = import('./Dependency').UpdateHashContext;
57
- type Hash = import('./util/Hash');
@@ -1,33 +0,0 @@
1
- declare abstract class ModuleFactory {
2
- create(
3
- data: ModuleFactoryCreateData,
4
- callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void,
5
- ): void;
6
- }
7
-
8
- declare interface ModuleFactoryCreateData {
9
- contextInfo: ModuleFactoryCreateDataContextInfo;
10
- resolveOptions?: ResolveOptionsWebpackOptions;
11
- context: string;
12
- dependencies: Dependency[];
13
- }
14
-
15
- declare interface ModuleFactoryCreateDataContextInfo {
16
- issuer: string;
17
- issuerLayer?: null | string;
18
- compiler: string;
19
- }
20
- declare interface ModuleFactoryResult {
21
- /**
22
- * the created module or unset if no module was created
23
- */
24
- module?: Module;
25
- fileDependencies?: Set<string>;
26
- contextDependencies?: Set<string>;
27
- missingDependencies?: Set<string>;
28
-
29
- /**
30
- * allow to use the unsafe cache
31
- */
32
- cacheable?: boolean;
33
- }
@@ -1,4 +0,0 @@
1
- export type ObjectDeserializerContext = {
2
- read: () => any;
3
- setCircularReference: (arg0: any) => void;
4
- };
@@ -1,28 +0,0 @@
1
- export class StaticExportsDependency extends NullDependency {
2
- /**
3
- * @param {string[] | true} exports export names
4
- * @param {boolean} canMangle true, if mangling exports names is allowed
5
- */
6
- constructor(exports: string[] | true, canMangle: boolean);
7
- exports: true | string[];
8
- canMangle: boolean;
9
- }
10
- declare namespace StaticExportsDependency {
11
- export {
12
- ChunkGraph,
13
- ExportSpec,
14
- ExportsSpec,
15
- UpdateHashContext,
16
- ModuleGraph,
17
- ObjectDeserializerContext,
18
- ObjectSerializerContext,
19
- Hash,
20
- };
21
- }
22
- import NullDependency = require('./NullDependency');
23
- type ChunkGraph = import('../ChunkGraph');
24
- type ExportSpec = import('./Dependency').ExportSpec;
25
- type ExportsSpec = import('./Dependency').ExportsSpec;
26
- type UpdateHashContext = import('./Dependency').UpdateHashContext;
27
- type ModuleGraph = import('../ModuleGraph');
28
- type Hash = import('../util/Hash');
@@ -1,198 +0,0 @@
1
- export = Template;
2
-
3
- declare class Template {
4
- /**
5
- *
6
- * @param {Function} fn a runtime function (.runtime.js) "template"
7
- * @returns {string} the updated and normalized function string
8
- */
9
- // eslint-disable-next-line @typescript-eslint/ban-types
10
- static getFunctionContent(fn: Function): string;
11
- /**
12
- * @param {string} str the string converted to identifier
13
- * @returns {string} created identifier
14
- */
15
- static toIdentifier(str: string): string;
16
- /**
17
- *
18
- * @param {string} str string to be converted to commented in bundle code
19
- * @returns {string} returns a commented version of string
20
- */
21
- static toComment(str: string): string;
22
- /**
23
- *
24
- * @param {string} str string to be converted to "normal comment"
25
- * @returns {string} returns a commented version of string
26
- */
27
- static toNormalComment(str: string): string;
28
- /**
29
- * @param {string} str string path to be normalized
30
- * @returns {string} normalized bundle-safe path
31
- */
32
- static toPath(str: string): string;
33
- /**
34
- * @param {number} n number to convert to ident
35
- * @returns {string} returns single character ident
36
- */
37
- static numberToIdentifier(n: number): string;
38
- /**
39
- * @param {number} n number to convert to ident
40
- * @returns {string} returns single character ident
41
- */
42
- static numberToIdentifierContinuation(n: number): string;
43
- /**
44
- *
45
- * @param {string | string[]} s string to convert to identity
46
- * @returns {string} converted identity
47
- */
48
- static indent(s: string | string[]): string;
49
- /**
50
- *
51
- * @param {string|string[]} s string to create prefix for
52
- * @param {string} prefix prefix to compose
53
- * @returns {string} returns new prefix string
54
- */
55
- static prefix(s: string | string[], prefix: string): string;
56
- /**
57
- *
58
- * @param {string|string[]} str string or string collection
59
- * @returns {string} returns a single string from array
60
- */
61
- static asString(str: string | string[]): string;
62
- /**
63
- * @typedef {Object} WithId
64
- * @property {string|number} id
65
- */
66
- /**
67
- * @param {WithId[]} modules a collection of modules to get array bounds for
68
- * @returns {[number, number] | false} returns the upper and lower array bounds
69
- * or false if not every module has a number based id
70
- */
71
- static getModulesArrayBounds(
72
- modules: {
73
- id: string | number;
74
- }[],
75
- ): [number, number] | false;
76
- /**
77
- * @param {ChunkRenderContext} renderContext render context
78
- * @param {Module[]} modules modules to render (should be ordered by identifier)
79
- * @param {function(Module): Source} renderModule function to render a module
80
- * @param {string=} prefix applying prefix strings
81
- * @returns {Source | null} rendered chunk modules in a Source object or null if no modules
82
- */
83
- static renderChunkModules(
84
- renderContext: ChunkRenderContext,
85
- modules: Module[],
86
- renderModule: (arg0: Module) => Source,
87
- prefix?: string | undefined,
88
- ): Source | null;
89
- /**
90
- * @param {RuntimeModule[]} runtimeModules array of runtime modules in order
91
- * @param {RenderContext & { codeGenerationResults?: CodeGenerationResults }} renderContext render context
92
- * @returns {Source} rendered runtime modules in a Source object
93
- */
94
- static renderRuntimeModules(
95
- runtimeModules: RuntimeModule[],
96
- renderContext: RenderContext & {
97
- codeGenerationResults?: CodeGenerationResults;
98
- },
99
- ): Source;
100
- /**
101
- * @param {RuntimeModule[]} runtimeModules array of runtime modules in order
102
- * @param {RenderContext} renderContext render context
103
- * @returns {Source} rendered chunk runtime modules in a Source object
104
- */
105
- static renderChunkRuntimeModules(
106
- runtimeModules: RuntimeModule[],
107
- renderContext: RenderContext,
108
- ): Source;
109
- }
110
- declare namespace Template {
111
- export {
112
- NUMBER_OF_IDENTIFIER_START_CHARS,
113
- NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS,
114
- Source,
115
- OutputOptions,
116
- Chunk,
117
- ChunkGraph,
118
- CodeGenerationResults,
119
- AssetInfo,
120
- PathData,
121
- DependencyTemplates,
122
- Module,
123
- ModuleGraph,
124
- ModuleTemplate,
125
- RuntimeModule,
126
- RuntimeTemplate,
127
- ChunkRenderContext,
128
- RenderContext,
129
- RenderManifestOptions,
130
- RenderManifestEntry,
131
- RenderManifestEntryTemplated,
132
- RenderManifestEntryStatic,
133
- HasId,
134
- ModuleFilterPredicate,
135
- };
136
- }
137
- type ChunkRenderContext =
138
- import('./javascript/JavascriptModulesPlugin').ChunkRenderContext;
139
- type Module = import('./Module');
140
- type Source = import('webpack-sources').Source;
141
- type RuntimeModule = import('./RuntimeModule');
142
- type RenderContext =
143
- import('./javascript/JavascriptModulesPlugin').RenderContext;
144
- type CodeGenerationResults = import('./CodeGenerationResults');
145
- declare const NUMBER_OF_IDENTIFIER_START_CHARS: number;
146
- declare const NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
147
- type OutputOptions = import('../declarations/WebpackOptions').Output;
148
- type Chunk = import('./Chunk');
149
- type ChunkGraph = import('./ChunkGraph');
150
- type AssetInfo = import('./Compilation').AssetInfo;
151
- type PathData = import('./Compilation').PathData;
152
- type DependencyTemplates = import('./DependencyTemplates');
153
- type ModuleGraph = import('./ModuleGraph');
154
- type ModuleTemplate = import('./ModuleTemplate');
155
- type RuntimeTemplate = import('./RuntimeTemplate');
156
- type RenderManifestOptions = {
157
- /**
158
- * the chunk used to render
159
- */
160
- chunk: Chunk;
161
- hash: string;
162
- fullHash: string;
163
- outputOptions: OutputOptions;
164
- codeGenerationResults: CodeGenerationResults;
165
- moduleTemplates: {
166
- javascript: ModuleTemplate;
167
- };
168
- dependencyTemplates: DependencyTemplates;
169
- runtimeTemplate: RuntimeTemplate;
170
- moduleGraph: ModuleGraph;
171
- chunkGraph: ChunkGraph;
172
- };
173
- type RenderManifestEntry =
174
- | RenderManifestEntryTemplated
175
- | RenderManifestEntryStatic;
176
- type RenderManifestEntryTemplated = {
177
- render: () => Source;
178
- filenameTemplate:
179
- | string
180
- | ((arg0: PathData, arg1: AssetInfo | undefined) => string);
181
- pathOptions?: PathData | undefined;
182
- info?: AssetInfo | undefined;
183
- identifier: string;
184
- hash?: string | undefined;
185
- auxiliary?: boolean | undefined;
186
- };
187
- type RenderManifestEntryStatic = {
188
- render: () => Source;
189
- filename: string;
190
- info: AssetInfo;
191
- identifier: string;
192
- hash?: string | undefined;
193
- auxiliary?: boolean | undefined;
194
- };
195
- type HasId = {
196
- id: number | string;
197
- };
198
- type ModuleFilterPredicate = (arg0: Module, arg1: number) => boolean;
@@ -1,33 +0,0 @@
1
- import type { Module } from 'webpack';
2
-
3
- declare class WebpackError extends Error {
4
- /**
5
- * Creates an instance of WebpackError.
6
- */
7
- constructor(message?: string);
8
- details?: string;
9
- module?: null | Module;
10
- loc?: SyntheticDependencyLocation | RealDependencyLocation;
11
- hideStack?: boolean;
12
- chunk?: Chunk;
13
- file?: string;
14
- serialize(__0: ObjectSerializerContext): void;
15
- deserialize(__0: ObjectDeserializerContext): void;
16
-
17
- /**
18
- * Create .stack property on a target object
19
- */
20
- static captureStackTrace(
21
- targetObject: object,
22
- constructorOpt?: Function,
23
- ): void;
24
-
25
- /**
26
- * Optional override for formatting stack traces
27
- */
28
- static prepareStackTrace?: (
29
- err: Error,
30
- stackTraces: NodeJS.CallSite[],
31
- ) => any;
32
- static stackTraceLimit: number;
33
- }
@@ -1,86 +0,0 @@
1
- import type { SemVerRange } from 'webpack/lib/util/semver';
2
-
3
- export interface ConsumeSharedModuleExcludeOptions {
4
- request?: string | RegExp;
5
- version?: string;
6
- fallbackVersion?: string;
7
- }
8
-
9
- export interface ConsumeSharedModuleIncludeOptions {
10
- request?: string | RegExp;
11
- version?: string;
12
- fallbackVersion?: string;
13
- }
14
-
15
- export type ConsumeOptions = {
16
- /**
17
- * fallback request
18
- */
19
- import?: string | undefined;
20
- /**
21
- * resolved fallback request
22
- */
23
- importResolved?: string | undefined;
24
- /**
25
- * The actual request to use for importing the module. If not specified, the property name/key will be used.
26
- */
27
- request?: string;
28
- /**
29
- * global share key
30
- */
31
- shareKey: string;
32
- /**
33
- * share scope
34
- */
35
- shareScope: string | string[];
36
- /**
37
- * version requirement
38
- */
39
- requiredVersion:
40
- | import('webpack/lib/util/semver').SemVerRange
41
- | false
42
- | undefined;
43
- /**
44
- * package name to determine required version automatically
45
- */
46
- packageName: string;
47
- /**
48
- * don't use shared version even if version isn't valid
49
- */
50
- strictVersion: boolean;
51
- /**
52
- * use single global version
53
- */
54
- singleton: boolean;
55
- /**
56
- * include the fallback module in a sync way
57
- */
58
- eager: boolean;
59
- /**
60
- * Share a specific layer of the module, if the module supports layers
61
- */
62
- layer?: string | null;
63
- /**
64
- * Issuer layer in which the module should be resolved
65
- */
66
- issuerLayer?: string | null;
67
- /**
68
- * Filter object for consuming shared modules.
69
- * Modules matching the criteria in this object will be excluded.
70
- */
71
- exclude?: ConsumeSharedModuleExcludeOptions;
72
- /**
73
- * Filter object for consuming shared modules.
74
- * Only modules matching the criteria in this object will be included.
75
- */
76
- include?: ConsumeSharedModuleIncludeOptions;
77
- /**
78
- * Enable reconstructed lookup for node_modules paths for this share item
79
- */
80
- allowNodeModulesSuffixMatch?: boolean;
81
- /**
82
- * Tree shaking mode for the shared module.
83
- */
84
- treeShakingMode?: 'server-calc' | 'runtime-infer';
85
- };
86
- const TYPES = new Set(['consume-shared']);
@@ -1,100 +0,0 @@
1
- /*
2
- * This file was automatically generated.
3
- * DO NOT MODIFY BY HAND.
4
- * Run `yarn special-lint-fix` to update
5
- */
6
-
7
- /**
8
- * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
9
- */
10
- export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
11
- /**
12
- * A module that should be consumed from share scope.
13
- */
14
- export type ConsumesItem = string;
15
-
16
- /**
17
- * Options for consuming shared modules.
18
- */
19
- export interface ConsumeSharedPluginOptions {
20
- /**
21
- * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
22
- */
23
- consumes: Consumes;
24
- /**
25
- * Share scope name used for all consumed modules (defaults to 'default').
26
- */
27
- shareScope?: string | string[];
28
- }
29
- /**
30
- * Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
31
- */
32
- export interface ConsumesObject {
33
- /**
34
- * Modules that should be consumed from share scope.
35
- */
36
- [k: string]: ConsumesConfig | ConsumesItem;
37
- }
38
-
39
- export interface IncludeExcludeOptions {
40
- request?: string | RegExp;
41
- version?: string;
42
- fallbackVersion?: string;
43
- }
44
-
45
- /**
46
- * Advanced configuration for modules that should be consumed from share scope.
47
- */
48
- export interface ConsumesConfig {
49
- /**
50
- * Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.
51
- */
52
- eager?: boolean;
53
- /**
54
- * Fallback module if no shared module is found in share scope. Defaults to the property name.
55
- */
56
- import?: false | ConsumesItem;
57
- /**
58
- * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
59
- */
60
- packageName?: string;
61
- /**
62
- * Version requirement from module in share scope.
63
- */
64
- requiredVersion?: false | string;
65
- /**
66
- * Module is looked up under this key from the share scope.
67
- */
68
- shareKey?: string;
69
- /**
70
- * Share scope name.
71
- */
72
- shareScope?: string | string[];
73
- /**
74
- * Allow only a single version of the shared module in share scope (disabled by default).
75
- */
76
- singleton?: boolean;
77
- /**
78
- * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
79
- */
80
- strictVersion?: boolean;
81
- /**
82
- * Issuer layer in which the module should be resolved.
83
- */
84
- issuerLayer?: string;
85
- /**
86
- * Layer for the shared module.
87
- */
88
- layer?: string;
89
- /**
90
- * The actual request to use for importing the module. If not specified, the property name/key will be used.
91
- */
92
- request?: string;
93
- exclude?: IncludeExcludeOptions;
94
- include?: IncludeExcludeOptions;
95
- allowNodeModulesSuffixMatch?: boolean;
96
- /**
97
- * Tree shaking mode for the shared module.
98
- */
99
- treeShakingMode?: 'server-calc' | 'runtime-infer';
100
- }