Skip to content

Commit a5056dc

Browse files
authored
Webpack+tapable passthrough newest versions (DefinitelyTyped#51712)
* Webpack+tapable passthrough newest versions Webpack and tapable's newest versions ship their own types, but webpack@4 still has types on Definitely Typed, as do lots of webpack plugins. All these plugins still target webpack@4; they cannot target anything higher while webpack still has types on DT. However, this causes a problem for people who need to use plugins with the newest webpack. They get webpack@5 types from webpack directly and webpack@4 types from DT-typed webpack plugins. These types conflict. After discussion with some other members of the community, I decided to add `@types/webpack@5` via a passthrough of webpack@5; index.d.ts just re-exports the entire module of webpack itself. I had to do the same for tapable to make webpack compile. This is *not* a completed PR; I'm opening it for discussion purposes. Weback and tapable pass individually, but none of their dependents do. Tasks left to do: - webpack@5's types appear to require Typescript 3.7; dependents need to require it to. - Upgrade all dependents' usage of webpack to 5. - Or: manually alias webpack to webpack/v4 for dependents that should not update to 5. I know very little about webpack 4 or 5, so I don't know how big a task upgrading is. And I don't know whether 5 is backward compatible, so maybe it's a good thing that old plugins don't compile with 5. Related: - DefinitelyTyped#49755, a PR to *remove* webpack typings entirely, which seems bad since it prevents bugfixes to webpack@4's types. * Switch first plugin to v4 and fix tapable header And tslint * redirect to webpack@4,tapable@1 in tsconfigs * Add explicit typescript version * update dependents of dependents
1 parent c994eb1 commit a5056dc

File tree

266 files changed

+4308
-3222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+4308
-3222
lines changed

types/appcache-webpack-plugin/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Project: https://github.com/lettertwo/appcache-webpack-plugin
33
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
// TypeScript Version: 3.7
56

67
import webpack = require('webpack');
78

types/appcache-webpack-plugin/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"typeRoots": [
1313
"../"
1414
],
15+
"paths": {
16+
"webpack": [
17+
"webpack/v4"
18+
],
19+
"tapable": [
20+
"tapable/v1"
21+
]
22+
},
1523
"types": [],
1624
"noEmit": true,
1725
"forceConsistentCasingInFileNames": true

types/assets-webpack-plugin/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Project: https://github.com/ztoben/assets-webpack-plugin
33
// Definitions by: Michael Strobel <https://github.com/kryops>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5-
// TypeScript Version: 2.3
5+
// TypeScript Version: 3.7
66

77
import { Compiler } from 'webpack';
88

types/assets-webpack-plugin/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"typeRoots": [
1313
"../"
1414
],
15+
"paths": {
16+
"webpack": [
17+
"webpack/v4"
18+
],
19+
"tapable": [
20+
"tapable/v1"
21+
]
22+
},
1523
"types": [],
1624
"noEmit": true,
1725
"forceConsistentCasingInFileNames": true

types/brotli-webpack-plugin/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Project: https://github.com/mynameiswhm/brotli-webpack-plugin
33
// Definitions by: Karol Majewski <https://github.com/karol-majewski>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5-
// TypeScript Version: 2.7
5+
// TypeScript Version: 3.7
66

77
import * as webpack from 'webpack';
88

types/brotli-webpack-plugin/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"typeRoots": [
1313
"../"
1414
],
15+
"paths": {
16+
"webpack": [
17+
"webpack/v4"
18+
],
19+
"tapable": [
20+
"tapable/v1"
21+
]
22+
},
1523
"types": [],
1624
"noEmit": true,
1725
"forceConsistentCasingInFileNames": true

types/browser-sync-webpack-plugin/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Project: https://github.com/Va1/browser-sync-webpack-plugin/blob/master/README.md
33
// Definitions by: Derek Sifford <https://github.com/dsifford>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5-
// TypeScript Version: 3.5
5+
// TypeScript Version: 3.7
66

77
import BrowserSync = require('browser-sync');
88
import { Plugin } from 'webpack';

types/browser-sync-webpack-plugin/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
"noEmit": true,
1313
"forceConsistentCasingInFileNames": true,
1414
"paths": {
15+
"webpack": [
16+
"webpack/v4"
17+
],
18+
"tapable": [
19+
"tapable/v1"
20+
],
1521
"micromatch": [
1622
"micromatch/v2"
1723
]

types/case-sensitive-paths-webpack-plugin/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Project: https://github.com/Urthen/case-sensitive-paths-webpack-plugin#readme
33
// Definitions by: Andrew Makarov <https://github.com/r3nya>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5-
// TypeScript Version: 2.3
5+
// TypeScript Version: 3.7
66

77
import { Plugin, Compiler } from 'webpack';
88

types/case-sensitive-paths-webpack-plugin/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
"typeRoots": [
1212
"../"
1313
],
14+
"paths": {
15+
"webpack": [
16+
"webpack/v4"
17+
],
18+
"tapable": [
19+
"tapable/v1"
20+
]
21+
},
1422
"types": [],
1523
"noEmit": true,
1624
"forceConsistentCasingInFileNames": true,

0 commit comments

Comments
 (0)