Skip to content

Commit

Permalink
remove feature flag cancel_image_downloads_on_recycle (#42663)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #42663

changelog: [internal]

Removing the MC, this has been shipped.

Reviewed By: rubennorte

Differential Revision: D53043474

fbshipit-source-id: 2036f6752a3930666e872df0f6418e3ad8986441
sammy-SC authored and facebook-github-bot committed Jan 25, 2024
1 parent c9764c5 commit 889ead1
Showing 4 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -101,15 +101,13 @@ - (void)_setStateAndResubscribeImageResponseObserver:(const ImageShadowNode::Con
const auto &imageRequest = _state->getData().getImageRequest();
auto &observerCoordinator = imageRequest.getObserverCoordinator();
observerCoordinator.removeObserver(_imageResponseObserverProxy);
if (CoreFeatures::cancelImageDownloadsOnRecycle) {
// Cancelling image request because we are no longer observing it.
// This is not 100% correct place to do this because we may want to
// re-create RCTImageComponentView with the same image and if it
// was cancelled before downloaded, download is not resumed.
// This will only become issue if we decouple life cycle of a
// ShadowNode from ComponentView, which is not something we do now.
imageRequest.cancel();
}
// Cancelling image request because we are no longer observing it.
// This is not 100% correct place to do this because we may want to
// re-create RCTImageComponentView with the same image and if it
// was cancelled before downloaded, download is not resumed.
// This will only become issue if we decouple life cycle of a
// ShadowNode from ComponentView, which is not something we do now.
imageRequest.cancel();
}

_state = state;
4 changes: 0 additions & 4 deletions packages/react-native/React/Fabric/RCTSurfacePresenter.mm
Original file line number Diff line number Diff line change
@@ -260,10 +260,6 @@ - (RCTScheduler *)_createScheduler
CoreFeatures::enablePropIteratorSetter = true;
}

if (reactNativeConfig && reactNativeConfig->getBool("react_fabric:cancel_image_downloads_on_recycle")) {
CoreFeatures::cancelImageDownloadsOnRecycle = true;
}

if (reactNativeConfig && reactNativeConfig->getBool("react_fabric:enable_granular_scroll_view_state_updates_ios")) {
CoreFeatures::enableGranularScrollViewStateUpdatesIOS = true;
}
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ namespace facebook::react {
bool CoreFeatures::enablePropIteratorSetter = false;
bool CoreFeatures::blockPaintForUseLayoutEffect = false;
bool CoreFeatures::cacheLastTextMeasurement = false;
bool CoreFeatures::cancelImageDownloadsOnRecycle = false;
bool CoreFeatures::enableGranularScrollViewStateUpdatesIOS = false;
bool CoreFeatures::enableMountHooks = false;
bool CoreFeatures::enableGranularShadowTreeStateReconciliation = false;
4 changes: 0 additions & 4 deletions packages/react-native/ReactCommon/react/utils/CoreFeatures.h
Original file line number Diff line number Diff line change
@@ -30,10 +30,6 @@ class CoreFeatures {
// On iOS, we also cache NSTextStorage.
static bool cacheLastTextMeasurement;

// Fabric was not cancelling image downloads when <ImageView /> was removed
// from view hierarchy. This feature flag enables this feature.
static bool cancelImageDownloadsOnRecycle;

// When enabled, RCTScrollViewComponentView will trigger ShadowTree state
// updates for all changes in scroll position.
static bool enableGranularScrollViewStateUpdatesIOS;

0 comments on commit 889ead1

Please sign in to comment.