Skip to content
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

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

Wxh16144
Copy link
Member

fixed: #10231

@vercel
Copy link

vercel bot commented Sep 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
umi ⬜️ Ignored (Inspect) Visit Preview Nov 6, 2023 9:57pm

@codecov
Copy link

codecov bot commented Sep 10, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8a0cd22) 29.00% compared to head (278459c) 29.00%.
Report is 69 commits behind head on master.

❗ Current head 278459c differs from pull request most recent head 10d850c. Consider uploading reports for the commit 10d850c to get more accurate results

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           
Files Coverage Δ
packages/plugins/src/antd.ts 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PeachScript
Copy link
Member

cc @MadCcc 帮忙看下?

* @**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'),
Copy link
Contributor

@MadCcc MadCcc Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个配置是不是直接叫 disableInternalStatic 类似的比较好。。使用场景上其实就是把原来内置的静态方法配置禁用掉了

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

英文水平太菜了,总是词不达意,哈哈哈。 再帮忙看看功能上有没有其他副作用或者影响

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我随便想的,可能有更好的命名哈,符合实现应该就行

@@ -50,6 +52,7 @@ export function rootContainer(rawContainer) {
let container = rawContainer;

{{#configProvider}}
{{^disableInternalStatic}}
if (finalConfigProvider.prefixCls) {
Modal.config({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里好像用 ConfigProvider 也够了吧,静态方法都在这了

Copy link
Member Author

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'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

禁用内部静态是啥,感觉用 useConfigProviderForPrefixCls 更好

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packages/plugins/src/antd.ts Outdated Show resolved Hide resolved
@fz6m
Copy link
Contributor

fz6m commented Nov 6, 2023

我认为这个是一个合理的 PR。

合并原因:解决了 antd 插件生成的代码中,使用旧 API 带来的 warning 。

@fz6m fz6m merged commit 4a93ea2 into umijs:master Nov 6, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants