Browse Source

pretty files

tags/v4.34.0
Tobias Koppers 6 months ago
parent
commit
fd4b3c503a
17 changed files with 33 additions and 95 deletions
  1. +1
    -1
      declarations.d.ts
  2. +2
    -6
      lib/ChunkGroup.js
  3. +2
    -6
      lib/Compilation.js
  4. +1
    -3
      lib/MainTemplate.js
  5. +1
    -3
      lib/NormalModuleFactory.js
  6. +1
    -3
      lib/dependencies/HarmonyExportImportedSpecifierDependency.js
  7. +1
    -3
      lib/dependencies/HarmonyImportSpecifierDependency.js
  8. +8
    -24
      lib/dependencies/ImportParserPlugin.js
  9. +1
    -3
      lib/dependencies/LoaderPlugin.js
  10. +1
    -3
      lib/dependencies/WebAssemblyImportDependency.js
  11. +1
    -3
      lib/optimize/ChunkModuleIdRangePlugin.js
  12. +6
    -18
      lib/optimize/ConcatenatedModule.js
  13. +1
    -3
      lib/wasm/WasmFinalizeExportsPlugin.js
  14. +1
    -3
      lib/wasm/WasmMainTemplatePlugin.js
  15. +1
    -3
      lib/web/JsonpMainTemplatePlugin.js
  16. +1
    -1
      open-bot.yaml
  17. +3
    -9
      test/BenchmarkTestCases.benchmark.js

+ 1
- 1
declarations.d.ts View File

@@ -59,7 +59,7 @@ declare module "neo-async" {
}

export type AsyncAutoTasks<R extends Dictionary<any>, E> = {
[K in keyof R]: AsyncAutoTask<R[K], R, E>
[K in keyof R]: AsyncAutoTask<R[K], R, E>;
};
export type AsyncAutoTask<R1, R extends Dictionary<any>, E> =
| AsyncAutoTaskFunctionWithoutDependencies<R1, E>

+ 2
- 6
lib/ChunkGroup.js View File

