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

Added kind option to connectField. #741

Merged
merged 14 commits into from
Jun 17, 2020
Merged

Added kind option to connectField. #741

merged 14 commits into from
Jun 17, 2020

Conversation

radekmie
Copy link
Contributor

@radekmie radekmie commented Jun 6, 2020

This change introduces a kind: 'leaf' | 'node' flag for the connectField, closing #717. This information is later used by AutoField, allowing it to skip one components layer (namely, Field created in connectField), effectively getting rid of one useField per field.

Rendering time (see #716) reduced noticeably, especially the upper bounds:

v3 1f70af5 v3 895130a v2 759a0a7
Nested min 42ms 40ms 55ms
Nested max 70ms 53ms 62ms
Flat min 51ms 43ms 22ms
Flat max 73ms 56ms 57ms

This is still a proof of concept, though. Things that are left:

  • Decide if Component and options are part of the public API. We'll introduce it as an internal API, therefore it could be changed without a major version change. In the following v3.x versions it may become public (and obtain stability guarantees).
  • Decide if kind is a good name and way of specifying that. Maybe something more specific like mayHaveSubfield, isLeaf or plainField would make more sense. We'll stick to kind for now.
  • Mark fields with kind: 'leaf' whenever possible.
  • Update other themes.
  • Write tests.
  • Update changelog.

@radekmie radekmie added the Type: Feature New features and feature requests label Jun 6, 2020
@radekmie radekmie added this to the v3.0 milestone Jun 6, 2020
@radekmie radekmie requested review from kestarumper and Monteth June 6, 2020 09:41
@codecov
Copy link

codecov bot commented Jun 10, 2020

Codecov Report

Merging #741 into v3 will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##               v3     #741   +/-   ##
=======================================
  Coverage   97.87%   97.87%           
=======================================
  Files         175      175           
  Lines        3429     3435    +6     
  Branches      625      637   +12     
=======================================
+ Hits         3356     3362    +6     
  Misses          8        8           
  Partials       65       65           
Impacted Files Coverage Δ
packages/uniforms-antd/src/AutoField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/BoolField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/DateField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/ErrorField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/ListAddField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/ListDelField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/LongTextField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/NumField.tsx 100.00% <100.00%> (ø)
packages/uniforms-antd/src/RadioField.tsx 90.90% <100.00%> (ø)
packages/uniforms-antd/src/SelectField.tsx 100.00% <100.00%> (ø)
... and 57 more

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 47cea74...9667c30. Read the comment docs.

@Monteth Monteth force-pushed the v3-connectfield-kind branch from 01dc4ef to 325b96e Compare June 17, 2020 10:55
@radekmie radekmie merged commit 09fd494 into v3 Jun 17, 2020
@radekmie radekmie deleted the v3-connectfield-kind branch June 17, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants