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

Use accurate Event type #4375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

asazernik
Copy link
Contributor

The existing Event type would not typecheck for any correct
event-handling code; dataTransfer is not present for non-DnD events, and
value is not guaranteed to be present for non-Input events.

This change is quite safe:

  1. Props the user is expected to pass in are replaced with supertypes of
    what they were before (a function taking a subtype is a supertype)

  2. Props the user is given are replaced with supertypes of what they
    were before, but they should only get a type error in cases where they
    are legitimately messing up (i.e. are passing an Event that doesn't have
    an HTMLInputElement as its target to the handlers in FieldProps).

@codecov
Copy link

codecov bot commented Feb 8, 2019

Codecov Report

Merging #4375 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4375   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          74      74           
  Lines        1686    1691    +5     
======================================
+ Hits         1686    1691    +5
Impacted Files Coverage Δ
src/createFieldProps.js 100% <ø> (ø) ⬆️
src/events/getValue.js 100% <100%> (ø) ⬆️

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 84359b3...02ec9b3. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Feb 8, 2019

Codecov Report

Merging #4375 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4375   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          74      74           
  Lines        1686    1691    +5     
======================================
+ Hits         1686    1691    +5
Impacted Files Coverage Δ
src/createFieldProps.js 100% <ø> (ø) ⬆️
src/events/getValue.js 100% <100%> (ø) ⬆️

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 84359b3...02ec9b3. Read the comment docs.

@codecov
Copy link

codecov bot commented Feb 8, 2019

Codecov Report

Merging #4375 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4375   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          74      74           
  Lines        1686    1691    +5     
======================================
+ Hits         1686    1691    +5
Impacted Files Coverage Δ
src/createFieldProps.js 100% <ø> (ø) ⬆️
src/events/getValue.js 100% <100%> (ø) ⬆️

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 84359b3...325d0bf. Read the comment docs.

The existing Event type would not typecheck for any correct
event-handling code; dataTransfer is not present for non-DnD events, and
value is not guaranteed to be present for non-Input events.

This change is quite safe:

1. Props the user is expected to pass in are replaced with supertypes of
what they were before (a function taking a subtype is a supertype)

2. Props the user is given are replaced with supertypes of what they
were before, but they should only get a type error in cases where they
are legitimately messing up (i.e. are passing an Event that doesn't have
an HTMLInputElement as its target to the handlers in FieldProps).
@codecov-io
Copy link

Codecov Report

Merging #4375 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4375   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          74      74           
  Lines        1694    1691    -3     
======================================
- Hits         1694    1691    -3
Impacted Files Coverage Δ
src/createFieldProps.js 100% <ø> (ø) ⬆️
src/events/getValue.js 100% <100%> (ø) ⬆️
src/structure/immutable/index.js 100% <0%> (ø) ⬆️
src/structure/immutable/deepEqual.js 100% <0%> (ø) ⬆️
src/handleSubmit.js 100% <0%> (ø) ⬆️
src/createReduxForm.js 100% <0%> (ø) ⬆️
src/structure/plain/deepEqual.js 100% <0%> (ø) ⬆️
src/propTypes.js 100% <0%> (ø) ⬆️

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 720c9d0...325d0bf. Read the comment docs.

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

2 participants