@module-federation/enhanced 0.2.0-canary.4 → 0.2.0-canary.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/enhanced",
3
- "version": "0.2.0-canary.4",
3
+ "version": "0.2.0-canary.5",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -10,7 +10,12 @@ declare class AsyncEntryStartupPlugin {
10
10
  private _runtimeChunks;
11
11
  constructor(options?: Options);
12
12
  apply(compiler: Compiler): void;
13
- private collectRuntimeChunks;
14
- private handleRenderStartup;
13
+ private _collectRuntimeChunks;
14
+ private _handleRenderStartup;
15
+ private _getChunkRuntime;
16
+ private _getRemotes;
17
+ private _getShared;
18
+ private _getInitialEntryModules;
19
+ private _getTemplateString;
15
20
  }
16
21
  export default AsyncEntryStartupPlugin;
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "default", {
10
10
  });
11
11
  const _RuntimeGlobals = /*#__PURE__*/ _interop_require_default(require("webpack/lib/RuntimeGlobals"));
12
12
  const _Template = /*#__PURE__*/ _interop_require_default(require("webpack/lib/Template"));
13
+ const _SortableSet = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/SortableSet"));
13
14
  function _interop_require_default(obj) {
14
15
  return obj && obj.__esModule ? obj : {
15
16
  default: obj
@@ -18,11 +19,11 @@ function _interop_require_default(obj) {
18
19
  let AsyncEntryStartupPlugin = class AsyncEntryStartupPlugin {
19
20
  apply(compiler) {
20
21
  compiler.hooks.thisCompilation.tap('AsyncEntryStartupPlugin', (compilation)=>{
21
- this.collectRuntimeChunks(compilation);
22
- this.handleRenderStartup(compiler, compilation);
22
+ this._collectRuntimeChunks(compilation);
23
+ this._handleRenderStartup(compiler, compilation);
23
24
  });
24
25
  }
25
- collectRuntimeChunks(compilation) {
26
+ _collectRuntimeChunks(compilation) {
26
27
  compilation.hooks.beforeChunkAssets.tap('AsyncEntryStartupPlugin', ()=>{
27
28
  for (const chunk of compilation.chunks){
28
29
  if (chunk.hasRuntime() && chunk.id !== null) {
@@ -36,9 +37,9 @@ let AsyncEntryStartupPlugin = class AsyncEntryStartupPlugin {
36
37
  }
37
38
  });
38
39
  }
39
- handleRenderStartup(compiler, compilation) {
40
+ _handleRenderStartup(compiler, compilation) {
40
41
  compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation).renderStartup.tap('AsyncEntryStartupPlugin', (source, renderContext, upperContext)=>{
41
- var _compiler_options_optimization, _compiler_options, _compiler_options_experiments, _compiler_options1, _compiler_options_experiments1, _compiler_options2;
42
+ var _compiler_options_optimization, _compiler_options;
42
43
  const isSingleRuntime = (_compiler_options = compiler.options) == null ? void 0 : (_compiler_options_optimization = _compiler_options.optimization) == null ? void 0 : _compiler_options_optimization.runtimeChunk;
43
44
  if ((upperContext == null ? void 0 : upperContext.chunk.id) && isSingleRuntime) {
44
45
  if (upperContext == null ? void 0 : upperContext.chunk.hasRuntime()) {
@@ -49,26 +50,13 @@ let AsyncEntryStartupPlugin = class AsyncEntryStartupPlugin {
49
50
  if (this._options.excludeChunk && this._options.excludeChunk(upperContext.chunk)) {
50
51
  return source;
51
52
  }
52
- const runtime = new Set();
53
- if (typeof upperContext.chunk.runtime === 'string' || typeof upperContext.chunk.runtime === 'number') {
54
- if (this._runtimeChunks.has(upperContext.chunk.runtime)) {
55
- runtime.add(this._runtimeChunks.get(upperContext.chunk.runtime));
56
- } else {
57
- runtime.add(upperContext.chunk);
58
- }
59
- } else if (upperContext.chunk.runtime && typeof upperContext.chunk.runtime[Symbol.iterator] === 'function') {
60
- for (const runtimeItem of upperContext.chunk.runtime){
61
- if (this._runtimeChunks.has(runtimeItem)) {
62
- runtime.add(this._runtimeChunks.get(runtimeItem));
63
- }
64
- }
65
- }
66
- if (runtime.size === 0) {
67
- runtime.add(upperContext.chunk);
68
- }
53
+ const runtime = this._getChunkRuntime(upperContext);
69
54
  let remotes = '';
70
55
  let shared = '';
71
56
  for (const runtimeItem of runtime){
57
+ if (!runtimeItem) {
58
+ continue;
59
+ }
72
60
  const requirements = compilation.chunkGraph.getTreeRuntimeRequirements(runtimeItem);
73
61
  const hasRemoteModules = compilation.chunkGraph.getChunkModulesIterableBySourceType(upperContext.chunk, 'remote');
74
62
  const consumeShares = compilation.chunkGraph.getChunkModulesIterableBySourceType(upperContext.chunk, 'consume-shared');
@@ -79,61 +67,116 @@ let AsyncEntryStartupPlugin = class AsyncEntryStartupPlugin {
79
67
  ] : [
80
68
  upperContext.chunk.id
81
69
  ];
82
- if (requirements.has(_RuntimeGlobals.default.currentRemoteGetScope) || hasRemoteModules || requirements.has('__webpack_require__.vmok')) {
83
- for (const chunkId of chunksToRef){
84
- remotes += `if(__webpack_require__.f && __webpack_require__.f.remotes) __webpack_require__.f.remotes(${JSON.stringify(chunkId)}, promiseTrack);`;
85
- }
86
- }
87
- if (requirements.has(_RuntimeGlobals.default.shareScopeMap) || requirements.has(_RuntimeGlobals.default.initializeSharing) || consumeShares) {
88
- for (const chunkId of chunksToRef){
89
- shared += `if(__webpack_require__.f && __webpack_require__.f.consumes) __webpack_require__.f.consumes(${JSON.stringify(chunkId)}, promiseTrack);`;
90
- }
91
- }
70
+ remotes = this._getRemotes(requirements, Boolean(hasRemoteModules), chunksToRef, remotes);
71
+ shared = this._getShared(requirements, Boolean(consumeShares), chunksToRef, shared);
92
72
  }
93
73
  if (!remotes && !shared) {
94
74
  return source;
95
75
  }
96
- const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(upperContext.chunk);
97
- const initialEntryModules = [];
98
- for (const entryModule of entryModules){
99
- const entryModuleID = compilation.chunkGraph.getModuleId(entryModule);
100
- if (entryModuleID) {
101
- let shouldInclude = false;
102
- if (typeof this._options.eager === 'function') {
103
- shouldInclude = this._options.eager(entryModule);
104
- } else if (this._options.eager && this._options.eager.test(entryModule.identifier())) {
105
- shouldInclude = true;
106
- }
107
- if (shouldInclude) {
108
- initialEntryModules.push(`__webpack_require__(${JSON.stringify(entryModuleID)});`);
109
- }
76
+ const initialEntryModules = this._getInitialEntryModules(compilation, upperContext);
77
+ return this._getTemplateString(compiler, initialEntryModules, shared, remotes, source);
78
+ });
79
+ }
80
+ _getChunkRuntime(upperContext) {
81
+ const runtime = new Set();
82
+ const chunkRuntime = upperContext.chunk.runtime;
83
+ if (chunkRuntime) {
84
+ const runtimeItems = chunkRuntime instanceof _SortableSet.default ? chunkRuntime : [
85
+ chunkRuntime
86
+ ];
87
+ for (const runtimeItem of runtimeItems){
88
+ const chunk = this._runtimeChunks.get(runtimeItem);
89
+ if (chunk) {
90
+ runtime.add(chunk);
110
91
  }
111
92
  }
112
- if (((_compiler_options1 = compiler.options) == null ? void 0 : (_compiler_options_experiments = _compiler_options1.experiments) == null ? void 0 : _compiler_options_experiments.topLevelAwait) && ((_compiler_options2 = compiler.options) == null ? void 0 : (_compiler_options_experiments1 = _compiler_options2.experiments) == null ? void 0 : _compiler_options_experiments1.outputModule)) {
113
- return _Template.default.asString([
114
- 'var promiseTrack = [];',
115
- _Template.default.asString(initialEntryModules),
116
- shared,
117
- remotes,
118
- 'await Promise.all(promiseTrack)',
119
- _Template.default.indent(source.source())
120
- ]);
93
+ }
94
+ if (runtime.size === 0) {
95
+ runtime.add(upperContext.chunk);
96
+ }
97
+ return runtime;
98
+ }
99
+ _getRemotes(requirements, hasRemoteModules, chunksToRef, remotes) {
100
+ if (!requirements.has(_RuntimeGlobals.default.currentRemoteGetScope) && !hasRemoteModules && !requirements.has('__webpack_require__.vmok')) {
101
+ return remotes;
102
+ }
103
+ const remotesParts = remotes.startsWith('if(__webpack_require__.f && __webpack_require__.f.remotes) {') ? [
104
+ remotes
105
+ ] : [
106
+ remotes,
107
+ 'if(__webpack_require__.f && __webpack_require__.f.remotes) {'
108
+ ];
109
+ for (const chunkId of chunksToRef){
110
+ if (chunkId !== null) {
111
+ remotesParts.push(` __webpack_require__.f.remotes(${JSON.stringify(chunkId)}, promiseTrack);`);
112
+ }
113
+ }
114
+ remotesParts.push('}');
115
+ return remotesParts.join('');
116
+ }
117
+ _getShared(requirements, consumeShares, chunksToRef, shared) {
118
+ if (!requirements.has(_RuntimeGlobals.default.shareScopeMap) && !consumeShares && !requirements.has(_RuntimeGlobals.default.initializeSharing)) {
119
+ return shared;
120
+ }
121
+ const sharedParts = shared.startsWith('if(__webpack_require__.f && __webpack_require__.f.consumes) {') ? [
122
+ shared
123
+ ] : [
124
+ shared,
125
+ 'if(__webpack_require__.f && __webpack_require__.f.consumes) {'
126
+ ];
127
+ for (const chunkId of chunksToRef){
128
+ if (chunkId !== null) {
129
+ sharedParts.push(` __webpack_require__.f.consumes(${JSON.stringify(chunkId)}, promiseTrack);`);
130
+ }
131
+ }
132
+ sharedParts.push('}');
133
+ return sharedParts.join('');
134
+ }
135
+ _getInitialEntryModules(compilation, upperContext) {
136
+ const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(upperContext.chunk);
137
+ const initialEntryModules = [];
138
+ for (const entryModule of entryModules){
139
+ const entryModuleID = compilation.chunkGraph.getModuleId(entryModule);
140
+ if (entryModuleID) {
141
+ let shouldInclude = false;
142
+ if (typeof this._options.eager === 'function') {
143
+ shouldInclude = this._options.eager(entryModule);
144
+ } else if (this._options.eager && this._options.eager.test(entryModule.identifier())) {
145
+ shouldInclude = true;
146
+ }
147
+ if (shouldInclude) {
148
+ initialEntryModules.push(`__webpack_require__(${JSON.stringify(entryModuleID)});`);
149
+ }
121
150
  }
151
+ }
152
+ return initialEntryModules;
153
+ }
154
+ _getTemplateString(compiler, initialEntryModules, shared, remotes, source) {
155
+ var _compiler_options_experiments, _compiler_options, _compiler_options_experiments1, _compiler_options1;
156
+ if (((_compiler_options = compiler.options) == null ? void 0 : (_compiler_options_experiments = _compiler_options.experiments) == null ? void 0 : _compiler_options_experiments.topLevelAwait) && ((_compiler_options1 = compiler.options) == null ? void 0 : (_compiler_options_experiments1 = _compiler_options1.experiments) == null ? void 0 : _compiler_options_experiments1.outputModule)) {
122
157
  return _Template.default.asString([
123
158
  'var promiseTrack = [];',
124
159
  _Template.default.asString(initialEntryModules),
125
160
  shared,
126
161
  remotes,
127
- 'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',
128
- _Template.default.indent(source.source()),
129
- _Template.default.indent('return __webpack_exports__'),
130
- '});'
162
+ 'await Promise.all(promiseTrack)',
163
+ _Template.default.indent(source.source())
131
164
  ]);
132
- });
165
+ }
166
+ return _Template.default.asString([
167
+ 'var promiseTrack = [];',
168
+ _Template.default.asString(initialEntryModules),
169
+ shared,
170
+ remotes,
171
+ 'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',
172
+ _Template.default.indent(source.source()),
173
+ _Template.default.indent('return __webpack_exports__'),
174
+ '});'
175
+ ]);
133
176
  }
134
177
  constructor(options){
135
- this._options = options || {};
136
178
  this._runtimeChunks = new Map();
179
+ this._options = options || {};
137
180
  }
138
181
  };
139
182
  const _default = AsyncEntryStartupPlugin;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/AsyncBoundaryPlugin.ts"],"sourcesContent":["import Compiler from 'webpack/lib/Compiler';\nimport Compilation from 'webpack/lib/Compilation';\nimport Chunk from 'webpack/lib/Chunk';\nimport RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport Template from 'webpack/lib/Template';\nimport Module from 'webpack/lib/Module';\n\ninterface Options {\n eager?: RegExp | ((module: Module) => boolean);\n excludeChunk?: (chunk: Chunk) => boolean;\n}\n\nclass AsyncEntryStartupPlugin {\n private _options: Options;\n private _runtimeChunks: Map<string | number, Chunk>;\n\n constructor(options?: Options) {\n this._options = options || {};\n this._runtimeChunks = new Map<string | number, Chunk>();\n }\n\n apply(compiler: Compiler): void {\n compiler.hooks.thisCompilation.tap(\n 'AsyncEntryStartupPlugin',\n (compilation: Compilation) => {\n this.collectRuntimeChunks(compilation);\n this.handleRenderStartup(compiler, compilation);\n },\n );\n }\n\n private collectRuntimeChunks(compilation: Compilation): void {\n compilation.hooks.beforeChunkAssets.tap('AsyncEntryStartupPlugin', () => {\n for (const chunk of compilation.chunks) {\n if (chunk.hasRuntime() && chunk.id !== null) {\n this._runtimeChunks.set(chunk.id, chunk);\n for (const dependentChunk of compilation.chunkGraph.getChunkEntryDependentChunksIterable(\n chunk,\n )) {\n if (dependentChunk.id !== null) {\n this._runtimeChunks.set(dependentChunk.id, dependentChunk);\n }\n }\n }\n }\n });\n }\n\n private handleRenderStartup(\n compiler: Compiler,\n compilation: Compilation,\n ): void {\n compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(\n compilation,\n ).renderStartup.tap(\n 'AsyncEntryStartupPlugin',\n (source: any, renderContext: Module, upperContext: { chunk: Chunk }) => {\n const isSingleRuntime = compiler.options?.optimization?.runtimeChunk;\n if (upperContext?.chunk.id && isSingleRuntime) {\n if (upperContext?.chunk.hasRuntime()) {\n this._runtimeChunks.set(upperContext.chunk.id, upperContext.chunk);\n return source;\n }\n }\n\n if (\n this._options.excludeChunk &&\n this._options.excludeChunk(upperContext.chunk)\n ) {\n return source;\n }\n\n const runtime = new Set();\n if (\n typeof upperContext.chunk.runtime === 'string' ||\n typeof upperContext.chunk.runtime === 'number'\n ) {\n if (this._runtimeChunks.has(upperContext.chunk.runtime)) {\n runtime.add(this._runtimeChunks.get(upperContext.chunk.runtime));\n } else {\n runtime.add(upperContext.chunk);\n }\n } else if (\n upperContext.chunk.runtime &&\n typeof upperContext.chunk.runtime[Symbol.iterator] === 'function'\n ) {\n for (const runtimeItem of upperContext.chunk.runtime) {\n if (this._runtimeChunks.has(runtimeItem)) {\n runtime.add(this._runtimeChunks.get(runtimeItem));\n }\n }\n }\n if (runtime.size === 0) {\n runtime.add(upperContext.chunk);\n }\n\n let remotes = '';\n let shared = '';\n\n for (const runtimeItem of runtime) {\n const requirements =\n compilation.chunkGraph.getTreeRuntimeRequirements(\n runtimeItem as Chunk,\n );\n\n const hasRemoteModules =\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n upperContext.chunk,\n 'remote',\n );\n\n const consumeShares =\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n upperContext.chunk,\n 'consume-shared',\n );\n\n const entryOptions = upperContext.chunk.getEntryOptions();\n const chunksToRef = entryOptions?.dependOn\n ? [...entryOptions.dependOn, upperContext.chunk.id]\n : [upperContext.chunk.id];\n\n if (\n requirements.has(RuntimeGlobals.currentRemoteGetScope) ||\n hasRemoteModules ||\n requirements.has('__webpack_require__.vmok')\n ) {\n for (const chunkId of chunksToRef) {\n remotes += `if(__webpack_require__.f && __webpack_require__.f.remotes) __webpack_require__.f.remotes(${JSON.stringify(\n chunkId,\n )}, promiseTrack);`;\n }\n }\n\n if (\n requirements.has(RuntimeGlobals.shareScopeMap) ||\n requirements.has(RuntimeGlobals.initializeSharing) ||\n consumeShares\n ) {\n for (const chunkId of chunksToRef) {\n shared += `if(__webpack_require__.f && __webpack_require__.f.consumes) __webpack_require__.f.consumes(${JSON.stringify(\n chunkId,\n )}, promiseTrack);`;\n }\n }\n }\n\n if (!remotes && !shared) {\n return source;\n }\n\n const entryModules =\n compilation.chunkGraph.getChunkEntryModulesIterable(\n upperContext.chunk,\n );\n\n const initialEntryModules = [];\n\n for (const entryModule of entryModules) {\n const entryModuleID = compilation.chunkGraph.getModuleId(entryModule);\n if (entryModuleID) {\n let shouldInclude = false;\n\n if (typeof this._options.eager === 'function') {\n shouldInclude = this._options.eager(entryModule);\n } else if (\n this._options.eager &&\n this._options.eager.test(entryModule.identifier())\n ) {\n shouldInclude = true;\n }\n\n if (shouldInclude) {\n initialEntryModules.push(\n `__webpack_require__(${JSON.stringify(entryModuleID)});`,\n );\n }\n }\n }\n if (\n compiler.options?.experiments?.topLevelAwait &&\n compiler.options?.experiments?.outputModule\n ) {\n return Template.asString([\n 'var promiseTrack = [];',\n Template.asString(initialEntryModules),\n shared,\n remotes,\n 'await Promise.all(promiseTrack)',\n Template.indent(source.source()),\n ]);\n }\n return Template.asString([\n 'var promiseTrack = [];',\n Template.asString(initialEntryModules),\n shared,\n remotes,\n 'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',\n Template.indent(source.source()),\n Template.indent('return __webpack_exports__'),\n '});',\n ]);\n },\n );\n }\n}\n\nexport default AsyncEntryStartupPlugin;\n"],"names":["AsyncEntryStartupPlugin","apply","compiler","hooks","thisCompilation","tap","compilation","collectRuntimeChunks","handleRenderStartup","beforeChunkAssets","chunk","chunks","hasRuntime","id","_runtimeChunks","set","dependentChunk","chunkGraph","getChunkEntryDependentChunksIterable","webpack","javascript","JavascriptModulesPlugin","getCompilationHooks","renderStartup","source","renderContext","upperContext","isSingleRuntime","options","optimization","runtimeChunk","_options","excludeChunk","runtime","Set","has","add","get","Symbol","iterator","runtimeItem","size","remotes","shared","requirements","getTreeRuntimeRequirements","hasRemoteModules","getChunkModulesIterableBySourceType","consumeShares","entryOptions","getEntryOptions","chunksToRef","dependOn","RuntimeGlobals","currentRemoteGetScope","chunkId","JSON","stringify","shareScopeMap","initializeSharing","entryModules","getChunkEntryModulesIterable","initialEntryModules","entryModule","entryModuleID","getModuleId","shouldInclude","eager","test","identifier","push","experiments","topLevelAwait","outputModule","Template","asString","indent","constructor","Map"],"mappings":";;;;+BA+MA;;;eAAA;;;uEA5M2B;iEACN;;;;;;AAQrB,IAAA,AAAMA,0BAAN,MAAMA;IASJC,MAAMC,QAAkB,EAAQ;QAC9BA,SAASC,KAAK,CAACC,eAAe,CAACC,GAAG,CAChC,2BACA,CAACC;YACC,IAAI,CAACC,oBAAoB,CAACD;YAC1B,IAAI,CAACE,mBAAmB,CAACN,UAAUI;QACrC;IAEJ;IAEQC,qBAAqBD,WAAwB,EAAQ;QAC3DA,YAAYH,KAAK,CAACM,iBAAiB,CAACJ,GAAG,CAAC,2BAA2B;YACjE,KAAK,MAAMK,SAASJ,YAAYK,MAAM,CAAE;gBACtC,IAAID,MAAME,UAAU,MAAMF,MAAMG,EAAE,KAAK,MAAM;o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ACAD,iBAAQ,CAACC,QAAQ,CAACb;oBAClBnB;oBACAD;oBACA;oBACAgC,iBAAQ,CAACE,MAAM,CAACpD,OAAOA,MAAM;iBAC9B;YACH;YACA,OAAOkD,iBAAQ,CAACC,QAAQ,CAAC;gBACvB;gBACAD,iBAAQ,CAACC,QAAQ,CAACb;gBAClBnB;gBACAD;gBACA;gBACAgC,iBAAQ,CAACE,MAAM,CAACpD,OAAOA,MAAM;gBAC7BkD,iBAAQ,CAACE,MAAM,CAAC;gBAChB;aACD;QACH;IAEJ;IA5LAC,YAAYjD,OAAiB,CAAE;QAC7B,IAAI,CAACG,QAAQ,GAAGH,WAAW,CAAC;QAC5B,IAAI,CAACd,cAAc,GAAG,IAAIgE;IAC5B;AA0LF;MAEA,WAAe9E"}
1
+ {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/AsyncBoundaryPlugin.ts"],"sourcesContent":["import Compiler from 'webpack/lib/Compiler';\nimport Compilation from 'webpack/lib/Compilation';\nimport Chunk, { Source } from 'webpack/lib/Chunk';\nimport RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport Template from 'webpack/lib/Template';\nimport SortableSet from 'webpack/lib/util/SortableSet';\nimport Module from 'webpack/lib/Module';\nimport { StartupRenderContext } from 'webpack/lib/javascript/JavascriptModulesPlugin';\n\ninterface Options {\n eager?: RegExp | ((module: Module) => boolean);\n excludeChunk?: (chunk: Chunk) => boolean;\n}\n\nclass AsyncEntryStartupPlugin {\n private _options: Options;\n private _runtimeChunks = new Map<string | number, Chunk | undefined>();\n\n constructor(options?: Options) {\n this._options = options || {};\n }\n\n apply(compiler: Compiler) {\n compiler.hooks.thisCompilation.tap(\n 'AsyncEntryStartupPlugin',\n (compilation: Compilation) => {\n this._collectRuntimeChunks(compilation);\n this._handleRenderStartup(compiler, compilation);\n },\n );\n }\n\n private _collectRuntimeChunks(compilation: Compilation) {\n compilation.hooks.beforeChunkAssets.tap('AsyncEntryStartupPlugin', () => {\n for (const chunk of compilation.chunks) {\n if (chunk.hasRuntime() && chunk.id !== null) {\n this._runtimeChunks.set(chunk.id, chunk);\n for (const dependentChunk of compilation.chunkGraph.getChunkEntryDependentChunksIterable(\n chunk,\n )) {\n if (dependentChunk.id !== null) {\n this._runtimeChunks.set(dependentChunk.id, dependentChunk);\n }\n }\n }\n }\n });\n }\n\n private _handleRenderStartup(compiler: Compiler, compilation: Compilation) {\n compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(\n compilation,\n ).renderStartup.tap(\n 'AsyncEntryStartupPlugin',\n (\n source: Source,\n renderContext: Module,\n upperContext: StartupRenderContext,\n ) => {\n const isSingleRuntime = compiler.options?.optimization?.runtimeChunk;\n if (upperContext?.chunk.id && isSingleRuntime) {\n if (upperContext?.chunk.hasRuntime()) {\n this._runtimeChunks.set(upperContext.chunk.id, upperContext.chunk);\n return source;\n }\n }\n\n if (\n this._options.excludeChunk &&\n this._options.excludeChunk(upperContext.chunk)\n ) {\n return source;\n }\n\n const runtime = this._getChunkRuntime(upperContext);\n\n let remotes = '';\n let shared = '';\n\n for (const runtimeItem of runtime) {\n if (!runtimeItem) {\n continue;\n }\n const requirements =\n compilation.chunkGraph.getTreeRuntimeRequirements(runtimeItem);\n const hasRemoteModules =\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n upperContext.chunk,\n 'remote',\n );\n const consumeShares =\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n upperContext.chunk,\n 'consume-shared',\n );\n const entryOptions = upperContext.chunk.getEntryOptions();\n const chunksToRef = entryOptions?.dependOn\n ? [...entryOptions.dependOn, upperContext.chunk.id]\n : [upperContext.chunk.id];\n\n remotes = this._getRemotes(\n requirements,\n Boolean(hasRemoteModules),\n chunksToRef,\n remotes,\n );\n shared = this._getShared(\n requirements,\n Boolean(consumeShares),\n chunksToRef,\n shared,\n );\n }\n\n if (!remotes && !shared) {\n return source;\n }\n\n const initialEntryModules = this._getInitialEntryModules(\n compilation,\n upperContext,\n );\n return this._getTemplateString(\n compiler,\n initialEntryModules,\n shared,\n remotes,\n source,\n );\n },\n );\n }\n\n private _getChunkRuntime(upperContext: StartupRenderContext) {\n const runtime = new Set<Chunk>();\n const chunkRuntime = upperContext.chunk.runtime;\n if (chunkRuntime) {\n const runtimeItems =\n chunkRuntime instanceof SortableSet ? chunkRuntime : [chunkRuntime];\n for (const runtimeItem of runtimeItems) {\n const chunk = this._runtimeChunks.get(runtimeItem);\n if (chunk) {\n runtime.add(chunk);\n }\n }\n }\n if (runtime.size === 0) {\n runtime.add(upperContext.chunk);\n }\n return runtime;\n }\n private _getRemotes(\n requirements: ReadonlySet<string>,\n hasRemoteModules: boolean,\n chunksToRef: (Chunk.ChunkId | null)[],\n remotes: string,\n ): string {\n if (\n !requirements.has(RuntimeGlobals.currentRemoteGetScope) &&\n !hasRemoteModules &&\n !requirements.has('__webpack_require__.vmok')\n ) {\n return remotes;\n }\n\n const remotesParts = remotes.startsWith(\n 'if(__webpack_require__.f && __webpack_require__.f.remotes) {',\n )\n ? [remotes]\n : [\n remotes,\n 'if(__webpack_require__.f && __webpack_require__.f.remotes) {',\n ];\n\n for (const chunkId of chunksToRef) {\n if (chunkId !== null) {\n remotesParts.push(\n ` __webpack_require__.f.remotes(${JSON.stringify(\n chunkId,\n )}, promiseTrack);`,\n );\n }\n }\n\n remotesParts.push('}');\n return remotesParts.join('');\n }\n\n private _getShared(\n requirements: ReadonlySet<string>,\n consumeShares: boolean,\n chunksToRef: (Chunk.ChunkId | null)[],\n shared: string,\n ): string {\n if (\n !requirements.has(RuntimeGlobals.shareScopeMap) &&\n !consumeShares &&\n !requirements.has(RuntimeGlobals.initializeSharing)\n ) {\n return shared;\n }\n\n const sharedParts = shared.startsWith(\n 'if(__webpack_require__.f && __webpack_require__.f.consumes) {',\n )\n ? [shared]\n : [\n shared,\n 'if(__webpack_require__.f && __webpack_require__.f.consumes) {',\n ];\n\n for (const chunkId of chunksToRef) {\n if (chunkId !== null) {\n sharedParts.push(\n ` __webpack_require__.f.consumes(${JSON.stringify(\n chunkId,\n )}, promiseTrack);`,\n );\n }\n }\n\n sharedParts.push('}');\n return sharedParts.join('');\n }\n\n private _getInitialEntryModules(\n compilation: Compilation,\n upperContext: { chunk: Chunk },\n ): string[] {\n const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(\n upperContext.chunk,\n );\n const initialEntryModules = [];\n\n for (const entryModule of entryModules) {\n const entryModuleID = compilation.chunkGraph.getModuleId(entryModule);\n if (entryModuleID) {\n let shouldInclude = false;\n\n if (typeof this._options.eager === 'function') {\n shouldInclude = this._options.eager(entryModule);\n } else if (\n this._options.eager &&\n this._options.eager.test(entryModule.identifier())\n ) {\n shouldInclude = true;\n }\n\n if (shouldInclude) {\n initialEntryModules.push(\n `__webpack_require__(${JSON.stringify(entryModuleID)});`,\n );\n }\n }\n }\n return initialEntryModules;\n }\n\n private _getTemplateString(\n compiler: Compiler,\n initialEntryModules: string[],\n shared: string,\n remotes: string,\n source: Source,\n ) {\n if (\n compiler.options?.experiments?.topLevelAwait &&\n compiler.options?.experiments?.outputModule\n ) {\n return Template.asString([\n 'var promiseTrack = [];',\n Template.asString(initialEntryModules),\n shared,\n remotes,\n 'await Promise.all(promiseTrack)',\n Template.indent(source.source()),\n ]);\n }\n return Template.asString([\n 'var promiseTrack = [];',\n Template.asString(initialEntryModules),\n shared,\n remotes,\n 'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',\n Template.indent(source.source()),\n Template.indent('return __webpack_exports__'),\n '});',\n ]);\n }\n}\n\nexport default AsyncEntryStartupPlugin;\n"],"names":["AsyncEntryStartupPlugin","apply","compiler","hooks","thisCompilation","tap","compilation","_collectRuntimeChunks","_handleRenderStartup","beforeChunkAssets","chunk","chunks","hasRuntime","id","_runtimeChunks","set","dependentChunk","chunkGraph","getChunkEntryDependentChunksIterable","webpack","javascript","JavascriptModulesPlugin","getCompilationHooks","renderStartup","source","renderContext","upperContext","isSingleRuntime","options","optimization","runtimeChunk","_options","excludeChunk","runtime","_getChunkRuntime","remotes","shared","runtimeItem","requirements","getTreeRuntimeRequirements","hasRemoteModules","getChunkModulesIterableBySourceType","consumeShares","entryOptions","getEntryOptions","chunksToRef","dependOn","_getRemotes","Boolean","_getShared","initialEntryModules","_getInitialEntryModules","_getTemplateString","Set","chunkRuntime","runtimeItems","SortableSet","get","add","size","has","RuntimeGlobals","currentRemoteGetScope","remotesParts","startsWith","chunkId","push","JSON","stringify","join","shareScopeMap","initializeSharing","sharedParts","entryModules","getChunkEntryModulesIterable","entryModule","entryModuleID","getModuleId","shouldInclude","eager","test","identifier","experiments","topLevelAwait","outputModule","Template","asString","indent","constructor","Map"],"mappings":";;;;+BAmSA;;;eAAA;;;uEAhS2B;iEACN;oEACG;;;;;;AASxB,IAAA,AAAMA,0BAAN,MAAMA;IAQJC,MAAMC,QAAkB,EAAE;QACxBA,SAASC,KAAK,CAACC,eAAe,CAACC,GAAG,CAChC,2BACA,CAACC;YACC,IAAI,CAACC,qBAAqB,CAACD;YAC3B,IAAI,CAACE,oBAAoB,CAACN,UAAUI;QACtC;IAEJ;IAEQC,sBAAsBD,WAAwB,EAAE;QACtDA,YAAYH,KAAK,CAACM,iBAAiB,CAACJ,GAAG,CAAC,2BAA2B;YACjE,KAAK,MAAMK,SAASJ,YAAYK,MAAM,CAAE;gBACtC,IAAID,MAAME,UAAU,MAAMF,MAAMG,EAAE,KAAK,MAAM;oBAC3C,IAAI,CAACC,cAAc,CAACC,GAAG,CAACL,MAAMG,EAAE,EAAEH;oBAClC,KAAK,MAAMM,kBAAkBV,YAAYW,UAAU,CAACC,oCAAoC,CACtFR,OACC;wBACD,IAAIM,eAAeH,EAAE,KAAK,MAAM;4BAC9B,IAAI,CAACC,cAAc,CAACC,GAAG,CAACC,eAAeH,EAAE,EAAEG;wBAC7C;oBACF;gBACF;YACF;QACF;IACF;IAEQR,qBAAqBN,QAAkB,EAAEI,WAAwB,EAAE;QACzEJ,SAASiB,OAAO,CAACC,UAAU,CAACC,uBAAuB,CAACC,mBAAm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