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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/README.md +1 -1
  2. package/dist/CHANGELOG.md +2678 -0
  3. package/dist/README.md +213 -0
  4. package/dist/rstestmigrate.md +140 -0
  5. package/dist/src/_virtual/_rolldown/runtime.js +47 -0
  6. package/dist/src/index.d.ts +22 -18
  7. package/dist/src/index.js +47 -41
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/lib/Constants.js +136 -116
  10. package/dist/src/lib/Constants.js.map +1 -1
  11. package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -16
  12. package/dist/src/lib/container/AsyncBoundaryPlugin.js +137 -196
  13. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
  14. package/dist/src/lib/container/ContainerEntryDependency.d.ts +25 -23
  15. package/dist/src/lib/container/ContainerEntryDependency.js +37 -39
  16. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
  17. package/dist/src/lib/container/ContainerEntryModule.d.ts +104 -79
  18. package/dist/src/lib/container/ContainerEntryModule.js +213 -234
  19. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -1
  20. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -10
  21. package/dist/src/lib/container/ContainerEntryModuleFactory.js +21 -25
  22. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
  23. package/dist/src/lib/container/ContainerExposedDependency.d.ts +26 -23
  24. package/dist/src/lib/container/ContainerExposedDependency.js +47 -47
  25. package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -1
  26. package/dist/src/lib/container/ContainerPlugin.d.ts +12 -8
  27. package/dist/src/lib/container/ContainerPlugin.js +144 -213
  28. package/dist/src/lib/container/ContainerPlugin.js.map +1 -1
  29. package/dist/src/lib/container/ContainerReferencePlugin.d.ts +16 -12
  30. package/dist/src/lib/container/ContainerReferencePlugin.js +72 -101
  31. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -1
  32. package/dist/src/lib/container/FallbackDependency.d.ts +24 -19
  33. package/dist/src/lib/container/FallbackDependency.js +46 -44
  34. package/dist/src/lib/container/FallbackDependency.js.map +1 -1
  35. package/dist/src/lib/container/FallbackItemDependency.d.ts +13 -8
  36. package/dist/src/lib/container/FallbackItemDependency.js +24 -24
  37. package/dist/src/lib/container/FallbackItemDependency.js.map +1 -1
  38. package/dist/src/lib/container/FallbackModule.d.ts +82 -71
  39. package/dist/src/lib/container/FallbackModule.js +133 -145
  40. package/dist/src/lib/container/FallbackModule.js.map +1 -1
  41. package/dist/src/lib/container/FallbackModuleFactory.d.ts +15 -10
  42. package/dist/src/lib/container/FallbackModuleFactory.js +20 -24
  43. package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -1
  44. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +11 -7
  45. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +124 -188
  46. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -1
  47. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +20 -16
  48. package/dist/src/lib/container/ModuleFederationPlugin.js +151 -170
  49. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
  50. package/dist/src/lib/container/RemoteModule.d.ts +83 -74
  51. package/dist/src/lib/container/RemoteModule.js +149 -153
  52. package/dist/src/lib/container/RemoteModule.js.map +1 -1
  53. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -7
  54. package/dist/src/lib/container/RemoteRuntimeModule.js +86 -120
  55. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -1
  56. package/dist/src/lib/container/RemoteToExternalDependency.d.ts +13 -8
  57. package/dist/src/lib/container/RemoteToExternalDependency.js +25 -23
  58. package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -1
  59. package/dist/src/lib/container/constant.d.ts +3 -0
  60. package/dist/src/lib/container/constant.js +11 -14
  61. package/dist/src/lib/container/constant.js.map +1 -1
  62. package/dist/src/lib/container/options.d.ts +12 -3
  63. package/dist/src/lib/container/options.js +51 -69
  64. package/dist/src/lib/container/options.js.map +1 -1
  65. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.d.ts +14 -9
  66. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js +56 -64
  67. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js.map +1 -1
  68. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.d.ts +23 -19
  69. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js +70 -101
  70. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js.map +1 -1
  71. package/dist/src/lib/container/runtime/FederationModulesPlugin.d.ts +20 -16
  72. package/dist/src/lib/container/runtime/FederationModulesPlugin.js +38 -46
  73. package/dist/src/lib/container/runtime/FederationModulesPlugin.js.map +1 -1
  74. package/dist/src/lib/container/runtime/FederationRuntimeDependency.d.ts +9 -4
  75. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js +16 -12
  76. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js.map +1 -1
  77. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +16 -11
  78. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +39 -46
  79. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -1
  80. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +31 -18
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +263 -293
  82. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -1
  83. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +9 -4
  84. package/dist/src/lib/container/runtime/getFederationGlobal.js +43 -41
  85. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -1
  86. package/dist/src/lib/container/runtime/normalizeToPosixPath.d.ts +5 -0
  87. package/dist/src/lib/container/runtime/normalizeToPosixPath.js +20 -0
  88. package/dist/src/lib/container/runtime/normalizeToPosixPath.js.map +1 -0
  89. package/dist/src/lib/container/runtime/utils.d.ts +22 -7
  90. package/dist/src/lib/container/runtime/utils.js +80 -102
  91. package/dist/src/lib/container/runtime/utils.js.map +1 -1
  92. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +15 -10
  93. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +27 -25
  94. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -1
  95. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +77 -67
  96. package/dist/src/lib/sharing/ConsumeSharedModule.js +190 -214
  97. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
  98. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +13 -9
  99. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +308 -472
  100. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
  101. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +16 -11
  102. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +108 -123
  103. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
  104. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +14 -9
  105. package/dist/src/lib/sharing/ProvideForSharedDependency.js +25 -25
  106. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -1
  107. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +44 -38
  108. package/dist/src/lib/sharing/ProvideSharedDependency.js +72 -74
  109. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
  110. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +91 -81
  111. package/dist/src/lib/sharing/ProvideSharedModule.js +177 -181
  112. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
  113. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +14 -9
  114. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +19 -25
  115. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
  116. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +27 -21
  117. package/dist/src/lib/sharing/ProvideSharedPlugin.js +341 -548
  118. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
  119. package/dist/src/lib/sharing/SharePlugin.d.ts +55 -12
  120. package/dist/src/lib/sharing/SharePlugin.js +91 -91
  121. package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
  122. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
  123. package/dist/src/lib/sharing/ShareRuntimeModule.js +81 -99
  124. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
  125. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +11 -7
  126. package/dist/src/lib/sharing/resolveMatchedConfigs.js +58 -71
  127. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -1
  128. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.d.ts +25 -0
  129. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js +85 -0
  130. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js.map +1 -0
  131. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.d.ts +41 -0
  132. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js +227 -0
  133. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js.map +1 -0
  134. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.d.ts +26 -0
  135. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js +32 -0
  136. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js.map +1 -0
  137. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.d.ts +32 -0
  138. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js +94 -0
  139. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js.map +1 -0
  140. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.d.ts +31 -0
  141. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js +49 -0
  142. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js.map +1 -0
  143. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.d.ts +22 -0
  144. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js +35 -0
  145. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js.map +1 -0
  146. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.d.ts +87 -0
  147. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js +144 -0
  148. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js.map +1 -0
  149. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.d.ts +16 -0
  150. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js +23 -0
  151. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js.map +1 -0
  152. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.d.ts +23 -0
  153. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js +163 -0
  154. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js.map +1 -0
  155. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.d.ts +22 -0
  156. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js +28 -0
  157. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js.map +1 -0
  158. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.d.ts +20 -0
  159. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js +44 -0
  160. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js.map +1 -0
  161. package/dist/src/lib/sharing/utils.d.ts +27 -23
  162. package/dist/src/lib/sharing/utils.js +224 -366
  163. package/dist/src/lib/sharing/utils.js.map +1 -1
  164. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.d.ts +11 -7
  165. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js +56 -75
  166. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js.map +1 -1
  167. package/dist/src/lib/startup/StartupHelpers.d.ts +11 -6
  168. package/dist/src/lib/startup/StartupHelpers.js +128 -178
  169. package/dist/src/lib/startup/StartupHelpers.js.map +1 -1
  170. package/dist/src/rspack.d.ts +3 -2
  171. package/dist/src/rspack.js +35 -10
  172. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +8 -4
  173. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -16
  174. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -1
  175. package/dist/src/runtime.d.ts +1 -1
  176. package/dist/src/runtime.js +11 -18
  177. package/dist/src/runtime.mjs +3 -0
  178. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +13 -5
  179. package/dist/src/schemas/container/ContainerPlugin.check.js +767 -1220
  180. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -1
  181. package/dist/src/schemas/container/ContainerPlugin.d.ts +267 -268
  182. package/dist/src/schemas/container/ContainerPlugin.js +269 -361
  183. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -1
  184. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +13 -5
  185. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +335 -443
  186. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -1
  187. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +102 -99
  188. package/dist/src/schemas/container/ContainerReferencePlugin.js +122 -162
  189. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -1
  190. package/dist/src/schemas/container/ExternalsType.check.d.ts +13 -5
  191. package/dist/src/schemas/container/ExternalsType.check.js +36 -62
  192. package/dist/src/schemas/container/ExternalsType.check.js.map +1 -1
  193. package/dist/src/schemas/container/ExternalsType.d.ts +5 -2
  194. package/dist/src/schemas/container/ExternalsType.js +8 -11
  195. package/dist/src/schemas/container/ExternalsType.js.map +1 -1
  196. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3020 -4301
  197. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
  198. package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +828 -758
  199. package/dist/src/schemas/container/ModuleFederationPlugin.js +788 -993
  200. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
  201. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.d.ts +13 -5
  202. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js +568 -739
  203. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js.map +1 -1
  204. package/dist/src/schemas/sharing/ConsumeSharedPlugin.d.ts +197 -189
  205. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js +212 -233
  206. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js.map +1 -1
  207. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.d.ts +13 -5
  208. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js +598 -775
  209. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js.map +1 -1
  210. package/dist/src/schemas/sharing/ProvideSharedPlugin.d.ts +184 -176
  211. package/dist/src/schemas/sharing/ProvideSharedPlugin.js +196 -224
  212. package/dist/src/schemas/sharing/ProvideSharedPlugin.js.map +1 -1
  213. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +12 -4
  214. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +285 -482
  215. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -1
  216. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +103 -100
  217. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +104 -126
  218. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -1
  219. package/dist/src/schemas/sharing/SharePlugin.check.d.ts +13 -5
  220. package/dist/src/schemas/sharing/SharePlugin.check.js +749 -794
  221. package/dist/src/schemas/sharing/SharePlugin.check.js.map +1 -1
  222. package/dist/src/schemas/sharing/SharePlugin.d.ts +245 -205
  223. package/dist/src/schemas/sharing/SharePlugin.js +256 -253
  224. package/dist/src/schemas/sharing/SharePlugin.js.map +1 -1
  225. package/dist/src/utils.d.ts +3 -0
  226. package/dist/src/utils.js +35 -26
  227. package/dist/src/utils.js.map +1 -1
  228. package/dist/src/webpack.d.ts +2 -2
  229. package/dist/src/webpack.js +6 -40
  230. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +9 -7
  231. package/dist/src/wrapper/AsyncBoundaryPlugin.js +13 -17
  232. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -1
  233. package/dist/src/wrapper/BaseWrapperPlugin.d.ts +32 -0
  234. package/dist/src/wrapper/BaseWrapperPlugin.js +43 -0
  235. package/dist/src/wrapper/BaseWrapperPlugin.js.map +1 -0
  236. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +10 -7
  237. package/dist/src/wrapper/ConsumeSharedPlugin.js +13 -17
  238. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -1
  239. package/dist/src/wrapper/ContainerPlugin.d.ts +9 -7
  240. package/dist/src/wrapper/ContainerPlugin.js +13 -17
  241. package/dist/src/wrapper/ContainerPlugin.js.map +1 -1
  242. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +9 -7
  243. package/dist/src/wrapper/ContainerReferencePlugin.js +13 -17
  244. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -1
  245. package/dist/src/wrapper/FederationModulesPlugin.d.ts +18 -10
  246. package/dist/src/wrapper/FederationModulesPlugin.js +20 -21
  247. package/dist/src/wrapper/FederationModulesPlugin.js.map +1 -1
  248. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +11 -8
  249. package/dist/src/wrapper/FederationRuntimePlugin.js +19 -20
  250. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -1
  251. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +8 -5
  252. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +13 -16
  253. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -1
  254. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +12 -9
  255. package/dist/src/wrapper/ModuleFederationPlugin.js +71 -104
  256. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -1
  257. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +10 -7
  258. package/dist/src/wrapper/ProvideSharedPlugin.js +13 -17
  259. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -1
  260. package/dist/src/wrapper/SharePlugin.d.ts +10 -7
  261. package/dist/src/wrapper/SharePlugin.js +13 -17
  262. package/dist/src/wrapper/SharePlugin.js.map +1 -1
  263. package/dist/src/wrapper/TreeShakingSharedPlugin.d.ts +10 -0
  264. package/dist/src/wrapper/TreeShakingSharedPlugin.js +15 -0
  265. package/dist/src/wrapper/TreeShakingSharedPlugin.js.map +1 -0
  266. package/package.json +27 -29
  267. package/dist/package.json +0 -110
  268. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +0 -57
  269. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +0 -33
  270. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +0 -4
  271. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +0 -28
  272. package/dist/src/declarations/plugins/container/Template.d.ts +0 -198
  273. package/dist/src/declarations/plugins/container/WebpackError.d.ts +0 -33
  274. package/dist/src/declarations/plugins/sharing/ConsumeSharedModule.d.ts +0 -82
  275. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +0 -96
  276. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +0 -98
  277. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +0 -108
  278. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.d.ts +0 -20
  279. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js +0 -219
  280. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js.map +0 -1
  281. package/dist/src/prefetch.d.ts +0 -2
  282. package/dist/src/prefetch.js +0 -8
  283. package/dist/src/prefetch.js.map +0 -1
  284. package/dist/src/rspack.js.map +0 -1
  285. package/dist/src/runtime.js.map +0 -1
  286. package/dist/src/types/runtime.d.ts +0 -10
  287. package/dist/src/types/runtime.js +0 -3
  288. package/dist/src/types/runtime.js.map +0 -1
  289. package/dist/src/webpack.js.map +0 -1
