-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Webpack 5.0.0+ contains its own typings instead of @types/webpack #49755
base: master
Are you sure you want to change the base?
Conversation
@dl748 Thank you for submitting this PR! This is a live comment which I will keep updated. This PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this? 2 packages in this PR
Code ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 49755,
"author": "dl748",
"headCommitAbbrOid": "21cef11",
"headCommitOid": "21cef11c481dd884d3f434c0d3ed0cd0a44a2966",
"lastPushDate": "2020-11-24T12:59:30.000Z",
"lastActivityDate": "2020-11-25T16:18:41.000Z",
"maintainerBlessed": false,
"hasMergeConflict": false,
"isFirstContribution": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": null,
"kind": "edit",
"files": [
{
"path": "notNeededPackages.json",
"kind": "infrastructure"
}
],
"owners": [],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
},
{
"name": "appcache-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/appcache-webpack-plugin/package.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "webpack",
"kind": "delete",
"files": [
{
"path": "types/webpack/OTHER_FILES.txt",
"kind": "package-meta",
"suspect": "couldn't fetch contents"
},
{
"path": "types/webpack/index.d.ts",
"kind": "definition"
},
{
"path": "types/webpack/next.d.ts",
"kind": "definition"
},
{
"path": "types/webpack/package.json",
"kind": "package-meta",
"suspect": "couldn't fetch contents"
},
{
"path": "types/webpack/test/index.ts",
"kind": "test"
},
{
"path": "types/webpack/test/next.ts",
"kind": "test"
},
{
"path": "types/webpack/tsconfig.json",
"kind": "package-meta",
"suspect": "couldn't fetch contents"
},
{
"path": "types/webpack/tslint.json",
"kind": "package-meta",
"suspect": "couldn't fetch contents"
},
{
"path": "types/webpack/v3/index.d.ts",
"kind": "definition"
},
{
"path": "types/webpack/v3/tsconfig.json",
"kind": "package-meta",
"suspect": "couldn't fetch contents"
},
{
"path": "types/webpack/v3/tslint.json",
"kind": "package-meta",
"suspect": "couldn't fetch contents"
},
{
"path": "types/webpack/v3/webpack-tests.ts",
"kind": "test"
}
],
"owners": [
"tkqubo",
"bumbleblym",
"bcherny",
"tommytroylin",
"mohsen1",
"jcreamer898",
"alan-agius4",
"dennispg",
"christophehurpeau",
"ZSkycat",
"johnnyreilly",
"rwaskiewicz",
"kuehlein",
"grgur",
"rubenspgcavalcante",
"andersk",
"ofhouse",
"danielthank",
"sasurau4",
"dionshihk",
"peterblazejewicz",
"spamshaker"
],
"addedOwners": [],
"deletedOwners": [
"tkqubo",
"bumbleblym",
"bcherny",
"tommytroylin",
"mohsen1",
"jcreamer898",
"alan-agius4",
"dennispg",
"christophehurpeau",
"ZSkycat",
"johnnyreilly",
"rwaskiewicz",
"kuehlein",
"grgur",
"rubenspgcavalcante",
"andersk",
"ofhouse",
"danielthank",
"sasurau4",
"dionshihk",
"peterblazejewicz",
"spamshaker"
],
"popularityLevel": "Critical"
}
],
"reviews": [],
"ciResult": "fail",
"ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/21cef11c481dd884d3f434c0d3ed0cd0a44a2966/checks?check_suite_id=1553303091"
} |
🔔 @peterblazejewicz @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein @grgur @rubenspgcavalcante @andersk @ofhouse @danielthank @sasurau4 @dionshihk @spamshaker — please review this PR in the next few days. Be sure to explicitly select |
@dl748 The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? appcache-webpack-plugin/v1.4Comparison details for appcache-webpack-plugin/1.4 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. zip-webpack-plugin/v3.0Comparison details for zip-webpack-plugin/3.0 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
I think it is by far to early to remove the types from Webpack v4 because the maintainers are still accepting PRs for it. |
AFAIK, thats not how types works. You mark what version of the package has its own typings, in this case 5.0.0+. Versions under 5 would still use @types/webpack You can see here https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49755/files#diff-a275c2eae7b8f788a52327e76809026ee1bc5ea614393806c8f3cbab07202621 |
Thank you for owning this! This issue is particularly problematic where plugins still require |
@dl748 What you propose here, is basically deleting the
To clarify here: I am very aware that Webpack v5 comes bundled with it's own types (In fact Webpack v4 package also already contains types for basic things like configuration). But the release of Webpack 5 does not automatically mean that Webpack 4 is now deprecated. To better understand this issue pls have a look at the actual download stats of Currently authors of plugins and loaders are busy to make their stuff compatible for Webpack 5 API but some of them choose the path to support Webpack 4 & 5 at the same time. For them it can be critical to publish new releases of I know the downside of this approach is that developers that are blindly typing |
@ofhouse All good points. The issue I personally ran into was with a couple of plugins that used Is there a way to support v4 through DefinitelyTyped and v5 via Webpack? I wonder if there's a simple way out without rewriting definitions. I agree that dropping types from here would be harmful. |
I have the reverse issue, can't update plugin typings to 5.0+ because any Thereby, errors of 'webpack doesn't export that member' and manually deleting @types/webpack fixes the issue. It makes it impossible to update any "@types/my-webpack-plugin" to 5.0 |
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: - #49755, a PR to *remove* webpack typings entirely, which seems bad since it prevents bugfixes to webpack@4's types.
* 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: - #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
Removing webpack typings.
Unfortunately, this seems to cause problems with other typings that rely on it.
I created a draft for review and discussion