-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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+tapable passthrough newest versions #51712
Conversation
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.
Based on the errors I was getting, I'm fairly certain that many of the types aren't compatible in either direction. IIRC some of the types for tapable didn't have generics in the DT version but required them in the new version. |
👋 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? react-loadable/v5.5Comparison details for react-loadable/5.5 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. tapable/v2.2These typings are for a version of tapable that doesn’t yet exist on master, so I’ve compared them with v1.0.
Wow, it looks like all the big movers moved in the right direction! Way to go! 🌟 I won’t post performance data again unless it gets worse. tapable/v2.2These typings are for a version of tapable that doesn’t yet exist on master, so I’ve compared them with v1.0.
Wow, it looks like all the big movers moved in the right direction! Way to go! 🌟 I won’t post performance data again unless it gets worse. |
This works locally, so I think it's ready to review. |
@sandersn Thank you for submitting this PR! This is a live comment which I will keep updated. 47 packages in this PR
Code ReviewsBecause this PR edits multiple packages, it can be merged once it's reviewed by a DT maintainer. 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": 51712,
"author": "sandersn",
"headCommitOid": "79b547692c173c41ddbd04a410983aa382d093f3",
"lastPushDate": "2021-03-24T23:58:29.000Z",
"lastActivityDate": "2021-03-25T19:46:59.000Z",
"maintainerBlessed": false,
"hasMergeConflict": false,
"isFirstContribution": false,
"popularityLevel": "Popular",
"pkgInfo": [
{
"name": "appcache-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/appcache-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/appcache-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "assets-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/assets-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/assets-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"kryops"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "brotli-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/brotli-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/brotli-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"karol-majewski"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "browser-sync-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/browser-sync-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/browser-sync-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "case-sensitive-paths-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/case-sensitive-paths-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/case-sensitive-paths-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"r3nya"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "circular-dependency-plugin",
"kind": "edit",
"files": [
{
"path": "types/circular-dependency-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/circular-dependency-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"jeremejevs"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "compression-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/compression-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/compression-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/compression-webpack-plugin/v2/index.d.ts",
"kind": "definition"
},
{
"path": "types/compression-webpack-plugin/v2/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"dublicator",
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "copy-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/copy-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/copy-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/copy-webpack-plugin/v5/index.d.ts",
"kind": "definition"
},
{
"path": "types/copy-webpack-plugin/v5/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"flying-sheep",
"avin-kavish",
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "critters-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/critters-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/critters-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"JuanJoseGonGi",
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "csp-html-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/csp-html-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/csp-html-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"Seally"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "css-minimizer-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/css-minimizer-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/css-minimizer-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "customize-cra",
"kind": "edit",
"files": [
{
"path": "types/customize-cra/index.d.ts",
"kind": "definition"
},
{
"path": "types/customize-cra/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"k-yle"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "dotenv-webpack",
"kind": "edit",
"files": [
{
"path": "types/dotenv-webpack/index.d.ts",
"kind": "definition"
},
{
"path": "types/dotenv-webpack/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"karol-majewski",
"davecardwell",
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "duplicate-package-checker-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/duplicate-package-checker-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/duplicate-package-checker-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"mtraynham"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "event-hooks-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/event-hooks-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/event-hooks-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"pine",
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "extra-watch-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/extra-watch-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/extra-watch-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"davecardwell"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "extract-text-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/extract-text-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/extract-text-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"flying-sheep",
"katyo"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "fail-on-errors-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/fail-on-errors-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/fail-on-errors-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"inglec-arista"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "file-loader",
"kind": "edit",
"files": [
{
"path": "types/file-loader/index.d.ts",
"kind": "definition"
},
{
"path": "types/file-loader/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"g-rath"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "friendly-errors-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/friendly-errors-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/friendly-errors-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"bahlo"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "generate-json-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/generate-json-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/generate-json-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"rynclark"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "git-revision-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/git-revision-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/git-revision-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"andersk"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "handlebars-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/handlebars-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/handlebars-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"Odas0R"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "happypack",
"kind": "edit",
"files": [
{
"path": "types/happypack/index.d.ts",
"kind": "definition"
},
{
"path": "types/happypack/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"akashishu777"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "hard-source-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/hard-source-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/hard-source-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"woitechen",
"Yama-Tomo"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "html-replace-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/html-replace-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/html-replace-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"bricka"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "html-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/html-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/html-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"deevus",
"bumbleblym",
"tlaziuk"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "html-webpack-template",
"kind": "edit",
"files": [
{
"path": "types/html-webpack-template/index.d.ts",
"kind": "definition"
},
{
"path": "types/html-webpack-template/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"bumbleblym"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "karma-webpack",
"kind": "edit",
"files": [
{
"path": "types/karma-webpack/index.d.ts",
"kind": "definition"
},
{
"path": "types/karma-webpack/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"mtraynham"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "koa-webpack",
"kind": "edit",
"files": [
{
"path": "types/koa-webpack/index.d.ts",
"kind": "definition"
},
{
"path": "types/koa-webpack/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"malj",
"leebenson",
"miZyind",
"tlaziuk"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "license-checker-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/license-checker-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/license-checker-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"ChaosinaCan"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "loadable__webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/loadable__webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/loadable__webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"skovy"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "loader-utils",
"kind": "edit",
"files": [
{
"path": "types/loader-utils/index.d.ts",
"kind": "definition"
},
{
"path": "types/loader-utils/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/loader-utils/v1/index.d.ts",
"kind": "definition"
},
{
"path": "types/loader-utils/v1/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"Perlmint",
"TotooriaHyperion",
"peterblazejewicz",
"Naturalclar"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "lodash-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/lodash-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/lodash-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"bumbleblym"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "memory-fs",
"kind": "edit",
"files": [
{
"path": "types/memory-fs/index.d.ts",
"kind": "definition"
},
{
"path": "types/memory-fs/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"e-cloud"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "mini-css-extract-plugin",
"kind": "edit",
"files": [
{
"path": "types/mini-css-extract-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/mini-css-extract-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"JounQin",
"dobogo",
"skovy",
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "mini-html-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/mini-html-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/mini-html-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "moment-locales-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/moment-locales-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/moment-locales-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"inglec-arista"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "name-all-modules-plugin",
"kind": "edit",
"files": [
{
"path": "types/name-all-modules-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/name-all-modules-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "npm-install-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/npm-install-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/npm-install-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "open-wc__webpack-import-meta-loader",
"kind": "edit",
"files": [
{
"path": "types/open-wc__webpack-import-meta-loader/index.d.ts",
"kind": "definition"
},
{
"path": "types/open-wc__webpack-import-meta-loader/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "optimize-css-assets-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/optimize-css-assets-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/optimize-css-assets-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"odnamrataizem",
"skovy"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "poi",
"kind": "edit",
"files": [
{
"path": "types/poi/index.d.ts",
"kind": "definition"
},
{
"path": "types/poi/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"bolasblack"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "progress-bar-webpack-plugin",
"kind": "edit",
"files": [
{
"path": "types/progress-bar-webpack-plugin/index.d.ts",
"kind": "definition"
},
{
"path": "types/progress-bar-webpack-plugin/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"peterblazejewicz"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "purifycss-webpack",
"kind": "edit",
"files": [
{
"path": "types/purifycss-webpack/index.d.ts",
"kind": "definition"
},
{
"path": "types/purifycss-webpack/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"garbetjie"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "react-dev-utils",
"kind": "edit",
"files": [
{
"path": "types/react-dev-utils/index.d.ts",
"kind": "definition"
},
{
"path": "types/react-dev-utils/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"ark120202"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
},
{
"name": "react-loadable-visibility",
"kind": "edit",
"files": [
{
"path": "types/react-loadable-visibility/index.d.ts",
"kind": "definition"
},
{
"path": "types/react-loadable-visibility/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"dbartholomae"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "peterblazejewicz",
"date": "2021-03-25T19:46:59.000Z",
"isMaintainer": false
}
],
"ciResult": "pass"
} |
🔔 @peterblazejewicz @kryops @karol-majewski @dsifford @r3nya @jeremejevs @dublicator @flying-sheep @avin-kavish @JuanJoseGonGi @Seally @k-yle @davecardwell @mtraynham @pine @katyo @inglec-arista @G-Rath @bahlo @rynclark @andersk @Odas0R @akashishu777 @woitechen @Yama-Tomo @bricka @deevus @bumbleblym @tlaziuk @malj @leebenson @miZyind @ChaosinaCan @skovy @Perlmint @TotooriaHyperion @Naturalclar @e-cloud @JounQin @dobogo @odnamrataizem @bolasblack @garbetjie @ark120202 @dbartholomae — please review this PR in the next few days. Be sure to explicitly select |
Updated numbers for you here from c8b946f. 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. assets-webpack-plugin/v6.1Comparison details for assets-webpack-plugin/6.1 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. brotli-webpack-plugin/v1.1Comparison details for brotli-webpack-plugin/1.1 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. browser-sync-webpack-plugin/v2.2Comparison details for browser-sync-webpack-plugin/2.2 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. case-sensitive-paths-webpack-plugin/v2.1Comparison details for case-sensitive-paths-webpack-plugin/2.1 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. circular-dependency-plugin/v5.0Comparison details for circular-dependency-plugin/5.0 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. compression-webpack-plugin/v6.0Comparison details for compression-webpack-plugin/6.0 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. compression-webpack-plugin/v6.0Comparison details for compression-webpack-plugin/6.0 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. copy-webpack-plugin/v6.4Comparison details for copy-webpack-plugin/6.4 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. copy-webpack-plugin/v6.4Comparison details for copy-webpack-plugin/6.4 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
Congrats |
import { RawSourceMap } from 'source-map'; | ||
import { Source, ConcatSource } from 'webpack-sources'; | ||
|
||
import webpack = require('./node_modules/webpack'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandersn Hm, am I missing something, or will this just not work in a monorepo that uses yarn workspaces, and hoists its dependencies to the root node_modules
? Webpack can not be found at this path in this scenario. Instead it's located at '../../webpack'
relative to the location of node_modules/@types/webpack/index.d.ts
. So the following error will occur:
error TS2307: Cannot find module './node_modules/webpack' or its corresponding type declarations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I change this line to import webpack = require('webpack');
, it does work. Is this not an option because it would require the tsconfig option "moduleResolution": "node"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work in the DT repo because it's a circular reference...maybe if I add a path mapping in the tsconfig...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thx!
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I just published |
I introduced a node_modules passthrough in webpack in DefinitelyTyped/DefinitelyTyped#51712: the entire index.d.ts is ```ts import webpack = require('./node_modules/webpack') export = webpack ``` This allows @types/webpack@5 to delegate its entire type definition to webpack@5, while still allowing @types/webpack@4 to be maintained on DT. However, the correct module specifier is actually just 'webpack', since there's no guarantee of the exact location where webpack will be installed. This can be made to compile on DT with a path mapping: ```json "paths": { "webpack": [ "./node_modules/webpack" ] } ``` Previously, path mappings like this were not allowed. This PR allows them.
* Allow ./node_modules passthrough in paths I introduced a node_modules passthrough in webpack in DefinitelyTyped/DefinitelyTyped#51712: the entire index.d.ts is ```ts import webpack = require('./node_modules/webpack') export = webpack ``` This allows @types/webpack@5 to delegate its entire type definition to webpack@5, while still allowing @types/webpack@4 to be maintained on DT. However, the correct module specifier is actually just 'webpack', since there's no guarantee of the exact location where webpack will be installed. This can be made to compile on DT with a path mapping: ```json "paths": { "webpack": [ "./node_modules/webpack" ] } ``` Previously, path mappings like this were not allowed. This PR allows them. * fix === lint
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 means that existing dependents of webpack and tapable are still using 4 and 1, respectively. But upgrading to 5 is now as easy as editing tsconfig (and then updating to use webpack@5's types ;) -- and new dependents start out with the current versions.Tasks done:
The only real change to most of the packages is that they now require TS 3.7. This is fine because (1) 3.7 will be the lowest supported version in 6 months (2) the effect is to stop updates to older clients, which is usually what older clients want.
Related: