-
-
Notifications
You must be signed in to change notification settings - Fork 759
refactor: remove js stats warning #10900
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
Conversation
✅ Deploy Preview for rspack canceled.
|
📦 Binary Size-limit
🎉 Size decreased by 8.38KB from 59.81MB to 59.80MB (⬇️0.01%) |
CodSpeed Performance ReportMerging #10900 will not alter performanceComparing 🎉 Hooray!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the separate JsStatsWarning
/StatsWarning
types by treating warnings as JsStatsError
/StatsError
, unifying error and warning data and updating tests and docs.
- Replaced all
JsStatsWarning
references withJsStatsError
in TypeScript and plugin code. - Deleted the
StatsWarning
struct in Rust core and removedJsStatsWarning
in the binding API. - Updated test expectations and snapshots to include
loc
for warnings now modeled as errors.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/rspack/src/stats/statsFactoryUtils.ts | Swapped JsStatsWarning for JsStatsError in extractor and adjusted signature. |
packages/rspack/src/stats/StatsFactory.ts | Changed cachedGetWarnings to return JsStatsError[] . |
packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts | Updated EXTRACT_ERROR to accept only JsStatsError . |
packages/rspack/etc/core.api.md | Removed JsStatsWarning import and updated docs to use JsStatsError . |
packages/rspack-test-tools/tests/... | Adjusted diagnostics tests and snapshots to include new loc field. |
crates/rspack_core/src/stats/struct.rs | Deleted the StatsWarning struct in core. |
crates/rspack_core/src/stats/mod.rs | Unified get_warnings to yield StatsError and populated name . |
crates/rspack_binding_api/src/stats.rs | Removed JsStatsWarning , added name to JsStatsError , updated warnings type. |
Comments suppressed due to low confidence (4)
packages/rspack/src/stats/statsFactoryUtils.ts:727
- [nitpick] Function name
warningFromStatsWarning
no longer aligns with its parameter typebinding.JsStatsError
; consider renaming it to something likewarningFromStatsError
or a more generic name for clarity.
export const warningFromStatsWarning = (
packages/rspack/etc/core.api.md:61
- Removed import of
JsStatsWarning
, but ensure all other documentation references toJsStatsWarning
are also updated or removed to prevent stale docs.
import type { JsStatsError } from '@rspack/binding';
packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts:611
- [nitpick] This extractor now handles both errors and warnings but is still named
EXTRACT_ERROR
; consider renaming toEXTRACT_ISSUE
or adding a comment to clarify it covers warnings too.
error: JsStatsError,
crates/rspack_binding_api/src/stats.rs:139
- [nitpick] New field
name
added toJsStatsError
; consider updating API reference incore.api.md
or inline comments to explain its purpose and when it will be set.
pub struct JsStatsError<'a> {
nitpick: I would cat this into a |
Summary
JsStatsWarning and JsStateError have same data, just keep one.
Related links
Checklist