-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix(antd-plugin): fix console deprecation warning #11630
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #11630 +/- ##
=======================================
Coverage 29.00% 29.00%
=======================================
Files 484 484
Lines 14717 14716 -1
Branches 3480 3480
=======================================
Hits 4268 4268
+ Misses 9693 9692 -1
Partials 756 756
☔ View full report in Codecov by Sentry. |
cc @MadCcc 帮忙看下? |
packages/plugins/src/antd.ts
Outdated
* @**umi-issue:** https://github.com/umijs/umi/issues/10231 | ||
* @**antd-PR:** https://github.com/ant-design/ant-design/pull/29285 | ||
*/ | ||
hasRefactorStaticConfig: semver.gte(antdVersion, '4.13.0'), |
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.
这个配置是不是直接叫 disableInternalStatic 类似的比较好。。使用场景上其实就是把原来内置的静态方法配置禁用掉了
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.
英文水平太菜了,总是词不达意,哈哈哈。 再帮忙看看功能上有没有其他副作用或者影响
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.
我随便想的,可能有更好的命名哈,符合实现应该就行
278459c
to
dafdeb0
Compare
@@ -50,6 +52,7 @@ export function rootContainer(rawContainer) { | |||
let container = rawContainer; | |||
|
|||
{{#configProvider}} | |||
{{^disableInternalStatic}} | |||
if (finalConfigProvider.prefixCls) { | |||
Modal.config({ |
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.
这里好像用 ConfigProvider 也够了吧,静态方法都在这了
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.
我不太清楚, 我理解的是 4.13.0 之前的版本还是只能用过 Modal.config 去设置。
4.13.1 以及之后的版本都建议用 CP.config 去设置。 {{^xxxx }}
的逻辑是取反 https://github.com/janl/mustache.js#inverted-sections
* @**umi-issue:** https://github.com/umijs/umi/issues/10231 | ||
* @**antd-PR:** https://github.com/ant-design/ant-design/pull/29285 | ||
*/ | ||
disableInternalStatic: semver.gt(antdVersion, '4.13.0'), |
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.
禁用内部静态是啥,感觉用 useConfigProviderForPrefixCls
更好
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.
我认为这个是一个合理的 PR。 合并原因:解决了 antd 插件生成的代码中,使用旧 API 带来的 warning 。 |
fixed: #10231