@@ -1,149 +1,137 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
4
- */
5
1
  'use strict';
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
11
- const Constants_1 = require("../Constants");
12
- const FallbackItemDependency_1 = __importDefault(require("./FallbackItemDependency"));
13
- const { sources: webpackSources } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
14
- const { Template, Module, RuntimeGlobals } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
15
- const makeSerializable = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/makeSerializable'));
16
- const TYPES = new Set(['javascript']);
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
+ const require_lib_Constants = require('../Constants.js');
6
+ const require_lib_container_FallbackItemDependency = require('./FallbackItemDependency.js');
7
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
8
+
9
+ //#region src/lib/container/FallbackModule.ts
10
+ const { sources: webpackSources } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
11
+ const { Template, Module, RuntimeGlobals } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
12
+ const makeSerializable = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/makeSerializable"));
13
+ const TYPES = new Set(["javascript"]);
17
14
  const RUNTIME_REQUIREMENTS = new Set([RuntimeGlobals.module]);
18
- class FallbackModule extends Module {
19
- /**
20
- * @param {string[]} requests list of requests to choose one
21
- */
22
- constructor(requests) {
23
- super(Constants_1.WEBPACK_MODULE_TYPE_FALLBACK);
24
- this.requests = requests;
25
- this._identifier = `fallback ${this.requests.join(' ')}`;
26
- }
27
- /**
28
- * @returns {string} a unique identifier of the module
29
- */
30
- identifier() {
31
- return this._identifier;
32
- }
33
- /**
34
- * @param {RequestShortener} requestShortener the request shortener
35
- * @returns {string} a user readable identifier of the module
36
- */
37
- readableIdentifier(requestShortener) {
38
- return this._identifier;
39
- }
40
- /**
41
- * @param {LibIdentOptions} options options
42
- * @returns {string | null} an identifier for library inclusion
43
- */
44
- libIdent(options) {
45
- return `${this.layer ? `(${this.layer})/` : ''}webpack/container/fallback/${this.requests[0]}/and ${this.requests.length - 1} more`;
46
- }
47
- /**
48
- * @param {Chunk} chunk the chunk which condition should be checked
49
- * @param {Compilation} compilation the compilation
50
- * @returns {boolean} true, if the chunk is ok for the module
51
- */
52
- chunkCondition(chunk, { chunkGraph }) {
53
- return chunkGraph.getNumberOfEntryModules(chunk) > 0;
54
- }
55
- /**
56
- * @param {NeedBuildContext} context context info
57
- * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
58
- * @returns {void}
59
- */
60
- needBuild(context, callback) {
61
- callback(null, !this.buildInfo);
62
- }
63
- /**
64
- * @param {WebpackOptions} options webpack options
65
- * @param {Compilation} compilation the compilation
66
- * @param {ResolverWithOptions} resolver the resolver
67
- * @param {InputFileSystem} fs the file system
68
- * @param {function(WebpackError=): void} callback callback function
69
- * @returns {void}
70
- */
71
- build(options, compilation, resolver, fs, callback) {
72
- this.buildMeta = {};
73
- this.buildInfo = {
74
- strict: true,
75
- };
76
- this.clearDependenciesAndBlocks();
77
- for (const request of this.requests)
78
- this.addDependency(new FallbackItemDependency_1.default(request));
79
- callback();
80
- }
81
- /**
82
- * @param {string=} type the source type for which the size should be estimated
83
- * @returns {number} the estimated size of the module (must be non-zero)
84
- */
85
- size(type) {
86
- return this.requests.length * 5 + 42;
87
- }
88
- /**
89
- * @returns {Set<string>} types available (do not mutate)
90
- */
91
- getSourceTypes() {
92
- return TYPES;
93
- }
94
- /**
95
- * @param {CodeGenerationContext} context context for code generation
96
- * @returns {CodeGenerationResult} result
97
- */
98
- codeGeneration({ runtimeTemplate, moduleGraph, chunkGraph, }) {
99
- const ids = this.dependencies.map((dep) =>
100
- // @ts-expect-error incompatible dependency type
101
- chunkGraph.getModuleId(moduleGraph.getModule(dep)));
102
- const code = Template.asString([
103
- `var ids = ${JSON.stringify(ids)};`,
104
- 'var error, result, i = 0;',
105
- `var loop = ${runtimeTemplate.basicFunction('next', [
106
- 'while(i < ids.length) {',
107
- Template.indent([
108
- `try { next = ${RuntimeGlobals.require}(ids[i++]); } catch(e) { return handleError(e); }`,
109
- 'if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);',
110
- ]),
111
- '}',
112
- 'if(error) throw error;',
113
- ])}`,
114
- `var handleResult = ${runtimeTemplate.basicFunction('result', [
115
- 'if(result) return result;',
116
- 'return loop();',
117
- ])};`,
118
- `var handleError = ${runtimeTemplate.basicFunction('e', [
119
- 'error = e;',
120
- 'return loop();',
121
- ])};`,
122
- 'module.exports = loop();',
123
- ]);
124
- const sources = new Map();
125
- sources.set('javascript', new webpackSources.RawSource(code));
126
- return { sources, runtimeRequirements: RUNTIME_REQUIREMENTS };
127
- }
128
- /**
129
- * @param {ObjectSerializerContext} context context
130
- */
131
- serialize(context) {
132
- const { write } = context;
133
- write(this.requests);
134
- super.serialize(context);
135
- }
136
- /**
137
- * @param {ObjectDeserializerContext} context context
138
- * @returns {FallbackModule} deserialized fallback module
139
- */
140
- static deserialize(context) {
141
- const { read } = context;
142
- const obj = new FallbackModule(read());
143
- obj.deserialize(context);
144
- return obj;
145
- }
146
- }
147
- makeSerializable(FallbackModule, 'enhanced/lib/container/FallbackModule');
15
+ var FallbackModule = class FallbackModule extends Module {
16
+ /**
17
+ * @param {string[]} requests list of requests to choose one
18
+ */
19
+ constructor(requests) {
20
+ super(require_lib_Constants.WEBPACK_MODULE_TYPE_FALLBACK);
21
+ this.requests = requests;
22
+ this._identifier = `fallback ${this.requests.join(" ")}`;
23
+ }
24
+ /**
25
+ * @returns {string} a unique identifier of the module
26
+ */
27
+ identifier() {
28
+ return this._identifier;
29
+ }
30
+ /**
31
+ * @param {RequestShortener} requestShortener the request shortener
32
+ * @returns {string} a user readable identifier of the module
33
+ */
34
+ readableIdentifier(requestShortener) {
35
+ return this._identifier;
36
+ }
37
+ /**
38
+ * @param {LibIdentOptions} options options
39
+ * @returns {string | null} an identifier for library inclusion
40
+ */
41
+ libIdent(options) {
42
+ return `${this.layer ? `(${this.layer})/` : ""}webpack/container/fallback/${this.requests[0]}/and ${this.requests.length - 1} more`;
43
+ }
44
+ /**
45
+ * @param {Chunk} chunk the chunk which condition should be checked
46
+ * @param {Compilation} compilation the compilation
47
+ * @returns {boolean} true, if the chunk is ok for the module
48
+ */
49
+ chunkCondition(chunk, { chunkGraph }) {
50
+ return chunkGraph.getNumberOfEntryModules(chunk) > 0;
51
+ }
52
+ /**
53
+ * @param {NeedBuildContext} context context info
54
+ * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
55
+ * @returns {void}
56
+ */
57
+ needBuild(context, callback) {
58
+ callback(null, !this.buildInfo);
59
+ }
60
+ /**
61
+ * @param {WebpackOptions} options webpack options
62
+ * @param {Compilation} compilation the compilation
63
+ * @param {ResolverWithOptions} resolver the resolver
64
+ * @param {InputFileSystem} fs the file system
65
+ * @param {function(WebpackError=): void} callback callback function
66
+ * @returns {void}
67
+ */
68
+ build(options, compilation, resolver, fs, callback) {
69
+ this.buildMeta = {};
70
+ this.buildInfo = { strict: true };
71
+ this.clearDependenciesAndBlocks();
72
+ for (const request of this.requests) this.addDependency(new require_lib_container_FallbackItemDependency.default(request));
73
+ callback();
74
+ }
75
+ /**
76
+ * @param {string=} type the source type for which the size should be estimated
77
+ * @returns {number} the estimated size of the module (must be non-zero)
78
+ */
79
+ size(type) {
80
+ return this.requests.length * 5 + 42;
81
+ }
82
+ /**
83
+ * @returns {Set<string>} types available (do not mutate)
84
+ */
85
+ getSourceTypes() {
86
+ return TYPES;
87
+ }
88
+ /**
89
+ * @param {CodeGenerationContext} context context for code generation
90
+ * @returns {CodeGenerationResult} result
91
+ */
92
+ codeGeneration({ runtimeTemplate, moduleGraph, chunkGraph }) {
93
+ const ids = this.dependencies.map((dep) => chunkGraph.getModuleId(moduleGraph.getModule(dep)));
94
+ const code = Template.asString([
95
+ `var ids = ${JSON.stringify(ids)};`,
96
+ "var error, result, i = 0;",
97
+ `var loop = ${runtimeTemplate.basicFunction("next", [
98
+ "while(i < ids.length) {",
99
+ Template.indent([`try { next = ${RuntimeGlobals.require}(ids[i++]); } catch(e) { return handleError(e); }`, "if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);"]),
100
+ "}",
101
+ "if(error) throw error;"
102
+ ])}`,
103
+ `var handleResult = ${runtimeTemplate.basicFunction("result", ["if(result) return result;", "return loop();"])};`,
104
+ `var handleError = ${runtimeTemplate.basicFunction("e", ["error = e;", "return loop();"])};`,
105
+ "module.exports = loop();"
106
+ ]);
107
+ const sources = /* @__PURE__ */ new Map();
108
+ sources.set("javascript", new webpackSources.RawSource(code));
109
+ return {
110
+ sources,
111
+ runtimeRequirements: RUNTIME_REQUIREMENTS
112
+ };
113
+ }
114
+ /**
115
+ * @param {ObjectSerializerContext} context context
116
+ */
117
+ serialize(context) {
118
+ const { write } = context;
119
+ write(this.requests);
120
+ super.serialize(context);
121
+ }
122
+ /**
123
+ * @param {ObjectDeserializerContext} context context
124
+ * @returns {FallbackModule} deserialized fallback module
125
+ */
126
+ static deserialize(context) {
127
+ const { read } = context;
128
+ const obj = new FallbackModule(read());
129
+ obj.deserialize(context);
130
+ return obj;
131
+ }
132
+ };
133
+ makeSerializable(FallbackModule, "enhanced/lib/container/FallbackModule");
134
+
135
+ //#endregion
148
136
  exports.default = FallbackModule;
