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: LocaleProvider warning after antd@3.21 #2941

Merged
merged 4 commits into from
Aug 12, 2019
Merged

fix: LocaleProvider warning after antd@3.21 #2941

merged 4 commits into from
Aug 12, 2019

Conversation

zombieJ
Copy link
Contributor

@zombieJ zombieJ commented Aug 6, 2019

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines

Close #2962 #2966 ant-design/ant-design-pro#5014

Description of change

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4993

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 10 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 33.628%

Files with Coverage Reduction New Missed Lines %
packages/umi-build-dev/lib/plugins/commands/ui/src/app.js 10 0.0%
Totals Coverage Status
Change from base Build 4973: -0.03%
Covered Lines: 1475
Relevant Lines: 4382

💛 - Coveralls

@coveralls
Copy link

coveralls commented Aug 6, 2019

Pull Request Test Coverage Report for Build 5147

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 33.583%

Totals Coverage Status
Change from base Build 5117: 0.0%
Covered Lines: 1475
Relevant Lines: 4389

💛 - Coveralls

@sorrycc
Copy link
Member

sorrycc commented Aug 6, 2019

这对 antd 的版本有要求吧?

@zombieJ
Copy link
Contributor Author

zombieJ commented Aug 6, 2019

@sorrycc 嗯,看 umi-plugin-react 里写的是 3.x

@sorrycc
Copy link
Member

sorrycc commented Aug 6, 2019

什么版本开始的?umi-plugin-react 会优先用项目里依赖的 antd 版本,如果用户手写了低版本 antd,会有 break-change 。

@ycjcl868
Copy link
Contributor

ycjcl868 commented Aug 6, 2019

需要判断下 antd version

@chenshuai2144 mac 机器重启下,一直卡住

{ret}
</LocaleProvider>);
</ConfigProvider>);
{{/antd}}
return ret;
Copy link
Contributor

Choose a reason for hiding this comment

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

这句话在有antd的时候是多余的,是否需要去掉?

@@ -122,9 +122,9 @@ class LocaleWrapper extends React.Component{
</IntlProvider>)
{{/localeList.length}}
{{#antd}}
return (<LocaleProvider locale={appLocale.antd ? (appLocale.antd.default || appLocale.antd) : defaultAntd}>
return (<ConfigProvider locale={appLocale.antd ? (appLocale.antd.default || appLocale.antd) : defaultAntd}>
Copy link
Contributor

@ycjcl868 ycjcl868 Aug 9, 2019

Choose a reason for hiding this comment

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

import { version, LocaleProvider,  ConfigProvider } from 'antd';

const AntdProvider = Number(major) > 3 || Number(major) >= 3 && Number(minor) >= 21  ? ConfigProvider : LocaleProvider;

<AntdProvider ...

* fix: judge antd version

* fix: format

* fix: ci
@sorrycc sorrycc changed the title chore: Update wrapper.jsx.tpl fix: LocaleProvider warning after antd@3.21 Aug 12, 2019
@sorrycc sorrycc merged commit e35aaaa into master Aug 12, 2019
@sorrycc sorrycc deleted the zombieJ-patch-1 branch August 12, 2019 01:58
sorrycc added a commit that referenced this pull request Aug 14, 2019
@sorrycc
Copy link
Member

sorrycc commented Aug 14, 2019

实现有些问题,在 #2992 回滚,后面提新的 PR 再处理。

sorrycc added a commit that referenced this pull request Aug 14, 2019
@zhipingzhang
Copy link

请问这个问题好了吗,已有的项目改如何操作才能去掉这个警告啊

@ycjcl868
Copy link
Contributor

@zhipingzhang #2993

@zhipingzhang
Copy link

@ycjcl868 您好,我看到umi的发布日志上解决了有说解决了这个问题,但是我不知道我该如何操作。。是要更新什么呢?

@sorrycc
Copy link
Member

sorrycc commented Aug 18, 2019

@zhipingzhang 还没,今天更新个版本修复,不需要操作什么,重装依赖就好。

@dellyoung
Copy link

@zhipingzhang 还没,今天更新个版本修复,不需要操作什么,重装依赖就好。

您好,我刚刚试了下删掉node_modules,用npm-check-updates更新package.json全部依赖到最新版本,然后yarn安装,发现还是存在这些报错呀

image

@Lind-pro
Copy link

@zhipingzhang 还没,今天更新个版本修复,不需要操作什么,重装依赖就好。

似乎现在重装依赖还是有这个问题。。

@TimRChen
Copy link

TimRChen commented Sep 10, 2019

@zhipingzhang 还没,今天更新个版本修复,不需要操作什么,重装依赖就好。

似乎现在重装依赖还是有这个问题。。

image
像这样更新下试试,我更新这三个包以后就没有错误显示了。

@zywkuo
Copy link

zywkuo commented Nov 5, 2019

提示没有了,但是默认弹窗不显示中文,有遇到的吗?
"umi": "^2.11.1",
"umi-plugin-react": "^1.13.1"
"antd": "^3.25.0",
WX20191105-153610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

umi-plugin-locale模板过时