webpack 5.112.0 → 5.112.2

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 (263) hide show
  1. package/bin/webpack.js +13 -7
  2. package/lib/Compilation.js +198 -61
  3. package/lib/Compiler.js +12 -25
  4. package/lib/asset/AssetBytesGenerator.js +14 -6
  5. package/lib/asset/AssetBytesParser.js +10 -8
  6. package/lib/asset/AssetGenerator.js +36 -48
  7. package/lib/asset/AssetModule.js +11 -0
  8. package/lib/asset/AssetModulesPlugin.js +5 -4
  9. package/lib/asset/AssetParser.js +8 -8
  10. package/lib/asset/AssetSourceGenerator.js +16 -8
  11. package/lib/asset/AssetSourceParser.js +10 -8
  12. package/lib/asset/WebManifestGenerator.js +11 -6
  13. package/lib/asset/WebManifestParser.js +3 -3
  14. package/lib/async-modules/AsyncModuleHelpers.js +8 -2
  15. package/lib/async-modules/InferAsyncModulesPlugin.js +7 -2
  16. package/lib/cache/CacheFacade.js +1 -1
  17. package/lib/cache/PackFileCacheStrategy.js +6 -10
  18. package/lib/cache/ResolverCachePlugin.js +58 -8
  19. package/lib/config/WebpackOptionsApply.js +8 -28
  20. package/lib/config/cli.js +9 -6
  21. package/lib/config/defaults.js +24 -13
  22. package/lib/config/getClaimedAssetTypes.js +2 -2
  23. package/lib/config/target.js +1 -1
  24. package/lib/context/ContextModule.js +1 -1
  25. package/lib/context/ContextModuleFactory.js +1 -1
  26. package/lib/context/ContextReplacementPlugin.js +3 -9
  27. package/lib/css/CssGenerator.js +40 -47
  28. package/lib/css/CssModule.js +10 -0
  29. package/lib/css/CssModulesPlugin.js +13 -6
  30. package/lib/css/CssParser.js +33 -32
  31. package/lib/css/conventions.js +1 -1
  32. package/lib/css/data.js +224 -219
  33. package/lib/css/syntax-parser.js +1312 -312
  34. package/lib/css/syntax-printer.js +1142 -1025
  35. package/lib/debug/ProfilingPlugin.js +65 -43
  36. package/lib/define/DefinePlugin.js +10 -15
  37. package/lib/define/DotenvPlugin.js +10 -6
  38. package/lib/define/EnvironmentPlugin.js +4 -2
  39. package/lib/dependencies/amd/AMDDefineDependencyParserPlugin.js +1 -2
  40. package/lib/dependencies/amd/AMDRequireDependenciesBlockParserPlugin.js +4 -1
  41. package/lib/dependencies/commonjs/CommonJsExportRequireDependency.js +1 -4
  42. package/lib/dependencies/commonjs/CommonJsExportsParserPlugin.js +18 -33
  43. package/lib/dependencies/commonjs/CommonJsImportsParserPlugin.js +1 -3
  44. package/lib/dependencies/commonjs/CommonJsObjectExportDependency.js +4 -4
  45. package/lib/dependencies/commonjs/CommonJsPlugin.js +2 -5
  46. package/lib/dependencies/commonjs/RequireEnsureDependenciesBlockParserPlugin.js +4 -1
  47. package/lib/dependencies/context/ImportMetaContextDependencyParserPlugin.js +1 -2
  48. package/lib/dependencies/context/ImportMetaGlobDependencyParserPlugin.js +4 -7
  49. package/lib/dependencies/context/ImportMetaGlobHelpers.js +8 -10
  50. package/lib/dependencies/core/CachedConstDependency.js +9 -6
  51. package/lib/dependencies/css/CssIcssExportDependency.js +6 -7
  52. package/lib/dependencies/css/CssIcssImportDependency.js +1 -3
  53. package/lib/dependencies/css/CssUrlDependency.js +2 -6
  54. package/lib/dependencies/esm/ESMDetectionParserPlugin.js +2 -4
  55. package/lib/dependencies/esm/ESMExportExpressionDependency.js +2 -2
  56. package/lib/dependencies/esm/ESMExportImportedSpecifierDependency.js +16 -18
  57. package/lib/dependencies/esm/ESMExportSpecifierDependency.js +20 -3
  58. package/lib/dependencies/esm/ESMExports.js +2 -10
  59. package/lib/dependencies/esm/ESMImportDependency.js +17 -2
  60. package/lib/dependencies/esm/ESMImportDependencyParserPlugin.js +6 -17
  61. package/lib/dependencies/esm/ESMImportGuard.js +11 -23
  62. package/lib/dependencies/esm/ESMImportSideEffectDependency.js +1 -1
  63. package/lib/dependencies/esm/ESMImportSpecifierDependency.js +4 -1
  64. package/lib/dependencies/esm/ESMLiveExportDependency.js +311 -0
  65. package/lib/dependencies/esm/ESMLiveExportParserPlugin.js +862 -0
  66. package/lib/dependencies/esm/ESMModulesPlugin.js +1 -3
  67. package/lib/dependencies/esm/TopLevelAwaitDependency.js +1 -8
  68. package/lib/dependencies/helpers/DynamicExports.js +4 -6
  69. package/lib/dependencies/html/HtmlEntryDependency.js +5 -14
  70. package/lib/dependencies/html/HtmlInlineHtmlDependency.js +1 -4
  71. package/lib/dependencies/html/HtmlInlineScriptDependency.js +2 -6
  72. package/lib/dependencies/html/HtmlInlineStyleDependency.js +1 -4
  73. package/lib/dependencies/import/ImportParserPlugin.js +3 -6
  74. package/lib/dependencies/import-meta/ImportMetaPlugin.js +4 -6
  75. package/lib/dependencies/url/URLParserPlugin.js +1 -1
  76. package/lib/dependencies/worker/WorkerAndWorkletPlugin.js +51 -20
  77. package/lib/devtool/ModuleFilenameHelpers.js +1 -1
  78. package/lib/devtool/SourceMapDevToolPlugin.js +1 -1
  79. package/lib/dll/DelegatedModule.js +3 -3
  80. package/lib/dll/DllModule.js +3 -1
  81. package/lib/dll/DllReferencePlugin.js +1 -4
  82. package/lib/errors/AbstractMethodError.js +1 -1
  83. package/lib/errors/ErrorHelpers.js +2 -1
  84. package/lib/errors/HookWebpackError.js +2 -1
  85. package/lib/errors/JSONParseError.js +4 -4
  86. package/lib/errors/WebpackError.js +3 -2
  87. package/lib/esm/ModuleChunkFormatPlugin.js +36 -1
  88. package/lib/externals/ExternalModule.js +12 -9
  89. package/lib/externals/ExternalModuleFactoryPlugin.js +1 -2
  90. package/lib/externals/ExternalsPlugin.js +1 -1
  91. package/lib/fs/FileSystemInfo.js +4 -4
  92. package/lib/graph/AsyncDependenciesBlock.js +1 -1
  93. package/lib/graph/ChunkGraph.js +5 -0
  94. package/lib/graph/Dependency.js +8 -2
  95. package/lib/graph/ExportsInfo.js +1 -1
  96. package/lib/graph/ModuleGraph.js +14 -3
  97. package/lib/graph/buildChunkGraph.js +17 -19
  98. package/lib/graph/findGraphRoots.js +1 -1
  99. package/lib/hmr/HotModuleReplacement.runtime.js +10 -9
  100. package/lib/hmr/HotModuleReplacementPlugin.js +5 -11
  101. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +16 -19
  102. package/lib/hmr/LazyCompilationPlugin.js +1 -7
  103. package/lib/html/HtmlGenerator.js +25 -17
  104. package/lib/html/HtmlModule.js +11 -1
  105. package/lib/html/HtmlModulesPlugin.js +12 -11
  106. package/lib/html/HtmlParser.js +10 -9
  107. package/lib/html/builtinEmbeddedRenderer.js +31 -33
  108. package/lib/html/data.js +42 -21
  109. package/lib/html/htmlMinify.js +4 -1
  110. package/lib/html/syntax-parser.js +34 -35
  111. package/lib/html/syntax-printer.js +2 -3
  112. package/lib/html/xmlMinify.js +4 -1
  113. package/lib/ids/HashedModuleIdsPlugin.js +1 -1
  114. package/lib/index.js +13 -12
  115. package/lib/javascript/APIPlugin.js +7 -13
  116. package/lib/javascript/BasicEvaluatedExpression.js +5 -5
  117. package/lib/javascript/CommonJsChunkFormatPlugin.js +2 -7
  118. package/lib/javascript/ConstPlugin.js +1 -1
  119. package/lib/javascript/JavascriptGenerator.js +16 -11
  120. package/lib/javascript/JavascriptMetaInfoPlugin.js +3 -15
  121. package/lib/javascript/JavascriptModule.js +10 -0
  122. package/lib/javascript/JavascriptModulesPlugin.js +2 -4
  123. package/lib/javascript/JavascriptParser.js +99 -11
  124. package/lib/javascript/ScopeAnalyzer.js +183 -107
  125. package/lib/javascript/UseStrictPlugin.js +2 -5
  126. package/lib/javascript/jsMinify.js +1 -1
  127. package/lib/javascript/regexp.js +2 -2
  128. package/lib/javascript/syntax-parser.js +2114 -1506
  129. package/lib/javascript/syntax-printer-data.js +167 -1
  130. package/lib/javascript/syntax-printer.js +9554 -2782
  131. package/lib/json/JsonGenerator.js +15 -7
  132. package/lib/json/JsonModule.js +11 -0
  133. package/lib/json/JsonParser.js +7 -6
  134. package/lib/library/AssignLibraryPlugin.js +1 -1
  135. package/lib/library/JsonpLibraryPlugin.js +1 -1
  136. package/lib/library/ModuleLibraryPlugin.js +399 -23
  137. package/lib/loaders/LoaderRunner.js +76 -38
  138. package/lib/loaders/loadLoader.js +16 -10
  139. package/lib/module/Generator.js +17 -9
  140. package/lib/module/Module.js +2 -2
  141. package/lib/module/NormalModule.js +7 -5
  142. package/lib/module/NormalModuleFactory.js +11 -17
  143. package/lib/module/Parser.js +9 -2
  144. package/lib/module/extractSourceMap.js +69 -18
  145. package/lib/module/findCaseMismatch.js +2 -2
  146. package/lib/node/ExternalModuleInitFragment.js +2 -2
  147. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +4 -12
  148. package/lib/node/ReadFileCompileWasmPlugin.js +2 -6
  149. package/lib/node/nodeConsole.js +4 -3
  150. package/lib/optimize/CircularModulesPlugin.js +1 -1
  151. package/lib/optimize/ConcatenatedModule.js +4 -8
  152. package/lib/optimize/FlagDependencyExportsPlugin.js +6 -11
  153. package/lib/optimize/FlagDependencyUsagePlugin.js +28 -3
  154. package/lib/optimize/InlineExports.js +4 -7
  155. package/lib/optimize/LazyBarrels.js +41 -5
  156. package/lib/optimize/ModuleConcatenationPlugin.js +8 -10
  157. package/lib/optimize/RealContentHashPlugin.js +2 -6
  158. package/lib/optimize/SideEffectsFlagPlugin.js +7 -21
  159. package/lib/optimize/SplitChunksPlugin.js +11 -24
  160. package/lib/optimize/TupleQueue.js +1 -1
  161. package/lib/output/CleanPlugin.js +3 -1
  162. package/lib/output/CopyPlugin.js +3 -4
  163. package/lib/performance/EvalUsagePlugin.js +1 -3
  164. package/lib/performance/HotspotsPlugin.js +33 -9
  165. package/lib/performance/PureAnnotationsPlugin.js +16 -10
  166. package/lib/performance/TopLevelThisPlugin.js +17 -9
  167. package/lib/prefetch/ResourceHintPlugin.js +1 -1
  168. package/lib/provide/ProvidedDependency.js +36 -4
  169. package/lib/rules/BasicEffectRulePlugin.js +1 -1
  170. package/lib/rules/RuleSetCompiler.js +15 -5
  171. package/lib/rules/UseEffectRulePlugin.js +1 -3
  172. package/lib/runtime/AsyncModuleRuntimeModule.js +7 -1
  173. package/lib/runtime/GetChunkFilenameRuntimeModule.js +1 -5
  174. package/lib/runtime/RuntimeGlobals.js +6 -0
  175. package/lib/runtime/RuntimePlugin.js +2 -0
  176. package/lib/schemes/HttpUriPlugin.js +1 -2
  177. package/lib/schemes/VirtualUrlPlugin.js +3 -1
  178. package/lib/serialization/AggregateErrorSerializer.js +3 -3
  179. package/lib/serialization/BinaryMiddleware.js +4 -1
  180. package/lib/serialization/ErrorObjectSerializer.js +2 -5
  181. package/lib/serialization/ObjectMiddleware.js +17 -15
  182. package/lib/serialization/PlainObjectSerializer.js +3 -7
  183. package/lib/serialization/Serializer.js +21 -11
  184. package/lib/serialization/SerializerMiddleware.js +8 -6
  185. package/lib/stats/DefaultStatsFactoryPlugin.js +35 -35
  186. package/lib/stats/DefaultStatsPresetPlugin.js +2 -6
  187. package/lib/stats/DefaultStatsPrinterPlugin.js +12 -11
  188. package/lib/stats/StatsFactory.js +194 -24
  189. package/lib/stats/StatsPrinter.js +126 -13
  190. package/lib/template/DependencyTemplate.js +1 -1
  191. package/lib/template/RuntimeTemplate.js +13 -32
  192. package/lib/template/Template.js +1 -1
  193. package/lib/util/SourceProcessor.js +146 -29
  194. package/lib/util/WeakTupleMap.js +10 -4
  195. package/lib/util/cleverMerge.js +61 -33
  196. package/lib/util/comparators.js +9 -5
  197. package/lib/util/dataURL.js +2 -0
  198. package/lib/util/deprecation.js +4 -3
  199. package/lib/util/globUtils.js +1 -4
  200. package/lib/util/internalSerializables.js +2 -0
  201. package/lib/util/makeSerializable.js +6 -4
  202. package/lib/util/memoize.js +1 -1
  203. package/lib/util/parseJson.js +2 -2
  204. package/lib/util/serialization.js +31 -27
  205. package/lib/wasm/AsyncWasmModule.js +12 -2
  206. package/lib/wasm/AsyncWebAssemblyGenerator.js +12 -4
  207. package/lib/wasm/AsyncWebAssemblyJavascriptGenerator.js +13 -5
  208. package/lib/wasm/AsyncWebAssemblyParser.js +7 -5
  209. package/lib/wasm/UniversalCompileAsyncWasmPlugin.js +2 -6
  210. package/lib/wasm-sync/SyncWasmModule.js +16 -1
  211. package/lib/wasm-sync/WebAssemblyGenerator.js +15 -10
  212. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +13 -5
  213. package/lib/wasm-sync/WebAssemblyParser.js +10 -12
  214. package/lib/web/FetchCompileAsyncWasmPlugin.js +4 -12
  215. package/lib/web/FetchCompileWasmPlugin.js +2 -6
  216. package/package.json +18 -19
  217. package/schemas/WebpackOptions.check.js +3 -3
  218. package/schemas/WebpackOptions.json +2 -2
  219. package/schemas/plugins/BannerPlugin.check.js +3 -3
  220. package/schemas/plugins/HtmlGeneratorOptions.check.js +3 -3
  221. package/schemas/plugins/HtmlParserOptions.check.js +3 -3
  222. package/schemas/plugins/IgnorePlugin.check.js +3 -3
  223. package/schemas/plugins/LoaderOptionsPlugin.check.js +3 -3
  224. package/schemas/plugins/ManifestPlugin.check.js +3 -3
  225. package/schemas/plugins/ProgressPlugin.check.js +3 -3
  226. package/schemas/plugins/SSRManifestPlugin.check.js +3 -3
  227. package/schemas/plugins/SourceMapDevToolPlugin.check.js +3 -3
  228. package/schemas/plugins/WatchIgnorePlugin.check.js +3 -3
  229. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +3 -3
  230. package/schemas/plugins/asset/AssetInlineGeneratorOptions.check.js +3 -3
  231. package/schemas/plugins/asset/AssetParserOptions.check.js +3 -3
  232. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +3 -3
  233. package/schemas/plugins/container/ContainerPlugin.check.js +3 -3
  234. package/schemas/plugins/container/ContainerReferencePlugin.check.js +3 -3
  235. package/schemas/plugins/container/ExternalsType.check.js +3 -3
  236. package/schemas/plugins/container/ModuleFederationPlugin.check.js +3 -3
  237. package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +3 -3
  238. package/schemas/plugins/css/CssGeneratorOptions.check.js +3 -3
  239. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +3 -3
  240. package/schemas/plugins/css/CssModuleParserOptions.check.js +3 -3
  241. package/schemas/plugins/css/CssParserOptions.check.js +3 -3
  242. package/schemas/plugins/debug/ProfilingPlugin.check.js +3 -3
  243. package/schemas/plugins/define/DotenvPluginOptions.check.js +7 -0
  244. package/schemas/plugins/define/DotenvPluginOptions.json +3 -0
  245. package/schemas/plugins/dll/DllPlugin.check.js +3 -3
  246. package/schemas/plugins/dll/DllReferencePlugin.check.js +3 -3
  247. package/schemas/plugins/ids/HashedModuleIdsPlugin.check.js +3 -3
  248. package/schemas/plugins/ids/OccurrenceChunkIdsPlugin.check.js +3 -3
  249. package/schemas/plugins/ids/OccurrenceModuleIdsPlugin.check.js +3 -3
  250. package/schemas/plugins/json/JsonModulesPluginGenerator.check.js +3 -3
  251. package/schemas/plugins/json/JsonModulesPluginParser.check.js +3 -3
  252. package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +3 -3
  253. package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +3 -3
  254. package/schemas/plugins/optimize/MergeDuplicateChunksPlugin.check.js +3 -3
  255. package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +3 -3
  256. package/schemas/plugins/output/CleanOptions.check.js +7 -0
  257. package/schemas/plugins/output/CleanOptions.json +3 -0
  258. package/schemas/plugins/schemes/HttpUriPlugin.check.js +3 -3
  259. package/schemas/plugins/schemes/VirtualUrlPlugin.check.js +3 -3
  260. package/schemas/plugins/sharing/ConsumeSharedPlugin.check.js +3 -3
  261. package/schemas/plugins/sharing/ProvideSharedPlugin.check.js +3 -3
  262. package/schemas/plugins/sharing/SharePlugin.check.js +3 -3
  263. package/types.d.ts +1482 -358