149
137
  //# sourceMappingURL=FallbackModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FallbackModule.js","sourceRoot":"","sources":["../../../../src/lib/container/FallbackModule.ts"],"names":[],"mappings":"AAAA;;;EAGE;AAEF,YAAY,CAAC;;;;;AAEb,0FAAqF;AAgBrF,4CAA4D;AAC5D,sFAA8D;AAE9D,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CACzC,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAC9B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAClD,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAC9B,MAAM,gBAAgB,GAAG,OAAO,CAC9B,IAAA,6CAAoB,EAAC,mCAAmC,CAAC,CACJ,CAAC;AAExD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;AACtC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAE9D,MAAM,cAAe,SAAQ,MAAM;IAIjC;;OAEG;IACH,YAAY,QAAkB;QAC5B,KAAK,CAAC,wCAA4B,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3D,CAAC;IAED;;OAEG;IACM,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACM,kBAAkB,CAAC,gBAAkC;QAC5D,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACM,QAAQ,CAAC,OAAwB;QACxC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,8BAC5C,IAAI,CAAC,QAAQ,CAAC,CAAC,CACjB,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACM,cAAc,CACrB,KAAY,EACZ,EAAE,UAAU,EAA8B;QAE1C,OAAO,UAAU,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACM,SAAS,CAChB,OAAyB,EACzB,QAAgE;QAEhE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;OAOG;IACM,KAAK,CACZ,OAAuB,EACvB,WAAwB,EACxB,QAA6B,EAC7B,EAAmB,EACnB,QAAwC;QAExC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG;YACf,MAAM,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAClC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ;YACjC,IAAI,CAAC,aAAa,CAAC,IAAI,gCAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;QAE1D,QAAQ,EAAE,CAAC;IACb,CAAC;IAED;;;OAGG;IACM,IAAI,CAAC,IAAa;QACzB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC;IACvC,CAAC;IAED;;OAEG;IACM,cAAc;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACM,cAAc,CAAC,EACtB,eAAe,EACf,WAAW,EACX,UAAU,GACY;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACxC,gDAAgD;QAChD,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CACnD,CAAC;QACF,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC;YAC7B,aAAa,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG;YACnC,2BAA2B;YAC3B,cAAc,eAAe,CAAC,aAAa,CAAC,MAAM,EAAE;gBAClD,yBAAyB;gBACzB,QAAQ,CAAC,MAAM,CAAC;oBACd,gBAAgB,cAAc,CAAC,OAAO,mDAAmD;oBACzF,wFAAwF;iBACzF,CAAC;gBACF,GAAG;gBACH,wBAAwB;aACzB,CAAC,EAAE;YACJ,sBAAsB,eAAe,CAAC,aAAa,CAAC,QAAQ,EAAE;gBAC5D,2BAA2B;gBAC3B,gBAAgB;aACjB,CAAC,GAAG;YACL,qBAAqB,eAAe,CAAC,aAAa,CAAC,GAAG,EAAE;gBACtD,YAAY;gBACZ,gBAAgB;aACjB,CAAC,GAAG;YACL,0BAA0B;SAC3B,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,CAAC;IAChE,CAAC;IAED;;OAEG;IACM,SAAS,CAAC,OAAgC;QACjD,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,OAAkC;QACnD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;QACvC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzB,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED,gBAAgB,CAAC,cAAc,EAAE,uCAAuC,CAAC,CAAC;AAE1E,kBAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"FallbackModule.js","names":["WEBPACK_MODULE_TYPE_FALLBACK","FallbackItemDependency"],"sources":["../../../../src/lib/container/FallbackModule.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\n\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type { Chunk, ChunkGraph } from 'webpack';\nimport type {\n CodeGenerationContext,\n CodeGenerationResult,\n Compilation,\n InputFileSystem,\n LibIdentOptions,\n NeedBuildContext,\n ObjectDeserializerContext,\n ObjectSerializerContext,\n RequestShortener,\n ResolverWithOptions,\n WebpackError,\n WebpackOptions,\n} from 'webpack/lib/Module';\nimport { WEBPACK_MODULE_TYPE_FALLBACK } from '../Constants';\nimport FallbackItemDependency from './FallbackItemDependency';\n\nconst { sources: webpackSources } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\nconst { Template, Module, RuntimeGlobals } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\nconst makeSerializable = require(\n normalizeWebpackPath('webpack/lib/util/makeSerializable'),\n) as typeof import('webpack/lib/util/makeSerializable');\n\nconst TYPES = new Set(['javascript']);\nconst RUNTIME_REQUIREMENTS = new Set([RuntimeGlobals.module]);\n\nclass FallbackModule extends Module {\n public requests: string[];\n private _identifier: string;\n\n /**\n * @param {string[]} requests list of requests to choose one\n */\n constructor(requests: string[]) {\n super(WEBPACK_MODULE_TYPE_FALLBACK);\n this.requests = requests;\n this._identifier = `fallback ${this.requests.join(' ')}`;\n }\n\n /**\n * @returns {string} a unique identifier of the module\n */\n override identifier(): string {\n return this._identifier;\n }\n\n /**\n * @param {RequestShortener} requestShortener the request shortener\n * @returns {string} a user readable identifier of the module\n */\n override readableIdentifier(requestShortener: RequestShortener): string {\n return this._identifier;\n }\n\n /**\n * @param {LibIdentOptions} options options\n * @returns {string | null} an identifier for library inclusion\n */\n override libIdent(options: LibIdentOptions): string | null {\n return `${this.layer ? `(${this.layer})/` : ''}webpack/container/fallback/${\n this.requests[0]\n }/and ${this.requests.length - 1} more`;\n }\n\n /**\n * @param {Chunk} chunk the chunk which condition should be checked\n * @param {Compilation} compilation the compilation\n * @returns {boolean} true, if the chunk is ok for the module\n */\n override chunkCondition(\n chunk: Chunk,\n { chunkGraph }: { chunkGraph: ChunkGraph },\n ): boolean {\n return chunkGraph.getNumberOfEntryModules(chunk) > 0;\n }\n\n /**\n * @param {NeedBuildContext} context context info\n * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild\n * @returns {void}\n */\n override needBuild(\n context: NeedBuildContext,\n callback: (error: WebpackError | null, result?: boolean) => void,\n ): void {\n callback(null, !this.buildInfo);\n }\n\n /**\n * @param {WebpackOptions} options webpack options\n * @param {Compilation} compilation the compilation\n * @param {ResolverWithOptions} resolver the resolver\n * @param {InputFileSystem} fs the file system\n * @param {function(WebpackError=): void} callback callback function\n * @returns {void}\n */\n override build(\n options: WebpackOptions,\n compilation: Compilation,\n resolver: ResolverWithOptions,\n fs: InputFileSystem,\n callback: (error?: WebpackError) => void,\n ): void {\n this.buildMeta = {};\n this.buildInfo = {\n strict: true,\n };\n\n this.clearDependenciesAndBlocks();\n for (const request of this.requests)\n this.addDependency(new FallbackItemDependency(request));\n\n callback();\n }\n\n /**\n * @param {string=} type the source type for which the size should be estimated\n * @returns {number} the estimated size of the module (must be non-zero)\n */\n override size(type?: string): number {\n return this.requests.length * 5 + 42;\n }\n\n /**\n * @returns {Set<string>} types available (do not mutate)\n */\n override getSourceTypes(): Set<string> {\n return TYPES;\n }\n\n /**\n * @param {CodeGenerationContext} context context for code generation\n * @returns {CodeGenerationResult} result\n */\n override codeGeneration({\n runtimeTemplate,\n moduleGraph,\n chunkGraph,\n }: CodeGenerationContext): CodeGenerationResult {\n const ids = this.dependencies.map((dep) =>\n // @ts-expect-error incompatible dependency type\n chunkGraph.getModuleId(moduleGraph.getModule(dep)),\n );\n const code = Template.asString([\n `var ids = ${JSON.stringify(ids)};`,\n 'var error, result, i = 0;',\n `var loop = ${runtimeTemplate.basicFunction('next', [\n 'while(i < ids.length) {',\n Template.indent([\n `try { next = ${RuntimeGlobals.require}(ids[i++]); } catch(e) { return handleError(e); }`,\n 'if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);',\n ]),\n '}',\n 'if(error) throw error;',\n ])}`,\n `var handleResult = ${runtimeTemplate.basicFunction('result', [\n 'if(result) return result;',\n 'return loop();',\n ])};`,\n `var handleError = ${runtimeTemplate.basicFunction('e', [\n 'error = e;',\n 'return loop();',\n ])};`,\n 'module.exports = loop();',\n ]);\n const sources = new Map();\n sources.set('javascript', new webpackSources.RawSource(code));\n return { sources, runtimeRequirements: RUNTIME_REQUIREMENTS };\n }\n\n /**\n * @param {ObjectSerializerContext} context context\n */\n override serialize(context: ObjectSerializerContext): void {\n const { write } = context;\n write(this.requests);\n super.serialize(context);\n }\n\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {FallbackModule} deserialized fallback module\n */\n static deserialize(context: ObjectDeserializerContext): FallbackModule {\n const { read } = context;\n const obj = new FallbackModule(read());\n obj.deserialize(context);\n return obj;\n }\n}\n\nmakeSerializable(FallbackModule, 'enhanced/lib/container/FallbackModule');\n\nexport default FallbackModule;\n"],"mappings":";;;;;;;;;AA0BA,MAAM,EAAE,SAAS,mBAAmB,gFACb,UAAU,CAChC;AACD,MAAM,EAAE,UAAU,QAAQ,mBAAmB,gFACtB,UAAU,CAChC;AACD,MAAM,mBAAmB,gFACF,oCAAoC,CAC1D;AAED,MAAM,QAAQ,IAAI,IAAI,CAAC,aAAa,CAAC;AACrC,MAAM,uBAAuB,IAAI,IAAI,CAAC,eAAe,OAAO,CAAC;AAE7D,IAAM,iBAAN,MAAM,uBAAuB,OAAO;;;;CAOlC,YAAY,UAAoB;AAC9B,QAAMA,mDAA6B;AACnC,OAAK,WAAW;AAChB,OAAK,cAAc,YAAY,KAAK,SAAS,KAAK,IAAI;;;;;CAMxD,AAAS,aAAqB;AAC5B,SAAO,KAAK;;;;;;CAOd,AAAS,mBAAmB,kBAA4C;AACtE,SAAO,KAAK;;;;;;CAOd,AAAS,SAAS,SAAyC;AACzD,SAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,MAAM,MAAM,GAAG,6BAC7C,KAAK,SAAS,GACf,OAAO,KAAK,SAAS,SAAS,EAAE;;;;;;;CAQnC,AAAS,eACP,OACA,EAAE,cACO;AACT,SAAO,WAAW,wBAAwB,MAAM,GAAG;;;;;;;CAQrD,AAAS,UACP,SACA,UACM;AACN,WAAS,MAAM,CAAC,KAAK,UAAU;;;;;;;;;;CAWjC,AAAS,MACP,SACA,aACA,UACA,IACA,UACM;AACN,OAAK,YAAY,EAAE;AACnB,OAAK,YAAY,EACf,QAAQ,MACT;AAED,OAAK,4BAA4B;AACjC,OAAK,MAAM,WAAW,KAAK,SACzB,MAAK,cAAc,IAAIC,qDAAuB,QAAQ,CAAC;AAEzD,YAAU;;;;;;CAOZ,AAAS,KAAK,MAAuB;AACnC,SAAO,KAAK,SAAS,SAAS,IAAI;;;;;CAMpC,AAAS,iBAA8B;AACrC,SAAO;;;;;;CAOT,AAAS,eAAe,EACtB,iBACA,aACA,cAC8C;EAC9C,MAAM,MAAM,KAAK,aAAa,KAAK,QAEjC,WAAW,YAAY,YAAY,UAAU,IAAI,CAAC,CACnD;EACD,MAAM,OAAO,SAAS,SAAS;GAC7B,aAAa,KAAK,UAAU,IAAI,CAAC;GACjC;GACA,cAAc,gBAAgB,cAAc,QAAQ;IAClD;IACA,SAAS,OAAO,CACd,gBAAgB,eAAe,QAAQ,oDACvC,yFACD,CAAC;IACF;IACA;IACD,CAAC;GACF,sBAAsB,gBAAgB,cAAc,UAAU,CAC5D,6BACA,iBACD,CAAC,CAAC;GACH,qBAAqB,gBAAgB,cAAc,KAAK,CACtD,cACA,iBACD,CAAC,CAAC;GACH;GACD,CAAC;EACF,MAAM,0BAAU,IAAI,KAAK;AACzB,UAAQ,IAAI,cAAc,IAAI,eAAe,UAAU,KAAK,CAAC;AAC7D,SAAO;GAAE;GAAS,qBAAqB;GAAsB;;;;;CAM/D,AAAS,UAAU,SAAwC;EACzD,MAAM,EAAE,UAAU;AAClB,QAAM,KAAK,SAAS;AACpB,QAAM,UAAU,QAAQ;;;;;;CAO1B,OAAO,YAAY,SAAoD;EACrE,MAAM,EAAE,SAAS;EACjB,MAAM,MAAM,IAAI,eAAe,MAAM,CAAC;AACtC,MAAI,YAAY,QAAQ;AACxB,SAAO;;;AAIX,iBAAiB,gBAAgB,wCAAwC"}
