refactor: fix code scanning#20890
Conversation
|
|
This PR is packaged and the instant preview is available (d4c42b1). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@d4c42b1
yarn add -D webpack@https://pkg.pr.new/webpack@d4c42b1
pnpm add -D webpack@https://pkg.pr.new/webpack@d4c42b1 |
There was a problem hiding this comment.
Pull request overview
Adds a new cache-filesystem configCase intended to exercise build-dependency scanning, and makes small refactors in dependency parsing/URL handling.
Changes:
- Added a new
cache-filesystem/dependenciesconfigCase (webpack config + fixture ESM file) to cover dependency scanning scenarios. - Tweaked hostname validation regex used by sharing URL/version normalization.
- Refactored ESM import specifier parsing used during build dependency tracking (
FileSystemInfo).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/configCases/cache-filesystem/dependencies/webpack.config.js | New configCase enabling filesystem cache and declaring explicit buildDependencies. |
| test/configCases/cache-filesystem/dependencies/index.js | Minimal “should build” test for the new configCase harness. |
| test/configCases/cache-filesystem/dependencies/foo.mjs | ESM fixture containing multiple import() specifier spellings/escapes for scanning. |
| test/configCases/cache-filesystem/dependencies/bar.mjs | Empty ESM target fixture for dependency resolution/scanning. |
| lib/sharing/utils.js | Adjusts RE_HOSTNAME to better constrain dot-separated hostname segments. |
| lib/FileSystemInfo.js | Changes how ESM import specifiers are converted from source text into strings during build dependency resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (14.28%) 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 #20890 +/- ##
===========================================
- Coverage 80.30% 36.18% -44.13%
===========================================
Files 528 418 -110
Lines 53756 45897 -7859
Branches 14199 12311 -1888
===========================================
- Hits 43171 16607 -26564
- Misses 10585 29290 +18705
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:
|
…d and template-literal strings
Merging this PR will degrade performance by 35.52%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Memory | benchmark "many-chunks-esm", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
892.6 KB | 135.9 KB | ×6.6 |
| ⚡ | Memory | benchmark "concatenate-modules", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
303.2 KB | 178.2 KB | +70.1% |
| ❌ | Memory | benchmark "future-defaults", scenario '{"name":"mode-development","mode":"development"}' |
1.4 MB | 2.1 MB | -35.52% |
| ⚡ | Memory | benchmark "three-long", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
1,236.5 KB | 948.5 KB | +30.36% |
| ⚡ | Memory | benchmark "devtool-eval", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
371.8 KB | 300.3 KB | +23.81% |
Comparing refactor-code (d4c42b1) with main (5bcf0e2)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
refactor code
What kind of change does this PR introduce?
refactor
Did you add tests for your changes?
Yes
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