react-native-macos/Libraries
Ben Nham 71bf8a3e48 Only clear image contents on memory warning
Summary:
Some apps are complaining about flashing images when performing navigation transitions. An example issue would be:

1. Load a master list view with many images
2. Click on an image to go to a detail view
3. Go back to the master list view

At step (3), users see a number of images flash from a placeholder image back to the final image because `-[RCTImageView didMoveToWindow]` calls `clearImage` when the image view exits the view hierarchy between (1) and (2) and calls `reloadImage` (which sets the image property asynchronously) when the image view re-enters the view hiearchy between (2) and (3).

This diff fixes the issue by being less aggressive about clearing image contents. It only clears image contents when the app receives a memory warning or the app goes into the background.

For comparison, CKNetworkImageComponent in ComponentKit doesn't have this purging behavior at all.

Reviewed By: javache

Differential Revision: D3325009

fbshipit-source-id: efca10099cdfdb49afbb3f550854d4b8a40511d0
2016-05-24 08:43:23 -07:00
..
ART Check if either array is null before diffing 2016-04-25 13:28:31 -07:00
ActionSheetIOS ActionSheetIOS - support share sheet on modals 2016-05-20 17:13:21 -07:00
AdSupport Text highlighting on iOS 2015-07-24 08:41:58 -08:00
Animated Round alpha channel when interpolating colors to the nearest thousandth. 2016-05-17 10:13:29 -07:00
AppRegistry Refactor BugReporing to avoid multiple registers 2016-05-18 14:28:26 -07:00
AppState Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
BatchedBridge Memoize lazy module configs 2016-05-16 03:58:23 -07:00
BugReporting Make BugReporting not pull in native module on require 2016-05-19 12:58:21 -07:00
CameraRoll ActionSheetIOS - support share sheet on modals 2016-05-20 17:13:21 -07:00
Components Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing 2016-05-24 03:28:25 -07:00
CustomComponents Set statics on the NavigationCard container 2016-05-23 20:43:28 -07:00
DebugComponentHierarchy Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
Devtools Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
EventEmitter Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
Experimental Faster animation 2016-05-23 10:28:34 -07:00
Fetch Reject promise if network request failed 2016-03-08 16:37:24 -08:00
Geolocation Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
Image Only clear image contents on memory warning 2016-05-24 08:43:23 -07:00
Inspector Fix internal fields access for inspector 2016-05-20 12:13:48 -07:00
Interaction Fix JSWatchdog reset 2016-05-03 19:20:26 -07:00
JavaScriptAppEngine Respect original enumerability/writability when polyfilling globals 2016-05-24 06:58:17 -07:00
LayoutAnimation Add support for delete animation in LayoutAnimation on iOS 2016-04-25 00:19:25 -07:00
Linking Mention native code in `Linking` docs 2016-04-20 19:23:19 -07:00
LinkingIOS Added explicit init to observer modules 2016-05-04 07:07:24 -07:00
Modal Modal Status Bar Translucent 2016-05-09 07:08:22 -07:00
NavigationExperimental Rename `navigationState.children` to `navigationState.routes`. 2016-05-22 16:28:27 -07:00
Network Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
PushNotificationIOS Added explicit init to observer modules 2016-05-04 07:07:24 -07:00
QuickPerformanceLogger added QPL for main interactions 2015-09-29 22:25:23 -07:00
RCTTest Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
RKBackendNode Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
ReactIOS Fix or suppress errors in react-native 2016-04-21 19:47:24 -07:00
ReactNative Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
Sample Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
Settings Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
Storage Update AsyncStorage.js 2016-04-10 18:02:20 -07:00
StyleSheet Deprecate transformMatrix and decomposedMatrix 2016-04-29 14:19:25 -07:00
Text Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
Utilities Prevent Systrace from including React in the preloaded modules section 2016-05-23 04:58:24 -07:00
Vibration Add support for vibration patterns 2016-03-29 21:45:20 -07:00
WebSocket Updated Websocket to use new event system 2016-05-12 08:30:24 -07:00
react-native Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing 2016-05-24 03:28:25 -07:00
vendor Fixed NativeEventListener deregistration 2016-05-16 04:13:56 -07:00
Promise.js Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
promiseRejectionIsError.js Add possibility to `console.error`/redbox on promise rejections 2016-03-15 05:22:22 -07:00