react-native-macos 0.0.0-1498fe595 → 0.0.0-15d2dbd2f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +2 -3
  2. package/Libraries/Alert/Alert.js +2 -2
  3. package/Libraries/Alert/RCTAlertManager.android.js +1 -1
  4. package/Libraries/Animated/AnimatedImplementation.js +53 -53
  5. package/Libraries/Animated/AnimatedMock.js +8 -8
  6. package/Libraries/Animated/NativeAnimatedHelper.js +23 -20
  7. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  8. package/Libraries/Animated/nodes/AnimatedNode.js +10 -9
  9. package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
  10. package/Libraries/AppState/AppState.js +8 -7
  11. package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +2 -2
  12. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -20
  13. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -2
  14. package/Libraries/Components/Button.js +1 -2
  15. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +6 -7
  16. package/Libraries/Components/Keyboard/Keyboard.js +8 -7
  17. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +5 -10
  18. package/Libraries/Components/Pressable/Pressable.js +1 -2
  19. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +2 -1
  20. package/Libraries/Components/RefreshControl/RefreshControl.js +2 -7
  21. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -3
  22. package/Libraries/Components/SafeAreaView/SafeAreaView.js +2 -2
  23. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -5
  24. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +3 -5
  25. package/Libraries/Components/ScrollView/ScrollView.js +34 -100
  26. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -4
  27. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -2
  28. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +2 -8
  29. package/Libraries/Components/Sound/SoundManager.js +1 -1
  30. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -2
  31. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +3 -5
  32. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +3 -5
  33. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  34. package/Libraries/Components/TextInput/TextInput.js +88 -11
  35. package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +3 -3
  36. package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +3 -3
  37. package/Libraries/Components/Touchable/BoundingDimensions.js +2 -2
  38. package/Libraries/Components/Touchable/PooledClass.js +6 -6
  39. package/Libraries/Components/Touchable/Position.js +1 -1
  40. package/Libraries/Components/Touchable/Touchable.js +26 -25
  41. package/Libraries/Components/Touchable/TouchableBounce.js +1 -2
  42. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -2
  43. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +4 -11
  44. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -2
  45. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  46. package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -0
  47. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +3 -3
  48. package/Libraries/Components/View/View.js +0 -7
  49. package/Libraries/Components/View/ViewNativeComponent.js +3 -4
  50. package/Libraries/Components/View/ViewPropTypes.js +10 -6
  51. package/Libraries/Core/Devtools/parseHermesStack.js +2 -1
  52. package/Libraries/Core/ExceptionsManager.js +2 -2
  53. package/Libraries/Core/NativeExceptionsManager.js +2 -3
  54. package/Libraries/Core/ReactNativeVersion.js +1 -1
  55. package/Libraries/Core/Timers/JSTimers.js +17 -13
  56. package/Libraries/Core/setUpAlert.js +1 -1
  57. package/Libraries/Core/setUpDeveloperTools.js +1 -1
  58. package/Libraries/Core/setUpPerformance.js +1 -1
  59. package/Libraries/Core/setUpRegeneratorRuntime.js +1 -1
  60. package/Libraries/Core/setUpSegmentFetcher.js +4 -4
  61. package/Libraries/EventEmitter/NativeEventEmitter.js +2 -1
  62. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -1
  63. package/Libraries/HeapCapture/HeapCapture.js +1 -1
  64. package/Libraries/Image/AssetSourceResolver.js +2 -4
  65. package/Libraries/Image/Image.android.js +4 -4
  66. package/Libraries/Image/Image.ios.js +3 -3
  67. package/Libraries/Image/ImageAnalyticsTagContext.js +2 -3
  68. package/Libraries/Image/ImageBackground.js +1 -2
  69. package/Libraries/Image/ImagePickerIOS.js +6 -6
  70. package/Libraries/Image/ImageViewNativeComponent.js +2 -4
  71. package/Libraries/Image/NativeImageLoaderAndroid.js +1 -3
  72. package/Libraries/Image/RCTImageCache.m +1 -1
  73. package/Libraries/Image/TextInlineImageNativeComponent.js +3 -5
  74. package/Libraries/Inspector/ElementProperties.js +2 -4
  75. package/Libraries/Inspector/InspectorOverlay.js +1 -2
  76. package/Libraries/Inspector/InspectorPanel.js +1 -2
  77. package/Libraries/Inspector/NetworkOverlay.js +5 -11
  78. package/Libraries/Interaction/BridgeSpyStallHandler.js +1 -1
  79. package/Libraries/Interaction/FrameRateLogger.js +2 -2
  80. package/Libraries/Interaction/InteractionManager.js +2 -4
  81. package/Libraries/Interaction/JSEventLoopWatchdog.js +4 -4
  82. package/Libraries/Interaction/PanResponder.js +3 -4
  83. package/Libraries/Interaction/TouchHistoryMath.js +7 -7
  84. package/Libraries/JSInspector/NetworkAgent.js +1 -6
  85. package/Libraries/LayoutAnimation/LayoutAnimation.js +3 -3
  86. package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
  87. package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
  88. package/Libraries/Lists/FillRateHelper.js +1 -3
  89. package/Libraries/Lists/FlatList.js +41 -5
  90. package/Libraries/Lists/ViewabilityHelper.js +4 -10
  91. package/Libraries/Lists/VirtualizeUtils.js +2 -6
  92. package/Libraries/Lists/VirtualizedList.js +143 -126
  93. package/Libraries/Lists/VirtualizedListContext.js +3 -5
  94. package/Libraries/Lists/VirtualizedSectionList.js +63 -68
  95. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  96. package/Libraries/LogBox/Data/parseLogBoxLog.js +12 -23
  97. package/Libraries/LogBox/UI/LogBoxButton.js +2 -4
  98. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -4
  99. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -2
  100. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -2
  101. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -6
  102. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -2
  103. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -4
  104. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -4
  105. package/Libraries/LogBox/UI/LogBoxNotification.js +2 -4
  106. package/Libraries/Modal/Modal.js +2 -4
  107. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -4
  108. package/Libraries/Network/XHRInterceptor.js +5 -6
  109. package/Libraries/NewAppScreen/components/Header.js +2 -4
  110. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -2
  111. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +2 -4
  112. package/Libraries/Performance/SamplingProfiler.js +3 -3
  113. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -3
  114. package/Libraries/Pressability/Pressability.js +2 -2
  115. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +4 -2
  116. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +8 -7
  117. package/Libraries/ReactNative/AppContainer.js +4 -6
  118. package/Libraries/ReactNative/AppRegistry.js +2 -3
  119. package/Libraries/ReactNative/I18nManager.js +2 -5
  120. package/Libraries/ReactNative/PaperUIManager.js +2 -3
  121. package/Libraries/ReactNative/RootTag.js +2 -3
  122. package/Libraries/ReactNative/renderApplication.js +1 -2
  123. package/Libraries/Storage/AsyncStorage.js +21 -21
  124. package/Libraries/StyleSheet/StyleSheet.js +2 -1
  125. package/Libraries/StyleSheet/StyleSheetTypes.js +26 -1
  126. package/Libraries/StyleSheet/processColor.js +2 -2
  127. package/Libraries/StyleSheet/splitLayoutProps.js +1 -3
  128. package/Libraries/Text/RCTTextAttributes.m +20 -13
  129. package/Libraries/Text/Text.js +2 -1
  130. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +13 -1
  131. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +86 -7
  132. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +12 -1
  133. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +20 -3
  134. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
  135. package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +12 -0
  136. package/Libraries/Text/TextInput/RCTBaseTextInputView.h +6 -0
  137. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +85 -4
  138. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +10 -2
  139. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.m +4 -0
  140. package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +2 -0
  141. package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +52 -2
  142. package/Libraries/Text/TextNativeComponent.js +3 -5
  143. package/Libraries/Types/CoreEventTypes.js +0 -1
  144. package/Libraries/Utilities/Appearance.js +8 -5
  145. package/Libraries/Utilities/BackHandler.android.js +4 -4
  146. package/Libraries/Utilities/HMRClient.js +2 -2
  147. package/Libraries/Utilities/JSDevSupportModule.js +3 -4
  148. package/Libraries/Utilities/MatrixMath.js +19 -19
  149. package/Libraries/Utilities/PerformanceLoggerContext.js +2 -3
  150. package/Libraries/Utilities/ReactNativeTestTools.js +2 -4
  151. package/Libraries/Utilities/SceneTracker.js +1 -3
  152. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -3
  153. package/Libraries/Utilities/buildStyleInterpolator.js +9 -9
  154. package/Libraries/Utilities/codegenNativeComponent.js +4 -2
  155. package/Libraries/Utilities/differ/deepDiffer.js +1 -1
  156. package/Libraries/Utilities/differ/insetsDiffer.js +1 -1
  157. package/Libraries/Utilities/differ/matricesDiffer.js +1 -1
  158. package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
  159. package/Libraries/Utilities/differ/sizesDiffer.js +1 -1
  160. package/Libraries/Utilities/logError.js +1 -1
  161. package/Libraries/Utilities/mergeIntoFast.js +1 -1
  162. package/Libraries/Utilities/truncate.js +1 -1
  163. package/Libraries/Vibration/Vibration.js +2 -2
  164. package/Libraries/WebSocket/WebSocketInterceptor.js +4 -4
  165. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  166. package/Libraries/vendor/emitter/_EmitterSubscription.js +2 -1
  167. package/Libraries/vendor/emitter/_EventEmitter.js +2 -1
  168. package/Libraries/vendor/emitter/_EventSubscription.js +2 -1
  169. package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +1 -1
  170. package/React/Base/RCTConvert.m +3 -0
  171. package/React/Base/RCTRootView.m +0 -51
  172. package/React/Base/RCTTouchHandler.m +11 -1
  173. package/React/Base/RCTUIKit.h +2 -0
  174. package/React/Base/RCTUtils.m +27 -0
  175. package/React/Base/RCTVersion.m +1 -1
  176. package/React/Base/macOS/RCTPlatformDisplayLink.m +3 -1
  177. package/React/Base/macOS/RCTUIKit.m +20 -0
  178. package/React/CoreModules/RCTAppearance.mm +21 -5
  179. package/React/CoreModules/RCTDevLoadingView.mm +1 -1
  180. package/React/CoreModules/RCTPerfMonitor.mm +1 -1
  181. package/React/Fabric/RCTImageResponseObserverProxy.h +1 -0
  182. package/React/Modules/RCTUIManager.m +33 -13
  183. package/React/Views/RCTActivityIndicatorView.m +2 -1
  184. package/React/Views/RCTCursor.h +39 -0
  185. package/React/Views/RCTCursor.m +105 -0
  186. package/React/Views/RCTView.h +16 -0
  187. package/React/Views/RCTView.m +135 -187
  188. package/React/Views/RCTViewKeyboardEvent.h +6 -28
  189. package/React/Views/RCTViewKeyboardEvent.m +66 -61
  190. package/React/Views/RCTViewManager.m +17 -12
  191. package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
  192. package/React/Views/ScrollView/RCTScrollContentView.m +18 -0
  193. package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
  194. package/React/Views/ScrollView/RCTScrollView.h +2 -1
  195. package/React/Views/ScrollView/RCTScrollView.m +75 -53
  196. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
  197. package/React/Views/UIView+React.h +2 -0
  198. package/React/Views/UIView+React.m +35 -18
  199. package/ReactAndroid/gradle.properties +1 -1
  200. package/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js +1 -2
  201. package/ReactAndroid/src/androidTest/js/Asserts.js +2 -2
  202. package/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js +1 -1
  203. package/ReactAndroid/src/androidTest/js/JSResponderTestApp.js +1 -2
  204. package/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js +1 -2
  205. package/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js +54 -54
  206. package/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js +1 -1
  207. package/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js +6 -7
  208. package/ReactAndroid/src/androidTest/js/ShareTestModule.js +1 -1
  209. package/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js +12 -19
  210. package/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js +2 -3
  211. package/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js +2 -2
  212. package/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js +17 -17
  213. package/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js +10 -10
  214. package/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js +2 -2
  215. package/ReactAndroid/src/androidTest/js/TextInputTestModule.js +2 -3
  216. package/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js +3 -6
  217. package/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +3 -6
  218. package/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js +5 -5
  219. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  220. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  221. package/ReactCommon/hermes/inspector/tools/msggen/package.json +1 -1
  222. package/ReactCommon/hermes/inspector/tools/msggen/src/HeaderWriter.js +1 -1
  223. package/ReactCommon/hermes/inspector/tools/msggen/src/index.js +1 -1
  224. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +346 -1294
  225. package/jest/assetFileTransformer.js +2 -2
  226. package/jest/preprocessor.js +2 -2
  227. package/jest/setup.js +3 -3
  228. package/package.json +24 -29
  229. package/scripts/generate-artifacts.js +21 -17
  230. package/template/App.js +4 -8
  231. package/template/Gemfile.lock +6 -6
  232. package/template/android/gradlew.bat +89 -89
  233. package/template/ios/HelloWorldTests/HelloWorldTests.m +1 -0
  234. package/template/package.json +1 -1
  235. package/Libraries/Types/RootTagTypes.js~merged +0 -23