@@ -496,18 +496,14 @@ class ChunkGroup {
for (const child of chunk._children) {
if (!child._parents.has(chunk)) {
throw new Error(
`checkConstraints: child missing parent ${chunk.debugId} -> ${
child.debugId
}`
`checkConstraints: child missing parent ${chunk.debugId} -> ${child.debugId}`
);
}
}
for (const parentChunk of chunk._parents) {
if (!parentChunk._children.has(chunk)) {
throw new Error(
`checkConstraints: parent missing child ${parentChunk.debugId} <- ${
chunk.debugId
}`
`checkConstraints: parent missing child ${parentChunk.debugId} <- ${chunk.debugId}`
);
}
}

+ 2
- 6
lib/Compilation.js View File

@@ -694,9 +694,7 @@ class Compilation extends Tapable {
const factory = this.dependencyFactories.get(dep.constructor);
if (factory === undefined) {
throw new Error(
`No module factory available for dependency type: ${
dep.constructor.name
}`
`No module factory available for dependency type: ${dep.constructor.name}`
);
}
let innerMap = dependencies.get(factory);
@@ -958,9 +956,7 @@ class Compilation extends Tapable {
const moduleFactory = this.dependencyFactories.get(Dep);
if (!moduleFactory) {
throw new Error(
`No dependency factory available for this dependency type: ${
dependency.constructor.name
}`
`No dependency factory available for this dependency type: ${dependency.constructor.name}`
);
}


+ 1
- 3
lib/MainTemplate.js View File

@@ -345,9 +345,7 @@ module.exports = class MainTemplate extends Tapable {
buf.push("");
buf.push("// Object.prototype.hasOwnProperty.call");
buf.push(
`${
this.requireFn
}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };`
`${this.requireFn}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };`
);

const publicPath = this.getPublicPath({

+ 1
- 3
lib/NormalModuleFactory.js View File

@@ -435,9 +435,7 @@ class NormalModuleFactory extends Tapable {
err.message +
"\n" +
"BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" +
` You need to specify '${
item.loader
}-loader' instead of '${item.loader}',\n` +
` You need to specify '${item.loader}-loader' instead of '${item.loader}',\n` +
" see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed";
}
callback(err);

+ 1
- 3
lib/dependencies/HarmonyExportImportedSpecifierDependency.js View File

@@ -382,9 +382,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
// We are sure that it's not provided
const idIsNotNameMessage =
this._id !== this.name ? ` (reexported as '${this.name}')` : "";
const errorMessage = `"export '${
this._id
}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
return [new HarmonyLinkingError(errorMessage)];
}


+ 1
- 3
lib/dependencies/HarmonyImportSpecifierDependency.js View File

@@ -107,9 +107,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
// We are sure that it's not provided
const idIsNotNameMessage =
this._id !== this.name ? ` (imported as '${this.name}')` : "";
const errorMessage = `"export '${
this._id
}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
return [new HarmonyLinkingError(errorMessage)];
}


+ 8
- 24
lib/dependencies/ImportParserPlugin.js View File

@@ -43,9 +43,7 @@ class ImportParserPlugin {
const { comment } = e;
parser.state.module.warnings.push(
new CommentCompilationWarning(
`Compilation error while processing magic comment(-s): /*${
comment.value
}*/: ${e.message}`,
`Compilation error while processing magic comment(-s): /*${comment.value}*/: ${e.message}`,
parser.state.module,
comment.loc
)
@@ -59,9 +57,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
parser.state.module,
`\`webpackIgnore\` expected a boolean, but received: ${
importOptions.webpackIgnore
}.`,
`\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`,
expr.loc
)
);
@@ -77,9 +73,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
parser.state.module,
`\`webpackChunkName\` expected a string, but received: ${
importOptions.webpackChunkName
}.`,
`\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`,
expr.loc
)
);
@@ -92,9 +86,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
parser.state.module,
`\`webpackMode\` expected a string, but received: ${
importOptions.webpackMode
}.`,
`\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`,
expr.loc
)
);
@@ -111,9 +103,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
parser.state.module,
`\`webpackPrefetch\` expected true or a number, but received: ${
importOptions.webpackPrefetch
}.`,
`\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`,
expr.loc
)
);
@@ -128,9 +118,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
parser.state.module,
`\`webpackPreload\` expected true or a number, but received: ${
importOptions.webpackPreload
}.`,
`\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`,
expr.loc
)
);
@@ -144,9 +132,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
parser.state.module,
`\`webpackInclude\` expected a regular expression, but received: ${
importOptions.webpackInclude
}.`,
`\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`,
expr.loc
)
);
@@ -162,9 +148,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push(
new UnsupportedFeatureWarning(
parser.state.module,
`\`webpackExclude\` expected a regular expression, but received: ${
importOptions.webpackExclude
}.`,
`\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`,
expr.loc
)
);

+ 1
- 3
lib/dependencies/LoaderPlugin.js View File