@@ -105,8 +105,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin {
105
105
  /** @type {RawReferencedExports | undefined} */
106
106
  let exports;
107
107
  if (optionsNode) {
108
- for (const prop of /** @type {ObjectExpression} */ (optionsNode)
109
- .properties) {
108
+ for (const prop of optionsNode.properties) {
110
109
  if (prop.type !== "Property" || prop.key.type !== "Identifier") {
111
110
  errors.push(
112
111
  createError(
@@ -11,7 +11,6 @@ const {
11
11
  const ImportMetaGlobDependency = require("./ImportMetaGlobDependency");
12
12
  const { parseImportMetaGlobCall } = require("./ImportMetaGlobHelpers");
13
13
 
14
- /** @import { CallExpression } from "estree" */
15
14
  /** @import JavascriptParser from "../../javascript/JavascriptParser" */
16
15
 
17
16
  const PLUGIN_NAME = "ImportMetaGlobDependencyParserPlugin";
@@ -38,7 +37,7 @@ module.exports = class ImportMetaGlobDependencyParserPlugin {
38
37
  options: globOptions,
39
38
  errors,
40
39
  warnings
41
- } = parseImportMetaGlobCall(/** @type {CallExpression} */ (expr), parser);
40
+ } = parseImportMetaGlobCall(expr, parser);
42
41
  for (const warning of warnings) {
43
42
  parser.state.module.addWarning(warning);
44
43
  }
@@ -58,11 +57,9 @@ module.exports = class ImportMetaGlobDependencyParserPlugin {
58
57
  exhaustive: globOptions.exhaustive,
59
58
  caseSensitive: globOptions.caseSensitive,
60
59
  referencedExports: globOptions.referencedExports,
61
- namespaceObject:
62
- /** @type {import("../../module/Module").BuildMeta} */
63
- (parser.state.module.buildMeta).strictHarmonyModule
64
- ? "strict"
65
- : true,
60
+ namespaceObject: parser.state.module.buildMeta.strictHarmonyModule
61
+ ? "strict"
62
+ : true,
66
63
  mode: globOptions.mode,
67
64
  category: "esm"
68
65
  },
@@ -87,9 +87,7 @@ const staticStringFromExpr = (expr, parser) => {
87
87
  return /** @type {string} */ (evaluated.string);
88
88
  }
89
89
  if (expr.type === "TemplateLiteral" && expr.expressions.length === 0) {
90
- const cooked = /** @type {import("estree").TemplateElement} */ (
91
- expr.quasis[0]
92
- ).value.cooked;
90
+ const cooked = expr.quasis[0].value.cooked;
93
91
  if (cooked !== null && cooked !== undefined) return cooked;
94
92
  }
95
93
  };
@@ -189,7 +187,10 @@ const staticImportMetaGlobQueryKeyFromPropName = (propName, parser) => {
189
187
  if (typeof propName.value === "number") return String(propName.value);
190
188
  if (typeof propName.value === "boolean") return String(propName.value);
191
189
  }
192
- const keyNode = /** @type {unknown} */ (propName);
190
+ const keyNode =
191
+ /** @type {typeof propName | { type: "Computed", expression: Expression }} */ (
192
+ propName
193
+ );
193
194
  if (
194
195
  typeof keyNode === "object" &&
195
196
  keyNode !== null &&
@@ -197,10 +198,7 @@ const staticImportMetaGlobQueryKeyFromPropName = (propName, parser) => {
197
198
  keyNode.type === "Computed" &&
198
199
  "expression" in keyNode
199
200
  ) {
200
- return staticImportMetaGlobQueryKeyFromExpr(
201
- /** @type {Expression} */ (keyNode.expression),
202
- parser
203
- );
201
+ return staticImportMetaGlobQueryKeyFromExpr(keyNode.expression, parser);
204
202
  }
205
203
  };
206
204
 
@@ -551,7 +549,7 @@ const parseImportMetaGlobCall = (expr, parser) => {
551
549
  }
552
550
 
553
551
  const rawGlobPatterns = parseStaticGlobPatternsFromExpr(
554
- /** @type {Expression} */ (directoryNode),
552
+ directoryNode,
555
553
  parser,
556
554
  warnings
557
555
  );
@@ -605,7 +603,7 @@ const parseImportMetaGlobCall = (expr, parser) => {
605
603
  const compilerContext = parser.state.compilation.compiler.context;
606
604
  const globOptions =
607
605
  optionsNode && optionsNode.type === "ObjectExpression"
608
- ? /** @type {ObjectExpression} */ (optionsNode)
606
+ ? optionsNode
609
607
  : undefined;
610
608
  const { eager, importName, query, base, exhaustive, caseSensitive } =
611
609
  parseImportMetaGlobOptionsObject(globOptions, parser, warnings);
@@ -127,12 +127,15 @@ CachedConstDependency.Template = class CachedConstDependencyTemplate extends (
127
127
  ? initFragments
128
128
  : chunkInitFragments
129
129
  ).push(
130
- new InitFragment(
131
- `var ${dep.identifier} = ${dep.expression};\n`,
132
- InitFragment.STAGE_CONSTANTS,
133
- // For a chunk we inject expression after imports
134
- dep.place === CachedConstDependency.PLACE_MODULE ? 0 : 10,
135
- `const ${dep.identifier}`
130
+ // Its content is fixed, so it fits either list's render context.
131
+ /** @type {DependencyTemplateContext["initFragments"][number] & DependencyTemplateContext["chunkInitFragments"][number]} */ (
132
+ new InitFragment(
133
+ `var ${dep.identifier} = ${dep.expression};\n`,
134
+ InitFragment.STAGE_CONSTANTS,
135
+ // For a chunk we inject expression after imports
136
+ dep.place === CachedConstDependency.PLACE_MODULE ? 0 : 10,
137
+ `const ${dep.identifier}`
138
+ )
136
139
  )
137
140
  );
138
141
 
@@ -141,8 +141,7 @@ const getLocalIdent = (local, module, chunkGraph, runtimeTemplate) => {
141
141
  /** @type {CssGeneratorLocalIdentName} */
142
142
  (generator.options.localIdentName);
143
143
  const relativeResourcePath = makePathsRelative(
144
- /** @type {string} */
145
- (runtimeTemplate.compilation.compiler.context),
144
+ runtimeTemplate.compilation.compiler.context,
146
145
  /** @type {string} */
147
146
  (module.getResource()),
148
147
  runtimeTemplate.compilation.compiler.root
@@ -197,8 +196,8 @@ const getLocalIdent = (local, module, chunkGraph, runtimeTemplate) => {
197
196
 
198
197
  contentHash = digestNonNumericOnly(
199
198
  hash,
200
- /** @type {string} */ (runtimeTemplate.outputOptions.hashDigest),
201
- /** @type {number} */ (runtimeTemplate.outputOptions.hashDigestLength)
199
+ runtimeTemplate.outputOptions.hashDigest,
200
+ runtimeTemplate.outputOptions.hashDigestLength
202
201
  );
203
202
  }
204
203
 
@@ -651,7 +650,7 @@ const EMPTY_INDEX = new Map();
651
650
  * type (CSS and JS), so this survives both passes — the index is built once per
652
651
  * build instead of once per `apply`. Weakly held, so it never keeps a module
653
652
  * alive.
654
- * @type {WeakMap<CssModule, { buildInfo: unknown, index: Map<string, CssIcssImportDependency[]> }>}
653
+ * @type {WeakMap<CssModule, { buildInfo: CssModule["buildInfo"], index: Map<string, CssIcssImportDependency[]> }>}
655
654
  */
656
655
  const moduleImportIndexes = new WeakMap();
657
656
 
@@ -1022,7 +1021,7 @@ CssIcssExportDependency.Template = class CssIcssExportDependencyTemplate extends
1022
1021
  } else {
1023
1022
  references.push(
1024
1023
  CssIcssExportDependencyTemplate.getIdentifier(
1025
- /** @type {string} */ (entry.value),
1024
+ entry.value,
1026
1025
  entry,
1027
1026
  templateContext
1028
1027
  )
@@ -1031,7 +1030,7 @@ CssIcssExportDependency.Template = class CssIcssExportDependencyTemplate extends
1031
1030
  const matches = getExportIndex(
1032
1031
  cache,
1033
1032
  /** @type {CssModule} */ (templateContext.module)
1034
- ).get(/** @type {string} */ (entry.value));
1033
+ ).get(entry.value);
1035
1034
  if (matches) {
1036
1035
  for (const d of matches) {
1037
1036
  if (d.exportMode === EXPORT_MODE.NONE) continue;
@@ -107,9 +107,7 @@ class CssIcssImportDependency extends CssImportDependency {
107
107
  /** @type {CssGenerator | undefined} */
108
108
  (module.generator);
109
109
  const convention =
110
- generator &&
111
- /** @type {CssGeneratorExportsConvention | undefined} */
112
- (generator.options && generator.options.exportsConvention);
110
+ generator && generator.options && generator.options.exportsConvention;
113
111
  const exportsInfo = moduleGraph.getExportsInfo(module);
114
112
  const names = convention
115
113
  ? this.getImportNameConventionNames(convention)
@@ -94,7 +94,7 @@ class CssUrlDependency extends ModuleDependency {
94
94
  module.buildInfo
95
95
  );
96
96
  if (buildInfo && buildInfo.hash) {
97
- hash.update(/** @type {string} */ (buildInfo.hash));
97
+ hash.update(buildInfo.hash);
98
98
  }
99
99
  }
100
100
 
@@ -231,11 +231,7 @@ CssUrlDependency.Template = class CssUrlDependencyTemplate extends (
231
231
  break;
232
232
  }
233
233
 
234
- source.replace(
235
- dep.range[0],
236
- dep.range[1] - 1,
237
- /** @type {string} */ (newValue)
238
- );
234
+ source.replace(dep.range[0], dep.range[1] - 1, newValue);
239
235
  }
240
236
 
241
237
  /**
@@ -23,7 +23,6 @@ const getEnvironmentNotSupportAsyncWarning = memoize(() =>
23
23
  require("../../errors/EnvironmentNotSupportAsyncWarning")
24
24
  );
25
25
 
26
- /** @import { BuildInfo, BuildMeta } from "../../module/Module" */
27
26
  /** @import JavascriptParser, { Range } from "../../javascript/JavascriptParser" */
28
27
 
29
28
  const PLUGIN_NAME = "ESMDetectionParserPlugin";
@@ -82,9 +81,8 @@ module.exports = class ESMDetectionParserPlugin {
82
81
  parser.hooks.topLevelAwait.tap(PLUGIN_NAME, (node) => {
83
82
  const module = parser.state.module;
84
83
  enableHarmony(false);
85
- /** @type {BuildMeta} */
86
- (module.buildMeta).async = true;
87
- const buildInfo = /** @type {BuildInfo} */ (module.buildInfo);
84
+ module.buildMeta.async = true;
85
+ const buildInfo = module.buildInfo;
88
86
  if (node.type === "AwaitExpression") {
89
87
  // Record for a possible `await` -> `(yield …)` rewrite when the module
90
88
  // is lowered to a generator (target without `async`/`await`).
@@ -30,8 +30,8 @@ const DEFAULT_EXPORT_NAME = "default";
30
30
  /** @import { InlinedValue } from "../../optimize/InlineExports" */
31
31
  /** @import { Range } from "../../javascript/JavascriptParser" */
32
32
  /** @typedef {string | { id?: string | undefined, range: Range, prefix: string, suffix: string }} DeclarationId */
33
- /** @typedef {import("../../serialization/ObjectMiddleware").ObjectDeserializerContext<[Range, Range, string, DeclarationId | undefined, boolean, boolean]>} ObjectDeserializerContext */
34
- /** @typedef {import("../../serialization/ObjectMiddleware").ObjectSerializerContext<[Range, Range, string, DeclarationId | undefined, boolean, boolean]>} ObjectSerializerContext */
33
+ /** @typedef {import("../../serialization/ObjectMiddleware").ObjectDeserializerContext<[Range, Range, string, DeclarationId | undefined, boolean, boolean, InlinedValue | undefined]>} ObjectDeserializerContext */
34
+ /** @typedef {import("../../serialization/ObjectMiddleware").ObjectSerializerContext<[Range, Range, string, DeclarationId | undefined, boolean, boolean, InlinedValue | undefined]>} ObjectSerializerContext */
35
35
  /** @import { ExportMap } from "./ESMExportInitFragment" */
36
36
  /**
37
37
  * @import {
@@ -14,6 +14,7 @@ const {
14
14
  isInlineExportsEnabled,
15
15
  isInlinedUsedName
16
16
  } = require("../../optimize/InlineExports");
17
+ const LazyBarrels = require("../../optimize/LazyBarrels");
17
18
  const {
18
19
  getKnownExportNames,
19
20
  getMakeDeferredNamespaceModeFromExportsType
@@ -899,9 +900,7 @@ class ESMExportImportedSpecifierDependency extends ESMImportDependency {
899
900
  runtime,
900
901
  referencedExports,
901
902
  [],
902
- /** @type {InstanceType<ExportInfo>} */ (
903
- mode.partialNamespaceExportInfo
904
- )
903
+ mode.partialNamespaceExportInfo
905
904
  );
906
905
  return referencedExports;
907
906
  }
@@ -917,9 +916,7 @@ class ESMExportImportedSpecifierDependency extends ESMImportDependency {
917
916
  runtime,
918
917
  referencedExports,
919
918
  [],
920
- /** @type {InstanceType<ExportInfo>} */ (
921
- mode.partialNamespaceExportInfo
922
- ),
919
+ mode.partialNamespaceExportInfo,
923
920
  mode.type === "reexport-fake-namespace-object"
924
921
  );
925
922
  return referencedExports;
@@ -1387,6 +1384,11 @@ ESMExportImportedSpecifierDependency.Template = class ESMExportImportedSpecifier
1387
1384
 
1388
1385
  const mode = dep.getMode(moduleGraph, runtime);
1389
1386
 
1387
+ // deferred by lazy barrel: never resolved, renders nothing
1388
+ if (mode.type === "missing" && LazyBarrels.isLazy(moduleGraph, dep)) {
1389
+ return;
1390
+ }
1391
+
1390
1392
  // a wrapped module has no shared-scope symbols to redirect reexports to
1391
1393
  if (concatenationScope && !concatenationScope.isWrapped()) {
1392
1394
  switch (mode.type) {
@@ -1457,15 +1459,13 @@ ESMExportImportedSpecifierDependency.Template = class ESMExportImportedSpecifier
1457
1459
  concatenationScope !== undefined &&
1458
1460
  concatenationScope.isModuleInScope(importedModule);
1459
1461
  const importVar = inScope
1460
- ? /** @type {ConcatenationScope} */ (
1461
- concatenationScope
1462
- ).createModuleReference(importedModule, { asiSafe: true })
1462
+ ? concatenationScope.createModuleReference(importedModule, {
1463
+ asiSafe: true
1464
+ })
1463
1465
  : dep.getImportVar(moduleGraph);
1464
1466
 
1465
1467
  const defaultImportVar = inScope
1466
- ? /** @type {ConcatenationScope} */ (
1467
- concatenationScope
1468
- ).createModuleReference(importedModule, {
1468
+ ? concatenationScope.createModuleReference(importedModule, {
1469
1469
  ids: ["default"],
1470
1470
  asiSafe: true
1471
1471
  })
@@ -1473,9 +1473,7 @@ ESMExportImportedSpecifierDependency.Template = class ESMExportImportedSpecifier
1473
1473
 
1474
1474
  // whole-namespace modes need the original export names, not mangled ones
1475
1475
  const namespaceImportVar = inScope
1476
- ? /** @type {ConcatenationScope} */ (
1477
- concatenationScope
1478
- ).createModuleReference(importedModule, {
1476
+ ? concatenationScope.createModuleReference(importedModule, {
1479
1477
  asiSafe: true,
1480
1478
  mangleableNamespace: true
1481
1479
  })
@@ -1560,9 +1558,9 @@ ESMExportImportedSpecifierDependency.Template = class ESMExportImportedSpecifier
1560
1558
  moduleGraph
1561
1559
  .getExportsInfo(module)
1562
1560
  .getUsedName(/** @type {string} */ (mode.name), runtime),
1563
- /** @type {ConcatenationScope} */ (
1564
- concatenationScope
1565
- ).createModuleReference(importedModule, { asiSafe: true }),
1561
+ concatenationScope.createModuleReference(importedModule, {
1562
+ asiSafe: true
1563
+ }),
1566
1564
  "",
1567
1565
  runtimeRequirements
1568
1566
  )
@@ -8,13 +8,14 @@
8
8
  const Dependency = require("../../graph/Dependency");
9
9
  const { isInlinedUsedName } = require("../../optimize/InlineExports");
10
10
  const makeSerializable = require("../../util/makeSerializable");
11
+ const { getRuntimeKey } = require("../../util/runtime");
11
12
  const NullDependency = require("../core/NullDependency");
12
13
  const ESMExportInitFragment = require("./ESMExportInitFragment");
13
14
 
14
15
  const { ExportBindingType } = ESMExportInitFragment;
15
16
 
16
17
  /** @import { ReplaceSource } from "webpack-sources" */
17
- /** @import { ExportsSpec, LazyRole, UpdateHashContext } from "../../graph/Dependency" */
18
+ /** @import { DependencyKinds, ExportsSpec, LazyRole, UpdateHashContext } from "../../graph/Dependency" */
18
19
  /** @import Module, { BuildInfo } from "../../module/Module" */
19
20
  /** @import Hash from "../../util/Hash" */
20
21
  /** @import { DependencyTemplateContext } from "../../template/DependencyTemplate" */
@@ -204,12 +205,22 @@ ESMExportSpecifierDependency.Template = class ESMExportSpecifierDependencyTempla
204
205
  meta !== undefined &&
205
206
  meta.onDemandExports === true;
206
207
 
208
+ // a module library may have moved the binding to the chunk's scope
209
+ const live =
210
+ meta !== undefined && meta.liveBindings !== undefined
211
+ ? meta.liveBindings.get(dep.id)
212
+ : undefined;
213
+ const local =
214
+ live !== undefined && live.runtimes.has(getRuntimeKey(runtime))
215
+ ? live.name
216
+ : dep.id;
217
+
207
218
  /** @type {ExportMap} */
208
219
  const map = new Map();
209
220
  map.set(used, {
210
- value: `/* binding */ ${dep.id}`,
221
+ value: `/* binding */ ${local}`,
211
222
  type: valueFormat ? ExportBindingType.Value : ExportBindingType.Getter,
212
- finalName: dep.id
223
+ finalName: local
213
224
  });
214
225
  initFragments.push(
215
226
  new ESMExportInitFragment(
@@ -222,4 +233,10 @@ ESMExportSpecifierDependency.Template = class ESMExportSpecifierDependencyTempla
222
233
  }
223
234
  };
224
235
 
236
+ /** @type {Set<keyof DependencyKinds>} */
237
+ ESMExportSpecifierDependency.KINDS = new Set([
238
+ ...NullDependency.KINDS,
239
+ "esm-export-specifier"
240
+ ]);
241
+
225
242
  module.exports = ESMExportSpecifierDependency;
@@ -7,12 +7,6 @@
7
7
 
8
8
  const RuntimeGlobals = require("../../runtime/RuntimeGlobals");
9
9
 
10
- /** @import { BuildInfo } from "../../module/Module" */
11
- /**
12
- * @import {
13
- * JavascriptModuleBuildMeta
14
- * } from "../../javascript/JavascriptModule"
15
- */
16
10
  /** @import { JavascriptParserState } from "../../javascript/JavascriptParser" */
17
11
 
18
12
  /** @type {WeakMap<JavascriptParserState, boolean>} */
@@ -29,11 +23,9 @@ module.exports.enable = (parserState, isStrictHarmony) => {
29
23
  if (value === false) return;
30
24
  parserStateExportsState.set(parserState, true);
31
25
  if (value !== true) {
32
- const buildMeta =
33
- /** @type {JavascriptModuleBuildMeta} */
34
- (parserState.module.buildMeta);
26
+ const buildMeta = parserState.module.buildMeta;
35
27
  buildMeta.exportsType = "namespace";
36
- const buildInfo = /** @type {BuildInfo} */ (parserState.module.buildInfo);
28
+ const buildInfo = parserState.module.buildInfo;
37
29
  buildInfo.strict = true;
38
30
  buildInfo.exportsArgument = RuntimeGlobals.exports;
39
31
  if (isStrictHarmony) {
@@ -23,7 +23,7 @@ const ModuleDependency = require("../core/ModuleDependency");
23
23
  * JavascriptParserOptions
24
24
  * } from "../../../declarations/WebpackOptions"
25
25
  */
26
- /** @import { ReferencedExports, DependencyKinds, LazyRole } from "../../graph/Dependency" */
26
+ /** @import { ReferencedExports, DependencyKinds, LazyRole, UpdateHashContext } from "../../graph/Dependency" */
27
27
  /** @import { DependencyTemplateContext } from "../../template/DependencyTemplate" */
28
28
  /** @import ExportsInfo from "../../graph/ExportsInfo" */
29
29
  /** @import Module, { BuildMeta } from "../../module/Module" */
@@ -37,6 +37,7 @@ const ModuleDependency = require("../core/ModuleDependency");
37
37
  * ObjectSerializerContext
38
38
  * } from "../../serialization/ObjectMiddleware"
39
39
  */
40
+ /** @import Hash from "../../util/Hash" */
40
41
  /** @import { RuntimeSpec } from "../../util/runtime" */
41
42
 
42
43
  /** @typedef {0 | 1 | 2 | 3} ExportPresenceMode */
@@ -146,6 +147,20 @@ class ESMImportDependency extends ModuleDependency {
146
147
  return "esm";
147
148
  }
148
149
 
150
+ /**
151
+ * Updates the hash with the data contributed by this instance.
152
+ * @param {Hash} hash hash to be updated
153
+ * @param {UpdateHashContext} context context
154
+ * @returns {void}
155
+ */
156
+ updateHash(hash, context) {
157
+ // neither a deferred nor a missing target has a connection, yet only a
158
+ // missing one renders a throw
159
+ if (LazyBarrels.isLazy(context.chunkGraph.moduleGraph, this)) {
160
+ hash.update("lazy");
161
+ }
162
+ }
163
+
149
164
  /**
150
165
  * Returns how this dependency may be deferred when its parent module is side-effect-free (lazy barrel optimization).
151
166
  * @returns {LazyRole | null} lazy classification, null when it must be processed eagerly
@@ -522,7 +537,7 @@ ESMImportDependency.Template = class ESMImportDependencyTemplate extends (
522
537
  // When the consuming module is emitted as a generator (target without
523
538
  // `async`/`await`), the dependency `await` must become `yield`.
524
539
  const generatorLowered = isGeneratorLowered(
525
- /** @type {Module} */ (module),
540
+ module,
526
541
  moduleGraph,
527
542
  templateContext.runtimeTemplate
528
543
  );
@@ -50,7 +50,6 @@ const ESMImportSpecifierDependency = require("./ESMImportSpecifierDependency");
50
50
  * } from "../../../declarations/WebpackOptions"
51
51
  */
52
52
  /** @import Module from "../../module/Module" */
53
- /** @import { JavascriptModuleBuildInfo } from "../../javascript/JavascriptModule" */
54
53
  /**
55
54
  * @import JavascriptParser, {
56
55
  * ImportAttributes,
@@ -155,14 +154,11 @@ const findImportSpecifier = (parser, node) => {
155
154
  (parser.getTagData(node.name, harmonySpecifierTag))
156
155
  );
157
156
  case "UnaryExpression":
158
- return findImportSpecifier(
159
- parser,
160
- /** @type {Expression} */ (node.argument)
161
- );
157
+ return findImportSpecifier(parser, node.argument);
162
158
  case "LogicalExpression":
163
159
  return (
164
- findImportSpecifier(parser, /** @type {Expression} */ (node.left)) ||
165
- findImportSpecifier(parser, /** @type {Expression} */ (node.right))
160
+ findImportSpecifier(parser, node.left) ||
161
+ findImportSpecifier(parser, node.right)
166
162
  );
167
163
  case "MemberExpression":
168
164
  return findImportSpecifier(
@@ -171,10 +167,7 @@ const findImportSpecifier = (parser, node) => {
171
167
  );
172
168
  case "BinaryExpression":
173
169
  // `"x" in ns` presence guard
174
- return (
175
- node.operator === "in" &&
176
- findImportSpecifier(parser, /** @type {Expression} */ (node.right))
177
- );
170
+ return node.operator === "in" && findImportSpecifier(parser, node.right);
178
171
  default:
179
172
  return false;
180
173
  }
@@ -444,8 +437,7 @@ class ESMImportDependencyParserPlugin {
444
437
  * @returns {void}
445
438
  */
446
439
  const bailOutOfConcatenation = () => {
447
- /** @type {JavascriptModuleBuildInfo} */
448
- (parser.state.module.buildInfo).moduleConcatenationBailout =
440
+ parser.state.module.buildInfo.moduleConcatenationBailout =
449
441
  "assignment to an imported binding";
450
442
  };
451
443
 
@@ -483,10 +475,7 @@ class ESMImportDependencyParserPlugin {
483
475
  });
484
476
  parser.hooks.write.for(harmonySpecifierTag).tap(PLUGIN_NAME, (node) => {
485
477
  const written = writeTargetOf(node);
486
- const target =
487
- written.type === "Identifier"
488
- ? /** @type {Identifier} */ (written)
489
- : undefined;
478
+ const target = written.type === "Identifier" ? written : undefined;
490
479
  markImportedBindingWrite(node, target);
491
480
  // A loop's binding walks nothing on its own, so the reference the
492
481
  // write renders as has to be walked here to exist at all.
@@ -74,7 +74,7 @@ const buildLivenessFormula = (test, depByRangeStart) => {
74
74
  */
75
75
  const build = (node) => {
76
76
  if (node.type === "UnaryExpression" && node.operator === "!") {
77
- return ["!", build(/** @type {Expression} */ (node.argument))];
77
+ return ["!", build(node.argument)];
78
78
  }
79
79
  if (
80
80
  node.type === "LogicalExpression" &&
@@ -82,14 +82,9 @@ const buildLivenessFormula = (test, depByRangeStart) => {
82
82
  node.operator === "||" ||
83
83
  node.operator === "??")
84
84
  ) {
85
- return [
86
- node.operator,
87
- build(/** @type {Expression} */ (node.left)),
88
- build(/** @type {Expression} */ (node.right))
89
- ];
85
+ return [node.operator, build(node.left), build(node.right)];
90
86
  }
91
- const dep =
92
- node.range && depByRangeStart.get(/** @type {number} */ (node.range[0]));
87
+ const dep = node.range && depByRangeStart.get(node.range[0]);
93
88
  return dep ? ["v", dep] : ["?"];
94
89
  };
95
90
 
@@ -243,23 +238,19 @@ const buildPresenceFormula = (parser, test, depByRangeStart) => {
243
238
  */
244
239
  const build = (node) => {
245
240
  if (node.type === "UnaryExpression" && node.operator === "!") {
246
- return ["!", build(/** @type {Expression} */ (node.argument))];
241
+ return ["!", build(node.argument)];
247
242
  }
248
243
  if (node.type === "LogicalExpression") {
249
244
  if (node.operator === "&&") {
250
- return [
251
- "&&",
252
- build(/** @type {Expression} */ (node.left)),
253
- build(/** @type {Expression} */ (node.right))
254
- ];
245
+ return ["&&", build(node.left), build(node.right)];
255
246
  }
256
247
 
257
248
  if (node.operator === "||") {
258
249
  if (parser.evaluateExpression(node.left).asBool() === false) {
259
- return build(/** @type {Expression} */ (node.right));
250
+ return build(node.right);
260
251
  }
261
252
  if (parser.evaluateExpression(node.right).asBool() === false) {
262
- return build(/** @type {Expression} */ (node.left));
253
+ return build(node.left);
263
254
  }
264
255
  return ["?"];
265
256
  }
@@ -267,16 +258,15 @@ const buildPresenceFormula = (parser, test, depByRangeStart) => {
267
258
  if (node.operator === "??") {
268
259
  const nullish = parser.evaluateExpression(node.left).asNullish();
269
260
  if (nullish === true) {
270
- return build(/** @type {Expression} */ (node.right));
261
+ return build(node.right);
271
262
  }
272
263
  if (nullish === false) {
273
- return build(/** @type {Expression} */ (node.left));
264
+ return build(node.left);
274
265
  }
275
266
  return ["?"];
276
267
  }
277
268
  }
278
- const dep =
279
- node.range && depByRangeStart.get(/** @type {number} */ (node.range[0]));
269
+ const dep = node.range && depByRangeStart.get(node.range[0]);
280
270
  return dep ? ["p", dep] : ["?"];
281
271
  };
282
272
 
@@ -298,9 +288,7 @@ const buildPresenceFormula = (parser, test, depByRangeStart) => {
298
288
  const evalPresenceFormula = (formula, name, member, needTruthy) => {
299
289
  switch (formula[0]) {
300
290
  case "p": {
301
- const dep = /** @type {ESMEvaluatedImportSpecifierDependency} */ (
302
- formula[1]
303
- );
291
+ const dep = formula[1];
304
292
  return (
305
293
  needTruthy &&
306
294
  dep.directImport === true &&
@@ -279,7 +279,7 @@ ESMImportSideEffectDependency.Template = class ESMImportSideEffectDependencyTemp
279
279
  const exportsType = importedModule.getExportsType(
280
280
  moduleGraph,
281
281
  /** @type {JavascriptModuleBuildMeta} */
282
- (/** @type {Module} */ (module).buildMeta).strictHarmonyModule
282
+ (module.buildMeta).strictHarmonyModule
283
283
  );
284
284
  if (exportsType !== "namespace") return;
285
285
  const importVar = dep.getImportVar(moduleGraph);
@@ -169,7 +169,10 @@ class ESMImportSpecifierDependency extends ESMImportDependency {
169
169
  * @returns {string | true | null} export name, true for all exports, null for none
170
170
  */
171
171
  get forwardId() {
172
- return this.ids.length > 0 ? this.ids[0] : true;
172
+ // SideEffectsFlagPlugin keeps a call with the namespace as `this` on the
173
+ // barrel, so the barrel runs whole
174
+ if (this.ids.length === 0 || this.namespaceObjectAsContext) return true;
175
+ return this.ids[0];
173
176
  }
174
177
 
175
178
  /**