Repository navigation
refactor(types): precise stats, loader, fragment and serialization types - #22762
Conversation
|
| Name | Type |
|---|---|
| webpack | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
|
This PR is packaged and the instant preview is available (58ecc95). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@58ecc95
yarn add -D webpack@https://pkg.pr.new/webpack@58ecc95
pnpm add -D webpack@https://pkg.pr.new/webpack@58ecc95 |
Types CoverageCoverage after merging refactor/stats-loader-generics into main will be
Coverage Report |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Change: Refactor Merge Risk: ⚪ Minimal · up to
|
Generated code sizeComparing base (
Read No asset changed size. No runtime gained or lost a runtime module. Built |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22762 +/- ##
=======================================
Coverage 96.48% 96.48%
=======================================
Files 778 778
Lines 137320 137324 +4
Branches 46550 46551 +1
=======================================
+ Hits 132488 132500 +12
+ Misses 4832 4824 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Continues #22752: replaces
anywith real types or generics, keeping existing callers compiling.EXPECTED_ANYinlib/goes from 118 to 97.foroverloads. Plugin keys fall back to the old open type.dataand loader entry options are generic. Runner results are typed as content, source map and additional data.anyor the generator's context.JSONParseError, minify options, tuple cache keys, lazy runtime modules,cleverMergeand the lazy serialization slot.What kind of change does this PR introduce?
refactor
Did you add tests for your changes?
No new tests; types are checked by
yarn lint:types*.test/unitCases/LoaderRunner.unittest.jsnow reads the typed result through a small helper.Does this PR introduce a breaking change?
No. A few type-only fixes can surface errors in code that was already wrong at runtime:
chunkInitFragments.addLazyRuntimeModule(nowT extends object).formatminify option the minifier rejects at runtime.Optional
webpackASTon loader additional data only loosens a type.If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
Claude Code wrote the type changes. It checked them with
yarn lint, alllint:types*projects, compile probes againsttypes.d.tsand targeted tests. The author reviewed the changes.Generated by Claude Code
Summary by CodeRabbit