webpack 5.86.0 → 5.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/README.md +5 -2
- package/lib/APIPlugin.js +1 -1
- package/lib/AsyncDependenciesBlock.js +3 -3
- package/lib/CaseSensitiveModulesWarning.js +3 -1
- package/lib/ChunkGraph.js +4 -4
- package/lib/ChunkGroup.js +10 -3
- package/lib/CompatibilityPlugin.js +50 -30
- package/lib/Compilation.js +2 -1
- package/lib/Compiler.js +3 -1
- package/lib/ConcatenationScope.js +2 -2
- package/lib/ConditionalInitFragment.js +11 -1
- package/lib/ConstPlugin.js +57 -29
- package/lib/ContextModule.js +4 -1
- package/lib/ContextReplacementPlugin.js +13 -0
- package/lib/DelegatedModule.js +15 -3
- package/lib/DelegatedModuleFactoryPlugin.js +6 -0
- package/lib/Dependency.js +11 -5
- package/lib/DllEntryPlugin.js +11 -1
- package/lib/DllReferencePlugin.js +13 -1
- package/lib/Entrypoint.js +1 -1
- package/lib/ErrorHelpers.js +1 -0
- package/lib/EvalSourceMapDevToolPlugin.js +4 -0
- package/lib/ExportsInfo.js +17 -3
- package/lib/ExportsInfoApiPlugin.js +14 -5
- package/lib/ExternalModule.js +5 -0
- package/lib/FlagAllModulesAsUsedPlugin.js +6 -1
- package/lib/FlagDependencyUsagePlugin.js +3 -1
- package/lib/FlagEntryExportAsUsedPlugin.js +4 -0
- package/lib/HotModuleReplacementPlugin.js +8 -0
- package/lib/InitFragment.js +28 -5
- package/lib/JavascriptMetaInfoPlugin.js +11 -6
- package/lib/LibManifestPlugin.js +20 -4
- package/lib/Module.js +7 -2
- package/lib/ModuleDependencyError.js +4 -2
- package/lib/ModuleDependencyWarning.js +4 -2
- package/lib/ModuleGraph.js +31 -24
- package/lib/ModuleGraphConnection.js +19 -6
- package/lib/ModuleInfoHeaderPlugin.js +9 -2
- package/lib/ModuleNotFoundError.js +5 -2
- package/lib/ModuleProfile.js +1 -0
- package/lib/ModuleRestoreError.js +2 -0
- package/lib/ModuleStoreError.js +2 -1
- package/lib/ModuleTypeConstants.js +7 -0
- package/lib/MultiWatching.js +4 -0
- package/lib/NodeStuffPlugin.js +32 -6
- package/lib/ProvidePlugin.js +13 -4
- package/lib/RawModule.js +3 -1
- package/lib/RequireJsStuffPlugin.js +7 -0
- package/lib/RuntimeGlobals.js +5 -0
- package/lib/RuntimeModule.js +3 -3
- package/lib/RuntimePlugin.js +6 -3
- package/lib/RuntimeTemplate.js +22 -4
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
- package/lib/SourceMapDevToolPlugin.js +7 -2
- package/lib/UseStrictPlugin.js +10 -3
- package/lib/WebpackError.js +6 -5
- package/lib/WebpackIsIncludedPlugin.js +6 -4
- package/lib/WebpackOptionsApply.js +1 -1
- package/lib/WebpackOptionsDefaulter.js +10 -3
- package/lib/asset/AssetGenerator.js +2 -1
- package/lib/asset/AssetParser.js +11 -6
- package/lib/asset/AssetSourceParser.js +8 -3
- package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -0
- package/lib/cache/IdleFileCachePlugin.js +2 -1
- package/lib/cache/PackFileCacheStrategy.js +35 -14
- package/lib/config/browserslistTargetHandler.js +7 -7
- package/lib/config/defaults.js +43 -26
- package/lib/container/RemoteRuntimeModule.js +1 -1
- package/lib/css/CssLoadingRuntimeModule.js +30 -13
- package/lib/css/CssModulesPlugin.js +5 -2
- package/lib/css/CssParser.js +22 -0
- package/lib/dependencies/AMDDefineDependency.js +34 -4
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +5 -0
- package/lib/dependencies/AMDRuntimeModules.js +2 -2
- package/lib/dependencies/CommonJsExportsParserPlugin.js +14 -4
- package/lib/dependencies/CommonJsImportsParserPlugin.js +169 -59
- package/lib/dependencies/CommonJsPlugin.js +13 -8
- package/lib/dependencies/CommonJsRequireContextDependency.js +2 -2
- package/lib/dependencies/ConstDependency.js +2 -2
- package/lib/dependencies/ContextDependency.js +7 -2
- package/lib/dependencies/CssImportDependency.js +1 -1
- package/lib/dependencies/CssLocalIdentifierDependency.js +5 -0
- package/lib/dependencies/CssUrlDependency.js +3 -3
- package/lib/dependencies/DllEntryDependency.js +5 -0
- package/lib/dependencies/DynamicExports.js +10 -6
- package/lib/dependencies/ExportsInfoDependency.js +14 -4
- package/lib/dependencies/HarmonyCompatibilityDependency.js +2 -1
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +3 -1
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +12 -5
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +4 -4
- package/lib/dependencies/HarmonyExports.js +9 -5
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +32 -17
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +1 -2
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +19 -9
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
- package/lib/dependencies/ImportDependency.js +5 -3
- package/lib/dependencies/ImportEagerDependency.js +5 -3
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +19 -0
- package/lib/dependencies/ImportMetaPlugin.js +31 -15
- package/lib/dependencies/ImportParserPlugin.js +62 -25
- package/lib/dependencies/ImportWeakDependency.js +5 -3
- package/lib/dependencies/ModuleDependency.js +1 -1
- package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
- package/lib/dependencies/ProvidedDependency.js +4 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +13 -5
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +5 -2
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +6 -1
- package/lib/dependencies/RequireHeaderDependency.js +4 -0
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +26 -5
- package/lib/dependencies/RequireResolveHeaderDependency.js +9 -0
- package/lib/dependencies/SystemPlugin.js +17 -5
- package/lib/dependencies/SystemRuntimeModule.js +1 -1
- package/lib/dependencies/URLDependency.js +2 -2
- package/lib/dependencies/URLPlugin.js +9 -4
- package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +59 -22
- package/lib/esm/ExportWebpackRequireRuntimeModule.js +1 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
- package/lib/ids/HashedModuleIdsPlugin.js +1 -1
- package/lib/ids/SyncModuleIdsPlugin.js +1 -0
- package/lib/javascript/BasicEvaluatedExpression.js +23 -15
- package/lib/javascript/CommonJsChunkFormatPlugin.js +6 -2
- package/lib/javascript/JavascriptParser.js +135 -63
- package/lib/javascript/JavascriptParserHelpers.js +37 -15
- package/lib/logging/runtime.js +1 -1
- package/lib/logging/truncateArgs.js +4 -0
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +10 -6
- package/lib/node/RequireChunkLoadingRuntimeModule.js +10 -6
- package/lib/optimize/InnerGraph.js +1 -1
- package/lib/optimize/InnerGraphPlugin.js +2 -1
- package/lib/performance/SizeLimitsPlugin.js +7 -4
- package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +6 -3
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -2
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +4 -2
- package/lib/rules/BasicEffectRulePlugin.js +4 -0
- package/lib/rules/BasicMatcherRulePlugin.js +5 -0
- package/lib/rules/RuleSetCompiler.js +3 -3
- package/lib/rules/UseEffectRulePlugin.js +6 -4
- package/lib/runtime/AsyncModuleRuntimeModule.js +8 -5
- package/lib/runtime/AutoPublicPathRuntimeModule.js +4 -2
- package/lib/runtime/BaseUriRuntimeModule.js +3 -3
- package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
- package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
- package/lib/runtime/CompatRuntimeModule.js +7 -2
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +5 -2
- package/lib/runtime/CreateScriptRuntimeModule.js +4 -2
- package/lib/runtime/CreateScriptUrlRuntimeModule.js +4 -2
- package/lib/runtime/DefinePropertyGettersRuntimeModule.js +5 -2
- package/lib/runtime/EnsureChunkRuntimeModule.js +15 -4
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +6 -10
- package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
- package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +4 -2
- package/lib/runtime/GlobalRuntimeModule.js +1 -1
- package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
- package/lib/runtime/LoadScriptRuntimeModule.js +64 -48
- package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
- package/lib/runtime/NonceRuntimeModule.js +1 -1
- package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
- package/lib/runtime/PublicPathRuntimeModule.js +4 -2
- package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
- package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +9 -3
- package/lib/runtime/StartupEntrypointRuntimeModule.js +3 -2
- package/lib/runtime/SystemContextRuntimeModule.js +1 -1
- package/lib/serialization/ObjectMiddleware.js +6 -3
- package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
- package/lib/sharing/ConsumeSharedRuntimeModule.js +14 -5
- package/lib/sharing/ProvideSharedDependency.js +11 -0
- package/lib/sharing/ProvideSharedModule.js +4 -0
- package/lib/sharing/ProvideSharedPlugin.js +22 -21
- package/lib/sharing/ShareRuntimeModule.js +12 -5
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/sharing/utils.js +32 -5
- package/lib/util/AsyncQueue.js +4 -2
- package/lib/util/ParallelismFactorCalculator.js +10 -0
- package/lib/util/Semaphore.js +1 -1
- package/lib/util/createHash.js +30 -9
- package/lib/util/deprecation.js +10 -3
- package/lib/util/deterministicGrouping.js +50 -11
- package/lib/util/findGraphRoots.js +4 -2
- package/lib/util/memoize.js +3 -3
- package/lib/util/processAsyncTree.js +7 -1
- package/lib/util/registerExternalSerializer.js +1 -1
- package/lib/util/runtime.js +14 -1
- package/lib/util/smartGrouping.js +1 -1
- package/lib/validateSchema.js +6 -2
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +6 -2
- package/lib/wasm-async/AsyncWebAssemblyParser.js +7 -3
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +14 -7
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +3 -1
- package/lib/wasm-sync/WebAssemblyGenerator.js +1 -0
- package/lib/wasm-sync/WebAssemblyParser.js +6 -2
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +14 -4
- package/lib/webpack.js +11 -2
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +15 -16
- package/module.d.ts +1 -0
- package/package.json +5 -4
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +39 -5
- package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
- package/schemas/plugins/css/CssParserOptions.json +1 -1
- package/types.d.ts +519 -222
package/README.md
CHANGED
@@ -232,6 +232,7 @@ or are automatically applied via regex from your webpack configuration.
|
|
232
232
|
| <a href="https://github.com/webpack-contrib/polymer-webpack-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/polymer.svg"></a> | ![polymer-npm] | ![polymer-size] | Process HTML & CSS with preprocessor of choice and `require()` Web Components like first-class modules |
|
233
233
|
| <a href="https://github.com/TheLarkInn/angular2-template-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/angular-icon-1.svg"></a> | ![angular-npm] | ![angular-size] | Loads and compiles Angular 2 Components |
|
234
234
|
| <a href="https://github.com/riot/webpack-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/riot.svg"></a> | ![riot-npm] | ![riot-size] | Riot official webpack loader |
|
235
|
+
| <a href="https://github.com/sveltejs/svelte-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/svelte-1.svg"></a> | ![svelte-npm] | ![svelte-size] | Official Svelte loader |
|
235
236
|
|
236
237
|
[vue-npm]: https://img.shields.io/npm/v/vue-loader.svg
|
237
238
|
[vue-size]: https://packagephobia.com/badge?p=vue-loader
|
@@ -241,6 +242,8 @@ or are automatically applied via regex from your webpack configuration.
|
|
241
242
|
[angular-size]: https://packagephobia.com/badge?p=angular2-template-loader
|
242
243
|
[riot-npm]: https://img.shields.io/npm/v/riot-tag-loader.svg
|
243
244
|
[riot-size]: https://packagephobia.com/badge?p=riot-tag-loader
|
245
|
+
[svelte-npm]: https://img.shields.io/npm/v/svelte-loader.svg
|
246
|
+
[svelte-size]: https://packagephobia.com/badge?p=svelte-loader
|
244
247
|
|
245
248
|
### Performance
|
246
249
|
|
@@ -714,5 +717,5 @@ src="https://static.monei.net/monei-logo.svg" height="30" alt="MONEI"></a>
|
|
714
717
|
[builds2-url]: https://dev.azure.com/webpack/webpack/_build/latest?definitionId=3
|
715
718
|
[licenses-url]: https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fwebpack%2Fwebpack?ref=badge_shield
|
716
719
|
[licenses]: https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fwebpack%2Fwebpack.svg?type=shield
|
717
|
-
[cover]: https://
|
718
|
-
[cover-url]: https://
|
720
|
+
[cover]: https://codecov.io/gh/webpack/webpack/branch/master/graph/badge.svg?token=mDP3mQJNnn
|
721
|
+
[cover-url]: https://codecov.io/gh/webpack/webpack
|
package/lib/APIPlugin.js
CHANGED
@@ -29,7 +29,7 @@ const GetFullHashRuntimeModule = require("./runtime/GetFullHashRuntimeModule");
|
|
29
29
|
/**
|
30
30
|
* @param {boolean} module true if ES module
|
31
31
|
* @param {string} importMetaName `import.meta` name
|
32
|
-
* @returns {Record<string, {expr: string, req: string[], type?: string, assign: boolean}>} replacements
|
32
|
+
* @returns {Record<string, {expr: string, req: string[] | null, type?: string, assign: boolean}>} replacements
|
33
33
|
*/
|
34
34
|
function getReplacements(module, importMetaName) {
|
35
35
|
return {
|
@@ -21,9 +21,9 @@ const makeSerializable = require("./util/makeSerializable");
|
|
21
21
|
|
22
22
|
class AsyncDependenciesBlock extends DependenciesBlock {
|
23
23
|
/**
|
24
|
-
* @param {ChunkGroupOptions & { entryOptions?: EntryOptions }} groupOptions options for the group
|
25
|
-
* @param {DependencyLocation=} loc the line of code
|
26
|
-
* @param {string=} request the request
|
24
|
+
* @param {(ChunkGroupOptions & { entryOptions?: EntryOptions }) | null} groupOptions options for the group
|
25
|
+
* @param {(DependencyLocation | null)=} loc the line of code
|
26
|
+
* @param {(string | null)=} request the request
|
27
27
|
*/
|
28
28
|
constructor(groupOptions, loc, request) {
|
29
29
|
super();
|
@@ -42,7 +42,9 @@ const createModulesListMessage = (modules, moduleGraph) => {
|
|
42
42
|
|
43
43
|
if (validReasons.length > 0) {
|
44
44
|
message += `\n Used by ${validReasons.length} module(s), i. e.`;
|
45
|
-
message += `\n ${
|
45
|
+
message += `\n ${
|
46
|
+
/** @type {Module[]} */ (validReasons)[0].identifier()
|
47
|
+
}`;
|
46
48
|
}
|
47
49
|
return message;
|
48
50
|
})
|
package/lib/ChunkGraph.js
CHANGED
@@ -188,7 +188,7 @@ class ChunkGraphModule {
|
|
188
188
|
this.entryInChunks = undefined;
|
189
189
|
/** @type {Set<Chunk> | undefined} */
|
190
190
|
this.runtimeInChunks = undefined;
|
191
|
-
/** @type {RuntimeSpecMap<ModuleHashInfo>} */
|
191
|
+
/** @type {RuntimeSpecMap<ModuleHashInfo> | undefined} */
|
192
192
|
this.hashes = undefined;
|
193
193
|
/** @type {string | number} */
|
194
194
|
this.id = null;
|
@@ -1388,7 +1388,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1388
1388
|
*/
|
1389
1389
|
hasModuleHashes(module, runtime) {
|
1390
1390
|
const cgm = this._getChunkGraphModule(module);
|
1391
|
-
const hashes = cgm.hashes;
|
1391
|
+
const hashes = /** @type {RuntimeSpecMap<ModuleHashInfo>} */ (cgm.hashes);
|
1392
1392
|
return hashes && hashes.has(runtime);
|
1393
1393
|
}
|
1394
1394
|
|
@@ -1399,7 +1399,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1399
1399
|
*/
|
1400
1400
|
getModuleHash(module, runtime) {
|
1401
1401
|
const cgm = this._getChunkGraphModule(module);
|
1402
|
-
const hashes = cgm.hashes;
|
1402
|
+
const hashes = /** @type {RuntimeSpecMap<ModuleHashInfo>} */ (cgm.hashes);
|
1403
1403
|
return this._getModuleHashInfo(module, hashes, runtime).hash;
|
1404
1404
|
}
|
1405
1405
|
|
@@ -1410,7 +1410,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1410
1410
|
*/
|
1411
1411
|
getRenderedModuleHash(module, runtime) {
|
1412
1412
|
const cgm = this._getChunkGraphModule(module);
|
1413
|
-
const hashes = cgm.hashes;
|
1413
|
+
const hashes = /** @type {RuntimeSpecMap<ModuleHashInfo>} */ (cgm.hashes);
|
1414
1414
|
return this._getModuleHashInfo(module, hashes, runtime).renderedHash;
|
1415
1415
|
}
|
1416
1416
|
|
package/lib/ChunkGroup.js
CHANGED
@@ -28,6 +28,7 @@ const {
|
|
28
28
|
* @typedef {Object} RawChunkGroupOptions
|
29
29
|
* @property {number=} preloadOrder
|
30
30
|
* @property {number=} prefetchOrder
|
31
|
+
* @property {("low" | "high" | "auto")=} fetchPriority
|
31
32
|
*/
|
32
33
|
|
33
34
|
/** @typedef {RawChunkGroupOptions & { name?: string }} ChunkGroupOptions */
|
@@ -108,9 +109,15 @@ class ChunkGroup {
|
|
108
109
|
*/
|
109
110
|
addOptions(options) {
|
110
111
|
for (const key of Object.keys(options)) {
|
111
|
-
if (
|
112
|
-
this.options[key]
|
113
|
-
|
112
|
+
if (
|
113
|
+
this.options[/** @type {keyof ChunkGroupOptions} */ (key)] === undefined
|
114
|
+
) {
|
115
|
+
this.options[key] =
|
116
|
+
options[/** @type {keyof ChunkGroupOptions} */ (key)];
|
117
|
+
} else if (
|
118
|
+
this.options[/** @type {keyof ChunkGroupOptions} */ (key)] !==
|
119
|
+
options[/** @type {keyof ChunkGroupOptions} */ (key)]
|
120
|
+
) {
|
114
121
|
if (key.endsWith("Order")) {
|
115
122
|
this.options[key] = Math.max(this.options[key], options[key]);
|
116
123
|
} else {
|
@@ -13,8 +13,11 @@ const {
|
|
13
13
|
const RuntimeGlobals = require("./RuntimeGlobals");
|
14
14
|
const ConstDependency = require("./dependencies/ConstDependency");
|
15
15
|
|
16
|
+
/** @typedef {import("estree").CallExpression} CallExpression */
|
16
17
|
/** @typedef {import("./Compiler")} Compiler */
|
18
|
+
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
|
17
19
|
/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */
|
20
|
+
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
|
18
21
|
|
19
22
|
const nestedWebpackIdentifierTag = Symbol("nested webpack identifier");
|
20
23
|
const PLUGIN_NAME = "CompatibilityPlugin";
|
@@ -43,31 +46,41 @@ class CompatibilityPlugin {
|
|
43
46
|
)
|
44
47
|
return;
|
45
48
|
|
46
|
-
parser.hooks.call.for("require").tap(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
const
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
last
|
65
|
-
|
66
|
-
|
49
|
+
parser.hooks.call.for("require").tap(
|
50
|
+
PLUGIN_NAME,
|
51
|
+
/**
|
52
|
+
* @param {CallExpression} expr call expression
|
53
|
+
* @returns {boolean | void} true when need to handle
|
54
|
+
*/
|
55
|
+
expr => {
|
56
|
+
// support for browserify style require delegator: "require(o, !0)"
|
57
|
+
if (expr.arguments.length !== 2) return;
|
58
|
+
const second = parser.evaluateExpression(expr.arguments[1]);
|
59
|
+
if (!second.isBoolean()) return;
|
60
|
+
if (second.asBool() !== true) return;
|
61
|
+
const dep = new ConstDependency(
|
62
|
+
"require",
|
63
|
+
/** @type {Range} */ (expr.callee.range)
|
64
|
+
);
|
65
|
+
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
66
|
+
if (parser.state.current.dependencies.length > 0) {
|
67
|
+
const last =
|
68
|
+
parser.state.current.dependencies[
|
69
|
+
parser.state.current.dependencies.length - 1
|
70
|
+
];
|
71
|
+
if (
|
72
|
+
last.critical &&
|
73
|
+
last.options &&
|
74
|
+
last.options.request === "." &&
|
75
|
+
last.userRequest === "." &&
|
76
|
+
last.options.recursive
|
77
|
+
)
|
78
|
+
parser.state.current.dependencies.pop();
|
79
|
+
}
|
80
|
+
parser.state.module.addPresentationalDependency(dep);
|
81
|
+
return true;
|
67
82
|
}
|
68
|
-
|
69
|
-
return true;
|
70
|
-
});
|
83
|
+
);
|
71
84
|
});
|
72
85
|
|
73
86
|
/**
|
@@ -82,7 +95,9 @@ class CompatibilityPlugin {
|
|
82
95
|
statement.id &&
|
83
96
|
statement.id.name === RuntimeGlobals.require
|
84
97
|
) {
|
85
|
-
const newName = `__nested_webpack_require_${
|
98
|
+
const newName = `__nested_webpack_require_${
|
99
|
+
/** @type {Range} */ (statement.range)[0]
|
100
|
+
}__`;
|
86
101
|
parser.tagVariable(
|
87
102
|
statement.id.name,
|
88
103
|
nestedWebpackIdentifierTag,
|
@@ -101,7 +116,9 @@ class CompatibilityPlugin {
|
|
101
116
|
parser.hooks.pattern
|
102
117
|
.for(RuntimeGlobals.require)
|
103
118
|
.tap(PLUGIN_NAME, pattern => {
|
104
|
-
const newName = `__nested_webpack_require_${
|
119
|
+
const newName = `__nested_webpack_require_${
|
120
|
+
/** @type {Range} */ (pattern.range)[0]
|
121
|
+
}__`;
|
105
122
|
parser.tagVariable(pattern.name, nestedWebpackIdentifierTag, {
|
106
123
|
name: newName,
|
107
124
|
declaration: {
|
@@ -135,8 +152,11 @@ class CompatibilityPlugin {
|
|
135
152
|
parser.state.module.addPresentationalDependency(dep);
|
136
153
|
declaration.updated = true;
|
137
154
|
}
|
138
|
-
const dep = new ConstDependency(
|
139
|
-
|
155
|
+
const dep = new ConstDependency(
|
156
|
+
name,
|
157
|
+
/** @type {Range} */ (expr.range)
|
158
|
+
);
|
159
|
+
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
140
160
|
parser.state.module.addPresentationalDependency(dep);
|
141
161
|
return true;
|
142
162
|
});
|
@@ -145,11 +165,11 @@ class CompatibilityPlugin {
|
|
145
165
|
parser.hooks.program.tap(PLUGIN_NAME, (program, comments) => {
|
146
166
|
if (comments.length === 0) return;
|
147
167
|
const c = comments[0];
|
148
|
-
if (c.type === "Line" && c.range[0] === 0) {
|
168
|
+
if (c.type === "Line" && /** @type {Range} */ (c.range)[0] === 0) {
|
149
169
|
if (parser.state.source.slice(0, 2).toString() !== "#!") return;
|
150
170
|
// this is a hashbang comment
|
151
171
|
const dep = new ConstDependency("//", 0);
|
152
|
-
dep.loc = c.loc;
|
172
|
+
dep.loc = /** @type {DependencyLocation} */ (c.loc);
|
153
173
|
parser.state.module.addPresentationalDependency(dep);
|
154
174
|
}
|
155
175
|
});
|
package/lib/Compilation.js
CHANGED
@@ -3208,6 +3208,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
3208
3208
|
const { chunkGraph, moduleGraph, dependencyTemplates, runtimeTemplate } =
|
3209
3209
|
this;
|
3210
3210
|
const results = this.codeGenerationResults;
|
3211
|
+
/** @type {WebpackError[]} */
|
3211
3212
|
const errors = [];
|
3212
3213
|
/** @type {Set<Module> | undefined} */
|
3213
3214
|
let notCodeGeneratedModules = undefined;
|
@@ -3303,7 +3304,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
3303
3304
|
* @param {RuntimeTemplate} runtimeTemplate runtimeTemplate
|
3304
3305
|
* @param {WebpackError[]} errors errors
|
3305
3306
|
* @param {CodeGenerationResults} results results
|
3306
|
-
* @param {function(WebpackError=, boolean=): void} callback callback
|
3307
|
+
* @param {function((WebpackError | null)=, boolean=): void} callback callback
|
3307
3308
|
*/
|
3308
3309
|
_codeGenerationModule(
|
3309
3310
|
module,
|
package/lib/Compiler.js
CHANGED
@@ -1073,7 +1073,9 @@ ${other}`);
|
|
1073
1073
|
childCompiler.root = this.root;
|
1074
1074
|
if (Array.isArray(plugins)) {
|
1075
1075
|
for (const plugin of plugins) {
|
1076
|
-
plugin
|
1076
|
+
if (plugin) {
|
1077
|
+
plugin.apply(childCompiler);
|
1078
|
+
}
|
1077
1079
|
}
|
1078
1080
|
}
|
1079
1081
|
for (const name in this.hooks) {
|
@@ -108,7 +108,7 @@ class ConcatenationScope {
|
|
108
108
|
module,
|
109
109
|
{ ids = undefined, call = false, directImport = false, asiSafe = false }
|
110
110
|
) {
|
111
|
-
const info = this._modulesMap.get(module);
|
111
|
+
const info = /** @type {ModuleInfo} */ (this._modulesMap.get(module));
|
112
112
|
const callFlag = call ? "_call" : "";
|
113
113
|
const directImportFlag = directImport ? "_directImport" : "";
|
114
114
|
const asiSafeFlag = asiSafe
|
@@ -133,7 +133,7 @@ class ConcatenationScope {
|
|
133
133
|
|
134
134
|
/**
|
135
135
|
* @param {string} name the identifier
|
136
|
-
* @returns {ModuleReferenceOptions & { index: number }} parsed options and index
|
136
|
+
* @returns {ModuleReferenceOptions & { index: number } | null} parsed options and index
|
137
137
|
*/
|
138
138
|
static matchModuleReference(name) {
|
139
139
|
const match = MODULE_REFERENCE_REGEXP.exec(name);
|
@@ -14,6 +14,11 @@ const { mergeRuntime } = require("./util/runtime");
|
|
14
14
|
/** @typedef {import("./Generator").GenerateContext} GenerateContext */
|
15
15
|
/** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
|
16
16
|
|
17
|
+
/**
|
18
|
+
* @param {string} condition condition
|
19
|
+
* @param {string | Source} source source
|
20
|
+
* @returns {string | Source} wrapped source
|
21
|
+
*/
|
17
22
|
const wrapInCondition = (condition, source) => {
|
18
23
|
if (typeof source === "string") {
|
19
24
|
return Template.asString([
|
@@ -33,13 +38,14 @@ const wrapInCondition = (condition, source) => {
|
|
33
38
|
|
34
39
|
/**
|
35
40
|
* @typedef {GenerateContext} Context
|
41
|
+
* @extends {InitFragment<Context>}
|
36
42
|
*/
|
37
43
|
class ConditionalInitFragment extends InitFragment {
|
38
44
|
/**
|
39
45
|
* @param {string|Source} content the source code that will be included as initialization code
|
40
46
|
* @param {number} stage category of initialization code (contribute to order)
|
41
47
|
* @param {number} position position in the category (contribute to order)
|
42
|
-
* @param {string} key unique key to avoid emitting the same initialization code twice
|
48
|
+
* @param {string | undefined} key unique key to avoid emitting the same initialization code twice
|
43
49
|
* @param {RuntimeSpec | boolean} runtimeCondition in which runtime this fragment should be executed
|
44
50
|
* @param {string|Source=} endContent the source code that will be included at the end of the module
|
45
51
|
*/
|
@@ -89,6 +95,10 @@ class ConditionalInitFragment extends InitFragment {
|
|
89
95
|
return wrapInCondition(expr, this.endContent);
|
90
96
|
}
|
91
97
|
|
98
|
+
/**
|
99
|
+
* @param {ConditionalInitFragment} other fragment to merge with
|
100
|
+
* @returns {ConditionalInitFragment} merged fragment
|
101
|
+
*/
|
92
102
|
merge(other) {
|
93
103
|
if (this.runtimeCondition === true) return this;
|
94
104
|
if (other.runtimeCondition === true) return other;
|
package/lib/ConstPlugin.js
CHANGED
@@ -15,9 +15,14 @@ const ConstDependency = require("./dependencies/ConstDependency");
|
|
15
15
|
const { evaluateToString } = require("./javascript/JavascriptParserHelpers");
|
16
16
|
const { parseResource } = require("./util/identifier");
|
17
17
|
|
18
|
-
/** @typedef {import("estree").Expression}
|
19
|
-
/** @typedef {import("estree").
|
18
|
+
/** @typedef {import("estree").Expression} Expression */
|
19
|
+
/** @typedef {import("estree").SourceLocation} SourceLocation */
|
20
|
+
/** @typedef {import("estree").Statement} Statement */
|
21
|
+
/** @typedef {import("estree").Super} Super */
|
20
22
|
/** @typedef {import("./Compiler")} Compiler */
|
23
|
+
/** @typedef {import("./javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */
|
24
|
+
/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */
|
25
|
+
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
|
21
26
|
|
22
27
|
const collectDeclaration = (declarations, pattern) => {
|
23
28
|
const stack = [pattern];
|
@@ -136,6 +141,9 @@ class ConstPlugin {
|
|
136
141
|
new CachedConstDependency.Template()
|
137
142
|
);
|
138
143
|
|
144
|
+
/**
|
145
|
+
* @param {JavascriptParser} parser the parser
|
146
|
+
*/
|
139
147
|
const handler = parser => {
|
140
148
|
parser.hooks.statementIf.tap(PLUGIN_NAME, statement => {
|
141
149
|
if (parser.scope.isAsmJs) return;
|
@@ -143,8 +151,11 @@ class ConstPlugin {
|
|
143
151
|
const bool = param.asBool();
|
144
152
|
if (typeof bool === "boolean") {
|
145
153
|
if (!param.couldHaveSideEffects()) {
|
146
|
-
const dep = new ConstDependency(
|
147
|
-
|
154
|
+
const dep = new ConstDependency(
|
155
|
+
`${bool}`,
|
156
|
+
/** @type {Range} */ (param.range)
|
157
|
+
);
|
158
|
+
dep.loc = /** @type {SourceLocation} */ (statement.loc);
|
148
159
|
parser.state.module.addPresentationalDependency(dep);
|
149
160
|
} else {
|
150
161
|
parser.walkExpression(statement.test);
|
@@ -200,9 +211,9 @@ class ConstPlugin {
|
|
200
211
|
}
|
201
212
|
const dep = new ConstDependency(
|
202
213
|
replacement,
|
203
|
-
branchToRemove.range
|
214
|
+
/** @type {Range} */ (branchToRemove.range)
|
204
215
|
);
|
205
|
-
dep.loc = branchToRemove.loc;
|
216
|
+
dep.loc = /** @type {SourceLocation} */ (branchToRemove.loc);
|
206
217
|
parser.state.module.addPresentationalDependency(dep);
|
207
218
|
}
|
208
219
|
return bool;
|
@@ -216,8 +227,11 @@ class ConstPlugin {
|
|
216
227
|
const bool = param.asBool();
|
217
228
|
if (typeof bool === "boolean") {
|
218
229
|
if (!param.couldHaveSideEffects()) {
|
219
|
-
const dep = new ConstDependency(
|
220
|
-
|
230
|
+
const dep = new ConstDependency(
|
231
|
+
` ${bool}`,
|
232
|
+
/** @type {Range} */ (param.range)
|
233
|
+
);
|
234
|
+
dep.loc = /** @type {SourceLocation} */ (expression.loc);
|
221
235
|
parser.state.module.addPresentationalDependency(dep);
|
222
236
|
} else {
|
223
237
|
parser.walkExpression(expression.test);
|
@@ -236,8 +250,11 @@ class ConstPlugin {
|
|
236
250
|
const branchToRemove = bool
|
237
251
|
? expression.alternate
|
238
252
|
: expression.consequent;
|
239
|
-
const dep = new ConstDependency(
|
240
|
-
|
253
|
+
const dep = new ConstDependency(
|
254
|
+
"0",
|
255
|
+
/** @type {Range} */ (branchToRemove.range)
|
256
|
+
);
|
257
|
+
dep.loc = /** @type {SourceLocation} */ (branchToRemove.loc);
|
241
258
|
parser.state.module.addPresentationalDependency(dep);
|
242
259
|
return bool;
|
243
260
|
}
|
@@ -313,8 +330,11 @@ class ConstPlugin {
|
|
313
330
|
//
|
314
331
|
// returnfalse&&'foo'
|
315
332
|
//
|
316
|
-
const dep = new ConstDependency(
|
317
|
-
|
333
|
+
const dep = new ConstDependency(
|
334
|
+
` ${bool}`,
|
335
|
+
/** @type {Range} */ (param.range)
|
336
|
+
);
|
337
|
+
dep.loc = /** @type {SourceLocation} */ (expression.loc);
|
318
338
|
parser.state.module.addPresentationalDependency(dep);
|
319
339
|
} else {
|
320
340
|
parser.walkExpression(expression.left);
|
@@ -322,9 +342,9 @@ class ConstPlugin {
|
|
322
342
|
if (!keepRight) {
|
323
343
|
const dep = new ConstDependency(
|
324
344
|
"0",
|
325
|
-
expression.right.range
|
345
|
+
/** @type {Range} */ (expression.right.range)
|
326
346
|
);
|
327
|
-
dep.loc = expression.loc;
|
347
|
+
dep.loc = /** @type {SourceLocation} */ (expression.loc);
|
328
348
|
parser.state.module.addPresentationalDependency(dep);
|
329
349
|
}
|
330
350
|
return keepRight;
|
@@ -363,15 +383,18 @@ class ConstPlugin {
|
|
363
383
|
//
|
364
384
|
// returnnull??'foo'
|
365
385
|
//
|
366
|
-
const dep = new ConstDependency(
|
367
|
-
|
386
|
+
const dep = new ConstDependency(
|
387
|
+
" null",
|
388
|
+
/** @type {Range} */ (param.range)
|
389
|
+
);
|
390
|
+
dep.loc = /** @type {SourceLocation} */ (expression.loc);
|
368
391
|
parser.state.module.addPresentationalDependency(dep);
|
369
392
|
} else {
|
370
393
|
const dep = new ConstDependency(
|
371
394
|
"0",
|
372
|
-
expression.right.range
|
395
|
+
/** @type {Range} */ (expression.right.range)
|
373
396
|
);
|
374
|
-
dep.loc = expression.loc;
|
397
|
+
dep.loc = /** @type {SourceLocation} */ (expression.loc);
|
375
398
|
parser.state.module.addPresentationalDependency(dep);
|
376
399
|
parser.walkExpression(expression.left);
|
377
400
|
}
|
@@ -382,9 +405,9 @@ class ConstPlugin {
|
|
382
405
|
}
|
383
406
|
);
|
384
407
|
parser.hooks.optionalChaining.tap(PLUGIN_NAME, expr => {
|
385
|
-
/** @type {
|
408
|
+
/** @type {Expression[]} */
|
386
409
|
const optionalExpressionsStack = [];
|
387
|
-
/** @type {
|
410
|
+
/** @type {Expression | Super} */
|
388
411
|
let next = expr.expression;
|
389
412
|
|
390
413
|
while (
|
@@ -395,7 +418,7 @@ class ConstPlugin {
|
|
395
418
|
if (next.optional) {
|
396
419
|
// SuperNode can not be optional
|
397
420
|
optionalExpressionsStack.push(
|
398
|
-
/** @type {
|
421
|
+
/** @type {Expression} */ (next.object)
|
399
422
|
);
|
400
423
|
}
|
401
424
|
next = next.object;
|
@@ -403,7 +426,7 @@ class ConstPlugin {
|
|
403
426
|
if (next.optional) {
|
404
427
|
// SuperNode can not be optional
|
405
428
|
optionalExpressionsStack.push(
|
406
|
-
/** @type {
|
429
|
+
/** @type {Expression} */ (next.callee)
|
407
430
|
);
|
408
431
|
}
|
409
432
|
next = next.callee;
|
@@ -412,7 +435,9 @@ class ConstPlugin {
|
|
412
435
|
|
413
436
|
while (optionalExpressionsStack.length) {
|
414
437
|
const expression = optionalExpressionsStack.pop();
|
415
|
-
const evaluated = parser.evaluateExpression(
|
438
|
+
const evaluated = parser.evaluateExpression(
|
439
|
+
/** @type {Expression} */ (expression)
|
440
|
+
);
|
416
441
|
|
417
442
|
if (evaluated.asNullish()) {
|
418
443
|
// ------------------------------------------
|
@@ -427,8 +452,11 @@ class ConstPlugin {
|
|
427
452
|
//
|
428
453
|
// ------------------------------------------
|
429
454
|
//
|
430
|
-
const dep = new ConstDependency(
|
431
|
-
|
455
|
+
const dep = new ConstDependency(
|
456
|
+
" undefined",
|
457
|
+
/** @type {Range} */ (expr.range)
|
458
|
+
);
|
459
|
+
dep.loc = /** @type {SourceLocation} */ (expr.loc);
|
432
460
|
parser.state.module.addPresentationalDependency(dep);
|
433
461
|
return true;
|
434
462
|
}
|
@@ -452,10 +480,10 @@ class ConstPlugin {
|
|
452
480
|
JSON.stringify(
|
453
481
|
cachedParseResource(parser.state.module.resource).query
|
454
482
|
),
|
455
|
-
expr.range,
|
483
|
+
/** @type {Range} */ (expr.range),
|
456
484
|
"__resourceQuery"
|
457
485
|
);
|
458
|
-
dep.loc = expr.loc;
|
486
|
+
dep.loc = /** @type {SourceLocation} */ (expr.loc);
|
459
487
|
parser.state.module.addPresentationalDependency(dep);
|
460
488
|
return true;
|
461
489
|
});
|
@@ -478,10 +506,10 @@ class ConstPlugin {
|
|
478
506
|
JSON.stringify(
|
479
507
|
cachedParseResource(parser.state.module.resource).fragment
|
480
508
|
),
|
481
|
-
expr.range,
|
509
|
+
/** @type {Range} */ (expr.range),
|
482
510
|
"__resourceFragment"
|
483
511
|
);
|
484
|
-
dep.loc = expr.loc;
|
512
|
+
dep.loc = /** @type {SourceLocation} */ (expr.loc);
|
485
513
|
parser.state.module.addPresentationalDependency(dep);
|
486
514
|
return true;
|
487
515
|
});
|
package/lib/ContextModule.js
CHANGED
@@ -63,7 +63,7 @@ const makeSerializable = require("./util/makeSerializable");
|
|
63
63
|
* @property {RawChunkGroupOptions=} groupOptions
|
64
64
|
* @property {string=} typePrefix
|
65
65
|
* @property {string=} category
|
66
|
-
* @property {string[][]=} referencedExports exports referenced from modules (won't be mangled)
|
66
|
+
* @property {(string[][] | null)=} referencedExports exports referenced from modules (won't be mangled)
|
67
67
|
* @property {string=} layer
|
68
68
|
*/
|
69
69
|
|
@@ -231,6 +231,9 @@ class ContextModule extends Module {
|
|
231
231
|
} else if (this.options.namespaceObject) {
|
232
232
|
identifier += "|namespace object";
|
233
233
|
}
|
234
|
+
if (this.layer) {
|
235
|
+
identifier += `|layer: ${this.layer}`;
|
236
|
+
}
|
234
237
|
|
235
238
|
return identifier;
|
236
239
|
}
|
@@ -8,7 +8,15 @@
|
|
8
8
|
const ContextElementDependency = require("./dependencies/ContextElementDependency");
|
9
9
|
const { join } = require("./util/fs");
|
10
10
|
|
11
|
+
/** @typedef {import("./Compiler")} Compiler */
|
12
|
+
|
11
13
|
class ContextReplacementPlugin {
|
14
|
+
/**
|
15
|
+
* @param {RegExp} resourceRegExp A regular expression that determines which files will be selected
|
16
|
+
* @param {TODO=} newContentResource A new resource to replace the match
|
17
|
+
* @param {TODO=} newContentRecursive If true, all subdirectories are searched for matches
|
18
|
+
* @param {TODO=} newContentRegExp A regular expression that determines which files will be selected
|
19
|
+
*/
|
12
20
|
constructor(
|
13
21
|
resourceRegExp,
|
14
22
|
newContentResource,
|
@@ -49,6 +57,11 @@ class ContextReplacementPlugin {
|
|
49
57
|
}
|
50
58
|
}
|
51
59
|
|
60
|
+
/**
|
61
|
+
* Apply the plugin
|
62
|
+
* @param {Compiler} compiler the compiler instance
|
63
|
+
* @returns {void}
|
64
|
+
*/
|
52
65
|
apply(compiler) {
|
53
66
|
const resourceRegExp = this.resourceRegExp;
|
54
67
|
const newContentCallback = this.newContentCallback;
|
package/lib/DelegatedModule.js
CHANGED
@@ -42,6 +42,13 @@ const RUNTIME_REQUIREMENTS = new Set([
|
|
42
42
|
]);
|
43
43
|
|
44
44
|
class DelegatedModule extends Module {
|
45
|
+
/**
|
46
|
+
* @param {string} sourceRequest source request
|
47
|
+
* @param {TODO} data data
|
48
|
+
* @param {"require" | "object"} type type
|
49
|
+
* @param {string} userRequest user request
|
50
|
+
* @param {string | Module} originalRequest original request
|
51
|
+
*/
|
45
52
|
constructor(sourceRequest, data, type, userRequest, originalRequest) {
|
46
53
|
super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null);
|
47
54
|
|
@@ -51,7 +58,7 @@ class DelegatedModule extends Module {
|
|
51
58
|
this.delegationType = type;
|
52
59
|
this.userRequest = userRequest;
|
53
60
|
this.originalRequest = originalRequest;
|
54
|
-
/** @type {ManifestModuleData} */
|
61
|
+
/** @type {ManifestModuleData | undefined} */
|
55
62
|
this.delegateData = data;
|
56
63
|
|
57
64
|
// Build info
|
@@ -110,7 +117,8 @@ class DelegatedModule extends Module {
|
|
110
117
|
* @returns {void}
|
111
118
|
*/
|
112
119
|
build(options, compilation, resolver, fs, callback) {
|
113
|
-
|
120
|
+
const delegateData = /** @type {ManifestModuleData} */ (this.delegateData);
|
121
|
+
this.buildMeta = { ...delegateData.buildMeta };
|
114
122
|
this.buildInfo = {};
|
115
123
|
this.dependencies.length = 0;
|
116
124
|
this.delegatedSourceDependency = new DelegatedSourceDependency(
|
@@ -118,7 +126,7 @@ class DelegatedModule extends Module {
|
|
118
126
|
);
|
119
127
|
this.addDependency(this.delegatedSourceDependency);
|
120
128
|
this.addDependency(
|
121
|
-
new StaticExportsDependency(
|
129
|
+
new StaticExportsDependency(delegateData.exports || true, false)
|
122
130
|
);
|
123
131
|
callback();
|
124
132
|
}
|
@@ -202,6 +210,10 @@ class DelegatedModule extends Module {
|
|
202
210
|
super.serialize(context);
|
203
211
|
}
|
204
212
|
|
213
|
+
/**
|
214
|
+
* @param {ObjectDeserializerContext} context context\
|
215
|
+
* @returns {DelegatedModule} DelegatedModule
|
216
|
+
*/
|
205
217
|
static deserialize(context) {
|
206
218
|
const { read } = context;
|
207
219
|
const obj = new DelegatedModule(
|