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
feat: ConfigProvider support config warning level #44809
Conversation
Run & review this pull request in StackBlitz Codeflow. |
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.
LGTM
size-limit report 📦
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #44809 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 680 681 +1
Lines 11427 11542 +115
Branches 3073 3111 +38
==========================================
+ Hits 11427 11542 +115
☔ View full report in Codecov by Sentry. |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
ref #44551
💡 Background and solution
📝 Changelog
warning
to config warning log level (like filter deprecated warning).warning
属性以配置警告等级(如过滤掉废弃 API 警告)。☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at e57eb6e
This pull request adds a new feature to the
ConfigProvider
component that allows users to control the warning level for deprecated or breaking changes in the ant-design components. It also updates the documentation, tests, and demos for the feature and modifies the warning type for theicon
prop change in theAvatar
component.🔍 Walkthrough
🤖 Generated by Copilot at e57eb6e
ConfigProvider
component to control the level of deprecation warnings (F0,F6,F7,F5)resetWarned
function fromrc-util/lib/warning
and rename it asrcResetWarned
to avoid conflict with customresetWarned
function (link)WarningContextProps
interface to usestrict
instead ofdeprecated
as property name (link)typeWarning
function to aggregate deprecated warnings based onstrict
property from warning context and use global variabledeprecatedWarnList
to store and print deprecated warnings once (link)warning
property toConfigProviderProps
interface to allow users to pass warning level configuration (link)warning
property fromprops
object and include it inmemoedConfig
object (link,link)WarningContext
provider withmemoedConfig.warning
value (link,link)warning
property to API sections of English and Chinese documentation forConfigProvider
component and describe its type, default value and version (link,link)ConfigProvider
component and reference demo files (link,link)type
argument oftypeWarning
function call inAvatar
component fromdeprecated
tobreaking
to reflect severity of change inicon
prop (link)resetWarned
function from../_util/warning
in test file forConfigProvider
component and reset global variabledeprecatedWarnList
before each test case (link)ConfigProvider
component and mock and restoreconsole.error
andconsole.warn
methods to spy on calls (link)ConfigProvider
component to follow convention of importing React first and then other modules (link,link)