-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: react-hot-loader compatibility #1137
Conversation
if (store !== lastStore) { | ||
if ( | ||
store !== lastStore || | ||
lastSelectorFactoryOptions !== selectorFactoryOptions |
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.
factory could change, not only store
lastChildProps = childProps | ||
lastForwardRef = forwardRef | ||
lastComponent = WrappedComponent |
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.
component could change. Don't use component from a local scope.
@@ -182,7 +200,14 @@ export default function connectAdvanced( | |||
) | |||
this.selectDerivedProps = makeDerivedPropsSelector() | |||
this.selectChildElement = makeChildElementSelector() | |||
this.renderWrappedComponent = this.renderWrappedComponent.bind(this) | |||
this.indirectRenderWrappedComponent = this.indirectRenderWrappedComponent.bind( |
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.
constructor could not be updated on hot-load.
Deploy preview for react-redux-docs ready! Built with commit c19b6d5 |
|
||
indirectRenderWrappedComponent(value) { | ||
// calling renderWrappedComponent on prototype from indirectRenderWrappedComponent bound to `this` | ||
return this.renderWrappedComponent(value) |
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.
That's the main trick - redirect to hot-reloadable prototype level.
Any update on when this will be merged and released? |
@timdorr : any thoughts on this? |
Have we run this through the benchmark suite as a regression check? |
Any guideline for benchmarking? |
I know you've been playing with a clone of the benchmarks harness repo. Run comparisons of v5, v6, and a build from this branch, and see if there's any meaningful perf differences between v6 and this branch in particular. |
Any update on this? As redux was invented to facilitate hot reloading, it was a bit annoying to find out that things aren't working anymore 😁 Anything I can do to help? |
Ok, slightly more useful comment from me this time: Benchmarks show no appreciable difference:
|
Spent the afternoon poking at the benchmarks setup. Thanks to @glenjamin for helping with some upgrades there. The actual FPS numbers fluctuate from run to run, but yeah, I don't see any appreciable indication that this makes things any slower. |
@theKashey : I rebased this branch against master, but it doesn't look like I can force-push it to your repo atm. I'm going to close this PR, push my branch, and create a new PR from that. |
This PR restores historically important ability to hot-reload redux.
The major change here is driven by
prettier
due to increased length of conditions, nothing more.