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

Document webpack change: fix: add typings for DefaultStatsFactoryPlugin, Stats, and MultiStats #4550

Closed
webpack-bot opened this issue Feb 5, 2021 · 1 comment

Comments

@webpack-bot
Copy link

A pull request by @davidhouweling was merged and maintainers requested a documentation change.

See pull request: webpack/webpack#12228


What kind of change does this PR introduce?

Add typings matching the JSON output.

Note: the types for output are defined as Stats* because the types are merged together into the root level types.d.ts which might cause issues with other definitions. I know we could use namespaces, but I don't believe that is possible without fully converting to TypeScript itself.

Did you add tests for your changes?

No as it's primarily compile time based, so difficult to add tests. How I've tested this:

  • Locally modified tests/Stats.test.js so that I captured the output of the toJson call into a file
  • Locally apply the output to a JS file and do the type cast to verify it's correct.

Does this PR introduce a breaking change?

No.

What needs to be documented once your changes are merged?

In @types/webpack@^4 we would originally get the structure of the JSON output as webpack.Stats.ToJsonOutput.
In version 5, we would now do webpack.StatsCompilation.

@chenxsan
Copy link
Member

We don't have any specific pages for those typings. And I believe IDEs should be able to give users the hint, hence no need to document it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants