Unverified Commit 761eadbd authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

update webpack (#29644)

Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent affbc158
......@@ -38,7 +38,7 @@ module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source
/***/ (function(module) {
"use strict";
module.exports = {"i8":"5.56.0"};
module.exports = {"i8":"5.57.1"};
/***/ }),
......@@ -21417,9 +21417,10 @@ class AsyncDependenciesBlock extends DependenciesBlock {
if (this._stringifiedGroupOptions === undefined) {
this._stringifiedGroupOptions = JSON.stringify(this.groupOptions);
}
hash.update(this._stringifiedGroupOptions);
const chunkGroup = chunkGraph.getBlockChunkGroup(this);
hash.update(chunkGroup ? chunkGroup.id : "");
hash.update(
`${this._stringifiedGroupOptions}${chunkGroup ? chunkGroup.id : ""}`
);
super.updateHash(hash, context);
}
......@@ -22850,9 +22851,9 @@ class Chunk {
* @returns {void}
*/
updateHash(hash, chunkGraph) {
hash.update(`${this.id} `);
hash.update(this.ids ? this.ids.join(",") : "");
hash.update(`${this.name || ""} `);
hash.update(
`${this.id} ${this.ids ? this.ids.join() : ""} ${this.name || ""} `
);
const xor = new StringXor();
for (const m of chunkGraph.getChunkModulesIterable(this)) {
xor.add(chunkGraph.getModuleHash(m, this.runtime));
......@@ -22861,9 +22862,7 @@ class Chunk {
const entryModules =
chunkGraph.getChunkEntryModulesWithChunkGroupIterable(this);
for (const [m, chunkGroup] of entryModules) {
hash.update("entry");
hash.update(`${chunkGraph.getModuleId(m)}`);
hash.update(chunkGroup.id);
hash.update(`entry${chunkGraph.getModuleId(m)}${chunkGroup.id}`);
}
}
......@@ -24637,8 +24636,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
}
const graphHash = cgm.graphHashes.provide(runtime, () => {
const hash = createHash(this._hashFunction);
hash.update(`${cgm.id}`);
hash.update(`${this.moduleGraph.isAsync(module)}`);
hash.update(`${cgm.id}${this.moduleGraph.isAsync(module)}`);
this.moduleGraph.getExportsInfo(module).updateHash(hash, runtime);
return BigInt(`0x${/** @type {string} */ (hash.digest("hex"))}`);
});
......@@ -27363,8 +27361,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
};
defineRemovedModuleTemplates(this.moduleTemplates);
/** @type {WeakMap<Module, WeakTupleMap<any, any>> | undefined} */
/** @type {Map<Module, WeakTupleMap<any, any>> | undefined} */
this.moduleMemCaches = undefined;
/** @type {Map<Module, WeakTupleMap<any, any>> | undefined} */
this.moduleMemCaches2 = undefined;
this.moduleGraph = new ModuleGraph();
/** @type {ChunkGraph} */
this.chunkGraph = undefined;
......@@ -28615,7 +28615,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
const moduleMemCacheCache = this.compiler.moduleMemCaches;
if (!moduleMemCacheCache) return;
if (!this.moduleMemCaches) {
this.moduleMemCaches = new WeakMap();
this.moduleMemCaches = new Map();
this.moduleGraph.setModuleMemCaches(this.moduleMemCaches);
}
const { moduleGraph, moduleMemCaches } = this;
......@@ -28625,7 +28625,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
let statChanged = 0;
let statUnchanged = 0;
let statReferencesChanged = 0;
let statWithoutHash = 0;
let statWithoutBuild = 0;
const computeReferences = module => {
/** @type {WeakMap<Dependency, Module>} */
......@@ -28657,48 +28657,63 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
return true;
};
for (const module of modules) {
const hash = module.buildInfo && module.buildInfo.hash;
if (typeof hash === "string") {
const cachedMemCache = moduleMemCacheCache.get(module);
if (cachedMemCache === undefined) {
// create a new entry
const memCache = new WeakTupleMap();
moduleMemCacheCache.set(module, {
hash: hash,
references: computeReferences(module),
memCache
});
moduleMemCaches.set(module, memCache);
affectedModules.add(module);
statNew++;
} else if (cachedMemCache.hash !== hash) {
// use a new one
const memCache = new WeakTupleMap();
moduleMemCaches.set(module, memCache);
affectedModules.add(module);
cachedMemCache.hash = hash;
cachedMemCache.references = computeReferences(module);
cachedMemCache.memCache = memCache;
statChanged++;
} else if (!compareReferences(module, cachedMemCache.references)) {
// use a new one
const memCache = new WeakTupleMap();
moduleMemCaches.set(module, memCache);
affectedModules.add(module);
cachedMemCache.references = computeReferences(module);
cachedMemCache.memCache = memCache;
statReferencesChanged++;
const modulesWithoutCache = new Set(modules);
for (const [module, cachedMemCache] of moduleMemCacheCache) {
if (modulesWithoutCache.has(module)) {
const buildInfo = module.buildInfo;
if (buildInfo) {
if (cachedMemCache.buildInfo !== buildInfo) {
// use a new one
const memCache = new WeakTupleMap();
moduleMemCaches.set(module, memCache);
affectedModules.add(module);
cachedMemCache.buildInfo = buildInfo;
cachedMemCache.references = computeReferences(module);
cachedMemCache.memCache = memCache;
statChanged++;
} else if (!compareReferences(module, cachedMemCache.references)) {
// use a new one
const memCache = new WeakTupleMap();
moduleMemCaches.set(module, memCache);
affectedModules.add(module);
cachedMemCache.references = computeReferences(module);
cachedMemCache.memCache = memCache;
statReferencesChanged++;
} else {
// keep the old mem cache
moduleMemCaches.set(module, cachedMemCache.memCache);
statUnchanged++;
}
} else {
// keep the old mem cache
moduleMemCaches.set(module, cachedMemCache.memCache);
statUnchanged++;
infectedModules.add(module);
moduleMemCacheCache.delete(module);
statWithoutBuild++;
}
modulesWithoutCache.delete(module);
} else {
moduleMemCacheCache.delete(module);
}
}
for (const module of modulesWithoutCache) {
const buildInfo = module.buildInfo;
if (buildInfo) {
// create a new entry
const memCache = new WeakTupleMap();
moduleMemCacheCache.set(module, {
buildInfo,
references: computeReferences(module),
memCache
});
moduleMemCaches.set(module, memCache);
affectedModules.add(module);
statNew++;
} else {
infectedModules.add(module);
statWithoutHash++;
statWithoutBuild++;
}
}
const reduceAffectType = connections => {
let affected = false;
for (const { dependency } of connections) {
......@@ -28759,7 +28774,112 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
infectedModules.size
} infected of ${
this.modules.size
}) modules flagged as affected (${statNew} new modules, ${statChanged} changed, ${statReferencesChanged} references changed, ${statUnchanged} unchanged, ${statWithoutHash} without hash)`
}) modules flagged as affected (${statNew} new modules, ${statChanged} changed, ${statReferencesChanged} references changed, ${statUnchanged} unchanged, ${statWithoutBuild} were not built)`
);
}
_updateAffectedModulesWithIds() {
const { moduleMemCaches } = this;
if (!moduleMemCaches) return;
const moduleMemCaches2 = (this.moduleMemCaches2 = new Map());
const { moduleGraph, chunkGraph } = this;
const key = "memCache2";
let statUnchanged = 0;
let statChanged = 0;
let statNew = 0;
/**
* @param {Module} module module
* @returns {{ modules?: Map<Module, string | number | undefined>, blocks?: (string | number)[] }} references
*/
const computeReferences = module => {
/** @type {Map<Module, string | number | undefined>} */
let modules = undefined;
/** @type {(string | number)[] | undefined} */
let blocks = undefined;
const outgoing = moduleGraph.getOutgoingConnectionsByModule(module);
if (outgoing !== undefined) {
for (const m of outgoing.keys()) {
if (!m) continue;
if (modules === undefined) modules = new Map();
modules.set(m, chunkGraph.getModuleId(m));
}
}
if (module.blocks.length > 0) {
blocks = [];
const queue = Array.from(module.blocks);
for (const block of queue) {
const chunkGroup = chunkGraph.getBlockChunkGroup(block);
if (chunkGroup) {
for (const chunk of chunkGroup.chunks) {
blocks.push(chunk.id);
}
} else {
blocks.push(null);
}
queue.push.apply(queue, block.blocks);
}
}
return { modules, blocks };
};
/**
* @param {Module} module module
* @param {Object} references references
* @param {Map<Module, string | number>=} references.modules modules
* @param {(string | number)[]=} references.blocks blocks
* @returns {boolean} ok?
*/
const compareReferences = (module, { modules, blocks }) => {
if (modules !== undefined) {
for (const [module, id] of modules) {
if (chunkGraph.getModuleId(module) !== id) return false;
}
}
if (blocks !== undefined) {
const queue = Array.from(module.blocks);
let i = 0;
for (const block of queue) {
const chunkGroup = chunkGraph.getBlockChunkGroup(block);
if (chunkGroup) {
for (const chunk of chunkGroup.chunks) {
if (i >= blocks.length || blocks[i++] !== chunk.id) return false;
}
} else {
if (i >= blocks.length || blocks[i++] !== null) return false;
}
queue.push.apply(queue, block.blocks);
}
if (i !== blocks.length) return false;
}
return true;
};
for (const [module, memCache] of moduleMemCaches) {
/** @type {{ references: { modules?: Map<Module, string | number | undefined>, blocks?: (string | number)[]}, memCache: WeakTupleMap<any[], any> }} */
const cache = memCache.get(key);
if (cache === undefined) {
const memCache2 = new WeakTupleMap();
memCache.set(key, {
references: computeReferences(module),
memCache: memCache2
});
moduleMemCaches2.set(module, memCache2);
statNew++;
} else if (!compareReferences(module, cache.references)) {
const memCache = new WeakTupleMap();
cache.references = computeReferences(module);
cache.memCache = memCache;
moduleMemCaches2.set(module, memCache);
statChanged++;
} else {
moduleMemCaches2.set(module, cache.memCache);
statUnchanged++;
}
}
this.logger.log(
`${Math.round(
(100 * statChanged) / (statNew + statChanged + statUnchanged)
)}% modules flagged as affected by chunk graph (${statNew} new modules, ${statChanged} changed, ${statUnchanged} unchanged)`
);
}
......@@ -29007,6 +29127,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
this.assetsInfo.clear();
this.moduleGraph.removeAllModuleAttributes();
this.moduleGraph.unfreeze();
this.moduleMemCaches2 = undefined;
}
/**
......@@ -29224,6 +29345,8 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
this.assignRuntimeIds();
this._updateAffectedModulesWithIds();
this.sortItemsWithChunkIds();
if (shouldRecord) {
......@@ -29567,18 +29690,14 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
chunkGraphEntries = this._getChunkGraphEntries()
} = {}) {
const context = { chunkGraph, codeGenerationResults };
const { moduleMemCaches } = this;
const { moduleMemCaches2 } = this;
this.logger.time("runtime requirements.modules");
const additionalModuleRuntimeRequirements =
this.hooks.additionalModuleRuntimeRequirements;
const runtimeRequirementInModule = this.hooks.runtimeRequirementInModule;
for (const module of modules) {
if (chunkGraph.getNumberOfModuleChunks(module) > 0) {
const memCache =
moduleMemCaches &&
// modules with async blocks depend on the chunk graph and can't be cached that way
module.blocks.length === 0 &&
moduleMemCaches.get(module);
const memCache = moduleMemCaches2 && moduleMemCaches2.get(module);
for (const runtime of chunkGraph.getModuleRuntimes(module)) {
if (memCache) {
const cached = memCache.get(
......@@ -30035,14 +30154,10 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
createModuleHashes() {
let statModulesHashed = 0;
let statModulesFromCache = 0;
const { chunkGraph, runtimeTemplate, moduleMemCaches } = this;
const { chunkGraph, runtimeTemplate, moduleMemCaches2 } = this;
const { hashFunction, hashDigest, hashDigestLength } = this.outputOptions;
for (const module of this.modules) {
const memCache =
moduleMemCaches &&
// modules with async blocks depend on the chunk graph and can't be cached that way
module.blocks.length === 0 &&
moduleMemCaches.get(module);
const memCache = moduleMemCaches2 && moduleMemCaches2.get(module);
for (const runtime of chunkGraph.getModuleRuntimes(module)) {
if (memCache) {
const digest = memCache.get(`moduleHash-${getRuntimeKey(runtime)}`);
......@@ -31132,7 +31247,7 @@ This prevents using hashes of each other and should be avoided.`);
strictModuleErrorHandling,
strictModuleExceptionHandling
} = this.outputOptions;
const __nested_webpack_require_143085__ = id => {
const __nested_webpack_require_146791__ = id => {
const cached = moduleCache[id];
if (cached !== undefined) {
if (cached.error) throw cached.error;
......@@ -31141,20 +31256,20 @@ This prevents using hashes of each other and should be avoided.`);
const moduleArgument = moduleArgumentsById.get(id);
return __webpack_require_module__(moduleArgument, id);
};
const interceptModuleExecution = (__nested_webpack_require_143085__[
const interceptModuleExecution = (__nested_webpack_require_146791__[
RuntimeGlobals.interceptModuleExecution.replace(
"__webpack_require__.",
""
)
] = []);
const moduleCache = (__nested_webpack_require_143085__[
const moduleCache = (__nested_webpack_require_146791__[
RuntimeGlobals.moduleCache.replace(
"__webpack_require__.",
""
)
] = {});
context.__webpack_require__ = __nested_webpack_require_143085__;
context.__webpack_require__ = __nested_webpack_require_146791__;
/**
* @param {ExecuteModuleArgument} moduleArgument the module argument
......@@ -31170,7 +31285,7 @@ This prevents using hashes of each other and should be avoided.`);
loaded: false,
error: undefined
},
require: __nested_webpack_require_143085__
require: __nested_webpack_require_146791__
};
interceptModuleExecution.forEach(handler =>
handler(execOptions)
......@@ -31210,7 +31325,7 @@ This prevents using hashes of each other and should be avoided.`);
moduleArgumentsMap.get(runtimeModule)
);
}
exports = __nested_webpack_require_143085__(module.identifier());
exports = __nested_webpack_require_146791__(module.identifier());
} catch (e) {
const err = new WebpackError(
`Execution of module code from module graph (${module.readableIdentifier(
......@@ -31685,7 +31800,7 @@ class Compiler {
this.cache = new Cache();
/** @type {WeakMap<Module, { hash: string, references: WeakMap<Dependency, Module>, memCache: WeakTupleMap }> | undefined} */
/** @type {Map<Module, { buildInfo: object, references: WeakMap<Dependency, Module>, memCache: WeakTupleMap }> | undefined} */
this.moduleMemCaches = undefined;
this.compilerPath = "";
......@@ -35366,7 +35481,7 @@ const toCacheVersion = code => {
};
const VALUE_DEP_PREFIX = "webpack/DefinePlugin ";
const VALUE_DEP_MAIN = "webpack/DefinePlugin";
const VALUE_DEP_MAIN = "webpack/DefinePlugin_hash";
class DefinePlugin {
/**
......@@ -36676,8 +36791,7 @@ class DependencyTemplates {
*/
updateHash(part) {
const hash = createHash(this._hashFunction);
hash.update(this._hash);
hash.update(part);
hash.update(`${this._hash}${part}`);
this._hash = /** @type {string} */ (hash.digest("hex"));
}
......@@ -36884,8 +36998,7 @@ class DllModule extends Module {
* @returns {void}
*/
updateHash(hash, context) {
hash.update("dll module");
hash.update(this.name || "");
hash.update(`dll module${this.name || ""}`);
super.updateHash(hash, context);
}
......@@ -39453,10 +39566,11 @@ class ExportInfo {
}
_updateHash(hash, runtime, alreadyVisitedExportsInfo) {
hash.update(`${this._usedName || this.name}`);
hash.update(`${this.getUsed(runtime)}`);
hash.update(`${this.provided}`);
hash.update(`${this.terminalBinding}`);
hash.update(
`${this._usedName || this.name}${this.getUsed(runtime)}${this.provided}${
this.terminalBinding
}`
);
if (this.exportsInfo && !alreadyVisitedExportsInfo.has(this.exportsInfo)) {
this.exportsInfo._updateHash(hash, runtime, alreadyVisitedExportsInfo);
}
......@@ -39682,6 +39796,7 @@ const { register } = __webpack_require__(99551);
/** @typedef {import("./Module").ConcatenationBailoutReasonContext} ConcatenationBailoutReasonContext */
/** @typedef {import("./Module").LibIdentOptions} LibIdentOptions */
/** @typedef {import("./Module").NeedBuildContext} NeedBuildContext */
/** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */
/** @typedef {import("./RequestShortener")} RequestShortener */
/** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */
/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */
......@@ -40147,6 +40262,10 @@ class ExternalModule extends Module {
callback();
}
restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory) {
this._restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory);
}
/**
* @param {ConcatenationBailoutReasonContext} context context
* @returns {string | undefined} reason why this module can't be concatenated, undefined when it can be concatenated
......@@ -40329,10 +40448,10 @@ class ExternalModule extends Module {
*/
updateHash(hash, context) {
const { chunkGraph } = context;
hash.update(this.externalType);
hash.update(JSON.stringify(this.request));
hash.update(
JSON.stringify(Boolean(this.isOptional(chunkGraph.moduleGraph)))
`${this.externalType}${JSON.stringify(this.request)}${this.isOptional(
chunkGraph.moduleGraph
)}`
);
super.updateHash(hash, context);
}
......@@ -44660,10 +44779,15 @@ class FlagDependencyUsagePlugin {
stage: STAGE_DEFAULT
},
modules => {
if (compilation.moduleMemCaches) {
throw new Error(
"optimization.usedExports can't be used with cacheUnaffected as export usage is a global effect"
);
}
const logger = compilation.getLogger(
"webpack.FlagDependencyUsagePlugin"
);
/** @type {Map<ExportsInfo, Module>} */
const exportInfoToModuleMap = new Map();
......@@ -48918,7 +49042,7 @@ const EMPTY_SET = new Set();
/**
* @param {SortableSet<ModuleGraphConnection>} set input
* @returns {readonly Map<Module, readonly ModuleGraphConnection[]>} mapped by origin module
* @returns {readonly Map<Module | undefined, readonly ModuleGraphConnection[]>} mapped by origin module
*/
const getConnectionsByOriginModule = set => {
const map = new Map();
......@@ -48946,11 +49070,41 @@ const getConnectionsByOriginModule = set => {
return map;
};
/**
* @param {SortableSet<ModuleGraphConnection>} set input
* @returns {readonly Map<Module | undefined, readonly ModuleGraphConnection[]>} mapped by module
*/
const getConnectionsByModule = set => {
const map = new Map();
/** @type {Module | 0} */
let lastModule = 0;
/** @type {ModuleGraphConnection[]} */
let lastList = undefined;
for (const connection of set) {
const { module } = connection;
if (lastModule === module) {
lastList.push(connection);
} else {
lastModule = module;
const list = map.get(module);
if (list !== undefined) {
lastList = list;
list.push(connection);
} else {
const list = [connection];
lastList = list;
map.set(module, list);
}
}
}
return map;
};
class ModuleGraphModule {
constructor() {
/** @type {SortableSet<ModuleGraphConnection>} */
this.incomingConnections = new SortableSet();
/** @type {Set<ModuleGraphConnection> | undefined} */
/** @type {SortableSet<ModuleGraphConnection> | undefined} */
this.outgoingConnections = undefined;
/** @type {Module | null} */
this.issuer = undefined;
......@@ -48993,7 +49147,7 @@ class ModuleGraph {
/** @type {WeakTupleMap<any[], any>} */
this._cache = undefined;
/** @type {WeakMap<Module, WeakTupleMap<any, any>>} */
/** @type {Map<Module, WeakTupleMap<any, any>>} */
this._moduleMemCaches = undefined;
}
......@@ -49069,7 +49223,7 @@ class ModuleGraph {
}
mgm._unassignedConnections.push(connection);
if (mgm.outgoingConnections === undefined) {
mgm.outgoingConnections = new Set();
mgm.outgoingConnections = new SortableSet();
}
mgm.outgoingConnections.add(connection);
} else {
......@@ -49171,7 +49325,7 @@ class ModuleGraph {
const oldConnections = oldMgm.outgoingConnections;
if (oldConnections !== undefined) {
if (newMgm.outgoingConnections === undefined) {
newMgm.outgoingConnections = new Set();
newMgm.outgoingConnections = new SortableSet();
}
const newConnections = newMgm.outgoingConnections;
for (const connection of oldConnections) {
......@@ -49208,7 +49362,7 @@ class ModuleGraph {
const oldConnections = oldMgm.outgoingConnections;
if (oldConnections !== undefined) {
if (newMgm.outgoingConnections === undefined) {
newMgm.outgoingConnections = new Set();
newMgm.outgoingConnections = new SortableSet();
}
const newConnections = newMgm.outgoingConnections;
for (const connection of oldConnections) {
......@@ -49323,13 +49477,24 @@ class ModuleGraph {
/**
* @param {Module} module the module
* @returns {readonly Map<Module, readonly ModuleGraphConnection[]>} reasons why a module is included, in a map by source module
* @returns {readonly Map<Module | undefined, readonly ModuleGraphConnection[]>} reasons why a module is included, in a map by source module
*/
getIncomingConnectionsByOriginModule(module) {
const connections = this._getModuleGraphModule(module).incomingConnections;
return connections.getFromUnorderedCache(getConnectionsByOriginModule);
}
/**
* @param {Module} module the module
* @returns {readonly Map<Module | undefined, readonly ModuleGraphConnection[]> | undefined} connections to modules, in a map by module
*/
getOutgoingConnectionsByModule(module) {
const connections = this._getModuleGraphModule(module).outgoingConnections;
return connections === undefined
? undefined
: connections.getFromUnorderedCache(getConnectionsByModule);
}
/**
* @param {Module} module the module
* @returns {ModuleProfile | null} the module profile
......@@ -49617,7 +49782,7 @@ class ModuleGraph {
}
/**
* @param {WeakMap<Module, WeakTupleMap<any, any>>} moduleMemCaches mem caches for modules for better caching
* @param {Map<Module, WeakTupleMap<any, any>>} moduleMemCaches mem caches for modules for better caching
*/
setModuleMemCaches(moduleMemCaches) {
this._moduleMemCaches = moduleMemCaches;
......@@ -61156,7 +61321,7 @@ class WebpackOptionsApply extends OptionsApply {
"'cache.cacheUnaffected: true' is only allowed when 'experiments.cacheUnaffected' is enabled"
);
}
compiler.moduleMemCaches = new WeakMap();
compiler.moduleMemCaches = new Map();
}
break;
}
......@@ -61183,7 +61348,7 @@ class WebpackOptionsApply extends OptionsApply {
"'cache.memoryCacheUnaffected: true' is only allowed when 'experiments.cacheUnaffected' is enabled"
);
}
compiler.moduleMemCaches = new WeakMap();
compiler.moduleMemCaches = new Map();
}
switch (cacheOptions.store) {
case "pack": {
......@@ -87928,11 +88093,9 @@ class ArrayPushCallbackChunkFormatPlugin {
"ArrayPushCallbackChunkFormatPlugin",
(chunk, hash, { chunkGraph, runtimeTemplate }) => {
if (chunk.hasRuntime()) return;
hash.update("ArrayPushCallbackChunkFormatPlugin");
hash.update("1");
hash.update(`${runtimeTemplate.outputOptions.chunkLoadingGlobal}`);
hash.update(`${runtimeTemplate.outputOptions.hotUpdateGlobal}`);
hash.update(`${runtimeTemplate.outputOptions.globalObject}`);
hash.update(
`ArrayPushCallbackChunkFormatPlugin1${runtimeTemplate.outputOptions.chunkLoadingGlobal}${runtimeTemplate.outputOptions.hotUpdateGlobal}${runtimeTemplate.outputOptions.globalObject}`
);
const entries = Array.from(
chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk)
);
......@@ -102281,6 +102444,11 @@ class MangleExportsPlugin {
compilation.hooks.optimizeCodeGeneration.tap(
"MangleExportsPlugin",
modules => {
if (compilation.moduleMemCaches) {
throw new Error(
"optimization.mangleExports can't be used with cacheUnaffected as export mangling is a global effect"
);
}
for (const module of modules) {
const isNamespace =
module.buildMeta && module.buildMeta.exportsType === "namespace";
......@@ -121694,41 +121862,47 @@ module.exports = StackedMap;
class StringXor {
constructor() {
this._value = undefined;
this._buffer = undefined;
}
/**
* @param {string} str string
* @returns {void}
*/
add(str) {
let buf = this._buffer;
let value;
if (buf === undefined) {
buf = this._buffer = Buffer.from(str, "latin1");
this._value = Buffer.from(buf);
const len = str.length;
const value = this._value;
if (value === undefined) {
const newValue = (this._value = Buffer.allocUnsafe(len));
for (let i = 0; i < len; i++) {
newValue[i] = str.charCodeAt(i);
}
return;
} else if (buf.length !== str.length) {
value = this._value;
buf = this._buffer = Buffer.from(str, "latin1");
if (value.length < buf.length) {
this._value = Buffer.allocUnsafe(buf.length);
value.copy(this._value);
this._value.fill(0, value.length);
value = this._value;
}
const valueLen = value.length;
if (valueLen < len) {
const newValue = (this._value = Buffer.allocUnsafe(len));
let i;
for (i = 0; i < valueLen; i++) {
newValue[i] = value[i] ^ str.charCodeAt(i);
}
for (; i < len; i++) {
newValue[i] = str.charCodeAt(i);
}
} else {
value = this._value;
buf.write(str, "latin1");
}
const len = buf.length;
for (let i = 0; i < len; i++) {
value[i] = value[i] ^ buf[i];
for (let i = 0; i < len; i++) {
value[i] = value[i] ^ str.charCodeAt(i);
}
}
}
toString() {
return this._value === undefined ? "" : this._value.toString("latin1");
const value = this._value;
return value === undefined ? "" : value.toString("latin1");
}
updateHash(hash) {
if (this._value !== undefined) hash.update(this._value);
const value = this._value;
if (value !== undefined) hash.update(value);
}
}
......@@ -252,7 +252,7 @@
"webpack-sources1": "npm:webpack-sources@1.4.3",
"webpack-sources3": "npm:webpack-sources@3.2.0",
"webpack4": "npm:webpack@4.44.1",
"webpack5": "npm:webpack@5.56.0"
"webpack5": "npm:webpack@5.57.1"
},
"resolutions": {
"browserslist": "4.16.6",
......
......@@ -19974,10 +19974,10 @@ webpack-sources@^3.2.0:
watchpack "^1.7.4"
webpack-sources "^1.4.1"
"webpack5@npm:webpack@5.56.0":
version "5.56.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.56.0.tgz#91a04de09c85765002818678538c319b6e461324"
integrity sha512-pJ7esw2AGkpZL0jqsEAKnDEfRZdrc9NVjAWA+d1mFkwj68ng9VQ6+Wnrl+kS5dlDHvrat5ASK5vd7wp6I7f53Q==
"webpack5@npm:webpack@5.57.1":
version "5.57.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.57.1.tgz#ead5ace2c17ecef2ae8126f143bfeaa7f55eab44"
integrity sha512-kHszukYjTPVfCOEyrUthA3jqJwduY/P3eO8I0gMNOZGIQWKAwZftxmp5hq6paophvwo9NoUrcZOecs9ulOyyTg==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.50"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment