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

Improved filterDOMProps return type #763

Merged
merged 4 commits into from
Jul 8, 2020
Merged

Improved filterDOMProps return type #763

merged 4 commits into from
Jul 8, 2020

Conversation

radekmie
Copy link
Contributor

@radekmie radekmie commented Jul 5, 2020

This change enhances filterDOMProps return type from Partial<T> to Omit<T, keyof FilterDOMProps>. In short, this allows us to properly exclude all filtered props, including the ones in the user app. New props have to be registered in the type as well:

declare module 'uniforms' {
  interface FilterDOMProps {
    customPropToFilter: never;
  }
}

filterDOMProps.register('customPropToFilter');

This showed a few unnecessarily passed props.

@radekmie radekmie added the Type: Feature New features and feature requests label Jul 5, 2020
@radekmie radekmie added this to the v3.0 milestone Jul 5, 2020
@radekmie radekmie requested review from kestarumper and Monteth July 5, 2020 14:10
@radekmie radekmie force-pushed the v3-filterdomprops-types branch from 3a0b454 to 481a300 Compare July 5, 2020 14:34
@codecov
Copy link

codecov bot commented Jul 5, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##               v3     #763   +/-   ##
=======================================
  Coverage   97.82%   97.82%           
=======================================
  Files         175      175           
  Lines        3397     3398    +1     
  Branches      641      641           
=======================================
+ Hits         3323     3324    +1     
  Misses          8        8           
  Partials       66       66           
Impacted Files Coverage Δ
packages/uniforms-antd/src/DateField.tsx 100.00% <ø> (ø)
packages/uniforms-antd/src/HiddenField.tsx 100.00% <ø> (ø)
packages/uniforms-antd/src/SelectField.tsx 100.00% <ø> (ø)
packages/uniforms-antd/src/wrapField.tsx 100.00% <ø> (ø)
packages/uniforms-bootstrap3/src/HiddenField.tsx 100.00% <ø> (ø)
packages/uniforms-bootstrap3/src/gridClassName.ts 100.00% <ø> (ø)
packages/uniforms-bootstrap4/src/HiddenField.tsx 100.00% <ø> (ø)
packages/uniforms-bootstrap4/src/gridClassName.ts 100.00% <ø> (ø)
...es/uniforms-bridge-simple-schema-2/src/register.ts 100.00% <ø> (ø)
...ages/uniforms-bridge-simple-schema/src/register.ts 100.00% <ø> (ø)
... and 4 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 c0f8c30...97bc8d2. Read the comment docs.

@radekmie radekmie merged commit 0376fbc into v3 Jul 8, 2020
@radekmie radekmie deleted the v3-filterdomprops-types branch July 8, 2020 10:08
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.

2 participants