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

Webpack+tapable passthrough newest versions #51712

Merged
merged 6 commits into from
Mar 25, 2021
Merged

Conversation

sandersn
Copy link
Contributor

@sandersn sandersn commented Mar 12, 2021

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:

  • webpack@5's types appear to require Typescript 3.7; dependents need to require it too.
  • Manually alias webpack to webpack/v4 for dependents that should not update to 5.

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:

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.
@tjjfvi
Copy link

tjjfvi commented Mar 12, 2021

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.

@typescript-bot
Copy link
Contributor

👋 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.5

Comparison details for react-loadable/5.5 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 126.9 117.8 -7.1%
Type count 29176 29176 0%
Assignability cache size 6527 6527 0%
Language service
Samples taken 204 204 0%
Identifiers in tests 204 204 0%
getCompletionsAtPosition
    Mean duration (ms) 649.7 647.0 -0.4%
    Mean CV 8.8% 8.4%
    Worst duration (ms) 879.5 844.4 -4.0%
    Worst identifier onClick text
getQuickInfoAtPosition
    Mean duration (ms) 641.4 642.0 +0.1%
    Mean CV 7.7% 7.8%
    Worst duration (ms) 854.7 806.0 -5.7%
    Worst identifier text text

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

tapable/v2.2

These typings are for a version of tapable that doesn’t yet exist on master, so I’ve compared them with v1.0.

1.0@master 2.2 in #51712 diff
Batch compilation
Memory usage (MiB) 79.6 73.3 -8.0%
Type count 11334 10901 -4%
Assignability cache size 4118 3757 -9%
Language service
Samples taken 575 6 -99%
Identifiers in tests 576 6 -99%
getCompletionsAtPosition
    Mean duration (ms) 393.3 423.6 +7.7%
    Mean CV 8.8% 14.9%
    Worst duration (ms) 618.9 453.5 -26.7% 🌟
    Worst identifier applyPluginsBailResult hook
getQuickInfoAtPosition
    Mean duration (ms) 406.6 378.5 -6.9%
    Mean CV 9.9% 6.4%
    Worst duration (ms) 603.1 387.1 -35.8% 🌟
    Worst identifier asyncSeriesHook hook

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.2

These typings are for a version of tapable that doesn’t yet exist on master, so I’ve compared them with v1.0.

1.0@master 2.2 in #51712 diff
Batch compilation
Memory usage (MiB) 76.4 73.1 -4.4%
Type count 11334 10901 -4%
Assignability cache size 4118 3757 -9%
Language service
Samples taken 575 6 -99%
Identifiers in tests 576 6 -99%
getCompletionsAtPosition
    Mean duration (ms) 396.4 406.3 +2.5%
    Mean CV 8.7% 9.9%
    Worst duration (ms) 608.3 469.1 -22.9%
    Worst identifier SyncHook hook
getQuickInfoAtPosition
    Mean duration (ms) 408.2 403.4 -1.2%
    Mean CV 10.2% 9.7%
    Worst duration (ms) 608.6 452.8 -25.6% 🌟
    Worst identifier asyncSeriesHook hf

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.

@typescript-bot typescript-bot added the Perf: Better typescript-bot determined that this PR improves compilation performance. label Mar 24, 2021
@sandersn sandersn marked this pull request as ready for review March 25, 2021 00:01
@sandersn
Copy link
Contributor Author

This works locally, so I think it's ready to review.

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Edits multiple packages Untested Change This PR does not touch tests labels Mar 25, 2021
@typescript-bot
Copy link
Contributor

typescript-bot commented Mar 25, 2021

@sandersn Thank you for submitting this PR!

This is a live comment which I will keep updated.

47 packages in this PR

Code Reviews

Because this PR edits multiple packages, it can be merged once it's reviewed by a DT maintainer.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 A DT maintainer needs to approve changes which affect more than one package

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"
}

@typescript-bot
Copy link
Contributor

Updated numbers for you here from c8b946f.

appcache-webpack-plugin/v1.4

Comparison details for appcache-webpack-plugin/1.4 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 81.7 81.5 -0.2%
Type count 11317 11317 0%
Assignability cache size 2243 2243 0%
Language service
Samples taken 9 9 0%
Identifiers in tests 9 9 0%
getCompletionsAtPosition
    Mean duration (ms) 414.8 403.3 -2.8%
    Mean CV 12.7% 11.8%
    Worst duration (ms) 482.7 445.0 -7.8%
    Worst identifier comment comment
getQuickInfoAtPosition
    Mean duration (ms) 434.2 413.9 -4.7%
    Mean CV 10.4% 11.5%
    Worst duration (ms) 469.7 438.6 -6.6%
    Worst identifier AppCachePlugin cache

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

assets-webpack-plugin/v6.1

Comparison details for assets-webpack-plugin/6.1 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 71.8 82.1 +14.3%
Type count 11311 11311 0%
Assignability cache size 2248 2248 0%
Language service
Samples taken 38 38 0%
Identifiers in tests 38 38 0%
getCompletionsAtPosition
    Mean duration (ms) 393.8 395.6 +0.5%
    Mean CV 13.2% 12.5%
    Worst duration (ms) 492.9 529.7 +7.5%
    Worst identifier meta webpack
getQuickInfoAtPosition
    Mean duration (ms) 400.9 403.4 +0.6%
    Mean CV 11.8% 12.3%
    Worst duration (ms) 500.5 503.3 +0.6%
    Worst identifier filename meta

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

brotli-webpack-plugin/v1.1

Comparison details for brotli-webpack-plugin/1.1 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 81.0 82.1 +1.3%
Type count 11297 11297 0%
Assignability cache size 2245 2245 0%
Language service
Samples taken 23 23 0%
Identifiers in tests 23 23 0%
getCompletionsAtPosition
    Mean duration (ms) 396.7 395.0 -0.4%
    Mean CV 13.9% 13.9%
    Worst duration (ms) 464.3 464.4 0.0%
    Worst identifier webpack BrotliWebpackPlugin
getQuickInfoAtPosition
    Mean duration (ms) 406.4 396.9 -2.4%
    Mean CV 12.4% 12.9%
    Worst duration (ms) 494.4 457.2 -7.5%
    Worst identifier BrotliWebpackPlugin Options

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

browser-sync-webpack-plugin/v2.2

Comparison details for browser-sync-webpack-plugin/2.2 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 79.9 81.6 +2.2%
Type count 11529 11529 0%
Assignability cache size 2287 2287 0%
Language service
Samples taken 6 6 0%
Identifiers in tests 6 6 0%
getCompletionsAtPosition
    Mean duration (ms) 426.9 434.3 +1.7%
    Mean CV 13.9% 14.7%
    Worst duration (ms) 463.6 471.5 +1.7%
    Worst identifier reloadDebounce notify
getQuickInfoAtPosition
    Mean duration (ms) 421.4 423.4 +0.5%
    Mean CV 10.1% 10.4%
    Worst duration (ms) 457.3 454.9 -0.5%
    Worst identifier reloadDebounce open

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

case-sensitive-paths-webpack-plugin/v2.1

Comparison details for case-sensitive-paths-webpack-plugin/2.1 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 81.9 82.6 +0.9%
Type count 11293 11293 0%
Assignability cache size 2246 2246 0%
Language service
Samples taken 24 24 0%
Identifiers in tests 24 24 0%
getCompletionsAtPosition
    Mean duration (ms) 393.4 390.6 -0.7%
    Mean CV 13.6% 14.5%
    Worst duration (ms) 458.1 462.0 +0.9%
    Worst identifier debug plugin
getQuickInfoAtPosition
    Mean duration (ms) 391.1 390.4 -0.2%
    Mean CV 12.3% 12.1%
    Worst duration (ms) 449.4 434.3 -3.4%
    Worst identifier CaseSensitivePathsWebpackPlugin debug

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

circular-dependency-plugin/v5.0

Comparison details for circular-dependency-plugin/5.0 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 81.9 81.8 -0.2%
Type count 11314 11314 0%
Assignability cache size 2248 2248 0%
Language service
Samples taken 40 40 0%
Identifiers in tests 40 40 0%
getCompletionsAtPosition
    Mean duration (ms) 386.1 394.8 +2.2%
    Mean CV 12.4% 14.1%
    Worst duration (ms) 469.0 501.0 +6.8%
    Worst identifier CircularDependencyPlugin CircularDependencyPlugin
getQuickInfoAtPosition
    Mean duration (ms) 396.5 400.1 +0.9%
    Mean CV 12.2% 11.9%
    Worst duration (ms) 507.0 470.1 -7.3%
    Worst identifier MAX_CYCLES CircularDependencyPlugin

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

compression-webpack-plugin/v6.0

Comparison details for compression-webpack-plugin/6.0 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 75.9 73.0 -3.9%
Type count 11477 11477 0%
Assignability cache size 2310 2310 0%
Language service
Samples taken 84 84 0%
Identifiers in tests 84 84 0%
getCompletionsAtPosition
    Mean duration (ms) 382.4 389.8 +1.9%
    Mean CV 11.5% 12.6%
    Worst duration (ms) 466.0 483.6 +3.8%
    Worst identifier threshold filename