@@ -49,9 +49,7 @@ class LoaderPlugin {
if (factory === undefined) {
return callback(
new Error(
`No module factory available for dependency type: ${
dep.constructor.name
}`
`No module factory available for dependency type: ${dep.constructor.name}`
)
);
}

+ 1
- 3
lib/dependencies/WebAssemblyImportDependency.js View File

@@ -40,9 +40,7 @@ class WebAssemblyImportDependency extends ModuleDependency {
) {
return [
new UnsupportedWebAssemblyFeatureError(
`Import "${this.name}" from "${this.request}" with ${
this.onlyDirectImport
} can only be used for direct wasm to wasm dependencies`
`Import "${this.name}" from "${this.request}" with ${this.onlyDirectImport} can only be used for direct wasm to wasm dependencies`
)
];
}

+ 1
- 3
lib/optimize/ChunkModuleIdRangePlugin.js View File

@@ -26,9 +26,7 @@ class ChunkModuleIdRangePlugin {
);
if (!chunk) {
throw new Error(
`ChunkModuleIdRangePlugin: Chunk with name '${
options.name
}"' was not found`
`ChunkModuleIdRangePlugin: Chunk with name '${options.name}"' was not found`
);
}


+ 6
- 18
lib/optimize/ConcatenatedModule.js View File

@@ -1136,23 +1136,17 @@ class ConcatenatedModule extends Module {
if (info.interopNamespaceObjectUsed) {
if (info.module.buildMeta.exportsType === "named") {
result.add(
`var ${
info.interopNamespaceObjectName
} = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n`
`var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n`
);
} else if (!info.module.buildMeta.exportsType) {
result.add(
`var ${
info.interopNamespaceObjectName
} = /*#__PURE__*/__webpack_require__.t(${info.name});\n`
`var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name});\n`
);
}
}
if (info.interopDefaultAccessUsed) {
result.add(
`var ${
info.interopDefaultAccessName
} = /*#__PURE__*/__webpack_require__.n(${info.name});\n`
`var ${info.interopDefaultAccessName} = /*#__PURE__*/__webpack_require__.n(${info.name});\n`
);
}
break;
@@ -1266,9 +1260,7 @@ class HarmonyImportSpecifierDependencyConcatenatedTemplate {
}_ns${strictFlag}__[${JSON.stringify(dep._id)}]`;
} else {
const exportData = Buffer.from(dep._id, "utf-8").toString("hex");
content = `__WEBPACK_MODULE_REFERENCE__${
info.index
}_${exportData}${callFlag}${strictFlag}__`;
content = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${callFlag}${strictFlag}__`;
}
if (dep.shorthand) {
content = dep.name + ": " + content;
@@ -1464,14 +1456,10 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate {
? "_strict"
: "";
if (def.id === true) {
finalName = `__WEBPACK_MODULE_REFERENCE__${
info.index
}_ns${strictFlag}__`;
finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_ns${strictFlag}__`;
} else {
const exportData = Buffer.from(def.id, "utf-8").toString("hex");
finalName = `__WEBPACK_MODULE_REFERENCE__${
info.index
}_${exportData}${strictFlag}__`;
finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${strictFlag}__`;
}
const exportsName = this.rootModule.exportsArgument;
const content =

+ 1
- 3
lib/wasm/WasmFinalizeExportsPlugin.js View File

@@ -46,9 +46,7 @@ class WasmFinalizeExportsPlugin {
// 4. error
/** @type {any} */
const error = new UnsupportedWebAssemblyFeatureError(
`Export "${name}" with ${
jsIncompatibleExports[name]
} can only be used for direct wasm to wasm dependencies`
`Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies`
);
error.module = module;
error.origin = reason.module;

+ 1
- 3
lib/wasm/WasmMainTemplatePlugin.js View File

@@ -307,9 +307,7 @@ class WasmMainTemplatePlugin {
"}",
"promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {",
Template.indent([
`return ${
mainTemplate.requireFn
}.w[wasmModuleId] = (res.instance || res).exports;`
`return ${mainTemplate.requireFn}.w[wasmModuleId] = (res.instance || res).exports;`
]),
"}));"
]),

+ 1
- 3
lib/web/JsonpMainTemplatePlugin.js View File

@@ -340,9 +340,7 @@ class JsonpMainTemplatePlugin {
source,
"",
"// on error function for async loading",
`${
mainTemplate.requireFn
}.oe = function(err) { console.error(err); throw err; };`
`${mainTemplate.requireFn}.oe = function(err) { console.error(err); throw err; };`
]);
}
);

+ 1
- 1
open-bot.yaml View File

@@ -505,7 +505,7 @@ rules:
context: "licence/cla"
description: "Contributor License Agreement is not needed for this user."
state: "success"
# merge dependabot PRs automatically
- filters:
open: true

+ 3
- 9
test/BenchmarkTestCases.benchmark.js View File

@@ -279,9 +279,7 @@ describe("BenchmarkTestCases", function() {
describe(`${testName} create benchmarks`, function() {
baselines.forEach(baseline => {
let baselineStats = null;
it(`should benchmark ${baseline.name} (${
baseline.rev
})`, function(done) {
it(`should benchmark ${baseline.name} (${baseline.rev})`, function(done) {
const outputDirectory = path.join(
__dirname,
"js",
@@ -332,14 +330,10 @@ describe("BenchmarkTestCases", function() {
}, 180000);

if (baseline.name !== "HEAD") {
it(`HEAD should not be slower than ${baseline.name} (${
baseline.rev
})`, function() {
it(`HEAD should not be slower than ${baseline.name} (${baseline.rev})`, function() {
if (baselineStats.maxConfidence < headStats.minConfidence) {
throw new Error(
`HEAD (${headStats.text}) is slower than ${baseline.name} (${
baselineStats.text
}) (90% confidence)`
`HEAD (${headStats.text}) is slower than ${baseline.name} (${baselineStats.text}) (90% confidence)`
);
} else if (
baselineStats.minConfidence > headStats.maxConfidence

Loading…
Cancel
Save