-
Notifications
You must be signed in to change notification settings - Fork 24.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
[iOS] Fix for loading state of Fast Refresh from user defaults #29880
Conversation
Base commit: 902611f |
95dea4f
to
a594047
Compare
@@ -405,17 +405,18 @@ - (void)addHandler:(id<RCTPackagerClientMethod>)handler forPackagerMethod:(NSStr | |||
|
|||
- (void)setupHMRClientWithBundleURL:(NSURL *)bundleURL | |||
{ | |||
if (bundleURL && !bundleURL.fileURL) { // isHotLoadingAvailable check |
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 assume this comment was a TODO that's now done
✌️ @PeteTheHeat
Base commit: 902611f |
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.
@PeteTheHeat has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
if (self.bridge) { | ||
[self.bridge enqueueJSCall:@"HMRClient" | ||
method:@"setup" | ||
args:@[ @"ios", path, host, RCTNullIfNil(port), @(YES) ] | ||
args:@[ @"ios", path, host, RCTNullIfNil(port), @(isHotLoadingEnabled) ] |
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.
Ahh nice catch. I think I must've originally misread this as isHotLoadingAvailable
, and assumed that since we've already passed the if condition, this is always true.
This pull request was successfully merged by @stigi in 845e9ea. When will my fix make it into a release? | Upcoming Releases |
) Summary: Disabling Fast Refresh won't be persisted when restarting the app. I believe this regressed with facebook@824e171. In this commit `HMRClient.setup` will always be called with `enabled` being set true. This PR loads the _enabled_ state from the user defaults (as it was done before). ## Changelog [iOS] [Fixed] - Enable Fast Refresh gets persisted across app launches Pull Request resolved: facebook#29880 Test Plan: Without this change Fast Refresh is enabled on every app restart. Tested with this change: - Disabling Fast Refresh - Restarting App -> Fast Refresh still disabled - Enabled Fast Refresh again - Restarting App -> Fast Refresh still enabled again Reviewed By: sammy-SC Differential Revision: D23686435 Pulled By: PeteTheHeat fbshipit-source-id: 42c31b22060d3dc4b1d4cb8f41792b303fc7fce8
Summary
Disabling Fast Refresh won't be persisted when restarting the app.
I believe this regressed with 824e171. In this commit
HMRClient.setup
will always be called withenabled
being set true. This PR loads the enabled state from the user defaults (as it was done before).Changelog
[iOS] [Fixed] - Enable Fast Refresh gets persisted across app launches
Test Plan
Without this change Fast Refresh is enabled on every app restart.
Tested with this change: