@office-iss/react-native-win32 0.0.0-canary.298 → 0.0.0-canary.299

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 (220) hide show
  1. package/.flowconfig +5 -3
  2. package/CHANGELOG.json +28 -1
  3. package/CHANGELOG.md +16 -6
  4. package/IntegrationTests/IntegrationTestsApp.js +1 -0
  5. package/IntegrationTests/LoggingTestModule.js +16 -20
  6. package/IntegrationTests/TimersTest.js +1 -0
  7. package/IntegrationTests/WebSocketTest.js +1 -0
  8. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
  9. package/Libraries/Alert/Alert.js +2 -2
  10. package/Libraries/Alert/NativeAlertManager.js +1 -0
  11. package/Libraries/Alert/RCTAlertManager.android.js +19 -13
  12. package/Libraries/Alert/RCTAlertManager.ios.js +9 -11
  13. package/Libraries/Alert/RCTAlertManager.js +1 -3
  14. package/Libraries/Alert/RCTAlertManager.js.flow +4 -6
  15. package/Libraries/Animated/AnimatedEvent.js +4 -3
  16. package/Libraries/Animated/AnimatedExports.js.flow +5 -0
  17. package/Libraries/Animated/AnimatedImplementation.js +44 -44
  18. package/Libraries/Animated/AnimatedMock.js +2 -2
  19. package/Libraries/Animated/NativeAnimatedModule.js +1 -0
  20. package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
  21. package/Libraries/Animated/animations/Animation.js +6 -1
  22. package/Libraries/Animated/components/AnimatedScrollView.js +6 -5
  23. package/Libraries/Animated/components/AnimatedText.js +2 -5
  24. package/Libraries/Animated/components/AnimatedView.js +2 -1
  25. package/Libraries/Animated/createAnimatedComponent.js +2 -4
  26. package/Libraries/Animated/nodes/AnimatedProps.js +2 -7
  27. package/Libraries/AppState/NativeAppState.js +1 -0
  28. package/Libraries/Blob/NativeBlobModule.js +1 -0
  29. package/Libraries/Blob/NativeFileReaderModule.js +1 -0
  30. package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +1 -2
  31. package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfoWin32.js +1 -2
  32. package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +1 -2
  33. package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +1 -2
  34. package/Libraries/Components/Button.js +7 -4
  35. package/Libraries/Components/Button.win32.js +7 -4
  36. package/Libraries/Components/Clipboard/NativeClipboard.js +1 -2
  37. package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +1 -2
  38. package/Libraries/Components/Keyboard/NativeKeyboardObserver.js +1 -2
  39. package/Libraries/Components/Pressable/Pressable.js +8 -2
  40. package/Libraries/Components/Pressable/Pressable.win32.js +8 -8
  41. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +1 -2
  42. package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +1 -2
  43. package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +1 -0
  44. package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -2
  45. package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -0
  46. package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -2
  47. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +3 -2
  48. package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +1 -2
  49. package/Libraries/Components/ScrollView/ScrollView.d.ts +10 -1
  50. package/Libraries/Components/ScrollView/ScrollView.js +3 -1
  51. package/Libraries/Components/Sound/NativeSoundManager.js +1 -2
  52. package/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +1 -2
  53. package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +1 -2
  54. package/Libraries/Components/StatusBar/StatusBar.d.ts +4 -0
  55. package/Libraries/Components/StatusBar/StatusBar.js +5 -0
  56. package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +1 -2
  57. package/Libraries/Components/Switch/Switch.js +2 -1
  58. package/Libraries/Components/Switch/SwitchNativeComponent.js +1 -2
  59. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +8 -7
  60. package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +1 -2
  61. package/Libraries/Components/TextInput/TextInput.flow.js +1 -1
  62. package/Libraries/Components/TextInput/TextInput.js +2 -4
  63. package/Libraries/Components/TextInput/TextInput.win32.js +28 -3
  64. package/Libraries/Components/ToastAndroid/NativeToastAndroid.js +1 -2
  65. package/Libraries/Components/Touchable/Touchable.js +7 -3
  66. package/Libraries/Components/Touchable/Touchable.win32.js +7 -3
  67. package/Libraries/Components/Touchable/TouchableHighlight.js +5 -1
  68. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +3 -2
  69. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +3 -2
  70. package/Libraries/Components/Touchable/TouchableOpacity.d.ts +1 -0
  71. package/Libraries/Components/Touchable/TouchableOpacity.js +3 -2
  72. package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +1 -2
  73. package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -15
  74. package/Libraries/Components/View/View.js +17 -18
  75. package/Libraries/Components/View/View.win32.js +16 -2
  76. package/Libraries/Components/View/ViewAccessibility.js +0 -7
  77. package/Libraries/Components/View/ViewAccessibility.win32.js +0 -7
  78. package/Libraries/Components/View/ViewPropTypes.d.ts +4 -0
  79. package/Libraries/Components/View/ViewPropTypes.js +8 -0
  80. package/Libraries/Components/View/ViewPropTypes.win32.js +8 -0
  81. package/Libraries/Core/ExceptionsManager.js +28 -15
  82. package/Libraries/Core/NativeExceptionsManager.js +1 -0
  83. package/Libraries/Core/ReactNativeVersion.js +1 -1
  84. package/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +1 -0
  85. package/Libraries/Core/Timers/NativeTiming.js +1 -0
  86. package/Libraries/Core/checkNativeVersion.js +1 -0
  87. package/Libraries/Core/setUpReactDevTools.js +21 -4
  88. package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +1 -0
  89. package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
  90. package/Libraries/Image/Image.android.js +3 -3
  91. package/Libraries/Image/ImageSource.d.ts +5 -0
  92. package/Libraries/Image/ImageViewNativeComponent.js +3 -3
  93. package/Libraries/Image/NativeImageEditor.js +1 -0
  94. package/Libraries/Image/NativeImageLoaderAndroid.js +1 -0
  95. package/Libraries/Image/NativeImageLoaderIOS.js +1 -0
  96. package/Libraries/Image/NativeImageLoaderWin32.js +1 -0
  97. package/Libraries/Image/NativeImageStoreAndroid.js +1 -0
  98. package/Libraries/Image/NativeImageStoreIOS.js +1 -0
  99. package/Libraries/Image/RelativeImageStub.js +1 -1
  100. package/Libraries/Image/TextInlineImageNativeComponent.js +3 -3
  101. package/Libraries/Interaction/InteractionManager.js +6 -1
  102. package/Libraries/Interaction/NativeFrameRateLogger.js +1 -0
  103. package/Libraries/Interaction/TaskQueue.js +14 -0
  104. package/Libraries/LayoutAnimation/LayoutAnimation.js +12 -8
  105. package/Libraries/Linking/NativeIntentAndroid.js +1 -0
  106. package/Libraries/Linking/NativeLinkingManager.js +1 -0
  107. package/Libraries/Lists/FlatList.js +5 -6
  108. package/Libraries/Lists/SectionList.js +4 -4
  109. package/Libraries/Lists/VirtualizedList.js +3 -2
  110. package/Libraries/LogBox/Data/LogBoxData.js +7 -4
  111. package/Libraries/LogBox/LogBox.js +72 -101
  112. package/Libraries/Modal/Modal.d.ts +8 -2
  113. package/Libraries/Modal/Modal.js +19 -2
  114. package/Libraries/Modal/NativeModalManager.js +1 -0
  115. package/Libraries/Modal/RCTModalHostViewNativeComponent.js +1 -0
  116. package/Libraries/NativeComponent/BaseViewConfig.android.js +6 -15
  117. package/Libraries/NativeComponent/BaseViewConfig.ios.js +6 -15
  118. package/Libraries/NativeComponent/BaseViewConfig.win32.js +6 -15
  119. package/Libraries/NativeModules/specs/NativeDevMenu.js +1 -0
  120. package/Libraries/NativeModules/specs/NativeDevSettings.js +1 -0
  121. package/Libraries/NativeModules/specs/NativeDeviceEventManager.js +1 -0
  122. package/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +1 -0
  123. package/Libraries/NativeModules/specs/NativeLogBox.js +1 -0
  124. package/Libraries/NativeModules/specs/NativeRedBox.js +1 -0
  125. package/Libraries/NativeModules/specs/NativeSourceCode.js +1 -0
  126. package/Libraries/Network/NativeNetworkingAndroid.js +1 -0
  127. package/Libraries/Network/NativeNetworkingIOS.js +1 -0
  128. package/Libraries/Network/XMLHttpRequest.js +2 -0
  129. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
  130. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -2
  131. package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
  132. package/Libraries/ReactNative/AppRegistry.flow.js +2 -2
  133. package/Libraries/ReactNative/AppRegistryImpl.js +0 -10
  134. package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
  135. package/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js +1 -0
  136. package/Libraries/ReactNative/NativeI18nManager.js +1 -0
  137. package/Libraries/ReactNative/NativeUIManager.js +1 -0
  138. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +80 -61
  139. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
  140. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +2 -2
  141. package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -1
  142. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -1
  143. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -1
  144. package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -12
  145. package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +3 -12
  146. package/Libraries/Settings/NativeSettingsManager.js +1 -0
  147. package/Libraries/Share/NativeShareModule.js +1 -0
  148. package/Libraries/StyleSheet/StyleSheet.js +1 -0
  149. package/Libraries/StyleSheet/processAspectRatio.js +2 -0
  150. package/Libraries/Text/Text.js +4 -6
  151. package/Libraries/Text/TextAncestor.js +3 -10
  152. package/Libraries/Text/TextAncestorContext.js +23 -0
  153. package/Libraries/Text/TextProps.js +2 -2
  154. package/Libraries/Text/TextProps.win32.js +2 -2
  155. package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +1 -0
  156. package/Libraries/Types/CodegenTypesNamespace.js +1 -0
  157. package/Libraries/Utilities/HMRClient.js +12 -2
  158. package/Libraries/Utilities/NativeAppearance.js +1 -0
  159. package/Libraries/Utilities/NativeDevLoadingView.js +1 -0
  160. package/Libraries/Utilities/NativeDeviceInfo.js +1 -2
  161. package/Libraries/Utilities/NativePlatformConstantsAndroid.js +1 -0
  162. package/Libraries/Utilities/NativePlatformConstantsIOS.js +1 -0
  163. package/Libraries/Utilities/NativePlatformConstantsWin.js +1 -0
  164. package/Libraries/Utilities/Platform.android.js +1 -4
  165. package/Libraries/Utilities/Platform.ios.js +1 -4
  166. package/Libraries/Utilities/Platform.js.flow +2 -2
  167. package/Libraries/Utilities/Platform.win32.js +1 -4
  168. package/Libraries/Utilities/PlatformTypes.js +1 -1
  169. package/Libraries/Utilities/codegenNativeCommands.js +4 -2
  170. package/Libraries/Utilities/codegenNativeComponent.js +3 -3
  171. package/Libraries/Utilities/createPerformanceLogger.js +32 -0
  172. package/Libraries/Vibration/NativeVibration.js +1 -0
  173. package/Libraries/WebSocket/NativeWebSocketModule.js +1 -0
  174. package/Libraries/vendor/emitter/EventEmitter.js +6 -6
  175. package/index.js +21 -0
  176. package/index.win32.js +12 -1
  177. package/jest/setup.js +1 -0
  178. package/overrides.json +25 -25
  179. package/package.json +11 -11
  180. package/src/private/animated/createAnimatedPropsHook.js +4 -1
  181. package/src/private/animated/createAnimatedPropsMemoHook.js +2 -2
  182. package/src/private/components/virtualview/VirtualView.js +145 -0
  183. package/src/private/components/virtualview/VirtualViewNativeComponent.js +90 -0
  184. package/src/private/featureflags/ReactNativeFeatureFlags.js +43 -23
  185. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +9 -5
  186. package/src/private/setup/setUpPerformanceObserver.js +7 -0
  187. package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +7 -4
  188. package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +3 -3
  189. package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +3 -3
  190. package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +3 -3
  191. package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +10 -7
  192. package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +5 -4
  193. package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +7 -4
  194. package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +9 -6
  195. package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +9 -6
  196. package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +14 -5
  197. package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +8 -5
  198. package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +5 -5
  199. package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +3 -3
  200. package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +1 -0
  201. package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +9 -6
  202. package/src/private/styles/composeStyles.js +5 -12
  203. package/src/private/webapis/errors/DOMException.js +1 -1
  204. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +4 -2
  205. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +12 -7
  206. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +13 -0
  207. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +2 -1
  208. package/src/private/webapis/performance/Performance.js +164 -61
  209. package/src/private/webapis/performance/PerformanceEntry.js +20 -16
  210. package/src/private/webapis/performance/PerformanceObserver.js +31 -27
  211. package/src/private/webapis/performance/ResourceTiming.js +108 -0
  212. package/src/private/webapis/performance/UserTiming.js +60 -8
  213. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +47 -32
  214. package/src/private/webapis/performance/specs/NativePerformance.js +13 -1
  215. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +4 -0
  216. package/Libraries/BugReporting/BugReporting.js +0 -140
  217. package/Libraries/BugReporting/NativeBugReporting.js +0 -13
  218. package/Libraries/BugReporting/dumpReactTree.js +0 -151
  219. package/Libraries/BugReporting/getReactData.js +0 -187
  220. package/src/private/specs_DEPRECATED/modules/NativeBugReporting.js +0 -20