@@ -1,11 +1,16 @@
1
- import type { ModuleFactoryCreateData, ModuleFactoryResult } from 'webpack/lib/ModuleFactory';
2
- declare const ModuleFactory: typeof import("webpack/lib/ModuleFactory");
3
- export default class FallbackModuleFactory extends ModuleFactory {
4
- /**
5
- * @param {ModuleFactoryCreateData} data data object
6
- * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
7
- * @returns {void}
8
- */
9
- create(data: ModuleFactoryCreateData, callback: (error: Error | null, result?: ModuleFactoryResult) => void): void;
1
+ import * as webpack_lib_ModuleFactory0 from "webpack/lib/ModuleFactory";
2
+ import { ModuleFactoryCreateData, ModuleFactoryResult } from "webpack/lib/ModuleFactory";
3
+
4
+ //#region src/lib/container/FallbackModuleFactory.d.ts
5
+ declare const ModuleFactory: typeof webpack_lib_ModuleFactory0;
6
+ declare class FallbackModuleFactory extends ModuleFactory {
7
+ /**
8
+ * @param {ModuleFactoryCreateData} data data object
9
+ * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
10
+ * @returns {void}
11
+ */
12
+ create(data: ModuleFactoryCreateData, callback: (error: Error | null, result?: ModuleFactoryResult) => void): void;
10
13
  }
11
- export {};
14
+ //#endregion
15
+ export { FallbackModuleFactory as default };
16
+ //# sourceMappingURL=FallbackModuleFactory.d.ts.map
@@ -1,28 +1,24 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
4
- */
5
1
  'use strict';
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
+ const require_lib_container_FallbackModule = require('./FallbackModule.js');
6
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
7
+
8
+ //#region src/lib/container/FallbackModuleFactory.ts
9
+ const ModuleFactory = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/ModuleFactory"));
10
+ var FallbackModuleFactory = class extends ModuleFactory {
11
+ /**
12
+ * @param {ModuleFactoryCreateData} data data object
13
+ * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
14
+ * @returns {void}
15
+ */
16
+ create(data, callback) {
17
+ const dependency = data.dependencies[0];
18
+ callback(null, { module: new require_lib_container_FallbackModule.default(dependency.requests) });
19
+ }
8
20
  };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
11
- const FallbackModule_1 = __importDefault(require("./FallbackModule"));
12
- const ModuleFactory = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/ModuleFactory'));
13
- class FallbackModuleFactory extends ModuleFactory {
14
- /**
15
- * @param {ModuleFactoryCreateData} data data object
16
- * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
17
- * @returns {void}
18
- */
19
- create(data, callback) {
20
- const dependency = data.dependencies[0];
21
- callback(null, {
22
- // @ts-expect-error Module !== FallbackModule
23
- module: new FallbackModule_1.default(dependency.requests),
24
- });
25
- }
26
- }
21
+
22
+ //#endregion
27
23
  exports.default = FallbackModuleFactory;
28
24
  //# sourceMappingURL=FallbackModuleFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FallbackModuleFactory.js","sourceRoot":"","sources":["../../../../src/lib/container/FallbackModuleFactory.ts"],"names":[],"mappings":"AAAA;;;EAGE;AAEF,YAAY,CAAC;;;;;AACb,0FAAqF;AAKrF,sEAA8C;AAE9C,MAAM,aAAa,GAAG,OAAO,CAC3B,IAAA,6CAAoB,EAAC,2BAA2B,CAAC,CACJ,CAAC;AAEhD,MAAqB,qBAAsB,SAAQ,aAAa;IAC9D;;;;OAIG;IACM,MAAM,CACb,IAA6B,EAC7B,QAAqE;QAErE,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACxC,QAAQ,CAAC,IAAI,EAAE;YACb,6CAA6C;YAC7C,MAAM,EAAE,IAAI,wBAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,wCAgBC"}
1
+ {"version":3,"file":"FallbackModuleFactory.js","names":["FallbackModule"],"sources":["../../../../src/lib/container/FallbackModuleFactory.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\n'use strict';\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type {\n ModuleFactoryCreateData,\n ModuleFactoryResult,\n} from 'webpack/lib/ModuleFactory';\nimport FallbackModule from './FallbackModule';\n\nconst ModuleFactory = require(\n normalizeWebpackPath('webpack/lib/ModuleFactory'),\n) as typeof import('webpack/lib/ModuleFactory');\n\nexport default class FallbackModuleFactory extends ModuleFactory {\n /**\n * @param {ModuleFactoryCreateData} data data object\n * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback\n * @returns {void}\n */\n override create(\n data: ModuleFactoryCreateData,\n callback: (error: Error | null, result?: ModuleFactoryResult) => void,\n ): void {\n const dependency = data.dependencies[0];\n callback(null, {\n // @ts-expect-error Module !== FallbackModule\n module: new FallbackModule(dependency.requests),\n });\n }\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,gBAAgB,gFACC,4BAA4B,CAClD;AAED,IAAqB,wBAArB,cAAmD,cAAc;;;;;;CAM/D,AAAS,OACP,MACA,UACM;EACN,MAAM,aAAa,KAAK,aAAa;AACrC,WAAS,MAAM,EAEb,QAAQ,IAAIA,6CAAe,WAAW,SAAS,EAChD,CAAC"}
@@ -1,12 +1,16 @@
1
- import type { Compiler, Compilation, WebpackPluginInstance, Module } from 'webpack';
1
+ import { Compilation, Compiler, Module, WebpackPluginInstance } from "webpack";
2
+
3
+ //#region src/lib/container/HoistContainerReferencesPlugin.d.ts
2
4
  /**
3
5
  * This plugin hoists container-related modules into runtime chunks when using runtimeChunk: single configuration.
4
6
  */
5
7
  declare class HoistContainerReferences implements WebpackPluginInstance {
6
- apply(compiler: Compiler): void;
7
- private hoistModulesInChunks;
8
- private cleanUpChunks;
9
- private getRuntimeChunks;
8
+ apply(compiler: Compiler): void;
9
+ private hoistModulesInChunks;
10
+ private cleanUpChunks;
11
+ private getRuntimeChunks;
10
12
  }
11
- export declare function getAllReferencedModules(compilation: Compilation, module: Module, type?: 'all' | 'initial' | 'external'): Set<Module>;
12
- export default HoistContainerReferences;
13
+ declare function getAllReferencedModules(compilation: Compilation, module: Module, type?: 'all' | 'initial' | 'external'): Set<Module>;
14
+ //#endregion
15
+ export { HoistContainerReferences as default, getAllReferencedModules };
16
+ //# sourceMappingURL=HoistContainerReferencesPlugin.d.ts.map