Deprecated refactor#20707
Conversation
🦋 Changeset detectedLatest commit: 7c9b6c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This PR is packaged and the instant preview is available (cc66616). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@cc66616
yarn add -D webpack@https://pkg.pr.new/webpack@cc66616
pnpm add -D webpack@https://pkg.pr.new/webpack@cc66616 |
There was a problem hiding this comment.
Pull request overview
This PR standardizes how deprecations are surfaced across the project by adding @deprecated JSDoc annotations in TypeScript typings, aligning JSON schema metadata for deprecated options, and adding/adjusting in-code deprecation markers and small internal refactors.
Changes:
- Added
@deprecatedannotations across various legacy APIs intypes.d.tsand runtime JSDoc inlib/Chunk.js/lib/Module.js. - Updated option deprecation signaling in
declarations/WebpackOptions.d.tsandschemas/WebpackOptions.json(including markingexprContextCriticalas deprecated and removing an incorrect deprecation marker frommoduleIds). - Small internal refactors: switch deprecated parser scoping API usages to
inFunctionScope, and replace someBuffer.sliceusages withBuffer.subarray.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| types.d.ts | Adds @deprecated markers to legacy Chunk/Module/Compilation APIs and adjusts assignDepths typing. |
| schemas/WebpackOptions.json | Marks exprContextCritical as deprecated and removes incorrect deprecation marker from moduleIds. |
| lib/web/JsonpTemplatePlugin.js | Adds a webpack 6 removal TODO for a deprecated class. |
| lib/serialization/FileMiddleware.js | Replaces slice with subarray in buffer handling paths. |
| lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js | Replaces deprecated parser.inScope usage with parser.inFunctionScope. |
| lib/dependencies/HarmonyImportDependency.js | Introduces a local typedef alias for JavascriptParserOptions and updates JSDoc accordingly. |
| lib/dependencies/HarmonyExportDependencyParserPlugin.js | Introduces a local typedef alias for JavascriptParserOptions and updates JSDoc accordingly. |
| lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js | Replaces deprecated parser.inScope usage with parser.inFunctionScope. |
| lib/dependencies/AMDDefineDependencyParserPlugin.js | Replaces deprecated parser.inScope usage with parser.inFunctionScope. |
| lib/ModuleParseError.js | Uses subarray for WASM header detection on Buffer sources. |
| lib/Module.js | Adds @deprecated JSDoc on legacy accessors and updates typedef imports. |
| lib/Compilation.js | Switches included-module depth assignment to assignDepths([module]) and updates JSDoc param type. |
| lib/ChunkGraph.js | Adds explicit BACKWARD-COMPAT start/end markers around deprecated compat APIs. |
| lib/Chunk.js | Adds @deprecated JSDoc to legacy methods (matching type deprecations). |
| declarations/WebpackOptions.d.ts | Marks exprContextCritical as deprecated and removes incorrect @deprecated on moduleIds. |
| .changeset/jolly-groups-tap.md | Adds a patch changeset describing the deprecation annotation updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this PR will degrade performance by 26.58%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | benchmark "many-chunks-esm", scenario '{"name":"mode-production","mode":"production"}' |
7.5 MB | 10.2 MB | -26.58% |
Comparing deprecated-refactor (7c9b6c9) with main (7cdc173)
ba94356 to
c347849
Compare
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (76.66%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #20707 +/- ##
==========================================
- Coverage 91.40% 91.39% -0.02%
==========================================
Files 560 560
Lines 55295 55298 +3
Branches 14593 14595 +2
==========================================
- Hits 50545 50537 -8
- Misses 4750 4761 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Mark all deprecated methods and options using
@deprecatedin types + small fixes around deprecationsWhat kind of change does this PR introduce?
refactor
Did you add tests for your changes?
Existing
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing
Use of AI
No