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

typescript tests and fixes #8

Merged
merged 7 commits into from
Jan 23, 2018
Merged

Conversation

rosskevin
Copy link
Contributor

@rosskevin rosskevin commented Jan 22, 2018

I improved the structure of the typescript exports (now strongly typed) and added tests for all the functions.

I believe I found the problem with #7 in that the package was referring to a js file instead of a ts file.

@erikras Please try a build and see if the ts gets included.

Closes #7
Depends on final-form/final-form#68

})

// Get form.mutators (default as object) and cast to Mutators
const mutators: Mutators = ((form.mutators || {}) as any) as Mutators
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI - This casting is a bit gross, but unless we allow parameterized types in the form and expose it all the way through, this is the way it needs to be done. Parameterized types in jsx is already painful so this is not any worse by any means.

@codecov
Copy link

codecov bot commented Jan 22, 2018

Codecov Report

Merging #8 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #8   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      8           
  Lines          48     48           
  Branches       10     10           
=====================================
  Hits           48     48

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 74d02c8...345c801. Read the comment docs.

@rosskevin
Copy link
Contributor Author

I need to PR a change to react-final-form to FormRenderProps mutators to make this simpler (make sure they are not undefined). The test I have created in final-form/react-final-form-arrays#18 show that this will be really painful in a strongly typed application.

@rosskevin
Copy link
Contributor Author

I don't have this quite right yet. Please hold and I'll work on it tomorrow. The import * as arrayMutators has default as the only member. I've tried a few quick things but did not work. I'll fix this tomorrow.

@erikras
Copy link
Member

erikras commented Jan 23, 2018

Okay. I upgraded the final-form dep. Let me know when this PR is good to go.

@rosskevin
Copy link
Contributor Author

@erikras This one is good to merge/release

@erikras erikras merged commit 0f31f17 into final-form:master Jan 23, 2018
@erikras
Copy link
Member

erikras commented Jan 23, 2018

Published in v1.0.4.

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.

2 participants