-
Notifications
You must be signed in to change notification settings - Fork 256
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
Migrate Frontity Connect to react easy state [21pt] #415
Conversation
🦋 Changeset detectedLatest commit: a86e636 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
TSDocs disabled by `@luisherranz` in this file because he needs to figure out first which types will remain when we merge this PR #415, taking into account that `react-easy-state` and `@nx-js/observer-util` already have types themselves.
Because I want to refactor those types in the #415 PR.
ESLint Summary View Full Report
[failure] jsdoc/require-param
[failure] jsdoc/require-jsdoc
Report generated by eslint-plus-action |
Codecov Report
|
ESLint Summary View Full Report
[failure] jsdoc/require-param
[failure] jsdoc/require-jsdoc
Report generated by eslint-plus-action |
I have updated the code to use the last alpha versions from |
This is finally ready for review 🙂 I've made a video to go over the changes: https://www.loom.com/share/e48c9accaabd4b69b8f4cc2349ed997e |
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.
I haven't finished reviewing it all but I have some questions in the meantime 🙂
Thanks for the reviews guys. I've made the changes and should be up for a review again 🙂 |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
scheduler: () => { | ||
// Trigger a new rerender if the component has already been | ||
// mounted. | ||
if (reaction.current.mounted) setState({}); | ||
// Annotate it as "changed" if the component has not been mounted | ||
// yet. | ||
else reaction.current.changedBeforeMounted = true; | ||
}, |
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.
Note to self: The custom scheduler is used here in order to fix the bug: RisingStack/react-easy-state#196 (comment)
ESLint Summary View Full Report
Report generated by eslint-plus-action |
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.
OK, looks great @luisherranz 🙂 Let's merge this!
Merged! Thanks a lot guys! 🙂 |
What:
Stop using our own fork and migrate back to
react-easy-state
.Why:
Because they are adding hooks to their library, so we can build on top of it. This means that Frontity Connect will become an opinionated version of
react-easy-state
instead of a fork.How:
I removed all our code, added
react-easy-state
back and used the hooks to replicate our changes.Tasks:
createStore
.createStore
unit tests.connect
.connect
unit tests.useConnect
and its tests (from ImplementuseConnect
hook #404).options.inject
toconnect
and it's tests (from ImplementuseConnect
hook #404).react-easy-state
: Warning: Can't perform a React state update on an unmounted component. RisingStack/react-easy-state#196react-easy-state
and@nx-js/observer-utils
Unrelated:
batch()
to batch invalidations ofobserve
as well.Update starter themesUpdate other packagesDocumentationCommunity discussions