-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Upgrade react-hot-loader
to 4.6
#10455
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
51ab5a2
Upgrade `react-hot-loader` to 4.6
jgierer12 323cb23
Remove `pureRender` config
jgierer12 a30e807
Fix `Cannot call a class as a function`
jgierer12 de6d443
Fix `hot update was not successful`
jgierer12 3894f0a
Add webpack loader for patching `react-dom`
jgierer12 24cb4d7
Restore `pureRender` config
jgierer12 be3d53e
Call `hot` synchronously
jgierer12 f0883f1
Remove webpack loader
jgierer12 0898e51
Move `hot` call to `sync-requires.js`
jgierer12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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 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
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.
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.
New
/root/hot
API will not stand asynchronously between the first part and the second.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.
Do you mean that
hot
should stay in this module? i.e.That was the reason for the original
hot update was not successful
errorThere 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.
hot
orimport 'react-hot-loader/root
are callingmodule.hot.accept
for the current module, thus setting self-acceptance.It's expected that some action would take a place on module hot update immediately and in a synchronous mode. Using
hot
inside indirectly called function are breaking some expectations - "module" could not accept it, as long as the "real action" is not yet called.Here - if you want to make
./root
hot - you have to make IT hot. And that's was done.The second moment is about HMR and an update propagation.
When you change a file webpack bubbles update to parent, unless parent will accept the change, then webpack will update parent and everything below it.
We had WFT-level issues if "parent" is the module with
react-dom/render
- everything got wiped and regenerated, making reconciliation impossible (Symbols
could be updated for example).This is not quite clear from RHL documentation, sorry. The difference is between
self-accept
in v4, andchild-accept
(ie module.hot.accept('./containers/App') in v3.Here you might want to accept only
./root
, but would accept everything.