@office-iss/react-native-win32 0.72.8 → 0.73.0-preview.2

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 (277) hide show
  1. package/.flowconfig +15 -5
  2. package/CHANGELOG.json +530 -101
  3. package/CHANGELOG.md +213 -56
  4. package/IntegrationTests/PromiseTest.js +1 -0
  5. package/IntegrationTests/websocket_integration_test_server.js +1 -1
  6. package/Libraries/Animated/Animated.js +1 -1
  7. package/Libraries/Animated/AnimatedImplementation.js +1 -1
  8. package/Libraries/Animated/NativeAnimatedHelper.js +14 -10
  9. package/Libraries/Animated/NativeAnimatedHelper.win32.js +16 -12
  10. package/Libraries/Animated/NativeAnimatedModule.js +6 -2
  11. package/Libraries/Animated/NativeAnimatedTurboModule.js +7 -4
  12. package/Libraries/Animated/animations/Animation.js +57 -3
  13. package/Libraries/Animated/animations/DecayAnimation.js +9 -0
  14. package/Libraries/Animated/animations/SpringAnimation.js +8 -0
  15. package/Libraries/Animated/animations/TimingAnimation.js +8 -0
  16. package/Libraries/Animated/components/AnimatedFlatList.js +2 -1
  17. package/Libraries/Animated/components/AnimatedScrollView.js +2 -0
  18. package/Libraries/Animated/components/AnimatedSectionList.js +2 -1
  19. package/Libraries/Animated/createAnimatedComponent.js +1 -0
  20. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  21. package/Libraries/Animated/nodes/AnimatedObject.js +146 -0
  22. package/Libraries/Animated/nodes/AnimatedProps.js +19 -7
  23. package/Libraries/Animated/nodes/AnimatedStyle.js +29 -55
  24. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -17
  25. package/Libraries/Animated/shouldUseTurboAnimatedModule.js +17 -0
  26. package/Libraries/Animated/useAnimatedProps.js +9 -10
  27. package/Libraries/AppState/AppState.d.ts +1 -1
  28. package/Libraries/AppState/NativeAppState.js +8 -4
  29. package/Libraries/BatchedBridge/MessageQueue.js +45 -36
  30. package/Libraries/Blob/Blob.js +6 -2
  31. package/Libraries/Blob/BlobManager.js +9 -10
  32. package/Libraries/Blob/BlobRegistry.js +14 -9
  33. package/Libraries/Blob/File.js +1 -1
  34. package/Libraries/Blob/FileReader.js +1 -2
  35. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +1 -5
  36. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +7 -48
  37. package/Libraries/Components/Button/ButtonWin32.Props.d.ts +1 -1
  38. package/Libraries/Components/Button/ButtonWin32.Props.js.map +1 -1
  39. package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
  40. package/Libraries/Components/Button/ButtonWin32.js +1 -4
  41. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  42. package/Libraries/Components/Clipboard/Clipboard.d.ts +4 -4
  43. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +3 -1
  44. package/Libraries/Components/EnterString.win32.d.ts +1 -1
  45. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +26 -6
  46. package/Libraries/Components/Pressable/Pressable.js +3 -2
  47. package/Libraries/Components/Pressable/Pressable.win32.js +4 -3
  48. package/Libraries/Components/Pressable/useAndroidRippleForView.js +1 -1
  49. package/Libraries/Components/SafeAreaView/SafeAreaView.js +7 -7
  50. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +7 -8
  51. package/Libraries/Components/ScrollView/ScrollView.js +3 -1
  52. package/Libraries/Components/ScrollView/ScrollView.win32.js +3 -1
  53. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +39 -46
  54. package/Libraries/Components/Switch/Switch.js +1 -0
  55. package/Libraries/Components/Text/TextWin32.d.ts +1 -1
  56. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  57. package/Libraries/Components/TextInput/TextInput.d.ts +49 -7
  58. package/Libraries/Components/TextInput/TextInput.flow.js +43 -10
  59. package/Libraries/Components/TextInput/TextInput.js +62 -10
  60. package/Libraries/Components/TextInput/TextInput.win32.js +953 -206
  61. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +23 -0
  62. package/Libraries/Components/ToastAndroid/{ToastAndroid.ios.js → ToastAndroid.js} +9 -1
  63. package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +9 -1
  64. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +2 -2
  65. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  66. package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
  67. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  68. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  69. package/Libraries/Components/Touchable/TouchableOpacity.js +4 -1
  70. package/Libraries/Components/Touchable/TouchableWin32.d.ts +1 -1
  71. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  72. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -0
  73. package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +16 -6
  74. package/Libraries/Components/View/ReactNativeStyleAttributes.js +9 -0
  75. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  76. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  77. package/Libraries/Components/View/View.js +46 -32
  78. package/Libraries/Components/View/View.win32.js +37 -6
  79. package/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
  80. package/Libraries/Components/View/ViewNativeComponent.js +1 -0
  81. package/Libraries/Components/View/ViewPropTypes.js +18 -3
  82. package/Libraries/Components/View/ViewPropTypes.win32.js +30 -4
  83. package/Libraries/Components/View/ViewWin32.js +3 -2
  84. package/Libraries/Core/Devtools/loadBundleFromServer.js +152 -0
  85. package/Libraries/Core/Devtools/symbolicateStackTrace.js +2 -1
  86. package/Libraries/Core/ExceptionsManager.js +16 -7
  87. package/Libraries/Core/ExtendedError.js +12 -0
  88. package/Libraries/Core/ReactNativeVersion.js +3 -3
  89. package/Libraries/Core/ReactNativeVersionCheck.js +0 -2
  90. package/Libraries/Core/ReactNativeVersionCheck.win32.js +0 -2
  91. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +20 -0
  92. package/Libraries/Core/setUpDeveloperTools.js +5 -1
  93. package/Libraries/Core/setUpIntersectionObserver.js +16 -0
  94. package/Libraries/{Components/ProgressBarAndroid/ProgressBarAndroid.ios.js → Core/setUpMutationObserver.js} +6 -2
  95. package/Libraries/Core/setUpPerformance.js +6 -13
  96. package/Libraries/Core/setUpPerformanceObserver.js +16 -0
  97. package/Libraries/Core/setUpRegeneratorRuntime.js +4 -2
  98. package/Libraries/DOM/Nodes/ReactNativeElement.js +135 -18
  99. package/Libraries/DOM/Nodes/ReadOnlyCharacterData.js +72 -0
  100. package/Libraries/DOM/Nodes/ReadOnlyElement.js +209 -21
  101. package/Libraries/DOM/Nodes/ReadOnlyNode.js +206 -17
  102. package/Libraries/DOM/Nodes/ReadOnlyText.js +30 -0
  103. package/Libraries/DOM/Nodes/Utilities/Traversal.js +54 -0
  104. package/Libraries/EventEmitter/NativeEventEmitter.d.ts +0 -6
  105. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +15 -4
  106. package/Libraries/Image/Image.android.js +8 -2
  107. package/Libraries/Image/Image.d.ts +1 -1
  108. package/Libraries/Image/Image.ios.js +4 -1
  109. package/Libraries/Image/Image.win32.js +6 -3
  110. package/Libraries/Image/ImageBackground.js +3 -0
  111. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  112. package/Libraries/Inspector/DevtoolsOverlay.js +6 -3
  113. package/Libraries/Inspector/NetworkOverlay.js +2 -2
  114. package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -5
  115. package/Libraries/Interaction/PanResponder.js +1 -4
  116. package/Libraries/IntersectionObserver/IntersectionObserver.js +252 -0
  117. package/Libraries/IntersectionObserver/IntersectionObserverEntry.js +140 -0
  118. package/Libraries/IntersectionObserver/IntersectionObserverManager.js +221 -0
  119. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +41 -0
  120. package/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +162 -0
  121. package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
  122. package/Libraries/Lists/FlatList.d.ts +2 -1
  123. package/Libraries/Lists/FlatList.js +15 -5
  124. package/Libraries/Lists/SectionList.js +4 -0
  125. package/Libraries/LogBox/Data/LogBoxData.js +2 -1
  126. package/Libraries/LogBox/Data/LogBoxLog.js +4 -1
  127. package/Libraries/LogBox/Data/LogBoxSymbolication.js +5 -2
  128. package/Libraries/LogBox/Data/parseLogBoxLog.js +57 -20
  129. package/Libraries/LogBox/UI/AnsiHighlight.js +1 -1
  130. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +24 -31
  131. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  132. package/Libraries/LogBox/UI/LogBoxMessage.js +4 -7
  133. package/Libraries/MutationObserver/MutationObserver.js +184 -0
  134. package/Libraries/MutationObserver/MutationObserverManager.js +218 -0
  135. package/Libraries/MutationObserver/MutationRecord.js +82 -0
  136. package/Libraries/MutationObserver/NativeMutationObserver.js +58 -0
  137. package/Libraries/MutationObserver/__mocks__/NativeMutationObserver.js +327 -0
  138. package/Libraries/NativeComponent/BaseViewConfig.android.js +18 -3
  139. package/Libraries/NativeComponent/BaseViewConfig.ios.js +33 -0
  140. package/Libraries/NativeComponent/BaseViewConfig.win32.js +33 -0
  141. package/Libraries/NativeComponent/NativeComponentRegistry.js +13 -9
  142. package/Libraries/NativeModules/specs/NativeSourceCode.js +6 -6
  143. package/Libraries/Network/RCTNetworking.android.js +2 -1
  144. package/Libraries/Network/XMLHttpRequest.js +1 -1
  145. package/Libraries/NewAppScreen/components/DebugInstructions.js +4 -4
  146. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +9 -2
  147. package/Libraries/Performance/QuickPerformanceLogger.js +1 -1
  148. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
  149. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +1 -0
  150. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -1
  151. package/Libraries/Pressability/Pressability.js +28 -3
  152. package/Libraries/Pressability/Pressability.win32.js +30 -5
  153. package/Libraries/ReactNative/AppContainer.js +2 -3
  154. package/Libraries/ReactNative/AppRegistry.d.ts +0 -5
  155. package/Libraries/ReactNative/AppRegistry.js +66 -53
  156. package/Libraries/ReactNative/BridgelessUIManager.js +38 -9
  157. package/Libraries/ReactNative/FabricUIManager.js +143 -34
  158. package/Libraries/ReactNative/I18nManager.js +5 -11
  159. package/Libraries/ReactNative/NativeI18nManager.js +7 -5
  160. package/Libraries/ReactNative/PaperUIManager.win32.js +2 -2
  161. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +151 -0
  162. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +81 -0
  163. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +492 -0
  164. package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +32 -0
  165. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +19 -3
  166. package/Libraries/ReactNative/UIManager.js +8 -0
  167. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +648 -0
  168. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +38 -2
  169. package/Libraries/Renderer/implementations/ReactFabric-dev.js +27 -27
  170. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
  171. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
  172. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27 -27
  173. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3 -3
  174. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3 -3
  175. package/Libraries/Renderer/shims/ReactFabric.js +5 -6
  176. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -3
  177. package/Libraries/Renderer/shims/ReactNative.js +2 -3
  178. package/Libraries/Renderer/shims/ReactNativeTypes.js +35 -17
  179. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -3
  180. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -3
  181. package/Libraries/Settings/{Settings.android.js → Settings.js} +4 -4
  182. package/Libraries/Share/Share.d.ts +3 -9
  183. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +9 -4
  184. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +28 -13
  185. package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +14 -4
  186. package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
  187. package/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
  188. package/Libraries/StyleSheet/StyleSheet.d.ts +10 -1
  189. package/Libraries/StyleSheet/StyleSheet.js +3 -0
  190. package/Libraries/StyleSheet/StyleSheet.win32.js +3 -0
  191. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +31 -17
  192. package/Libraries/StyleSheet/StyleSheetTypes.js +90 -6
  193. package/Libraries/StyleSheet/flattenStyle.js +4 -0
  194. package/Libraries/StyleSheet/private/_TransformStyle.js +16 -2
  195. package/Libraries/StyleSheet/processColor.js +1 -2
  196. package/Libraries/StyleSheet/processTransformOrigin.js +136 -0
  197. package/Libraries/StyleSheet/splitLayoutProps.js +1 -0
  198. package/Libraries/Text/Text.d.ts +5 -5
  199. package/Libraries/Text/Text.js +17 -10
  200. package/Libraries/Text/Text.win32.js +354 -0
  201. package/Libraries/Text/TextProps.win32.js +281 -0
  202. package/Libraries/TurboModule/TurboModuleRegistry.js +47 -7
  203. package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +6 -0
  204. package/Libraries/Types/CoreEventTypes.d.ts +5 -2
  205. package/Libraries/Utilities/GlobalPerformanceLogger.js +2 -12
  206. package/Libraries/Utilities/NativeDeviceInfo.js +8 -9
  207. package/Libraries/Utilities/NativePlatformConstantsAndroid.js +23 -18
  208. package/Libraries/Utilities/NativePlatformConstantsIOS.js +16 -13
  209. package/Libraries/Utilities/NativePlatformConstantsWin.js +13 -10
  210. package/Libraries/Utilities/PerformanceLoggerContext.js +1 -1
  211. package/Libraries/Utilities/Platform.android.js +12 -8
  212. package/Libraries/Utilities/Platform.d.ts +1 -0
  213. package/Libraries/Utilities/Platform.flow.js +84 -0
  214. package/Libraries/Utilities/Platform.flow.win32.js +111 -0
  215. package/Libraries/Utilities/Platform.ios.js +12 -8
  216. package/Libraries/Utilities/Platform.win32.js +12 -8
  217. package/Libraries/Utilities/PolyfillFunctions.js +1 -1
  218. package/Libraries/Utilities/ReactNativeTestTools.js +1 -2
  219. package/Libraries/Utilities/SceneTracker.js +1 -1
  220. package/Libraries/Utilities/createPerformanceLogger.js +63 -32
  221. package/Libraries/Utilities/useColorScheme.js +7 -8
  222. package/Libraries/WebPerformance/MemoryInfo.js +1 -1
  223. package/Libraries/WebPerformance/NativePerformance.js +3 -8
  224. package/Libraries/WebPerformance/NativePerformanceObserver.js +4 -0
  225. package/Libraries/WebPerformance/Performance.js +42 -15
  226. package/Libraries/WebPerformance/PerformanceEntry.js +14 -6
  227. package/Libraries/WebPerformance/PerformanceEventTiming.js +18 -1
  228. package/Libraries/WebPerformance/ReactNativeStartupTiming.js +40 -14
  229. package/Libraries/WebPerformance/__mocks__/NativePerformance.js +4 -2
  230. package/Libraries/WebPerformance/__mocks__/NativePerformanceObserver.js +21 -3
  231. package/Libraries/promiseRejectionTrackingOptions.js +21 -9
  232. package/Libraries/vendor/emitter/EventEmitter.js +17 -17
  233. package/flow/global.js +1 -3
  234. package/flow/jest.js +5 -1
  235. package/{Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js → jest/ReactNativeInternalFeatureFlagsMock.js} +2 -1
  236. package/jest/__tests__/setup-test.js +18 -0
  237. package/jest/mockModal.js +6 -4
  238. package/jest/setup.js +61 -30
  239. package/jest.config.js +1 -1
  240. package/just-task.js +1 -0
  241. package/overrides.json +54 -60
  242. package/package.json +35 -33
  243. package/src/Libraries/Components/Button/ButtonWin32.Props.ts +1 -1
  244. package/src/Libraries/Components/Button/ButtonWin32.tsx +0 -2
  245. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +2 -2
  246. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
  247. package/src/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
  248. package/src/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
  249. package/types/experimental.d.ts +44 -0
  250. package/types/index.d.ts +2 -1
  251. package/types/modules/Devtools.d.ts +1 -0
  252. package/types/modules/globals.d.ts +16 -1
  253. package/IntegrationTests/BUCK +0 -32
  254. package/IntegrationTests/PropertiesUpdateTest.js +0 -29
  255. package/IntegrationTests/RCTRootViewIntegrationTestApp.js +0 -86
  256. package/IntegrationTests/ReactContentSizeUpdateTest.js +0 -89
  257. package/IntegrationTests/SizeFlexibilityUpdateTest.js +0 -106
  258. package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfoWin32.js +0 -37
  259. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +0 -51
  260. package/Libraries/Components/TextInput/TextInput.Types.win32.js +0 -3
  261. package/Libraries/Components/TextInput/TextInput.Types.win32.js.map +0 -1
  262. package/Libraries/Utilities/AcessibilityMapping.js +0 -154
  263. package/Libraries/Utilities/AcessibilityMapping.win32.js +0 -156
  264. package/Libraries/Utilities/NativeDevSplitBundleLoader.js +0 -19
  265. package/Libraries/Utilities/useColorScheme.win32.js +0 -26
  266. package/flow/use-sync-external-store.js +0 -20
  267. package/flow-typed/npm/base64-js_v1.x.x.js +0 -12
  268. package/flow-typed/npm/glob_v7.x.x.js +0 -79
  269. package/flow-typed/npm/pretty-format_v26.x.x.js +0 -49
  270. package/flow-typed/npm/promise_v8.x.x.js +0 -30
  271. package/flow-typed/npm/react-dom_v17.x.x.js +0 -139
  272. package/flow-typed/npm/react-test-renderer_v16.x.x.js +0 -79
  273. package/flow-typed/npm/stacktrace-parser_v0.1.x.js +0 -17
  274. package/flow-typed/npm/yargs_v17.x.x.js +0 -341
  275. package/src/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +0 -161
  276. package/src/Libraries/Components/TextInput/TextInput.Types.win32.ts +0 -68
  277. /package/Libraries/{Renderer/public → ReactNative/ReactFabricPublicInstance}/ReactFabricPublicInstanceUtils.js +0 -0
