Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependencies in-range #10183

Merged
merged 1 commit into from
Dec 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions declarations/WebpackOptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export type Externals =
request: string,
callback: (err?: Error, result?: string) => void
) => void)
| ExternalItem)[];
| ExternalItem
)[];
/**
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "ExternalItem".
Expand Down Expand Up @@ -391,7 +392,8 @@ export interface WebpackOptions {
| "normal"
| "detailed"
| "verbose"
| "errors-warnings");
| "errors-warnings"
);
/**
* Environment to build for
*/
Expand All @@ -404,7 +406,8 @@ export interface WebpackOptions {
| "node-webkit"
| "electron-main"
| "electron-renderer"
| "electron-preload")
| "electron-preload"
)
| ((compiler: import("../lib/Compiler")) => void);
/**
* Enter watch mode, which rebuilds on file change.
Expand Down
14 changes: 8 additions & 6 deletions lib/CommonJsStuffPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,20 @@ class CommonJsStuffPlugin {
.tap("CommonJsStuffPlugin", expr => {
parser.state.module.buildMeta.moduleConcatenationBailout =
"module.loaded";
return ParserHelpers.toConstantDependency(parser, "module.l")(
expr
);
return ParserHelpers.toConstantDependency(
parser,
"module.l"
)(expr);
});
parser.hooks.expression
.for("module.id")
.tap("CommonJsStuffPlugin", expr => {
parser.state.module.buildMeta.moduleConcatenationBailout =
"module.id";
return ParserHelpers.toConstantDependency(parser, "module.i")(
expr
);
return ParserHelpers.toConstantDependency(
parser,
"module.i"
)(expr);
});
parser.hooks.expression
.for("module.exports")
Expand Down
14 changes: 8 additions & 6 deletions lib/DefinePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ class DefinePlugin {
strCode
)(expr);
} else {
return ParserHelpers.toConstantDependency(parser, strCode)(
expr
);
return ParserHelpers.toConstantDependency(
parser,
strCode
)(expr);
}
});
}
Expand Down Expand Up @@ -255,9 +256,10 @@ class DefinePlugin {
strCode
)(expr);
} else {
return ParserHelpers.toConstantDependency(parser, strCode)(
expr
);
return ParserHelpers.toConstantDependency(
parser,
strCode
)(expr);
}
});
parser.hooks.typeof.for(key).tap("DefinePlugin", expr => {
Expand Down
7 changes: 4 additions & 3 deletions lib/ProvidePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ class ProvidePlugin {
return false;
}
if (scopedName) {
ParserHelpers.toConstantDependency(parser, nameIdentifier)(
expr
);
ParserHelpers.toConstantDependency(
parser,
nameIdentifier
)(expr);
}
return true;
});
Expand Down
33 changes: 15 additions & 18 deletions lib/logging/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,31 @@

"use strict";

/**
* @enum {string}
*/
const LogType = Object.freeze({
error: "error", // message, c style arguments
warn: "warn", // message, c style arguments
info: "info", // message, c style arguments
log: "log", // message, c style arguments
debug: "debug", // message, c style arguments
error: /** @type {"error"} */ ("error"), // message, c style arguments
warn: /** @type {"warn"} */ ("warn"), // message, c style arguments
info: /** @type {"info"} */ ("info"), // message, c style arguments
log: /** @type {"log"} */ ("log"), // message, c style arguments
debug: /** @type {"debug"} */ ("debug"), // message, c style arguments

trace: "trace", // no arguments
trace: /** @type {"trace"} */ ("trace"), // no arguments

group: "group", // [label]
groupCollapsed: "groupCollapsed", // [label]
groupEnd: "groupEnd", // [label]
group: /** @type {"group"} */ ("group"), // [label]
groupCollapsed: /** @type {"groupCollapsed"} */ ("groupCollapsed"), // [label]
groupEnd: /** @type {"groupEnd"} */ ("groupEnd"), // [label]

profile: "profile", // [profileName]
profileEnd: "profileEnd", // [profileName]
profile: /** @type {"profile"} */ ("profile"), // [profileName]
profileEnd: /** @type {"profileEnd"} */ ("profileEnd"), // [profileName]

time: "time", // name, time as [seconds, nanoseconds]
time: /** @type {"time"} */ ("time"), // name, time as [seconds, nanoseconds]

clear: "clear", // no arguments
status: "status" // message, arguments
clear: /** @type {"clear"} */ ("clear"), // no arguments
status: /** @type {"status"} */ ("status") // message, arguments
});

exports.LogType = LogType;

/** @typedef {keyof typeof LogType} LogTypeEnum */
/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */

const LOG_SYMBOL = Symbol("webpack logger raw log method");
const TIMERS_SYMBOL = Symbol("webpack logger times");
Expand Down
5 changes: 4 additions & 1 deletion setup/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function checkSymlinkExistsAsync() {
function ensureYarnInstalledAsync() {
const semverPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/;
return execGetOutput("yarn", ["-v"], "Check yarn version")
.then(stdout => semverPattern.test(stdout), () => false)
.then(
stdout => semverPattern.test(stdout),
() => false
)
.then(hasYarn => hasYarn || installYarnAsync());
}

Expand Down
10 changes: 8 additions & 2 deletions test/NormalModule.unittest.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,14 @@ describe("NormalModule", () => {
fileB = "fileB";
fileDependencies = [fileA, fileB];
contextDependencies = [fileA, fileB];
fileTimestamps = new Map([[fileA, 1], [fileB, 1]]);
contextTimestamps = new Map([[fileA, 1], [fileB, 1]]);
fileTimestamps = new Map([
[fileA, 1],
[fileB, 1]
]);
contextTimestamps = new Map([
[fileA, 1],
[fileB, 1]
]);
normalModule.buildTimestamp = 2;
setDeps(fileDependencies, contextDependencies);
});
Expand Down
30 changes: 15 additions & 15 deletions test/__snapshots__/StatsTestCases.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,9 @@ Entrypoint main = main.js
`;

exports[`StatsTestCases should print correct stats for filter-warnings 1`] = `
"Hash: b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0
"Hash: 167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce
Child undefined:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down Expand Up @@ -855,49 +855,49 @@ Child undefined:

WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child Terser:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child /Terser/:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child warnings => true:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child [Terser]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child [/Terser/]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child [warnings => true]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child should not filter:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down Expand Up @@ -926,7 +926,7 @@ Child should not filter:

WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child /should not filter/:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down Expand Up @@ -955,7 +955,7 @@ Child /should not filter/:

WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child warnings => false:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down Expand Up @@ -984,7 +984,7 @@ Child warnings => false:

WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child [should not filter]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down Expand Up @@ -1013,7 +1013,7 @@ Child [should not filter]:

WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child [/should not filter/]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down Expand Up @@ -1042,7 +1042,7 @@ Child [/should not filter/]:

WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child [warnings => false]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down Expand Up @@ -3523,7 +3523,7 @@ Entrypoint main = bundle.js
`;

exports[`StatsTestCases should print correct stats for warnings-terser 1`] = `
"Hash: d747afbed2a2cf9a7f5d
"Hash: b1d135d55f1314d24fc5
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
Expand Down