getQuickInfoAtPosition
    Mean duration (ms) 378.5 384.6 +1.6%
    Mean CV 9.1% 10.5%
    Worst duration (ms) 470.2 456.8 -2.8%
    Worst identifier cache CompressionPlugin

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

compression-webpack-plugin/v6.0

Comparison details for compression-webpack-plugin/6.0 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 74.4 74.4 0.0%
Type count 11477 11477 0%
Assignability cache size 2310 2310 0%
Language service
Samples taken 84 84 0%
Identifiers in tests 84 84 0%
getCompletionsAtPosition
    Mean duration (ms) 383.1 382.1 -0.3%
    Mean CV 12.5% 11.0%
    Worst duration (ms) 485.8 490.0 +0.9%
    Worst identifier algorithm threshold
getQuickInfoAtPosition
    Mean duration (ms) 377.9 386.3 +2.2%
    Mean CV 9.6% 10.8%
    Worst duration (ms) 462.9 475.8 +2.8%
    Worst identifier filename cache

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

copy-webpack-plugin/v6.4

Comparison details for copy-webpack-plugin/6.4 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 74.6 74.7 +0.1%
Type count 11618 11618 0%
Assignability cache size 2360 2360 0%
Language service
Samples taken 267 267 0%
Identifiers in tests 267 267 0%
getCompletionsAtPosition
    Mean duration (ms) 369.9 378.7 +2.4%
    Mean CV 9.5% 9.1%
    Worst duration (ms) 465.6 457.4 -1.8%
    Worst identifier globOptions minimized
getQuickInfoAtPosition
    Mean duration (ms) 383.0 388.9 +1.5%
    Mean CV 9.5% 9.5%
    Worst duration (ms) 481.2 480.8 -0.1%
    Worst identifier from path

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

copy-webpack-plugin/v6.4

Comparison details for copy-webpack-plugin/6.4 📊
master #51712 diff
Batch compilation
Memory usage (MiB) 75.0 74.9 -0.2%
Type count 11618 11618 0%
Assignability cache size 2360 2360 0%
Language service
Samples taken 267 267 0%
Identifiers in tests 267 267 0%
getCompletionsAtPosition
    Mean duration (ms) 370.7 375.5 +1.3%
    Mean CV 9.2% 9.4%
    Worst duration (ms) 454.6 469.9 +3.4%
    Worst identifier globOptions file
getQuickInfoAtPosition
    Mean duration (ms) 383.4 385.6 +0.6%
    Mean CV 9.5% 9.3%
    Worst duration (ms) 466.2 535.4 +14.9%
    Worst identifier path path

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. and removed Perf: Better typescript-bot determined that this PR improves compilation performance. labels Mar 25, 2021
@orta
Copy link
Collaborator

orta commented Mar 25, 2021

Congrats

import { RawSourceMap } from 'source-map';
import { Source, ConcatSource } from 'webpack-sources';

import webpack = require('./node_modules/webpack');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

Copy link
Contributor

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.

Copy link
Contributor

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"?

Copy link
Contributor Author

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...

Copy link
Member

@peterblazejewicz peterblazejewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thx!

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Mar 25, 2021
@typescript-bot
Copy link
Contributor

I just published @types/webpack-notifier@1.8.2 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-pkg-plugin-v4@2.0.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-serve@2.0.3 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-serve@1.0.7 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-shell-plugin@0.5.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-stats-plugin@0.3.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-stream@3.2.12 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-subresource-integrity@1.2.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-validator@2.2.8 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpack-virtual-modules@0.1.1 to npm.

@typescript-bot
Copy link
Contributor

@typescript-bot
Copy link
Contributor

I just published @types/webpackbar@4.0.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/webpackbar@2.6.4 to npm.

@typescript-bot
Copy link
Contributor

@typescript-bot
Copy link
Contributor

@typescript-bot
Copy link
Contributor

I just published @types/workbox-webpack-plugin@5.1.6 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/worker-plugin@4.0.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/write-file-webpack-plugin@4.5.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/zip-webpack-plugin@3.0.2 to npm.

sandersn added a commit to microsoft/DefinitelyTyped-tools that referenced this pull request Mar 29, 2021
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.
sandersn added a commit to microsoft/DefinitelyTyped-tools that referenced this pull request Mar 29, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Edits multiple packages Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants