-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix flow typing | remove createSender
API
#7
fix flow typing | remove createSender
API
#7
Conversation
54950c6
to
7ef4aa7
Compare
Codecov Report
@@ Coverage Diff @@
## master #7 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 67 67
Branches 15 15
=====================================
Hits 67 67 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @wzrdzl!
Thank you so much for your contribution. I fully agree that we should require the type for an Action
instead of an ActionType
- this will dramatically improve the soundness of the typings. Great job!
I'm not sure about removing createSender
I think it might still be useful in certain situations. I've pushed a commit to your repo that re-enables this method and adds the best typing that I could come up with. What do you think about that?
In addition to that, we'd probably want to publish this as a major release as this breaks existing types but I see no issue in that.
Hi @philipp-spiess , Thanks for such a quick reaction! I agree that What I would do though, is to update the documentation so that it's clear that you are losing the typing of
I agree, for any flow project these changes are breaking |
It would be great if you could update the docs. I think we should remove We should also roll back the tests I suppose so that we also test Thank you for your help! |
Sure, no worries will update everything! :) |
…mponent into fix-flow-support
…component into fix-flow-support
@philipp-spiess I updated docs and brought back some |
1db7c85
to
467ccd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing! Thank you 👏 I'll release a 1.0.0-rc1
soon (tomorrow at the latest) so you can start using it.
Thanks man, it's been a pleasure to collaborate with you :) |
The pleasure is all mine 😊 FYI I've released https://github.com/philipp-spiess/react-recomponent/releases/tag/v1.0.0-rc.1 |
Fixes #6
Action
instead ofActionType
as a generic parameter ofReComponent
andRePureComponent
action.payload
is preserved throughout the component's API and reducerUnfortunately, in order to ensure proper type-checking I had to remove
createSender
API.I simply didn't manage to come up with typing that would ensure the correct
payload
typing, while maintaining the same API ofcreateSender
. Please let me know if you see a solution for it.Even though it has to be removed, I don't think it would make the ergonomics of
ReComponent
significantly worse:becomes
or
NOTE: I did not fix documentation (remove all mentions of
createSender
and fix the examples) yet. I would like to wait for the code review first just to know if you are OK with this breaking change. If you decide to proceed with these changes I will make sure the docs are updated as well