@@ -102,8 +102,8 @@ function reportException(
102
102
  isComponentError: !!e.isComponentError,
103
103
  });
104
104
  } else if (isFatal || e.type !== 'warn') {
105
- const NativeExceptionsManager = require('./NativeExceptionsManager')
106
- .default;
105
+ const NativeExceptionsManager =
106
+ require('./NativeExceptionsManager').default;
107
107
  if (NativeExceptionsManager) {
108
108
  NativeExceptionsManager.reportException(data);
109
109
  }
@@ -57,9 +57,8 @@ export interface Spec extends TurboModule {
57
57
 
58
58
  const Platform = require('../Utilities/Platform');
59
59
 
60
- const NativeModule = TurboModuleRegistry.getEnforcing<Spec>(
61
- 'ExceptionsManager',
62
- );
60
+ const NativeModule =
61
+ TurboModuleRegistry.getEnforcing<Spec>('ExceptionsManager');
63
62
 
64
63
  const ExceptionsManager = {
65
64
  reportFatalException(
@@ -17,5 +17,5 @@ exports.version = {
17
17
  major: 0,
18
18
  minor: 0,
19
19
  patch: 0,
20
- prerelease: '1498fe595',
20
+ prerelease: '15d2dbd2f',
21
21
  };
@@ -114,7 +114,7 @@ function _callTimer(timerID: number, frameTime: number, didTimeout: ?boolean) {
114
114
  callback(global.performance.now());
115
115
  } else if (type === 'requestIdleCallback') {
116
116
  callback({
117
- timeRemaining: function() {
117
+ timeRemaining: function () {
118
118
  // TODO: Optimisation: allow running for longer than one frame if
119
119
  // there are no pending JS calls on the bridge from native. This
120
120
  // would require a way to check the bridge queue synchronously.
@@ -205,7 +205,11 @@ const JSTimers = {
205
205
  * @param {function} func Callback to be invoked after `duration` ms.
206
206
  * @param {number} duration Number of milliseconds.
207
207
  */
208
- setTimeout: function(func: Function, duration: number, ...args: any): number {
208
+ setTimeout: function (
209
+ func: Function,
210
+ duration: number,
211
+ ...args: any
212
+ ): number {
209
213
  const id = _allocateCallback(
210
214
  () => func.apply(undefined, args),
211
215
  'setTimeout',
@@ -218,7 +222,7 @@ const JSTimers = {
218
222
  * @param {function} func Callback to be invoked every `duration` ms.
219
223
  * @param {number} duration Number of milliseconds.
220
224
  */
221
- setInterval: function(
225
+ setInterval: function (
222
226
  func: Function,
223
227
  duration: number,
224
228
  ...args: any
@@ -239,7 +243,7 @@ const JSTimers = {
239
243
  * @param {function} func Callback to be invoked before the end of the
240
244
  * current JavaScript execution loop.
241
245
  */
242
- queueReactNativeMicrotask: function(func: Function, ...args: any) {
246
+ queueReactNativeMicrotask: function (func: Function, ...args: any) {
243
247
  const id = _allocateCallback(
244
248
  () => func.apply(undefined, args),
245
249
  'queueReactNativeMicrotask',
@@ -251,7 +255,7 @@ const JSTimers = {
251
255
  /**
252
256
  * @param {function} func Callback to be invoked every frame.
253
257
  */
254
- requestAnimationFrame: function(func: Function) {
258
+ requestAnimationFrame: function (func: Function) {
255
259
  const id = _allocateCallback(func, 'requestAnimationFrame');
256
260
  createTimer(id, 1, Date.now(), /* recurring */ false);
257
261
  return id;
@@ -262,7 +266,7 @@ const JSTimers = {
262
266
  * with time remaining in frame.
263
267
  * @param {?object} options
264
268
  */
265
- requestIdleCallback: function(func: Function, options: ?Object) {
269
+ requestIdleCallback: function (func: Function, options: ?Object) {
266
270
  if (requestIdleCallbacks.length === 0) {
267
271
  setSendIdleEvents(true);
268
272
  }
@@ -300,7 +304,7 @@ const JSTimers = {
300
304
  return id;
301
305
  },
302
306
 
303
- cancelIdleCallback: function(timerID: number) {
307
+ cancelIdleCallback: function (timerID: number) {
304
308
  _freeCallback(timerID);
305
309
  const index = requestIdleCallbacks.indexOf(timerID);
306
310
  if (index !== -1) {
@@ -318,15 +322,15 @@ const JSTimers = {
318
322
  }
319
323
  },
320
324
 
321
- clearTimeout: function(timerID: number) {
325
+ clearTimeout: function (timerID: number) {
322
326
  _freeCallback(timerID);
323
327
  },
324
328
 
325
- clearInterval: function(timerID: number) {
329
+ clearInterval: function (timerID: number) {
326
330
  _freeCallback(timerID);
327
331
  },
328
332
 
329
- clearReactNativeMicrotask: function(timerID: number) {
333
+ clearReactNativeMicrotask: function (timerID: number) {
330
334
  _freeCallback(timerID);
331
335
  const index = reactNativeMicrotasks.indexOf(timerID);
332
336
  if (index !== -1) {
@@ -334,7 +338,7 @@ const JSTimers = {
334
338
  }
335
339
  },
336
340
 
337
- cancelAnimationFrame: function(timerID: number) {
341
+ cancelAnimationFrame: function (timerID: number) {
338
342
  _freeCallback(timerID);
339
343
  },
340
344
 
@@ -342,7 +346,7 @@ const JSTimers = {
342
346
  * This is called from the native side. We are passed an array of timerIDs,
343
347
  * and
344
348
  */
345
- callTimers: function(timersToCall: Array<number>) {
349
+ callTimers: function (timersToCall: Array<number>) {
346
350
  invariant(
347
351
  timersToCall.length !== 0,
348
352
  'Cannot call `callTimers` with an empty list of IDs.',
@@ -371,7 +375,7 @@ const JSTimers = {
371
375
  }
372
376
  },
373
377
 
374
- callIdleCallbacks: function(frameTime: number) {
378
+ callIdleCallbacks: function (frameTime: number) {
375
379
  if (
376
380
  FRAME_DURATION - (global.performance.now() - frameTime) <
377
381
  IDLE_CALLBACK_FRAME_DEADLINE
@@ -15,7 +15,7 @@
15
15
  * You can use this module directly, or just require InitializeCore.
16
16
  */
17
17
  if (!global.alert) {
18
- global.alert = function(text) {
18
+ global.alert = function (text) {
19
19
  // Require Alert on demand. Requiring it too early can lead to issues
20
20
  // with things like Platform not being fully initialized.
21
21
  require('../Alert/Alert').alert('Alert', '' + text);
@@ -58,7 +58,7 @@ if (__DEV__) {
58
58
  'debug',
59
59
  ].forEach(level => {
60
60
  const originalFunction = console[level];
61
- console[level] = function(...args) {
61
+ console[level] = function (...args) {
62
62
  HMRClient.log(level, args);
63
63
  originalFunction.apply(console, args);
64
64
  };
@@ -19,7 +19,7 @@ if (!global.performance) {
19
19
  * https://developer.mozilla.org/en-US/docs/Web/API/Performance/now
20
20
  */
21
21
  if (typeof global.performance.now !== 'function') {
22
- global.performance.now = function() {
22
+ global.performance.now = function () {
23
23
  const performanceNow = global.nativePerformanceNow || Date.now;
24
24
  return performanceNow();
25
25
  };
@@ -22,7 +22,7 @@ let hasNativeGenerator;
22
22
  try {
23
23
  // If this function was lowered by regenerator-transform, it will try to
24
24
  // access `global.regeneratorRuntime` which doesn't exist yet and will throw.
25
- hasNativeGenerator = hasNativeConstructor(function*() {},
25
+ hasNativeGenerator = hasNativeConstructor(function* () {},
26
26
  'GeneratorFunction');
27
27
  } catch {
28
28
  // In this case, we know generators are not provided natively.
@@ -27,8 +27,8 @@ function __fetchSegment(
27
27
  }>,
28
28
  callback: (?Error) => void,
29
29
  ) {
30
- const SegmentFetcher = require('./SegmentFetcher/NativeSegmentFetcher')
31
- .default;
30
+ const SegmentFetcher =
31
+ require('./SegmentFetcher/NativeSegmentFetcher').default;
32
32
  SegmentFetcher.fetchSegment(
33
33
  segmentId,
34
34
  options,
@@ -61,8 +61,8 @@ function __getSegment(
61
61
  }>,
62
62
  callback: (?Error, ?string) => void,
63
63
  ) {
64
- const SegmentFetcher = require('./SegmentFetcher/NativeSegmentFetcher')
65
- .default;
64
+ const SegmentFetcher =
65
+ require('./SegmentFetcher/NativeSegmentFetcher').default;
66
66
 
67
67
  if (!SegmentFetcher.getSegment) {
68
68
  throw new Error('SegmentFetcher.getSegment must be defined');
@@ -36,7 +36,8 @@ export type {EventSubscription};
36
36
  * can theoretically listen to `RCTDeviceEventEmitter` (although discouraged).
37
37
  */
38
38
  export default class NativeEventEmitter<TEventToArgsMap: {...}>
39
- implements IEventEmitter<TEventToArgsMap> {
39
+ implements IEventEmitter<TEventToArgsMap>
40
+ {
40
41
  _nativeModule: ?NativeModule;
41
42
 
42
43
  constructor(nativeModule: ?NativeModule) {
@@ -18,7 +18,8 @@ import RCTDeviceEventEmitter from '../RCTDeviceEventEmitter';
18
18
  * Mock `NativeEventEmitter` to ignore Native Modules.
19
19
  */
20
20
  export default class NativeEventEmitter<TEventToArgsMap: {...}>
21
- implements IEventEmitter<TEventToArgsMap> {
21
+ implements IEventEmitter<TEventToArgsMap>
22
+ {
22
23
  addListener<TEvent: $Keys<TEventToArgsMap>>(
23
24
  eventType: TEvent,
24
25
  listener: (...args: $ElementType<TEventToArgsMap, TEvent>) => mixed,
@@ -11,7 +11,7 @@
11
11
  import NativeJSCHeapCapture from './NativeJSCHeapCapture';
12
12
 
13
13
  const HeapCapture = {
14
- captureHeap: function(path: string) {
14
+ captureHeap: function (path: string) {
15
15
  let error = null;
16
16
  try {
17
17
  global.nativeCaptureHeap(path);
@@ -159,10 +159,8 @@ class AssetSourceResolver {
159
159
  };
160
160
  }
161
161
 
162
- static pickScale: (
163
- scales: Array<number>,
164
- deviceScale?: number,
165
- ) => number = pickScale;
162
+ static pickScale: (scales: Array<number>, deviceScale?: number) => number =
163
+ pickScale;
166
164
  }
167
165
 
168
166
  module.exports = AssetSourceResolver;
@@ -40,12 +40,12 @@ function getSize(
40
40
  failure?: (error: any) => void,
41
41
  ): any {
42
42
  return NativeImageLoaderAndroid.getSize(url)
43
- .then(function(sizes) {
43
+ .then(function (sizes) {
44
44
  success(sizes.width, sizes.height);
45
45
  })
46
46
  .catch(
47
47
  failure ||
48
- function() {
48
+ function () {
49
49
  console.warn('Failed to get size for image: ' + url);
50
50
  },
51
51
  );
@@ -64,12 +64,12 @@ function getSizeWithHeaders(
64
64
  failure?: (error: any) => void,
65
65
  ): any {
66
66
  return NativeImageLoaderAndroid.getSizeWithHeaders(url, headers)
67
- .then(function(sizes) {
67
+ .then(function (sizes) {
68
68
  success(sizes.width, sizes.height);
69
69
  })
70
70
  .catch(
71
71
  failure ||
72
- function() {
72
+ function () {
73
73
  console.warn('Failed to get size for image: ' + url);
74
74
  },
75
75
  );
@@ -33,7 +33,7 @@ function getSize(
33
33
  .then(([width, height]) => success(width, height))
34
34
  .catch(
35
35
  failure ||
36
- function() {
36
+ function () {
37
37
  console.warn('Failed to get size for image ' + uri);
38
38
  },
39
39
  );
@@ -46,12 +46,12 @@ function getSizeWithHeaders(
46
46
  failure?: (error: any) => void,
47
47
  ): any {
48
48
  return NativeImageLoaderIOS.getSizeWithHeaders(uri, headers)
49
- .then(function(sizes) {
49
+ .then(function (sizes) {
50
50
  success(sizes.width, sizes.height);
51
51
  })
52
52
  .catch(
53
53
  failure ||
54
- function() {
54
+ function () {
55
55
  console.warn('Failed to get size for image: ' + uri);
56
56
  },
57
57
  );
@@ -12,9 +12,8 @@ import * as React from 'react';
12
12
 
13
13
  type ContextType = ?string;
14
14
 
15
- const Context: React.Context<ContextType> = React.createContext<ContextType>(
16
- null,
17
- );
15
+ const Context: React.Context<ContextType> =
16
+ React.createContext<ContextType>(null);
18
17
 
19
18
  if (__DEV__) {
20
19
  Context.displayName = 'ImageAnalyticsTagContext';
@@ -72,8 +72,7 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {
72
72
  <View
73
73
  accessibilityIgnoresInvertColors={true}
74
74
  style={style}
75
- ref={this._captureRef}
76
- >
75
+ ref={this._captureRef}>
77
76
  <Image
78
77
  {...props}
79
78
  style={[
@@ -12,15 +12,15 @@ import NativeImagePickerIOS from './NativeImagePickerIOS';
12
12
  import invariant from 'invariant';
13
13
 
14
14
  const ImagePickerIOS = {
15
- canRecordVideos: function(callback: (result: boolean) => void): void {
15
+ canRecordVideos: function (callback: (result: boolean) => void): void {
16
16
  invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
17
17
  return NativeImagePickerIOS.canRecordVideos(callback);
18
18
  },
19
- canUseCamera: function(callback: (result: boolean) => void): void {
19
+ canUseCamera: function (callback: (result: boolean) => void): void {
20
20
  invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
21
21
  return NativeImagePickerIOS.canUseCamera(callback);
22
22
  },
23
- openCameraDialog: function(
23
+ openCameraDialog: function (
24
24
  config: $ReadOnly<{|
25
25
  unmirrorFrontFacingCamera?: boolean,
26
26
  videoMode?: boolean,
@@ -49,7 +49,7 @@ const ImagePickerIOS = {
49
49
  cancelCallback,
50
50
  );
51
51
  },
52
- openSelectDialog: function(
52
+ openSelectDialog: function (
53
53
  config: $ReadOnly<{|
54
54
  showImages?: boolean,
55
55
  showVideos?: boolean,
@@ -86,7 +86,7 @@ const ImagePickerIOS = {
86
86
  * It is safe to call this method for urlsthat aren't video URLs;
87
87
  * it will be a no-op.
88
88
  */
89
- removePendingVideo: function(url: string): void {
89
+ removePendingVideo: function (url: string): void {
90
90
  invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
91
91
  NativeImagePickerIOS.removePendingVideo(url);
92
92
  },
@@ -94,7 +94,7 @@ const ImagePickerIOS = {
94
94
  * WARNING: In most cases, removePendingVideo should be used instead because
95
95
  * clearAllPendingVideos could clear out pending videos made by other callers.
96
96
  */
97
- clearAllPendingVideos: function(): void {
97
+ clearAllPendingVideos: function (): void {
98
98
  invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
99
99
  NativeImagePickerIOS.clearAllPendingVideos();
100
100
  },
@@ -128,9 +128,7 @@ const ImageViewViewConfig =
128
128
  },
129
129
  };
130
130
 
131
- const ImageViewNativeComponent: HostComponent<Props> = NativeComponentRegistry.get<Props>(
132
- 'RCTImageView',
133
- () => ImageViewViewConfig,
134
- );
131
+ const ImageViewNativeComponent: HostComponent<Props> =
132
+ NativeComponentRegistry.get<Props>('RCTImageView', () => ImageViewViewConfig);
135
133
 
136
134
  export default ImageViewNativeComponent;
@@ -14,9 +14,7 @@ import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
14
14
  export interface Spec extends TurboModule {
15
15
  +abortRequest: (requestId: number) => void;
16
16
  +getConstants: () => {||};
17
- +getSize: (
18
- uri: string,
19
- ) => Promise<
17
+ +getSize: (uri: string) => Promise<
20
18
  $ReadOnly<{
21
19
  width: number,
22
20
  height: number,
@@ -38,10 +38,10 @@ static NSString *RCTCacheKeyForImage(NSString *imageTag, CGSize size, CGFloat sc
38
38
  {
39
39
  if (self = [super init]) {
40
40
  _decodedImageCache = [NSCache new];
41
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
42
41
  _decodedImageCache.totalCostLimit = 20 * 1024 * 1024; // 20 MB
43
42
  _cacheStaleTimes = [NSMutableDictionary new];
44
43
 
44
+ #if !TARGET_OS_OSX // TODO(macOS GH#774)
45
45
  [[NSNotificationCenter defaultCenter] addObserver:self
46
46
  selector:@selector(clearCache)
47
47
  name:UIApplicationDidReceiveMemoryWarningNotification
@@ -24,9 +24,8 @@ type NativeProps = $ReadOnly<{
24
24
  headers?: ?{[string]: string},
25
25
  }>;
26
26
 
27
- const TextInlineImage: HostComponent<NativeProps> = NativeComponentRegistry.get<NativeProps>(
28
- 'RCTTextInlineImage',
29
- () => ({
27
+ const TextInlineImage: HostComponent<NativeProps> =
28
+ NativeComponentRegistry.get<NativeProps>('RCTTextInlineImage', () => ({
30
29
  uiViewClassName: 'RCTTextInlineImage',
31
30
  bubblingEventTypes: {},
32
31
  directEventTypes: {},
@@ -38,7 +37,6 @@ const TextInlineImage: HostComponent<NativeProps> = NativeComponentRegistry.get<
38
37
  },
39
38
  headers: true,
40
39
  },
41
- }),
42
- );
40
+ }));
43
41
 
44
42
  module.exports = TextInlineImage;
@@ -51,8 +51,7 @@ class ElementProperties extends React.Component<Props> {
51
51
  openFileButton = (
52
52
  <TouchableHighlight
53
53
  style={styles.openButton}
54
- onPress={openFileInEditor.bind(null, fileName, lineNumber)}
55
- >
54
+ onPress={openFileInEditor.bind(null, fileName, lineNumber)}>
56
55
  <Text style={styles.openButtonTitle} numberOfLines={1}>
57
56
  {fileNameShort}:{lineNumber}
58
57
  </Text>
@@ -72,8 +71,7 @@ class ElementProperties extends React.Component<Props> {
72
71
  key={'item-' + i}
73
72
  style={[styles.breadItem, i === selection && styles.selected]}
74
73
  // $FlowFixMe[not-a-function] found when converting React.createClass to ES6
75
- onPress={() => this.props.setSelection(i)}
76
- >
74
+ onPress={() => this.props.setSelection(i)}>
77
75
  <Text style={styles.breadItemText}>{hierarchyItem.name}</Text>
78
76
  </TouchableHighlight>
79
77
  ),
@@ -57,8 +57,7 @@ class InspectorOverlay extends React.Component<Props> {
57
57
  onStartShouldSetResponder={this.shouldSetResponser}
58
58
  onResponderMove={this.findViewForTouchEvent}
59
59
  nativeID="inspectorOverlay" /* TODO: T68258846. */
60
- style={[styles.inspector, {height: Dimensions.get('window').height}]}
61
- >
60
+ style={[styles.inspector, {height: Dimensions.get('window').height}]}>
62
61
  {content}
63
62
  </View>
64
63
  );
@@ -124,8 +124,7 @@ class InspectorPanelButton extends React.Component<InspectorPanelButtonProps> {
124
124
  return (
125
125
  <TouchableHighlight
126
126
  onPress={() => this.props.onClick(!this.props.pressed)}
127
- style={[styles.button, this.props.pressed && styles.buttonPressed]}
128
- >
127
+ style={[styles.button, this.props.pressed && styles.buttonPressed]}>
129
128
  <Text style={styles.buttonText}>{this.props.title}</Text>
130
129
  </TouchableHighlight>
131
130
  );
@@ -339,8 +339,7 @@ class NetworkOverlay extends React.Component<Props, State> {
339
339
  <TouchableHighlight
340
340
  onPress={() => {
341
341
  this._pressRow(index);
342
- }}
343
- >
342
+ }}>
344
343
  <View>
345
344
  <View style={tableRowViewStyle}>
346
345
  <View style={urlCellViewStyle}>
@@ -381,16 +380,14 @@ class NetworkOverlay extends React.Component<Props, State> {
381
380
  <View>
382
381
  <TouchableHighlight
383
382
  style={styles.closeButton}
384
- onPress={this._closeButtonClicked}
385
- >
383
+ onPress={this._closeButtonClicked}>
386
384
  <View>
387
385
  <Text style={styles.closeButtonText}>v</Text>
388
386
  </View>
389
387
  </TouchableHighlight>
390
388
  <ScrollView
391
389
  style={styles.detailScrollView}
392
- ref={scrollRef => (this._detailScrollView = scrollRef)}
393
- >
390
+ ref={scrollRef => (this._detailScrollView = scrollRef)}>
394
391
  {details}
395
392
  </ScrollView>
396
393
  </View>
@@ -400,11 +397,8 @@ class NetworkOverlay extends React.Component<Props, State> {
400
397
  _indicateAdditionalRequests = (): void => {
401
398
  if (this._requestsListView) {
402
399
  const distanceFromEndThreshold = LISTVIEW_CELL_HEIGHT * 2;
403
- const {
404
- offset,
405
- visibleLength,
406
- contentLength,
407
- } = this._requestsListViewScrollMetrics;
400
+ const {offset, visibleLength, contentLength} =
401
+ this._requestsListViewScrollMetrics;
408
402
  const distanceFromEnd = contentLength - visibleLength - offset;
409
403
  const isCloseToEnd = distanceFromEnd <= distanceFromEndThreshold;
410
404
  if (isCloseToEnd) {
@@ -16,7 +16,7 @@ const MessageQueue = require('../BatchedBridge/MessageQueue');
16
16
  const infoLog = require('../Utilities/infoLog');
17
17
 
18
18
  const BridgeSpyStallHandler = {
19
- register: function() {
19
+ register: function () {
20
20
  let spyBuffer = [];
21
21
  MessageQueue.spy(data => {
22
22
  spyBuffer.push(data);
@@ -33,7 +33,7 @@ const FrameRateLogger = {
33
33
  * Enable `debug` to see local logs of what's going on. `reportStackTraces` will grab stack traces
34
34
  * during UI thread stalls and upload them if the native module supports it.
35
35
  */
36
- setGlobalOptions: function(options: {
36
+ setGlobalOptions: function (options: {
37
37
  debug?: boolean,
38
38
  reportStackTraces?: boolean,
39
39
  ...
@@ -58,7 +58,7 @@ const FrameRateLogger = {
58
58
  * Must call `setContext` before any events can be properly tracked, which is done automatically
59
59
  * in `AppRegistry`, but navigation is also a common place to hook in.
60
60
  */
61
- setContext: function(context: string) {
61
+ setContext: function (context: string) {
62
62
  NativeFrameRateLogger && NativeFrameRateLogger.setContext(context);
63
63
  },
64
64
 
@@ -86,9 +86,7 @@ const InteractionManager = {
86
86
  * Schedule a function to run after all interactions have completed. Returns a cancellable
87
87
  * "promise".
88
88
  */
89
- runAfterInteractions(
90
- task: ?Task,
91
- ): {
89
+ runAfterInteractions(task: ?Task): {
92
90
  then: <U>(
93
91
  onFulfill?: ?(void) => ?(Promise<U> | U),
94
92
  onReject?: ?(error: mixed) => ?(Promise<U> | U),
@@ -122,7 +120,7 @@ const InteractionManager = {
122
120
  );
123
121
  }
124
122
  },
125
- cancel: function() {
123
+ cancel: function () {
126
124
  _taskQueue.cancelTasks(tasks);
127
125
  },
128
126
  };
@@ -35,20 +35,20 @@ type Handler = {
35
35
  * queried with `getStats`.
36
36
  */
37
37
  const JSEventLoopWatchdog = {
38
- getStats: function(): Object {
38
+ getStats: function (): Object {
39
39
  return {stallCount, totalStallTime, longestStall, acceptableBusyTime};
40
40
  },
41
- reset: function() {
41
+ reset: function () {
42
42
  infoLog('JSEventLoopWatchdog: reset');
43
43
  totalStallTime = 0;
44
44
  stallCount = 0;
45
45
  longestStall = 0;
46
46
  lastInterval = global.performance.now();
47
47
  },
48
- addHandler: function(handler: Handler) {
48
+ addHandler: function (handler: Handler) {
49
49
  handlers.push(handler);
50
50
  },
51
- install: function({thresholdMS}: {thresholdMS: number, ...}) {
51
+ install: function ({thresholdMS}: {thresholdMS: number, ...}) {
52
52
  acceptableBusyTime = thresholdMS;
53
53
  if (installed) {
54
54
  return;
@@ -383,9 +383,7 @@ const PanResponder = {
383
383
  * accordingly. (numberActiveTouches) may not be totally accurate unless you
384
384
  * are the responder.
385
385
  */
386
- create(
387
- config: PanResponderConfig,
388
- ): $TEMPORARY$object<{|
386
+ create(config: PanResponderConfig): $TEMPORARY$object<{|
389
387
  getInteractionHandle: () => ?number,
390
388
  panHandlers: $TEMPORARY$object<{|
391
389
  onMoveShouldSetResponder: (event: PressEvent) => boolean,
@@ -462,7 +460,8 @@ const PanResponder = {
462
460
 
463
461
  onResponderGrant(event: PressEvent): boolean {
464
462
  if (!interactionState.handle) {
465
- interactionState.handle = InteractionManager.createInteractionHandle();
463
+ interactionState.handle =
464
+ InteractionManager.createInteractionHandle();
466
465
  }
467
466
  gestureState.x0 = currentCentroidX(event.touchHistory);
468
467
  gestureState.y0 = currentCentroidY(event.touchHistory);