-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
[Fresh] Implement missing features #15860
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This test included a change in variable name. It wasn't needed, and distracts from the actual thing being tested (the annotation).
prepareUpdate() now returns null if there are none.
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: c403ae4...6a062a3 react-dom
react-art
react-test-renderer
react-native-renderer
react-reconciler
react-fresh
Generated by 🚫 dangerJS |
bvaughn
approved these changes
Jun 11, 2019
gaearon
added a commit
to gaearon/react
that referenced
this pull request
Jun 19, 2019
* Fix existing test This test included a change in variable name. It wasn't needed, and distracts from the actual thing being tested (the annotation). * Reset state on edits to initial state argument * Add a way to check whether there are hot updates prepareUpdate() now returns null if there are none. * Add a way to query host nodes for families
gaearon
added a commit
to gaearon/react
that referenced
this pull request
Jun 19, 2019
* Fix existing test This test included a change in variable name. It wasn't needed, and distracts from the actual thing being tested (the annotation). * Reset state on edits to initial state argument * Add a way to check whether there are hot updates prepareUpdate() now returns null if there are none. * Add a way to query host nodes for families
rickhanlonii
pushed a commit
to rickhanlonii/react
that referenced
this pull request
Jun 25, 2019
* Fix existing test This test included a change in variable name. It wasn't needed, and distracts from the actual thing being tested (the annotation). * Reset state on edits to initial state argument * Add a way to check whether there are hot updates prepareUpdate() now returns null if there are none. * Add a way to query host nodes for families
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Those are technically separate but I figured I'd put them in one PR instead of many small ones. I can separate if you prefer.
Commits:
e8f6894: Fixing an existing test to test the correct thing. It was supposed to test the annotation but I additionally had a variable rename there due to copy pasta. So I cleaned it up.
892930d: This adds a new heuristic. If you edit
useState()
argument, likeuseState(0)
->useState(1)
, we'll remount. This will reinitialize the state, as you'd expect. This heuristic isn't perfect, e.g. it won't capture edits to a constant outside the parens, but it's good enough for the common case. I had to adjust a bunch of existing tests which started failing because of it.9e9a9dd: This makes it easy for the module system integration to determine whether there's any hot update that needs to be applied.
6a062a3: A reincarnation of [React Fresh] Return host nodes for visual feedback #15688. That approach was bad because it highlighted nodes after hot update. That is distracting because you just want to see the new thing. Instead, I'm going with highlighting likely affected component before hot update is applied. So we can highlight the "old version", wait for update to come in (~100-200ms), and then replace it. This commit doesn't add any actual highlighting, but it adds the infrastructure necessary for it. Such as ability to query closest host nodes by a set of families. I verified it works and is sufficient in my playground.
The theme of this PR is to get to feature complete on the React side. The rest is integration.