@@ -10,9 +10,9 @@
10
10
 
11
11
  import type {ViewProps} from './ViewPropTypes';
12
12
 
13
+ import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags';
13
14
  import flattenStyle from '../../StyleSheet/flattenStyle';
14
15
  import TextAncestor from '../../Text/TextAncestor';
15
- import {getAccessibilityRoleFromRole} from '../../Utilities/AcessibilityMapping';
16
16
  import ViewNativeComponent from './ViewNativeComponent';
17
17
  import * as React from 'react';
18
18
 
@@ -35,7 +35,6 @@ const View: React.AbstractComponent<
35
35
  accessibilityLabel,
36
36
  accessibilityLabelledBy,
37
37
  accessibilityLiveRegion,
38
- accessibilityRole,
39
38
  accessibilityState,
40
39
  accessibilityValue,
41
40
  'aria-busy': ariaBusy,
@@ -56,12 +55,12 @@ const View: React.AbstractComponent<
56
55
  importantForAccessibility,
57
56
  nativeID,
58
57
  pointerEvents,
59
- role,
60
58
  tabIndex,
61
59
  ...otherProps
62
60
  }: ViewProps,
63
61
  forwardedRef,
64
62
  ) => {
63
+ const hasTextAncestor = React.useContext(TextAncestor);
65
64
  const _accessibilityLabelledBy =
66
65
  ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
67
66
 
@@ -101,38 +100,53 @@ const View: React.AbstractComponent<
101
100
  // $FlowFixMe[underconstrained-implicit-instantiation]
102
101
  let style = flattenStyle(otherProps.style);
103
102
 
103
+ // $FlowFixMe[sketchy-null-mixed]
104
104
  const newPointerEvents = style?.pointerEvents || pointerEvents;
105
-
106
- return (
107
- <TextAncestor.Provider value={false}>
108
- <ViewNativeComponent
109
- {...otherProps}
110
- accessibilityLiveRegion={
111
- ariaLive === 'off' ? 'none' : ariaLive ?? accessibilityLiveRegion
112
- }
113
- accessibilityLabel={ariaLabel ?? accessibilityLabel}
114
- focusable={tabIndex !== undefined ? !tabIndex : focusable}
115
- accessibilityState={_accessibilityState}
116
- accessibilityRole={
117
- role ? getAccessibilityRoleFromRole(role) : accessibilityRole
118
- }
119
- accessibilityElementsHidden={
120
- ariaHidden ?? accessibilityElementsHidden
121
- }
122
- accessibilityLabelledBy={_accessibilityLabelledBy}
123
- accessibilityValue={_accessibilityValue}
124
- importantForAccessibility={
125
- ariaHidden === true
126
- ? 'no-hide-descendants'
127
- : importantForAccessibility
105
+ const collapsableOverride =
106
+ ReactNativeFeatureFlags.shouldForceUnflattenForElevation()
107
+ ? {
108
+ collapsable:
109
+ style != null && style.elevation != null && style.elevation !== 0
110
+ ? false
111
+ : otherProps.collapsable,
128
112
  }
129
- nativeID={id ?? nativeID}
130
- style={style}
131
- pointerEvents={newPointerEvents}
132
- ref={forwardedRef}
133
- />
134
- </TextAncestor.Provider>
113
+ : {};
114
+
115
+ const actualView = (
116
+ <ViewNativeComponent
117
+ {...otherProps}
118
+ {...collapsableOverride}
119
+ accessibilityLiveRegion={
120
+ ariaLive === 'off' ? 'none' : ariaLive ?? accessibilityLiveRegion
121
+ }
122
+ accessibilityLabel={ariaLabel ?? accessibilityLabel}
123
+ focusable={tabIndex !== undefined ? !tabIndex : focusable}
124
+ accessibilityState={_accessibilityState}
125
+ accessibilityElementsHidden={ariaHidden ?? accessibilityElementsHidden}
126
+ accessibilityLabelledBy={_accessibilityLabelledBy}
127
+ accessibilityValue={_accessibilityValue}
128
+ importantForAccessibility={
129
+ ariaHidden === true
130
+ ? 'no-hide-descendants'
131
+ : importantForAccessibility
132
+ }
133
+ nativeID={id ?? nativeID}
134
+ style={style}
135
+ // $FlowFixMe[incompatible-type]
136
+ pointerEvents={newPointerEvents}
137
+ ref={forwardedRef}
138
+ />
135
139
  );
140
+
141
+ if (hasTextAncestor) {
142
+ return (
143
+ <TextAncestor.Provider value={false}>
144
+ {actualView}
145
+ </TextAncestor.Provider>
146
+ );
147
+ }
148
+
149
+ return actualView;
136
150
  },
137
151
  );
138
152
 
@@ -10,9 +10,9 @@
10
10
 
11
11
  import type {ViewProps} from './ViewPropTypes';
12
12
 
13
+ import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags';
13
14
  import flattenStyle from '../../StyleSheet/flattenStyle';
14
15
  import TextAncestor from '../../Text/TextAncestor';
15
- import {getAccessibilityRoleFromRole} from '../../Utilities/AcessibilityMapping';
16
16
  import ViewNativeComponent from './ViewNativeComponent';
17
17
  import * as React from 'react';
18
18
  import invariant from 'invariant'; // [Windows]
@@ -35,24 +35,35 @@ const View: React.AbstractComponent<
35
35
  > = React.forwardRef(
36
36
  (
37
37
  {
38
+ accessibilityControls, // Win32
39
+ accessibilityDescribedBy, // Win32
40
+ accessibilityDescription, // Win32
38
41
  accessibilityElementsHidden,
39
42
  accessibilityLabel,
40
43
  accessibilityLabelledBy,
44
+ accessibilityLevel, // Win32
41
45
  accessibilityLiveRegion,
42
- accessibilityRole,
46
+ accessibilityPositionInSet, // Win32
47
+ accessibilitySetSize, // Win32
43
48
  accessibilityState,
44
49
  accessibilityValue,
45
50
  'aria-busy': ariaBusy,
46
51
  'aria-checked': ariaChecked,
52
+ 'aria-controls': ariaControls,
53
+ 'aria-describedby': ariaDescribedBy, // Win32
54
+ 'aria-description': ariaDescription, // Win32
47
55
  'aria-disabled': ariaDisabled,
48
56
  'aria-expanded': ariaExpanded,
49
57
  'aria-hidden': ariaHidden,
50
58
  'aria-label': ariaLabel,
51
59
  'aria-labelledby': ariaLabelledBy,
60
+ 'aria-level': ariaLevel, // Win32
52
61
  'aria-live': ariaLive,
53
62
  'aria-multiselectable': ariaMultiselectable, // Win32
63
+ 'aria-posinset': ariaPosinset, // Win32
54
64
  'aria-required': ariaRequired, // Win32
55
65
  'aria-selected': ariaSelected,
66
+ 'aria-setsize': ariaSetsize, // Win32
56
67
  'aria-valuemax': ariaValueMax,
57
68
  'aria-valuemin': ariaValueMin,
58
69
  'aria-valuenow': ariaValueNow,
@@ -62,7 +73,6 @@ const View: React.AbstractComponent<
62
73
  importantForAccessibility,
63
74
  nativeID,
64
75
  pointerEvents,
65
- role,
66
76
  tabIndex,
67
77
  ...otherProps
68
78
  }: ViewProps,
@@ -112,7 +122,17 @@ const View: React.AbstractComponent<
112
122
  // $FlowFixMe[underconstrained-implicit-instantiation]
113
123
  let style = flattenStyle(otherProps.style);
114
124
 
125
+ // $FlowFixMe[sketchy-null-mixed]
115
126
  const newPointerEvents = style?.pointerEvents || pointerEvents;
127
+ const collapsableOverride =
128
+ ReactNativeFeatureFlags.shouldForceUnflattenForElevation()
129
+ ? {
130
+ collapsable:
131
+ style != null && style.elevation != null && style.elevation !== 0
132
+ ? false
133
+ : otherProps.collapsable,
134
+ }
135
+ : {};
116
136
 
117
137
  const _keyDown = (event: KeyEvent) => {
118
138
  if (otherProps.keyDownEvents && event.isPropagationStopped() !== true) {
@@ -200,17 +220,27 @@ const View: React.AbstractComponent<
200
220
  return (
201
221
  <ViewNativeComponent
202
222
  {...otherProps}
223
+ {...collapsableOverride}
224
+ accessibilityControls={ariaControls ?? accessibilityControls} // Win32
225
+ accessibilityDescribedBy={
226
+ ariaDescribedBy ?? accessibilityDescribedBy
227
+ } // Win32
228
+ accessibilityDescription={
229
+ ariaDescription ?? accessibilityDescription
230
+ } // Win32
203
231
  accessibilityLiveRegion={
204
232
  ariaLive === 'off'
205
233
  ? 'none'
206
234
  : ariaLive ?? accessibilityLiveRegion
207
235
  }
208
236
  accessibilityLabel={ariaLabel ?? accessibilityLabel}
237
+ accessibilityLevel={ariaLevel ?? accessibilityLevel} // Win32
209
238
  focusable={tabIndex !== undefined ? !tabIndex : focusable}
239
+ accessibilityPositionInSet={
240
+ ariaPosinset ?? accessibilityPositionInSet
241
+ } // Win32
242
+ accessibilitySetSize={ariaSetsize ?? accessibilitySetSize} // Win32
210
243
  accessibilityState={_accessibilityState}
211
- accessibilityRole={
212
- role ? getAccessibilityRoleFromRole(role) : accessibilityRole
213
- }
214
244
  accessibilityElementsHidden={
215
245
  ariaHidden ?? accessibilityElementsHidden
216
246
  }
@@ -223,6 +253,7 @@ const View: React.AbstractComponent<
223
253
  }
224
254
  nativeID={id ?? nativeID}
225
255
  style={style}
256
+ // $FlowFixMe[incompatible-type]
226
257
  pointerEvents={newPointerEvents}
227
258
  ref={forwardedRef}
228
259
  onKeyDown={_keyDown}
@@ -321,7 +321,7 @@ export interface AccessibilityPropsIOS {
321
321
  accessibilityViewIsModal?: boolean | undefined;
322
322
 
323
323
  /**
324
- * When accessibile is true, the system will invoke this function when the user performs the escape gesture (scrub with two fingers).
324
+ * When accessible is true, the system will invoke this function when the user performs the escape gesture (scrub with two fingers).
325
325
  * @platform ios
326
326
  */
327
327
  onAccessibilityEscape?: (() => void) | undefined;
@@ -395,19 +395,22 @@ export interface AccessibilityPropsWin32 {
395
395
  * @platform win32
396
396
  */
397
397
  accessibilityPositionInSet?: number;
398
+ 'aria-posinset'?: number;
398
399
  /**
399
400
  * accessibilitySetSize
400
401
  * @platform win32
401
402
  */
402
403
  accessibilitySetSize?: ?number;
404
+ 'aria-setsize'?: number;
403
405
 
404
406
  /**
405
407
  * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)
406
- * while accessibilityHint provides infomation on what will happen when they perform an action.
408
+ * while accessibilityHint provides information on what will happen when they perform an action.
407
409
  * @platform win32
408
410
  *
409
411
  */
410
412
  accessibilityDescription?: string;
413
+ 'aria-description'?: string;
411
414
 
412
415
  /**
413
416
  * Tells a person using a screen reader what kind of annotation they
@@ -432,6 +435,7 @@ export interface AccessibilityPropsWin32 {
432
435
  * @platform win32
433
436
  */
434
437
  accessibilityLevel?: number;
438
+ 'aria-level'?: number | undefined;
435
439
 
436
440
  /**
437
441
  * Identifies the ItemType property, which is a text string describing the type of the automation element.
@@ -450,6 +454,7 @@ export interface AccessibilityPropsWin32 {
450
454
  * @platform win32
451
455
  */
452
456
  accessibilityControls?: string | undefined;
457
+ 'aria-controls'?: string;
453
458
 
454
459
  /**
455
460
  * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.
@@ -458,6 +463,7 @@ export interface AccessibilityPropsWin32 {
458
463
  * @platform win32
459
464
  */
460
465
  accessibilityDescribedBy?: string | undefined;
466
+ 'aria-describedby'?: string;
461
467
  }
462
468
 
463
469
  export type Role =
@@ -98,6 +98,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
98
98
  focusable: true,
99
99
  overflow: true,
100
100
  backfaceVisibility: true,
101
+ experimental_layoutConformance: true,
101
102
  },
102
103
  }
103
104
  : {
@@ -87,6 +87,8 @@ type MouseEventProps = $ReadOnly<{|
87
87
 
88
88
  // Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
89
89
  type PointerEventProps = $ReadOnly<{|
90
+ onClick?: ?(event: PointerEvent) => void,
91
+ onClickCapture?: ?(event: PointerEvent) => void,
90
92
  onPointerEnter?: ?(event: PointerEvent) => void,
91
93
  onPointerEnterCapture?: ?(event: PointerEvent) => void,
92
94
  onPointerLeave?: ?(event: PointerEvent) => void,
@@ -103,6 +105,10 @@ type PointerEventProps = $ReadOnly<{|
103
105
  onPointerOverCapture?: ?(e: PointerEvent) => void,
104
106
  onPointerOut?: ?(e: PointerEvent) => void,
105
107
  onPointerOutCapture?: ?(e: PointerEvent) => void,
108
+ onGotPointerCapture?: ?(e: PointerEvent) => void,
109
+ onGotPointerCaptureCapture?: ?(e: PointerEvent) => void,
110
+ onLostPointerCapture?: ?(e: PointerEvent) => void,
111
+ onLostPointerCaptureCapture?: ?(e: PointerEvent) => void,
106
112
  |}>;
107
113
 
108
114
  type FocusEventProps = $ReadOnly<{|
@@ -158,8 +164,8 @@ type GestureResponderEventProps = $ReadOnly<{|
158
164
  * `View.props.onResponderGrant: (event) => {}`, where `event` is a synthetic
159
165
  * touch event as described above.
160
166
  *
161
- * PanResponder includes a note `// TODO: t7467124 investigate if this can be removed` that
162
- * should help fixing this return type.
167
+ * Return true from this callback to prevent any other native components from
168
+ * becoming responder until this responder terminates (Android-only).
163
169
  *
164
170
  * See https://reactnative.dev/docs/view#onrespondergrant
165
171
  */
@@ -563,7 +569,16 @@ export type ViewProps = $ReadOnly<{|
563
569
  collapsable?: ?boolean,
564
570
 
565
571
  /**
566
- * Used to locate this view from native classes.
572
+ * Contols whether this view, and its transitive children, are laid in a way
573
+ * consistent with web browsers ('strict'), or consistent with existing
574
+ * React Native code which may rely on incorrect behavior ('classic').
575
+ *
576
+ * This prop only works when using Fabric.
577
+ */
578
+ experimental_layoutConformance?: ?('strict' | 'classic'),
579
+
580
+ /**
581
+ * Used to locate this view from native classes. Has precedence over `nativeID` prop.
567
582
  *
568
583
  * > This disables the 'layout-only view removal' optimization for this view!
569
584
  *
@@ -88,6 +88,8 @@ type MouseEventProps = $ReadOnly<{|
88
88
 
89
89
  // Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
90
90
  type PointerEventProps = $ReadOnly<{|
91
+ onClick?: ?(event: PointerEvent) => void,
92
+ onClickCapture?: ?(event: PointerEvent) => void,
91
93
  onPointerEnter?: ?(event: PointerEvent) => void,
92
94
  onPointerEnterCapture?: ?(event: PointerEvent) => void,
93
95
  onPointerLeave?: ?(event: PointerEvent) => void,
@@ -104,6 +106,10 @@ type PointerEventProps = $ReadOnly<{|
104
106
  onPointerOverCapture?: ?(e: PointerEvent) => void,
105
107
  onPointerOut?: ?(e: PointerEvent) => void,
106
108
  onPointerOutCapture?: ?(e: PointerEvent) => void,
109
+ onGotPointerCapture?: ?(e: PointerEvent) => void,
110
+ onGotPointerCaptureCapture?: ?(e: PointerEvent) => void,
111
+ onLostPointerCapture?: ?(e: PointerEvent) => void,
112
+ onLostPointerCaptureCapture?: ?(e: PointerEvent) => void,
107
113
  |}>;
108
114
 
109
115
  type FocusEventProps = $ReadOnly<{|
@@ -159,8 +165,8 @@ type GestureResponderEventProps = $ReadOnly<{|
159
165
  * `View.props.onResponderGrant: (event) => {}`, where `event` is a synthetic
160
166
  * touch event as described above.
161
167
  *
162
- * PanResponder includes a note `// TODO: t7467124 investigate if this can be removed` that
163
- * should help fixing this return type.
168
+ * Return true from this callback to prevent any other native components from
169
+ * becoming responder until this responder terminates (Android-only).
164
170
  *
165
171
  * See https://reactnative.dev/docs/view#onrespondergrant
166
172
  */
@@ -465,10 +471,21 @@ type WindowsViewProps = $ReadOnly<{|
465
471
 
466
472
  tabIndex?: ?number,
467
473
 
468
- accessibilityPosInSet?: ?number,
469
474
  accessibilitySetSize?: ?number,
475
+ accessibilityControls?: ?Stringish,
476
+ accessibilityDescribedBy?: ?Stringish,
477
+ accessibilityDescription?: ?Stringish,
478
+ accessibilityLevel?: ?number,
479
+ accessibilityPositionInSet?: ?number,
480
+ 'aria-posinset'?: ?number,
481
+ 'aria-setsize'?: ?number,
482
+ 'aria-description'?: ?Stringish,
483
+ 'aria-level'?: ?number,
484
+ 'aria-controls'?: ?Stringish,
485
+ 'aria-describedby'?: ?Stringish,
470
486
  'aria-multiselectable'?: ?boolean,
471
487
  'aria-required'?: ?boolean,
488
+
472
489
  /**
473
490
  * Specifies if the control should show System focus visuals
474
491
  */
@@ -613,7 +630,16 @@ export type ViewProps = $ReadOnly<{|
613
630
  collapsable?: ?boolean,
614
631
 
615
632
  /**
616
- * Used to locate this view from native classes.
633
+ * Contols whether this view, and its transitive children, are laid in a way
634
+ * consistent with web browsers ('strict'), or consistent with existing
635
+ * React Native code which may rely on incorrect behavior ('classic').
636
+ *
637
+ * This prop only works when using Fabric.
638
+ */
639
+ experimental_layoutConformance?: ?('strict' | 'classic'),
640
+
641
+ /**
642
+ * Used to locate this view from native classes. Has precedence over `nativeID` prop.
617
643
  *
618
644
  * > This disables the 'layout-only view removal' optimization for this view!
619
645
  *
@@ -72,7 +72,7 @@ const ViewWin32: React.AbstractComponent<
72
72
  ) {
73
73
  warnOnce(
74
74
  'accessibilityDescribedByRef',
75
- 'accessibilityDescribedBy should be specfied as a string matching the nativeID of the target component. Support of specifying accessibilityDescribedBy using a ref is deprecated and will be removed in a future release',
75
+ 'accessibilityDescribedBy should be specified as a string matching the nativeID of the target component. Support of specifying accessibilityDescribedBy using a ref is deprecated and will be removed in a future release',
76
76
  );
77
77
  // $FlowFixMe[incompatible-use] - Using accessibilityDescribedBy as Ref for backcompat, not typed
78
78
  // $FlowFixMe[prop-missing]
@@ -90,7 +90,7 @@ const ViewWin32: React.AbstractComponent<
90
90
  ) {
91
91
  warnOnce(
92
92
  'accessibilityControlsRef',
93
- 'accessibilityControls should be specfied as a string matching the nativeID of the target component. Support of specifying accessibilityControls using a ref is deprecated and will be removed in a future release',
93
+ 'accessibilityControls should be specified as a string matching the nativeID of the target component. Support of specifying accessibilityControls using a ref is deprecated and will be removed in a future release',
94
94
  );
95
95
  // $FlowFixMe[incompatible-use] - Using accessibilityControls as Ref for backcompat, not typed
96
96
  // $FlowFixMe[prop-missing]
@@ -108,6 +108,7 @@ const ViewWin32: React.AbstractComponent<
108
108
  {...(labeledByTarget !== null
109
109
  ? {accessibilityLabeledBy: labeledByTarget}
110
110
  : {})}
111
+ // $FlowFixMe[exponential-spread]
111
112
  {...(describedByTarget !== null
112
113
  ? // $FlowFixMe[exponential-spread]
113
114
  {accessibilityDescribedBy: describedByTarget}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ * @oncall react_native
10
+ */
11
+
12
+ import Networking from '../../Network/RCTNetworking';
13
+ import HMRClient from '../../Utilities/HMRClient';
14
+ import LoadingView from '../../Utilities/LoadingView';
15
+ import getDevServer from './getDevServer';
16
+
17
+ declare var global: {globalEvalWithSourceUrl?: (string, string) => mixed, ...};
18
+
19
+ let pendingRequests = 0;
20
+
21
+ const cachedPromisesByUrl = new Map<string, Promise<void>>();
22
+
23
+ function asyncRequest(
24
+ url: string,
25
+ ): Promise<{body: string, headers: {[string]: string}}> {
26
+ let id = null;
27
+ let responseText = null;
28
+ let headers = null;
29
+ let dataListener;
30
+ let completeListener;
31
+ let responseListener;
32
+ let incrementalDataListener;
33
+ return new Promise<{body: string, headers: {[string]: string}}>(
34
+ (resolve, reject) => {
35
+ dataListener = Networking.addListener(
36
+ 'didReceiveNetworkData',
37
+ ([requestId, response]) => {
38
+ if (requestId === id) {
39
+ responseText = response;
40
+ }
41
+ },
42
+ );
43
+ incrementalDataListener = Networking.addListener(
44
+ 'didReceiveNetworkIncrementalData',
45
+ ([requestId, data]) => {
46
+ if (requestId === id) {
47
+ if (responseText != null) {
48
+ responseText += data;
49
+ } else {
50
+ responseText = data;
51
+ }
52
+ }
53
+ },
54
+ );
55
+ responseListener = Networking.addListener(
56
+ 'didReceiveNetworkResponse',
57
+ ([requestId, status, responseHeaders]) => {
58
+ if (requestId === id) {
59
+ headers = responseHeaders;
60
+ }
61
+ },
62
+ );
63
+ completeListener = Networking.addListener(
64
+ 'didCompleteNetworkResponse',
65
+ ([requestId, error]) => {
66
+ if (requestId === id) {
67
+ if (error) {
68
+ reject(error);
69
+ } else {
70
+ //$FlowFixMe[incompatible-call]
71
+ resolve({body: responseText, headers});
72
+ }
73
+ }
74
+ },
75
+ );
76
+ Networking.sendRequest(
77
+ 'GET',
78
+ 'asyncRequest',
79
+ url,
80
+ {},
81
+ '',
82
+ 'text',
83
+ true,
84
+ 0,
85
+ requestId => {
86
+ id = requestId;
87
+ },
88
+ true,
89
+ );
90
+ },
91
+ ).finally(() => {
92
+ dataListener?.remove();
93
+ completeListener?.remove();
94
+ responseListener?.remove();
95
+ incrementalDataListener?.remove();
96
+ });
97
+ }
98
+
99
+ function buildUrlForBundle(bundlePathAndQuery: string) {
100
+ const {url: serverUrl} = getDevServer();
101
+ return (
102
+ serverUrl.replace(/\/+$/, '') + '/' + bundlePathAndQuery.replace(/^\/+/, '')
103
+ );
104
+ }
105
+
106
+ module.exports = function (bundlePathAndQuery: string): Promise<void> {
107
+ const requestUrl = buildUrlForBundle(bundlePathAndQuery);
108
+ let loadPromise = cachedPromisesByUrl.get(requestUrl);
109
+
110
+ if (loadPromise) {
111
+ return loadPromise;
112
+ }
113
+ LoadingView.showMessage('Downloading...', 'load');
114
+ ++pendingRequests;
115
+
116
+ loadPromise = asyncRequest(requestUrl)
117
+ .then<void>(({body, headers}) => {
118
+ if (
119
+ headers['Content-Type'] != null &&
120
+ headers['Content-Type'].indexOf('application/json') >= 0
121
+ ) {
122
+ // Errors are returned as JSON.
123
+ throw new Error(
124
+ JSON.parse(body).message ||
125
+ `Unknown error fetching '${bundlePathAndQuery}'`,
126
+ );
127
+ }
128
+
129
+ HMRClient.registerBundle(requestUrl);
130
+
131
+ // Some engines do not support `sourceURL` as a comment. We expose a
132
+ // `globalEvalWithSourceUrl` function to handle updates in that case.
133
+ if (global.globalEvalWithSourceUrl) {
134
+ global.globalEvalWithSourceUrl(body, requestUrl);
135
+ } else {
136
+ // eslint-disable-next-line no-eval
137
+ eval(body);
138
+ }
139
+ })
140
+ .catch<void>(e => {
141
+ cachedPromisesByUrl.delete(requestUrl);
142
+ throw e;
143
+ })
144
+ .finally(() => {
145
+ if (!--pendingRequests) {
146
+ LoadingView.hide();
147
+ }
148
+ });
149
+
150
+ cachedPromisesByUrl.set(requestUrl, loadPromise);
151
+ return loadPromise;
152
+ };
@@ -31,6 +31,7 @@ export type SymbolicatedStackTrace = $ReadOnly<{
31
31
 
32
32
  async function symbolicateStackTrace(
33
33
  stack: Array<StackFrame>,
34
+ extraData?: mixed,
34
35
  ): Promise<SymbolicatedStackTrace> {
35
36
  const devServer = getDevServer();
36
37
  if (!devServer.bundleLoadedFromServer) {
@@ -41,7 +42,7 @@ async function symbolicateStackTrace(
41
42
  const fetch = global.fetch ?? require('../../Network/fetch');
42
43
  const response = await fetch(devServer.url + 'symbolicate', {
43
44
  method: 'POST',
44
- body: JSON.stringify({stack}),
45
+ body: JSON.stringify({stack, extraData}),
45
46
  });
46
47
  return await response.json();
47
48
  }
@@ -78,6 +78,19 @@ function reportException(
78
78
  message =
79
79
  e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`;
80
80
 
81
+ // $FlowFixMe[unclear-type]
82
+ const extraData: Object = {
83
+ // $FlowFixMe[incompatible-use] we can't define a type with a Symbol-keyed field in flow
84
+ ...e[decoratedExtraDataKey],
85
+ jsEngine: e.jsEngine,
86
+ rawStack: e.stack,
87
+ };
88
+ if (e.cause != null && typeof e.cause === 'object') {
89
+ extraData.stackSymbols = e.cause.stackSymbols;
90
+ extraData.stackReturnAddresses = e.cause.stackReturnAddresses;
91
+ extraData.stackElements = e.cause.stackElements;
92
+ }
93
+
81
94
  const data = preprocessException({
82
95
  message,
83
96
  originalMessage: message === originalMessage ? null : originalMessage,
@@ -87,12 +100,7 @@ function reportException(
87
100
  stack,
88
101
  id: currentExceptionID,
89
102
  isFatal,
90
- extraData: {
91
- // $FlowFixMe[incompatible-use] we can't define a type with a Symbol-keyed field in flow
92
- ...e[decoratedExtraDataKey],
93
- jsEngine: e.jsEngine,
94
- rawStack: e.stack,
95
- },
103
+ extraData,
96
104
  });
97
105
 
98
106
  if (reportToConsole) {
@@ -117,7 +125,8 @@ function reportException(
117
125
  }
118
126
  }
119
127
 
120
- declare var console: typeof console & {
128
+ declare var console: {
129
+ error: typeof console.error,
121
130
  _errorOriginal: typeof console.error,
122
131
  reportErrorsAsExceptions: boolean,
123
132
  ...
@@ -18,4 +18,16 @@ export type ExtendedError = Error &
18
18
  // Note: A field keyed by the Symbol ExceptionsManager.decoratedExtraDataKey is also read from ExtendedErrors.
19
19
  // This field isn't documented in the types as Flow does not support this usecase, but it's effectively:
20
20
  // [decoratedExtraDataKey]?: {[string]: mixed},
21
+
22
+ // Included for native errors
23
+ cause?: {
24
+ name: string,
25
+ message: string,
26
+ // $FlowFixMe[unclear-type]
27
+ stackElements?: $ReadOnlyArray<Object>,
28
+ // $FlowFixMe[unclear-type]
29
+ stackSymbols?: $ReadOnlyArray<Object>,
30
+ // $FlowFixMe[unclear-type]
31
+ stackReturnAddresses?: $ReadOnlyArray<Object>,
32
+ },
21
33
  };
@@ -11,7 +11,7 @@
11
11
 
12
12
  exports.version = {
13
13
  major: 0,
14
- minor: 72,
15
- patch: 6,
16
- prerelease: null,
14
+ minor: 73,
15
+ patch: 0,
16
+ prerelease: 'rc.3',
17
17
  };