-
-
Notifications
You must be signed in to change notification settings - Fork 747
feat: improve deprecation warning messages #12524
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.
|
✅ Deploy Preview for rspack canceled.
|
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 introduces a deprecate() helper function to standardize and improve deprecation warning messages across the Rspack codebase. The new helper ensures deprecation warnings are only shown once per message by tracking them in a Set, and provides consistent formatting with a [Rspack Deprecation] prefix.
Key changes:
- Added a new
deprecate()helper function that deduplicates warnings and formats them consistently - Replaced all
util.deprecate()calls from Node.js with the new helper function - Updated deprecation messages to be more concise and consistent in tone
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/src/util/index.ts | Added new deprecate() helper function with message deduplication; updated error messages in unsupported() to use consistent branding |
| packages/rspack/src/rspack.ts | Replaced util.deprecate() with new deprecate() helper for watch option warning |
| packages/rspack/src/config/types.ts | Added JSDoc deprecation notice for topLevelAwait option |
| packages/rspack/src/config/normalization.ts | Replaced all util.deprecate() calls with new deprecate() helper; updated deprecation messages to be more concise and consistent |
| packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts | Replaced console.warn() calls with deprecate() helper for automatic deduplication; removed manual warning tracking logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 47.87MB |
CodSpeed Performance ReportMerging #12524 will not alter performanceComparing Summary
Footnotes
|
Summary
This PR introduces a
deprecate()helper to improve deprecation warning messages.Before
After
Checklist