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

feat: validateFirst support parallel #25321

Merged
merged 4 commits into from Jul 1, 2020
Merged

feat: validateFirst support parallel #25321

merged 4 commits into from Jul 1, 2020

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jun 30, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Perfermance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

resolve #21793

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Adjust Form.Item validateFist to validate in order. Origin logic use parallel to validate.
🇨🇳 Chinese 调整 Form.Item validateFirst 属性为依次执行校验,原并行逻辑改由配置 parallel 开启。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

View rendered components/form/index.en-US.md
View rendered components/form/index.zh-CN.md

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jun 30, 2020

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jun 30, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 30, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 87509c8:

Sandbox Source
antd reproduction template Configuration
antd reproduction template Issue #21793

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #25321 into feature will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           feature   #25321   +/-   ##
========================================
  Coverage    99.51%   99.51%           
========================================
  Files          368      368           
  Lines         7290     7290           
  Branches      1995     2044   +49     
========================================
  Hits          7255     7255           
  Misses          35       35           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8313497...87509c8. Read the comment docs.

components/form/index.en-US.md Outdated Show resolved Hide resolved
components/form/index.zh-CN.md Outdated Show resolved Hide resolved
xrkffgg
xrkffgg approved these changes Jul 1, 2020
Co-authored-by: xrkffgg <xrkffgg@gmail.com>
Co-authored-by: xrkffgg <xrkffgg@gmail.com>
@zombieJ zombieJ merged commit b46ea66 into feature Jul 1, 2020
8 of 12 checks passed
@zombieJ zombieJ deleted the form-parallel branch Jul 1, 2020
@@ -93,7 +93,7 @@ const validateMessages = {
| rules | 校验规则,设置字段的校验逻辑。点击[此处](#components-form-demo-basic)查看示例 | [Rule](#Rule)[] | - | |
| shouldUpdate | 自定义字段更新逻辑,说明[见下](#shouldUpdate) | boolean \| (prevValue, curValue) => boolean | false | |
| trigger | 设置收集字段值变更的时机 | string | `onChange` | |
| validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验 | boolean | false | |
| validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验。设置 `parallel` 时会并行校验 | boolean \| `parallel` | false | `parallel`: 4.5.0 |
Copy link
Contributor

@yoyo837 yoyo837 Jul 1, 2020

Choose a reason for hiding this comment

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

我咋理解这里是应该是串行?

Copy link
Member

@xrkffgg xrkffgg Jul 1, 2020

Choose a reason for hiding this comment

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

没有的。 boolean | parallel 展示的出的效果,表示类型是 boolean 或者 parallel ,默认值为 false ,其中 parallel 是 4.5.0 版本加的

Copy link
Member

@afc163 afc163 Jul 1, 2020

Choose a reason for hiding this comment

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

markdown table 换行和代码格式是个大问题。

Copy link
Contributor

@yoyo837 yoyo837 Jul 1, 2020

Choose a reason for hiding this comment

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

那这算breaking change吧?原并行改为串行,支持开启并行。

Copy link
Member Author

@zombieJ zombieJ Jul 1, 2020

Choose a reason for hiding this comment

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

嗯,不过影响不大。设置 validateFirst 有一个报错就行了。

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

Successfully merging this pull request may close these issues.

None yet

5 participants