@@ -76,9 +76,6 @@ function reportException(
76
76
  message = namePrefix + message;
77
77
  }
78
78
 
79
- message =
80
- e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`;
81
-
82
79
  // $FlowFixMe[unclear-type]
83
80
  const extraData: Object = {
84
81
  // $FlowFixMe[incompatible-use] we can't define a type with a Symbol-keyed field in flow
@@ -108,15 +105,20 @@ function reportException(
108
105
  // we feed back into console.error, to make sure any methods that are
109
106
  // monkey patched on top of console.error are called when coming from
110
107
  // handleException
111
- console.error(data.message);
108
+ console.error(e);
112
109
  }
113
110
 
114
111
  if (__DEV__) {
115
- const LogBox = require('../LogBox/LogBox').default;
116
- LogBox.addException({
117
- ...data,
118
- isComponentError: !!e.isComponentError,
119
- });
112
+ // reportToConsole is only true when coming from handleException,
113
+ // and the error has not yet been logged. If it's false, then it was
114
+ // reported to LogBox in reactConsoleErrorHandler, and we don't need to.
115
+ if (reportToConsole) {
116
+ const LogBox = require('../LogBox/LogBox').default;
117
+ LogBox.addException({
118
+ ...data,
119
+ isComponentError: !!e.isComponentError,
120
+ });
121
+ }
120
122
  } else if (isFatal || e.type !== 'warn') {
121
123
  const NativeExceptionsManager =
122
124
  require('./NativeExceptionsManager').default;
@@ -223,12 +225,6 @@ function reactConsoleErrorHandler(...args) {
223
225
  error = firstArg;
224
226
  } else {
225
227
  const stringifySafe = require('../Utilities/stringifySafe').default;
226
- if (typeof firstArg === 'string' && firstArg.startsWith('Warning: ')) {
227
- // React warnings use console.error so that a stack trace is shown, but
228
- // we don't (currently) want these to show a redbox
229
- // (Note: Logic duplicated in polyfills/console.js.)
230
- return;
231
- }
232
228
  const message = args
233
229
  .map(arg => (typeof arg === 'string' ? arg : stringifySafe(arg)))
234
230
  .join(' ');
@@ -243,6 +239,23 @@ function reactConsoleErrorHandler(...args) {
243
239
  !global.RN$handleException ||
244
240
  !global.RN$handleException(error, isFatal, reportToConsole)
245
241
  ) {
242
+ if (__DEV__) {
243
+ // If we're not reporting to the console in reportException,
244
+ // we need to report it as a console.error here.
245
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
246
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
247
+ if (!reportToConsole) {
248
+ require('../LogBox/LogBox').default.addConsoleLog('error', ...args);
249
+ }
250
+ }
251
+ if (error.message.startsWith('Warning: ')) {
252
+ // React warnings use console.error so that a stack trace is shown, but
253
+ // we don't (currently) want these to report to native.
254
+ // Note: We can probably remove this, but would be a breaking change
255
+ // if the warning module is still used somewhere.
256
+ // Logic duplicated in polyfills/console.js
257
+ return;
258
+ }
246
259
  reportException(
247
260
  /* $FlowFixMe[class-object-subtyping] added when improving typing for this
248
261
  * parameters */
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeExceptionsManager';
12
12
  import NativeExceptionsManager from '../../src/private/specs_DEPRECATED/modules/NativeExceptionsManager';
13
+
13
14
  export default NativeExceptionsManager;
@@ -18,5 +18,5 @@ export const version: $ReadOnly<{
18
18
  major: 0,
19
19
  minor: 81,
20
20
  patch: 0,
21
- prerelease: 'nightly-20250604-1a6d466f1',
21
+ prerelease: 'nightly-20250709-6892dde36',
22
22
  };
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../../src/private/specs_DEPRECATED/modules/NativeSegmentFetcher';
12
12
  import NativeSegmentFetcher from '../../../src/private/specs_DEPRECATED/modules/NativeSegmentFetcher';
13
+
13
14
  export default NativeSegmentFetcher;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../../src/private/specs_DEPRECATED/modules/NativeTiming';
12
12
  import NativeTiming from '../../../src/private/specs_DEPRECATED/modules/NativeTiming';
13
+
13
14
  export default NativeTiming;
@@ -15,4 +15,5 @@
15
15
  * You can use this module directly, or just require InitializeCore.
16
16
  */
17
17
  const ReactNativeVersionCheck = require('./ReactNativeVersionCheck');
18
+
18
19
  ReactNativeVersionCheck.checkVersions();
@@ -143,10 +143,7 @@ if (__DEV__) {
143
143
  // Get hostname from development server (packager)
144
144
  const devServer = getDevServer();
145
145
  const host = devServer.bundleLoadedFromServer
146
- ? devServer.url
147
- .replace(/https?:\/\//, '')
148
- .replace(/\/$/, '')
149
- .split(':')[0]
146
+ ? guessHostFromDevServerUrl(devServer.url)
150
147
  : 'localhost';
151
148
 
152
149
  // Read the optional global variable for backward compatibility.
@@ -259,3 +256,23 @@ function readReloadAndProfileConfig(
259
256
  onReloadAndProfileFlagsReset,
260
257
  };
261
258
  }
259
+
260
+ /**
261
+ * This is a bad, no good, broken hack to get the host from a dev server URL for the purposes
262
+ * of connecting to the legacy React DevTools socket (for the standalone react-devtools package).
263
+ * It has too many bugs to list. Please don't use it in new code.
264
+ *
265
+ * The correct implementation would just be `return new URL(url).host`, but React Native does not
266
+ * ship with a spec-compliant `URL` class yet. Alternatively, this can be deleted when we delete
267
+ * `connectToWSBasedReactDevToolsFrontend`.
268
+ */
269
+ function guessHostFromDevServerUrl(url: string): string {
270
+ const hopefullyHostAndPort = url
271
+ .replace(/https?:\/\//, '')
272
+ .replace(/\/$/, '');
273
+ // IPv6 addresses contain colons, so the split(':') below will return garbage.
274
+ if (hopefullyHostAndPort.includes(']')) {
275
+ return hopefullyHostAndPort.split(']')[0] + ']';
276
+ }
277
+ return hopefullyHostAndPort.split(':')[0];
278
+ }
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent';
12
12
  import DebuggingOverlayNativeComponent from '../../src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent';
13
+
13
14
  export default DebuggingOverlayNativeComponent;
@@ -32,7 +32,7 @@ export type {EventSubscription, EmitterSubscription};
32
32
  export type NativeEventSubscription = EventSubscription;
33
33
 
34
34
  // $FlowFixMe[unclear-type] unclear type of events
35
- type UnsafeObject = Object;
35
+ type UnsafeNativeEventObject = Object;
36
36
 
37
37
  /**
38
38
  * `NativeEventEmitter` is intended for use by Native Modules to emit events to
@@ -46,8 +46,8 @@ type UnsafeObject = Object;
46
46
  */
47
47
  export default class NativeEventEmitter<
48
48
  TEventToArgsMap: $ReadOnly<
49
- Record<string, $ReadOnlyArray<UnsafeObject>>,
50
- > = $ReadOnly<Record<string, $ReadOnlyArray<UnsafeObject>>>,
49
+ Record<string, $ReadOnlyArray<UnsafeNativeEventObject>>,
50
+ > = $ReadOnly<Record<string, $ReadOnlyArray<UnsafeNativeEventObject>>>,
51
51
  > implements IEventEmitter<TEventToArgsMap>
52
52
  {
53
53
  _nativeModule: ?NativeModule;
@@ -16,7 +16,7 @@ import type {AbstractImageAndroid, ImageAndroid} from './ImageTypes.flow';
16
16
 
17
17
  import flattenStyle from '../StyleSheet/flattenStyle';
18
18
  import StyleSheet from '../StyleSheet/StyleSheet';
19
- import TextAncestor from '../Text/TextAncestor';
19
+ import TextAncestorContext from '../Text/TextAncestorContext';
20
20
  import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
21
21
  import {
22
22
  unstable_getImageComponentDecorator,
@@ -222,7 +222,7 @@ let BaseImage: AbstractImageAndroid = ({
222
222
  }
223
223
  : nativeProps;
224
224
  return (
225
- <TextAncestor.Consumer>
225
+ <TextAncestorContext.Consumer>
226
226
  {hasTextAncestor => {
227
227
  if (hasTextAncestor) {
228
228
  return (
@@ -245,7 +245,7 @@ let BaseImage: AbstractImageAndroid = ({
245
245
  />
246
246
  );
247
247
  }}
248
- </TextAncestor.Consumer>
248
+ </TextAncestorContext.Consumer>
249
249
  );
250
250
  }}
251
251
  </ImageAnalyticsTagContext.Consumer>
@@ -72,3 +72,8 @@ export interface ImageURISource {
72
72
  }
73
73
 
74
74
  export type ImageRequireSource = number;
75
+
76
+ export type ImageSource =
77
+ | ImageRequireSource
78
+ | ImageURISource
79
+ | ReadonlyArray<ImageURISource>;
@@ -26,7 +26,7 @@ import {ConditionallyIgnoredEventHandlers} from '../NativeComponent/ViewConfigIg
26
26
  import codegenNativeCommands from '../Utilities/codegenNativeCommands';
27
27
  import Platform from '../Utilities/Platform';
28
28
 
29
- type Props = $ReadOnly<{
29
+ type ImageHostComponentProps = $ReadOnly<{
30
30
  ...ImageProps,
31
31
  ...ViewProps,
32
32
 
@@ -162,8 +162,8 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
162
162
  },
163
163
  };
164
164
 
165
- const ImageViewNativeComponent: HostComponent<Props> =
166
- NativeComponentRegistry.get<Props>(
165
+ const ImageViewNativeComponent: HostComponent<ImageHostComponentProps> =
166
+ NativeComponentRegistry.get<ImageHostComponentProps>(
167
167
  'RCTImageView',
168
168
  () => __INTERNAL_VIEW_CONFIG,
169
169
  );
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeImageEditor';
12
12
  import NativeImageEditor from '../../src/private/specs_DEPRECATED/modules/NativeImageEditor';
13
+
13
14
  export default NativeImageEditor;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid';
12
12
  import NativeImageLoaderAndroid from '../../src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid';
13
+
13
14
  export default NativeImageLoaderAndroid;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS';
12
12
  import NativeImageLoaderIOS from '../../src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS';
13
+
13
14
  export default NativeImageLoaderIOS;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeImageLoaderWin32';
12
12
  import NativeImageLoaderWin32 from '../../src/private/specs_DEPRECATED/modules/NativeImageLoaderWin32';
13
+
13
14
  export default NativeImageLoaderWin32;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid';
12
12
  import NativeImageStoreAndroid from '../../src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid';
13
+
13
14
  export default NativeImageStoreAndroid;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeImageStoreIOS';
12
12
  import NativeImageStoreIOS from '../../src/private/specs_DEPRECATED/modules/NativeImageStoreIOS';
13
+
13
14
  export default NativeImageStoreIOS;
@@ -27,5 +27,5 @@ const RelativeImageStub = (AssetRegistry.registerAsset({
27
27
  type: 'png',
28
28
  }): number);
29
29
 
30
- // eslint-disable-next-line lint/no-commonjs-exports
30
+ // eslint-disable-next-line @react-native/monorepo/no-commonjs-exports
31
31
  module.exports = RelativeImageStub;
@@ -18,7 +18,7 @@ import type {ImageResizeMode} from './ImageResizeMode';
18
18
 
19
19
  import * as NativeComponentRegistry from '../NativeComponent/NativeComponentRegistry';
20
20
 
21
- type NativeProps = $ReadOnly<{
21
+ type RCTTextInlineImageNativeProps = $ReadOnly<{
22
22
  ...ViewProps,
23
23
  resizeMode?: ?ImageResizeMode,
24
24
  src?: ?$ReadOnlyArray<?$ReadOnly<{uri?: ?string, ...}>>,
@@ -40,8 +40,8 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
40
40
  },
41
41
  };
42
42
 
43
- const TextInlineImage: HostComponent<NativeProps> =
44
- NativeComponentRegistry.get<NativeProps>(
43
+ const TextInlineImage: HostComponent<RCTTextInlineImageNativeProps> =
44
+ NativeComponentRegistry.get<RCTTextInlineImageNativeProps>(
45
45
  'RCTTextInlineImage',
46
46
  () => __INTERNAL_VIEW_CONFIG,
47
47
  );
@@ -73,6 +73,8 @@ const InteractionManagerImpl = {
73
73
  * Notify manager that an interaction has started.
74
74
  */
75
75
  createInteractionHandle(): Handle {
76
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
77
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
76
78
  DEBUG && console.log('InteractionManager: create interaction handle');
77
79
  _scheduleUpdate();
78
80
  const handle = ++_inc;
@@ -84,6 +86,8 @@ const InteractionManagerImpl = {
84
86
  * Notify manager that an interaction has completed.
85
87
  */
86
88
  clearInteractionHandle(handle: Handle) {
89
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
90
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
87
91
  DEBUG && console.log('InteractionManager: clear interaction handle');
88
92
  invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
89
93
  _scheduleUpdate();
@@ -229,7 +233,8 @@ function _processUpdate() {
229
233
  */
230
234
  const InteractionManager = (
231
235
  ReactNativeFeatureFlags.disableInteractionManager()
232
- ? require('./InteractionManagerStub').default
236
+ ? // $FlowFixMe[incompatible-variance]
237
+ require('./InteractionManagerStub').default
233
238
  : InteractionManagerImpl
234
239
  ) as typeof InteractionManagerImpl;
235
240
 
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeFrameRateLogger';
12
12
  import NativeFrameRateLogger from '../../src/private/specs_DEPRECATED/modules/NativeFrameRateLogger';
13
+
13
14
  export default NativeFrameRateLogger;
@@ -99,9 +99,13 @@ class TaskQueue {
99
99
  const task = queue.shift();
100
100
  try {
101
101
  if (typeof task === 'object' && task.gen) {
102
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
103
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
102
104
  DEBUG && console.log('TaskQueue: genPromise for task ' + task.name);
103
105
  this._genPromise(task);
104
106
  } else if (typeof task === 'object' && task.run) {
107
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
108
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
105
109
  DEBUG && console.log('TaskQueue: run task ' + task.name);
106
110
  task.run();
107
111
  } else {
@@ -110,6 +114,8 @@ class TaskQueue {
110
114
  'Expected Function, SimpleTask, or PromiseTask, but got:\n' +
111
115
  JSON.stringify(task, null, 2),
112
116
  );
117
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
118
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
113
119
  DEBUG && console.log('TaskQueue: run anonymous task');
114
120
  task();
115
121
  }
@@ -139,6 +145,8 @@ class TaskQueue {
139
145
  this._queueStack.length > 1
140
146
  ) {
141
147
  this._queueStack.pop();
148
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
149
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
142
150
  DEBUG &&
143
151
  console.log('TaskQueue: popped queue: ', {
144
152
  stackIdx,
@@ -158,11 +166,17 @@ class TaskQueue {
158
166
  this._queueStack.push({tasks: [], popable: false});
159
167
  const stackIdx = this._queueStack.length - 1;
160
168
  const stackItem = this._queueStack[stackIdx];
169
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
170
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
161
171
  DEBUG && console.log('TaskQueue: push new queue: ', {stackIdx});
172
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
173
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
162
174
  DEBUG && console.log('TaskQueue: exec gen task ' + task.name);
163
175
  task
164
176
  .gen()
165
177
  .then(() => {
178
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
179
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
166
180
  DEBUG &&
167
181
  console.log('TaskQueue: onThen for gen task ' + task.name, {
168
182
  stackIdx,
@@ -11,7 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  import type {
14
- LayoutAnimationConfig as LayoutAnimationConfig_,
14
+ LayoutAnimationConfig,
15
15
  LayoutAnimationProperty,
16
16
  LayoutAnimationType,
17
17
  } from '../Renderer/shims/ReactNativeTypes';
@@ -29,7 +29,7 @@ export type {
29
29
  } from '../Renderer/shims/ReactNativeTypes';
30
30
 
31
31
  // Reexport type
32
- export type LayoutAnimationConfig = LayoutAnimationConfig_;
32
+ export type {LayoutAnimationConfig} from '../Renderer/shims/ReactNativeTypes';
33
33
 
34
34
  export type LayoutAnimationTypes = $ReadOnly<{
35
35
  [type in LayoutAnimationType]: type,
@@ -45,7 +45,7 @@ type OnAnimationDidFailCallback = () => void;
45
45
  let isLayoutAnimationEnabled: boolean =
46
46
  ReactNativeFeatureFlags.isLayoutAnimationEnabled();
47
47
 
48
- function setEnabled(value: boolean) {
48
+ function setLayoutAnimationEnabled(value: boolean) {
49
49
  isLayoutAnimationEnabled = isLayoutAnimationEnabled;
50
50
  }
51
51
 
@@ -115,7 +115,7 @@ function configureNext(
115
115
  }
116
116
  }
117
117
 
118
- function create(
118
+ function createLayoutAnimation(
119
119
  duration: number,
120
120
  type?: LayoutAnimationType,
121
121
  property?: LayoutAnimationProperty,
@@ -129,12 +129,16 @@ function create(
129
129
  }
130
130
 
131
131
  const Presets = {
132
- easeInEaseOut: (create(
132
+ easeInEaseOut: (createLayoutAnimation(
133
133
  300,
134
134
  'easeInEaseOut',
135
135
  'opacity',
136
136
  ): LayoutAnimationConfig),
137
- linear: (create(500, 'linear', 'opacity'): LayoutAnimationConfig),
137
+ linear: (createLayoutAnimation(
138
+ 500,
139
+ 'linear',
140
+ 'opacity',
141
+ ): LayoutAnimationConfig),
138
142
  spring: ({
139
143
  duration: 700,
140
144
  create: {
@@ -180,7 +184,7 @@ const LayoutAnimation = {
180
184
  /**
181
185
  * Helper for creating a config for `configureNext`.
182
186
  */
183
- create,
187
+ create: createLayoutAnimation,
184
188
  Types: Object.freeze({
185
189
  spring: 'spring',
186
190
  linear: 'linear',
@@ -208,7 +212,7 @@ const LayoutAnimation = {
208
212
  spring: (configureNext.bind(null, Presets.spring): (
209
213
  onAnimationDidEnd?: OnAnimationDidEndCallback,
210
214
  ) => void),
211
- setEnabled,
215
+ setEnabled: setLayoutAnimationEnabled,
212
216
  };
213
217
 
214
218
  export default LayoutAnimation;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeIntentAndroid';
12
12
  import NativeIntentAndroid from '../../src/private/specs_DEPRECATED/modules/NativeIntentAndroid';
13
+
13
14
  export default NativeIntentAndroid;
@@ -10,4 +10,5 @@
10
10
 
11
11
  export * from '../../src/private/specs_DEPRECATED/modules/NativeLinkingManager';
12
12
  import NativeLinkingManager from '../../src/private/specs_DEPRECATED/modules/NativeLinkingManager';
13
+
13
14
  export default NativeLinkingManager;
@@ -15,6 +15,7 @@ import type {
15
15
  ListRenderItemInfo,
16
16
  ViewabilityConfigCallbackPair,
17
17
  ViewToken,
18
+ VirtualizedListProps,
18
19
  } from '@react-native/virtualized-lists';
19
20
 
20
21
  import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
@@ -32,14 +33,14 @@ const invariant = require('invariant');
32
33
  const VirtualizedList = VirtualizedLists.VirtualizedList;
33
34
  const defaultKeyExtractor = VirtualizedLists.keyExtractor;
34
35
 
35
- type RequiredProps<ItemT> = {
36
+ type RequiredFlatListProps<ItemT> = {
36
37
  /**
37
38
  * An array (or array-like list) of items to render. Other data types can be
38
39
  * used by targeting VirtualizedList directly.
39
40
  */
40
41
  data: ?$ReadOnly<$ArrayLike<ItemT>>,
41
42
  };
42
- type OptionalProps<ItemT> = {
43
+ type OptionalFlatListProps<ItemT> = {
43
44
  /**
44
45
  * Takes an item from `data` and renders it into the list. Example usage:
45
46
  *
@@ -177,12 +178,10 @@ function isArrayLike(data: mixed): boolean {
177
178
  }
178
179
 
179
180
  type FlatListBaseProps<ItemT> = {
180
- ...RequiredProps<ItemT>,
181
- ...OptionalProps<ItemT>,
181
+ ...RequiredFlatListProps<ItemT>,
182
+ ...OptionalFlatListProps<ItemT>,
182
183
  };
183
184
 
184
- type VirtualizedListProps = React.ElementConfig<typeof VirtualizedList>;
185
-
186
185
  export type FlatListProps<ItemT> = {
187
186
  ...Omit<
188
187
  VirtualizedListProps,
@@ -39,7 +39,7 @@ export type {
39
39
  ScrollToLocationParamsType as SectionListScrollParams,
40
40
  };
41
41
 
42
- type RequiredProps<ItemT, SectionT = DefaultSectionT> = {
42
+ type RequiredSectionListProps<ItemT, SectionT = DefaultSectionT> = {
43
43
  /**
44
44
  * The actual data to render, akin to the `data` prop in [`<FlatList>`](https://reactnative.dev/docs/flatlist).
45
45
  *
@@ -64,7 +64,7 @@ export type SectionListRenderItem<ItemT, SectionT = DefaultSectionT> = (
64
64
  info: SectionListRenderItemInfo<ItemT, SectionT>,
65
65
  ) => React.Node | null;
66
66
 
67
- type OptionalProps<ItemT, SectionT = DefaultSectionT> = {
67
+ type OptionalSectionListProps<ItemT, SectionT = DefaultSectionT> = {
68
68
  /**
69
69
  * Default renderer for every item in every section. Can be over-ridden on a per-section basis.
70
70
  */
@@ -110,8 +110,8 @@ export type SectionListProps<ItemT, SectionT = DefaultSectionT> = {
110
110
  VirtualizedSectionListProps<ItemT, SectionT>,
111
111
  'getItem' | 'getItemCount' | 'renderItem' | 'keyExtractor',
112
112
  >,
113
- ...RequiredProps<ItemT, SectionT>,
114
- ...OptionalProps<ItemT, SectionT>,
113
+ ...RequiredSectionListProps<ItemT, SectionT>,
114
+ ...OptionalSectionListProps<ItemT, SectionT>,
115
115
  };
116
116
 
117
117
  /**
@@ -13,7 +13,8 @@
13
13
  import VirtualizedLists from '@react-native/virtualized-lists';
14
14
 
15
15
  type VirtualizedListType = typeof VirtualizedLists.VirtualizedList;
16
- const VirtualizedList: VirtualizedListType = VirtualizedLists.VirtualizedList;
16
+ const VirtualizedListComponent: VirtualizedListType =
17
+ VirtualizedLists.VirtualizedList;
17
18
 
18
19
  export type {
19
20
  ListRenderItemInfo,
@@ -21,4 +22,4 @@ export type {
21
22
  Separators,
22
23
  VirtualizedListProps,
23
24
  } from '@react-native/virtualized-lists';
24
- export default VirtualizedList;
25
+ export default VirtualizedListComponent;
@@ -413,8 +413,8 @@ export function observe(observer: Observer): Subscription {
413
413
  };
414
414
  }
415
415
 
416
- type Props = $ReadOnly<{}>;
417
- type State = $ReadOnly<{
416
+ type LogBoxStateSubscriptionProps = $ReadOnly<{}>;
417
+ type LogBoxStateSubscriptionState = $ReadOnly<{
418
418
  logs: LogBoxLogs,
419
419
  isDisabled: boolean,
420
420
  hasError: boolean,
@@ -432,7 +432,10 @@ type SubscribedComponent = React.ComponentType<
432
432
  export function withSubscription(
433
433
  WrappedComponent: SubscribedComponent,
434
434
  ): React.ComponentType<{}> {
435
- class LogBoxStateSubscription extends React.Component<Props, State> {
435
+ class LogBoxStateSubscription extends React.Component<
436
+ LogBoxStateSubscriptionProps,
437
+ LogBoxStateSubscriptionState,
438
+ > {
436
439
  static getDerivedStateFromError(): {hasError: boolean} {
437
440
  return {hasError: true};
438
441
  }
@@ -446,7 +449,7 @@ export function withSubscription(
446
449
 
447
450
  _subscription: ?Subscription;
448
451
 
449
- state: State = {
452
+ state: LogBoxStateSubscriptionState = {
450
453
  logs: new Set(),
451
454
  isDisabled: false,
452
455
  hasError: false,