Merge pull request #12061 from webpack/deps/typescript

upgrade typescript major version
This commit is contained in:
Tobias Koppers 2020-11-30 11:02:43 +01:00 committed by GitHub
commit 165fa87a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 508 additions and 955 deletions

View File

@ -76,14 +76,17 @@ class WebpackOptionsApply extends OptionsApply {
new NodeTargetPlugin().apply(compiler);
}
if (options.externalsPresets.electronMain) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ElectronTargetPlugin = require("./electron/ElectronTargetPlugin");
new ElectronTargetPlugin("main").apply(compiler);
}
if (options.externalsPresets.electronPreload) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ElectronTargetPlugin = require("./electron/ElectronTargetPlugin");
new ElectronTargetPlugin("preload").apply(compiler);
}
if (options.externalsPresets.electronRenderer) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ElectronTargetPlugin = require("./electron/ElectronTargetPlugin");
new ElectronTargetPlugin("renderer").apply(compiler);
}
@ -93,17 +96,21 @@ class WebpackOptionsApply extends OptionsApply {
!options.externalsPresets.electronPreload &&
!options.externalsPresets.electronRenderer
) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ElectronTargetPlugin = require("./electron/ElectronTargetPlugin");
new ElectronTargetPlugin().apply(compiler);
}
if (options.externalsPresets.nwjs) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ExternalsPlugin = require("./ExternalsPlugin");
new ExternalsPlugin("commonjs", "nw.gui").apply(compiler);
}
if (options.externalsPresets.webAsync) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ExternalsPlugin = require("./ExternalsPlugin");
new ExternalsPlugin("import", /^(https?:\/\/|std:)/).apply(compiler);
} else if (options.externalsPresets.web) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ExternalsPlugin = require("./ExternalsPlugin");
new ExternalsPlugin("module", /^(https?:\/\/|std:)/).apply(compiler);
}
@ -155,6 +162,7 @@ class WebpackOptionsApply extends OptionsApply {
}
if (options.externals) {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const ExternalsPlugin = require("./ExternalsPlugin");
new ExternalsPlugin(options.externalsType, options.externals).apply(
compiler
@ -420,6 +428,7 @@ class WebpackOptionsApply extends OptionsApply {
break;
}
case "size": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const OccurrenceChunkIdsPlugin = require("./ids/OccurrenceChunkIdsPlugin");
new OccurrenceChunkIdsPlugin({
prioritiseInitial: true
@ -427,6 +436,7 @@ class WebpackOptionsApply extends OptionsApply {
break;
}
case "total-size": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const OccurrenceChunkIdsPlugin = require("./ids/OccurrenceChunkIdsPlugin");
new OccurrenceChunkIdsPlugin({
prioritiseInitial: false
@ -478,6 +488,7 @@ class WebpackOptionsApply extends OptionsApply {
const cacheOptions = options.cache;
switch (cacheOptions.type) {
case "memory": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const MemoryCachePlugin = require("./cache/MemoryCachePlugin");
new MemoryCachePlugin().apply(compiler);
break;
@ -488,6 +499,7 @@ class WebpackOptionsApply extends OptionsApply {
const list = cacheOptions.buildDependencies[key];
new AddBuildDependenciesPlugin(list).apply(compiler);
}
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const MemoryCachePlugin = require("./cache/MemoryCachePlugin");
new MemoryCachePlugin().apply(compiler);
switch (cacheOptions.store) {

View File

@ -13,7 +13,6 @@ const HarmonyImportDependency = require("./HarmonyImportDependency");
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../Dependency")} Dependency */
/** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */
/** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */

View File

@ -81,6 +81,7 @@ class EnableChunkLoadingPlugin {
break;
}
case "require": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const CommonJsChunkLoadingPlugin = require("../node/CommonJsChunkLoadingPlugin");
new CommonJsChunkLoadingPlugin({
asyncChunkLoading: false
@ -88,6 +89,7 @@ class EnableChunkLoadingPlugin {
break;
}
case "async-node": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const CommonJsChunkLoadingPlugin = require("../node/CommonJsChunkLoadingPlugin");
new CommonJsChunkLoadingPlugin({
asyncChunkLoading: true

View File

@ -76,6 +76,7 @@ class EnableLibraryPlugin {
}).apply(compiler);
switch (type) {
case "var": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,
@ -86,6 +87,7 @@ class EnableLibraryPlugin {
break;
}
case "assign": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,
@ -96,6 +98,7 @@ class EnableLibraryPlugin {
break;
}
case "this": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,
@ -106,6 +109,7 @@ class EnableLibraryPlugin {
break;
}
case "window": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,
@ -116,6 +120,7 @@ class EnableLibraryPlugin {
break;
}
case "self": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,
@ -126,6 +131,7 @@ class EnableLibraryPlugin {
break;
}
case "global": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,
@ -136,6 +142,7 @@ class EnableLibraryPlugin {
break;
}
case "commonjs": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,
@ -147,6 +154,7 @@ class EnableLibraryPlugin {
}
case "commonjs2":
case "commonjs-module": {
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
new AssignLibraryPlugin({
type,

View File

@ -308,10 +308,11 @@ register(
register(
ValidationError,
CURRENT_MODULE,
"schema-util/ValidationError",
"schema-utils/ValidationError",
new (class ValidationErrorSerializer {
// TODO error should be ValidationError, but this fails the type checks
/**
* @param {ValidationError} error the source map source to be serialized
* @param {TODO} error the source map source to be serialized
* @param {WebpackObjectSerializerContext} context context
* @returns {void}
*/
@ -327,7 +328,7 @@ register(
/**
* @param {ObjectDeserializerContext} context context
* @returns {ValidationError} error
* @returns {TODO} error
*/
deserialize({ read }) {
return new ValidationError(read(), read(), read());

View File

@ -94,7 +94,7 @@
"toml": "^3.0.0",
"tooling": "webpack/tooling#v1.10.0",
"ts-loader": "^8.0.2",
"typescript": "^3.9.7",
"typescript": "^4.2.0-dev.20201130",
"url-loader": "^4.1.0",
"wast-loader": "^1.9.0",
"webassembly-feature": "1.3.0",

View File

@ -1,4 +1,8 @@
const { HttpUriPlugin } = require("../../../../").experiments.schemes;
const {
experiments: {
schemes: { HttpUriPlugin }
}
} = require("../../../../");
const ServerPlugin = require("./server");
/** @type {import("../../../../").Configuration} */

View File

@ -1,4 +1,8 @@
const { HttpsUriPlugin } = require("../../../../").experiments.schemes;
const {
experiments: {
schemes: { HttpsUriPlugin }
}
} = require("../../../../");
/** @type {import("../../../../").Configuration} */
module.exports = {

1411
types.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@ -6472,10 +6472,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"
typescript@^3.9.7:
version "3.9.7"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
typescript@^4.2.0-dev.20201130:
version "4.2.0-dev.20201130"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.0-dev.20201130.tgz#13339af4dfd23070dcd16f28e590efe541c766c4"
integrity sha512-oMboCGPKWDJ8BFmmanPAWw3LUGlEXSkkF+MbuHu97i1iF7K4z4zjmnodoD3Dilqs2IMuVDmWBIkmget9xMrpTw==
uglify-js@^3.1.4:
version "3.10.1"