react-native 0.80.0-rc.0 → 0.80.0-rc.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 (149) hide show
  1. package/Libraries/Animated/AnimatedExports.js.flow +1 -1
  2. package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
  3. package/Libraries/AppState/AppState.js +6 -1
  4. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
  5. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +13 -1
  6. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
  9. package/Libraries/Image/AssetSourceResolver.js +17 -4
  10. package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
  11. package/Libraries/StyleSheet/StyleSheetTypes.js +4 -2
  12. package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
  13. package/Libraries/Text/TextProps.js +2 -31
  14. package/Libraries/vendor/core/ErrorUtils.js +28 -4
  15. package/React/Base/RCTVersion.m +1 -1
  16. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +18 -4
  17. package/ReactAndroid/api/ReactAndroid.api +7 -7
  18. package/ReactAndroid/gradle.properties +1 -1
  19. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +20 -0
  20. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +6 -6
  21. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  22. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +2 -2
  23. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStylesDiffMap.kt +6 -1
  24. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +6 -1
  25. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +1 -1
  26. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +2 -2
  27. package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +30 -0
  28. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +31 -17
  29. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  30. package/ReactCommon/jsc/React-jsc.podspec +1 -1
  31. package/jest/resolver.js +31 -0
  32. package/jest-preset.js +1 -0
  33. package/package.json +9 -8
  34. package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +11 -3
  35. package/scripts/codegen/generate-artifacts-executor/index.js +21 -2
  36. package/scripts/codegen/generate-artifacts-executor/utils.js +30 -14
  37. package/sdks/hermesc/osx-bin/hermes +0 -0
  38. package/sdks/hermesc/osx-bin/hermesc +0 -0
  39. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  40. package/src/private/styles/composeStyles.js +12 -5
  41. package/src/types/globals.d.ts +42 -0
  42. package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +9 -9
  43. package/types_generated/Libraries/Animated/AnimatedExports.d.ts +2 -2
  44. package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +4 -4
  45. package/types_generated/Libraries/Animated/Easing.d.ts +49 -49
  46. package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +4 -4
  47. package/types_generated/Libraries/Animated/components/AnimatedImage.d.ts +4 -4
  48. package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +5 -5
  49. package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +4 -4
  50. package/types_generated/Libraries/Animated/components/AnimatedText.d.ts +4 -4
  51. package/types_generated/Libraries/Animated/components/AnimatedView.d.ts +4 -4
  52. package/types_generated/Libraries/Animated/nodes/AnimatedProps.d.ts +2 -2
  53. package/types_generated/Libraries/AppState/AppState.d.ts +5 -5
  54. package/types_generated/Libraries/BatchedBridge/BatchedBridge.d.ts +4 -4
  55. package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +4 -4
  56. package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +13 -13
  57. package/types_generated/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.d.ts +4 -4
  58. package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +9 -10
  59. package/types_generated/Libraries/Components/Button.d.ts +4 -4
  60. package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +4 -4
  61. package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +4 -4
  62. package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +4 -4
  63. package/types_generated/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +4 -4
  64. package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +4 -4
  65. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +12 -5
  66. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.d.ts +4 -4
  67. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +6 -30
  68. package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -9
  69. package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +4 -4
  70. package/types_generated/Libraries/Components/ScrollView/ScrollViewContext.d.ts +4 -4
  71. package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponent.d.ts +4 -4
  72. package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +4 -4
  73. package/types_generated/Libraries/Components/Switch/AndroidSwitchNativeComponent.d.ts +4 -4
  74. package/types_generated/Libraries/Components/Switch/Switch.d.ts +9 -9
  75. package/types_generated/Libraries/Components/Switch/SwitchNativeComponent.d.ts +4 -4
  76. package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +4 -4
  77. package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +4 -4
  78. package/types_generated/Libraries/Components/TextInput/TextInputState.d.ts +4 -4
  79. package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +4 -4
  80. package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +4 -4
  81. package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +4 -4
  82. package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +4 -4
  83. package/types_generated/Libraries/Components/View/View.d.ts +9 -9
  84. package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +4 -4
  85. package/types_generated/Libraries/Core/ExceptionsManager.d.ts +4 -4
  86. package/types_generated/Libraries/Core/NativeExceptionsManager.d.ts +4 -4
  87. package/types_generated/Libraries/Core/RawEventEmitter.d.ts +4 -4
  88. package/types_generated/Libraries/Core/ReactFiberErrorDialog.d.ts +4 -4
  89. package/types_generated/Libraries/Core/registerCallableModule.d.ts +4 -4
  90. package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +2 -2
  91. package/types_generated/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +4 -4
  92. package/types_generated/Libraries/EventEmitter/RCTEventEmitter.d.ts +4 -4
  93. package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +5 -5
  94. package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +13 -2
  95. package/types_generated/Libraries/Image/Image.d.ts +4 -4
  96. package/types_generated/Libraries/Image/ImageViewNativeComponent.d.ts +4 -4
  97. package/types_generated/Libraries/Image/TextInlineImageNativeComponent.d.ts +4 -4
  98. package/types_generated/Libraries/Interaction/InteractionManager.d.ts +4 -4
  99. package/types_generated/Libraries/Interaction/PanResponder.d.ts +4 -4
  100. package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +14 -14
  101. package/types_generated/Libraries/Linking/Linking.d.ts +4 -4
  102. package/types_generated/Libraries/Lists/VirtualizedList.d.ts +4 -4
  103. package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +4 -4
  104. package/types_generated/Libraries/LogBox/LogBox.d.ts +4 -4
  105. package/types_generated/Libraries/Modal/Modal.d.ts +4 -4
  106. package/types_generated/Libraries/NativeModules/specs/NativeDialogManagerAndroid.d.ts +4 -4
  107. package/types_generated/Libraries/Network/RCTNetworking.d.ts +4 -4
  108. package/types_generated/Libraries/Network/convertRequestBody.d.ts +4 -4
  109. package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -4
  110. package/types_generated/Libraries/ReactNative/DisplayMode.d.ts +6 -6
  111. package/types_generated/Libraries/ReactNative/I18nManager.d.ts +4 -4
  112. package/types_generated/Libraries/ReactNative/NativeI18nManager.d.ts +4 -4
  113. package/types_generated/Libraries/ReactNative/NativeUIManager.d.ts +4 -4
  114. package/types_generated/Libraries/ReactNative/UIManager.d.ts +4 -4
  115. package/types_generated/Libraries/ReactNative/requireNativeComponent.d.ts +5 -6
  116. package/types_generated/Libraries/Settings/Settings.d.ts +4 -4
  117. package/types_generated/Libraries/StyleSheet/StyleSheetExports.d.ts +2 -2
  118. package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +8 -5
  119. package/types_generated/Libraries/StyleSheet/flattenStyle.d.ts +4 -4
  120. package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +7 -3
  121. package/types_generated/Libraries/StyleSheet/processColor.d.ts +4 -4
  122. package/types_generated/Libraries/Text/Text.d.ts +9 -9
  123. package/types_generated/Libraries/Text/TextProps.d.ts +3 -31
  124. package/types_generated/Libraries/UTFSequence.d.ts +11 -11
  125. package/types_generated/Libraries/Utilities/BackHandler.d.ts +4 -4
  126. package/types_generated/Libraries/Utilities/DevSettings.d.ts +7 -7
  127. package/types_generated/Libraries/Utilities/DeviceInfo.d.ts +4 -4
  128. package/types_generated/Libraries/Utilities/NativeAppearance.d.ts +4 -4
  129. package/types_generated/Libraries/Utilities/NativeDeviceInfo.d.ts +4 -4
  130. package/types_generated/Libraries/Utilities/Platform.d.ts +4 -4
  131. package/types_generated/Libraries/Utilities/codegenNativeCommands.d.ts +4 -4
  132. package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +4 -4
  133. package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +4 -4
  134. package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +4 -4
  135. package/types_generated/Libraries/Vibration/Vibration.d.ts +4 -4
  136. package/types_generated/Libraries/vendor/core/ErrorUtils.d.ts +16 -6
  137. package/types_generated/index.d.ts +2 -2
  138. package/types_generated/src/private/devsupport/devmenu/DevMenu.d.ts +4 -4
  139. package/types_generated/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.d.ts +4 -4
  140. package/types_generated/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.d.ts +4 -4
  141. package/types_generated/src/private/specs_DEPRECATED/components/SwitchNativeComponent.d.ts +4 -4
  142. package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +4 -4
  143. package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +4 -4
  144. package/types_generated/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.d.ts +4 -4
  145. package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +4 -4
  146. package/types_generated/src/private/specs_DEPRECATED/modules/NativeI18nManager.d.ts +4 -4
  147. package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +4 -4
  148. package/types_generated/src/private/styles/composeStyles.d.ts +4 -2
  149. package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +4 -4
@@ -37,7 +37,7 @@ export type {default as AnimatedDivision} from './nodes/AnimatedDivision';
37
37
  export type {default as AnimatedModulo} from './nodes/AnimatedModulo';
38
38
  export type {default as AnimatedMultiplication} from './nodes/AnimatedMultiplication';
39
39
  export type {default as AnimatedSubtraction} from './nodes/AnimatedSubtraction';
40
- export type {WithAnimatedValue} from './createAnimatedComponent';
40
+ export type {WithAnimatedValue, AnimatedProps} from './createAnimatedComponent';
41
41
  export type {AnimatedComponentType as AnimatedComponent} from './createAnimatedComponent';
42
42
 
43
43
  /**
@@ -22,7 +22,7 @@ import invariant from 'invariant';
22
22
 
23
23
  export type AnimatedPropsAllowlist = $ReadOnly<{
24
24
  style?: ?AnimatedStyleAllowlist,
25
- [string]: true,
25
+ [key: string]: true | AnimatedStyleAllowlist,
26
26
  }>;
27
27
 
28
28
  type TargetView = {
@@ -22,7 +22,12 @@ import NativeAppState from './NativeAppState';
22
22
  * - @platform android - on another Activity (even if it was launched by your app)
23
23
  * @platform ios - inactive - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of an incoming call.
24
24
  */
25
- export type AppStateStatus = 'inactive' | 'background' | 'active';
25
+ export type AppStateStatus =
26
+ | 'inactive'
27
+ | 'background'
28
+ | 'active'
29
+ | 'extension'
30
+ | 'unknown';
26
31
 
27
32
  /**
28
33
  * change - This even is received when the app state has changed.
@@ -110,6 +110,7 @@ const ActivityIndicator = (
110
110
  style={StyleSheet.compose(styles.container, style)}>
111
111
  {Platform.OS === 'android' ? (
112
112
  // $FlowFixMe[prop-missing] Flow doesn't know when this is the android component
113
+ // $FlowFixMe[incompatible-type]
113
114
  <PlatformActivityIndicator {...nativeProps} {...androidProps} />
114
115
  ) : (
115
116
  /* $FlowFixMe[incompatible-type] (>=0.106.0 site=react_native_android_fb) This comment
@@ -17,11 +17,23 @@ import Platform from '../../Utilities/Platform';
17
17
 
18
18
  export type {ProgressBarAndroidProps};
19
19
 
20
+ // A utility type to preserve the semantics of the union uses in the definition
21
+ // of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so
22
+ // we define our own version which does. This does not affect Flow.
23
+ // $FlowExpectedError[unclear-type]
24
+ type Omit<T, K> = T extends any ? Pick<T, Exclude<$Keys<T>, K>> : T;
25
+
26
+ /**
27
+ * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
28
+ * It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
29
+ * @see https://github.com/react-native-community/progress-bar-android
30
+ * @deprecated
31
+ */
20
32
  let ProgressBarAndroid: component(
21
33
  ref?: React.RefSetter<
22
34
  React.ElementRef<ProgressBarAndroidNativeComponentType>,
23
35
  >,
24
- ...props: ProgressBarAndroidProps
36
+ ...props: Omit<ProgressBarAndroidProps, empty>
25
37
  );
26
38
 
27
39
  if (Platform.OS === 'android') {
@@ -17,28 +17,25 @@ import type {ViewProps} from '../View/ViewPropTypes';
17
17
  * `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
18
18
  * `progress` value.
19
19
  */
20
- type ProgressBarAndroidStyleAttrProp =
21
- | {
22
- styleAttr: 'Horizontal',
23
- indeterminate: false,
24
- progress: number,
25
- }
26
- | {
27
- styleAttr:
28
- | 'Horizontal'
29
- | 'Normal'
30
- | 'Small'
31
- | 'Large'
32
- | 'Inverse'
33
- | 'SmallInverse'
34
- | 'LargeInverse',
35
- indeterminate: true,
36
- };
20
+ type DeterminateProgressBarAndroidStyleAttrProp = {
21
+ styleAttr: 'Horizontal',
22
+ indeterminate: false,
23
+ progress: number,
24
+ };
37
25
 
38
- export type ProgressBarAndroidProps = $ReadOnly<{
39
- ...ViewProps,
40
- ...ProgressBarAndroidStyleAttrProp,
26
+ type IndeterminateProgressBarAndroidStyleAttrProp = {
27
+ styleAttr:
28
+ | 'Horizontal'
29
+ | 'Normal'
30
+ | 'Small'
31
+ | 'Large'
32
+ | 'Inverse'
33
+ | 'SmallInverse'
34
+ | 'LargeInverse',
35
+ indeterminate: true,
36
+ };
41
37
 
38
+ type ProgressBarAndroidBaseProps = $ReadOnly<{
42
39
  /**
43
40
  * Whether to show the ProgressBar (true, the default) or hide it (false).
44
41
  */
@@ -52,3 +49,15 @@ export type ProgressBarAndroidProps = $ReadOnly<{
52
49
  */
53
50
  testID?: ?string,
54
51
  }>;
52
+
53
+ export type ProgressBarAndroidProps =
54
+ | $ReadOnly<{
55
+ ...ViewProps,
56
+ ...ProgressBarAndroidBaseProps,
57
+ ...DeterminateProgressBarAndroidStyleAttrProp,
58
+ }>
59
+ | $ReadOnly<{
60
+ ...ViewProps,
61
+ ...ProgressBarAndroidBaseProps,
62
+ ...IndeterminateProgressBarAndroidStyleAttrProp,
63
+ }>;
@@ -17,5 +17,5 @@ export const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 80,
19
19
  patch: 0,
20
- prerelease: 'rc.0',
20
+ prerelease: 'rc.2',
21
21
  };
@@ -52,7 +52,7 @@ export default class NativeEventEmitter<
52
52
  {
53
53
  _nativeModule: ?NativeModule;
54
54
 
55
- constructor(nativeModule: ?NativeModule) {
55
+ constructor(nativeModule?: ?NativeModule) {
56
56
  if (Platform.OS === 'ios') {
57
57
  invariant(
58
58
  nativeModule != null,
@@ -18,10 +18,23 @@ export type ResolvedAssetSource = {
18
18
  +scale: number,
19
19
  };
20
20
 
21
- import type {
22
- AssetDestPathResolver,
23
- PackagerAsset,
24
- } from '@react-native/assets-registry/registry';
21
+ // From @react-native/assets-registry
22
+ type AssetDestPathResolver = 'android' | 'generic';
23
+
24
+ // From @react-native/assets-registry
25
+ type PackagerAsset = $ReadOnly<{
26
+ __packager_asset: boolean,
27
+ fileSystemLocation: string,
28
+ httpServerLocation: string,
29
+ width: ?number,
30
+ height: ?number,
31
+ scales: Array<number>,
32
+ hash: string,
33
+ name: string,
34
+ type: string,
35
+ resolver?: AssetDestPathResolver,
36
+ ...
37
+ }>;
25
38
 
26
39
  const PixelRatio = require('../Utilities/PixelRatio').default;
27
40
  const Platform = require('../Utilities/Platform').default;
@@ -107,4 +107,6 @@ declare export const setStyleAttributePreprocessor: (
107
107
  * An identity function for creating style sheets.
108
108
  */
109
109
  // $FlowFixMe[unsupported-variance-annotation]
110
- declare export const create: <+S: ____Styles_Internal>(obj: S) => $ReadOnly<S>;
110
+ declare export const create: <+S: ____Styles_Internal>(
111
+ obj: S & ____Styles_Internal,
112
+ ) => $ReadOnly<S>;
@@ -21,6 +21,7 @@ import type {
21
21
  ____ViewStyle_InternalOverrides,
22
22
  } from './private/_StyleSheetTypesOverrides';
23
23
  import type {____TransformStyle_Internal} from './private/_TransformStyle';
24
+ import type {ColorValue} from './StyleSheet';
24
25
 
25
26
  export type {____TransformStyle_Internal};
26
27
 
@@ -1001,7 +1002,8 @@ export type ____ImageStyle_InternalCore = $ReadOnly<{
1001
1002
  resizeMode?: ImageResizeMode,
1002
1003
  objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
1003
1004
  tintColor?: ____ColorValue_Internal,
1004
- overlayColor?: string,
1005
+ overlayColor?: ColorValue,
1006
+ overflow?: 'visible' | 'hidden',
1005
1007
  }>;
1006
1008
 
1007
1009
  export type ____ImageStyle_Internal = $ReadOnly<{
@@ -1014,7 +1016,7 @@ export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
1014
1016
  resizeMode?: ImageResizeMode,
1015
1017
  objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
1016
1018
  tintColor?: ____ColorValue_Internal,
1017
- overlayColor?: string,
1019
+ overlayColor?: ColorValue,
1018
1020
  }>;
1019
1021
 
1020
1022
  export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
@@ -10,6 +10,25 @@
10
10
 
11
11
  import type AnimatedNode from '../../Animated/nodes/AnimatedNode';
12
12
 
13
+ // Helper types to enforce that a single key is used in a transform object
14
+ // after generating a TypeScript definition file from the Flow types.
15
+ // $FlowExpectedError[unclear-type]
16
+ type KeysOfUnion<T> = T extends any ? $Keys<T> : empty;
17
+ // $FlowExpectedError[unclear-type]
18
+ type ValueOfUnion<T, K> = T extends any
19
+ ? K extends $Keys<T>
20
+ ? T[K]
21
+ : empty
22
+ : empty;
23
+ type MergeUnion<T> = {
24
+ [K in KeysOfUnion<T>]?: ValueOfUnion<T, K>,
25
+ };
26
+ type MaximumOneOf<T: {...}> = $Values<{
27
+ [K in keyof T]: $Exact<{
28
+ [P in keyof T]?: P extends K ? T[P] : empty,
29
+ }>,
30
+ }>;
31
+
13
32
  export type ____TransformStyle_Internal = $ReadOnly<{
14
33
  /**
15
34
  * `transform` accepts an array of transformation objects. Each object specifies
@@ -29,27 +48,36 @@ export type ____TransformStyle_Internal = $ReadOnly<{
29
48
  */
30
49
  transform?:
31
50
  | $ReadOnlyArray<
32
- | {+perspective: number | AnimatedNode}
33
- | {+rotate: string | AnimatedNode}
34
- | {+rotateX: string | AnimatedNode}
35
- | {+rotateY: string | AnimatedNode}
36
- | {+rotateZ: string | AnimatedNode}
37
- | {+scale: number | AnimatedNode}
38
- | {+scaleX: number | AnimatedNode}
39
- | {+scaleY: number | AnimatedNode}
40
- | {+translateX: number | string | AnimatedNode}
41
- | {+translateY: number | string | AnimatedNode}
42
- | {
43
- +translate:
44
- | [number | string | AnimatedNode, number | string | AnimatedNode]
45
- | AnimatedNode,
46
- }
47
- | {+skewX: string | AnimatedNode}
48
- | {+skewY: string | AnimatedNode}
49
- // TODO: what is the actual type it expects?
50
- | {
51
- +matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
52
- },
51
+ $ReadOnly<
52
+ MaximumOneOf<
53
+ MergeUnion<
54
+ | {+perspective: number | AnimatedNode}
55
+ | {+rotate: string | AnimatedNode}
56
+ | {+rotateX: string | AnimatedNode}
57
+ | {+rotateY: string | AnimatedNode}
58
+ | {+rotateZ: string | AnimatedNode}
59
+ | {+scale: number | AnimatedNode}
60
+ | {+scaleX: number | AnimatedNode}
61
+ | {+scaleY: number | AnimatedNode}
62
+ | {+translateX: number | string | AnimatedNode}
63
+ | {+translateY: number | string | AnimatedNode}
64
+ | {
65
+ +translate:
66
+ | [
67
+ number | string | AnimatedNode,
68
+ number | string | AnimatedNode,
69
+ ]
70
+ | AnimatedNode,
71
+ }
72
+ | {+skewX: string | AnimatedNode}
73
+ | {+skewY: string | AnimatedNode}
74
+ // TODO: what is the actual type it expects?
75
+ | {
76
+ +matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
77
+ },
78
+ >,
79
+ >,
80
+ >,
53
81
  >
54
82
  | string,
55
83
  /**
@@ -13,6 +13,7 @@
13
13
  import type {
14
14
  AccessibilityActionEvent,
15
15
  AccessibilityActionInfo,
16
+ AccessibilityProps,
16
17
  AccessibilityRole,
17
18
  AccessibilityState,
18
19
  Role,
@@ -124,20 +125,7 @@ export type TextPropsAndroid = {
124
125
  };
125
126
 
126
127
  type TextBaseProps = $ReadOnly<{
127
- /**
128
- * Indicates whether the view is an accessibility element.
129
- *
130
- * See https://reactnative.dev/docs/text#accessible
131
- */
132
- accessible?: ?boolean,
133
- accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
134
128
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
135
- accessibilityHint?: ?Stringish,
136
- accessibilityLanguage?: ?Stringish,
137
- accessibilityLabel?: ?Stringish,
138
- accessibilityRole?: ?AccessibilityRole,
139
- accessibilityState?: ?AccessibilityState,
140
- 'aria-label'?: ?string,
141
129
 
142
130
  /**
143
131
  * Whether fonts should scale to respect Text Size accessibility settings.
@@ -152,24 +140,6 @@ type TextBaseProps = $ReadOnly<{
152
140
  *
153
141
  */
154
142
  android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),
155
-
156
- /**
157
- * alias for accessibilityState
158
- *
159
- * see https://reactnative.dev/docs/accessibility#accessibilitystate
160
- */
161
- 'aria-busy'?: ?boolean,
162
- 'aria-checked'?: ?boolean | 'mixed',
163
- 'aria-disabled'?: ?boolean,
164
- 'aria-expanded'?: ?boolean,
165
- 'aria-selected'?: ?boolean,
166
-
167
- /**
168
- * Represents the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud.
169
- * This prop is listed for cross-platform reasons and has no real effect on Android or iOS.
170
- */
171
- 'aria-labelledby'?: ?string,
172
-
173
143
  children?: ?React.Node,
174
144
 
175
145
  /**
@@ -306,4 +276,5 @@ export type TextProps = $ReadOnly<{
306
276
  ...TextPropsIOS,
307
277
  ...TextPropsAndroid,
308
278
  ...TextBaseProps,
279
+ ...AccessibilityProps,
309
280
  }>;
@@ -8,9 +8,33 @@
8
8
  * @flow strict
9
9
  */
10
10
 
11
- import type {ErrorUtilsT} from '@react-native/js-polyfills/error-guard';
12
-
13
- export type ErrorUtils = ErrorUtilsT;
11
+ // From @react-native/js-polyfills
12
+ type ErrorHandler = (error: mixed, isFatal: boolean) => void;
13
+ type Fn<Args: $ReadOnlyArray<mixed>, Return> = (...Args) => Return;
14
+ export type ErrorUtils = {
15
+ applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(
16
+ fun: Fn<TArgs, TOut>,
17
+ context?: mixed,
18
+ args?: ?TArgs,
19
+ unused_onError?: null,
20
+ unused_name?: ?string,
21
+ ): ?TOut,
22
+ applyWithGuardIfNeeded<TArgs: $ReadOnlyArray<mixed>, TOut>(
23
+ fun: Fn<TArgs, TOut>,
24
+ context?: mixed,
25
+ args?: ?TArgs,
26
+ ): ?TOut,
27
+ getGlobalHandler(): ErrorHandler,
28
+ guard<TArgs: $ReadOnlyArray<mixed>, TOut>(
29
+ fun: Fn<TArgs, TOut>,
30
+ name?: ?string,
31
+ context?: mixed,
32
+ ): ?(...TArgs) => ?TOut,
33
+ inGuard(): boolean,
34
+ reportError(error: mixed): void,
35
+ reportFatalError(error: mixed): void,
36
+ setGlobalHandler(fun: ErrorHandler): void,
37
+ };
14
38
 
15
39
  /**
16
40
  * The particular require runtime that we are using looks for a global
@@ -24,4 +48,4 @@ export type ErrorUtils = ErrorUtilsT;
24
48
  * that use it aren't just using a global variable, so simply export the global
25
49
  * variable here. ErrorUtils is originally defined in a file named error-guard.js.
26
50
  */
27
- export default (global.ErrorUtils: ErrorUtilsT);
51
+ export default global.ErrorUtils as ErrorUtils;
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(80),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.0",
27
+ RCTVersionPrerelease: @"rc.2",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
170
170
 
171
171
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
172
172
  {
173
- [_viewsToBeMounted addObject:@{
174
- kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
175
- kRCTLegacyInteropChildComponentKey : childComponentView
176
- }];
173
+ if (_adapter && index == _adapter.paperView.reactSubviews.count) {
174
+ // This is a new child view that is being added to the end of the children array.
175
+ // After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
176
+ // Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
177
+ // called and the `finalizeUpdate` is not invoked.
178
+ if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
179
+ UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
180
+ [_adapter.paperView insertReactSubview:target atIndex:index];
181
+ } else {
182
+ [_adapter.paperView insertReactSubview:childComponentView atIndex:index];
183
+ }
184
+ [_adapter.paperView didUpdateReactSubviews];
185
+ } else {
186
+ [_viewsToBeMounted addObject:@{
187
+ kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
188
+ kRCTLegacyInteropChildComponentKey : childComponentView
189
+ }];
190
+ }
177
191
  }
178
192
 
179
193
  - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
@@ -2006,7 +2006,7 @@ public final class com/facebook/react/devsupport/DefaultDevLoadingViewImplementa
2006
2006
  public final fun setDevLoadingEnabled (Z)V
2007
2007
  }
2008
2008
 
2009
- public final class com/facebook/react/devsupport/DevServerHelper {
2009
+ public class com/facebook/react/devsupport/DevServerHelper {
2010
2010
  public fun <init> (Lcom/facebook/react/modules/debug/interfaces/DeveloperSettings;Landroid/content/Context;Lcom/facebook/react/packagerconnection/PackagerConnectionSettings;)V
2011
2011
  public final fun closeInspectorConnection ()V
2012
2012
  public final fun closePackagerConnection ()V
@@ -2015,12 +2015,12 @@ public final class com/facebook/react/devsupport/DevServerHelper {
2015
2015
  public final fun downloadBundleFromURL (Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;)V
2016
2016
  public static synthetic fun downloadBundleFromURL$default (Lcom/facebook/react/devsupport/DevServerHelper;Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;ILjava/lang/Object;)V
2017
2017
  public final fun downloadBundleResourceFromUrlSync (Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
2018
- public final fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
2019
- public final fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
2020
- public final fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
2021
- public final fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
2018
+ public fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
2019
+ public fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
2020
+ public fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
2021
+ public fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
2022
2022
  public final fun getWebsocketProxyURL ()Ljava/lang/String;
2023
- public final fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
2023
+ public fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
2024
2024
  public final fun openDebugger (Lcom/facebook/react/bridge/ReactContext;Ljava/lang/String;)V
2025
2025
  public final fun openInspectorConnection ()V
2026
2026
  public final fun openPackagerConnection (Ljava/lang/String;Lcom/facebook/react/devsupport/DevServerHelper$PackagerCommandListener;)V
@@ -4656,7 +4656,7 @@ public abstract class com/facebook/react/uimanager/ViewGroupManager : com/facebo
4656
4656
  public fun getShadowNodeClass ()Ljava/lang/Class;
4657
4657
  public static final fun getViewZIndex (Landroid/view/View;)Ljava/lang/Integer;
4658
4658
  public fun needsCustomLayoutForChildren ()Z
4659
- public final fun removeView (Landroid/view/ViewGroup;Landroid/view/View;)V
4659
+ public fun removeView (Landroid/view/ViewGroup;Landroid/view/View;)V
4660
4660
  public synthetic fun removeViewAt (Landroid/view/View;I)V
4661
4661
  public fun removeViewAt (Landroid/view/ViewGroup;I)V
4662
4662
  public static final fun setViewZIndex (Landroid/view/View;I)V
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.80.0-rc.0
1
+ VERSION_NAME=0.80.0-rc.2
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -11,11 +11,13 @@ import android.content.Intent;
11
11
  import android.content.res.Configuration;
12
12
  import android.os.Bundle;
13
13
  import android.view.KeyEvent;
14
+ import androidx.activity.OnBackPressedCallback;
14
15
  import androidx.annotation.Nullable;
15
16
  import androidx.appcompat.app.AppCompatActivity;
16
17
  import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
17
18
  import com.facebook.react.modules.core.PermissionAwareActivity;
18
19
  import com.facebook.react.modules.core.PermissionListener;
20
+ import com.facebook.react.util.AndroidVersion;
19
21
  import org.jetbrains.annotations.NotNull;
20
22
 
21
23
  /** Base Activity for React Native applications. */
@@ -24,6 +26,18 @@ public abstract class ReactActivity extends AppCompatActivity
24
26
 
25
27
  private final ReactActivityDelegate mDelegate;
26
28
 
29
+ // Due to enforced predictive back on targetSdk 36, 'onBackPressed()' is disabled by default.
30
+ // Using a workaround to trigger it manually.
31
+ private final OnBackPressedCallback mBackPressedCallback =
32
+ new OnBackPressedCallback(true) {
33
+ @Override
34
+ public void handleOnBackPressed() {
35
+ setEnabled(false);
36
+ onBackPressed();
37
+ setEnabled(true);
38
+ }
39
+ };
40
+
27
41
  protected ReactActivity() {
28
42
  mDelegate = createReactActivityDelegate();
29
43
  }
@@ -45,6 +59,9 @@ public abstract class ReactActivity extends AppCompatActivity
45
59
  protected void onCreate(Bundle savedInstanceState) {
46
60
  super.onCreate(savedInstanceState);
47
61
  mDelegate.onCreate(savedInstanceState);
62
+ if (AndroidVersion.isAtLeastTargetSdk36(this)) {
63
+ getOnBackPressedDispatcher().addCallback(this, mBackPressedCallback);
64
+ }
48
65
  }
49
66
 
50
67
  @Override
@@ -103,6 +120,9 @@ public abstract class ReactActivity extends AppCompatActivity
103
120
 
104
121
  @Override
105
122
  public void invokeDefaultOnBackPressed() {
123
+ // Disabling callback so the fallback logic (finish activity) can run
124
+ // as super.onBackPressed() will call all enabled callbacks in the dispatcher.
125
+ mBackPressedCallback.setEnabled(false);
106
126
  super.onBackPressed();
107
127
  }
108
128
 
@@ -59,7 +59,7 @@ import okio.Okio
59
59
  */
60
60
  @SuppressLint(
61
61
  "StaticFieldLeak") // TODO: This entire class should be rewritten to don't use AsyncTask
62
- public class DevServerHelper(
62
+ public open class DevServerHelper(
63
63
  private val settings: DeveloperSettings,
64
64
  private val applicationContext: Context,
65
65
  private val packagerConnectionSettings: PackagerConnectionSettings
@@ -287,20 +287,20 @@ public class DevServerHelper(
287
287
  additionalOptionsBuilder.toString())
288
288
  }
289
289
 
290
- public fun getDevServerBundleURL(jsModulePath: String): String =
290
+ public open fun getDevServerBundleURL(jsModulePath: String): String =
291
291
  createBundleURL(jsModulePath, BundleType.BUNDLE, packagerConnectionSettings.debugServerHost)
292
292
 
293
- public fun getDevServerSplitBundleURL(jsModulePath: String): String =
293
+ public open fun getDevServerSplitBundleURL(jsModulePath: String): String =
294
294
  createSplitBundleURL(jsModulePath, packagerConnectionSettings.debugServerHost)
295
295
 
296
- public fun isPackagerRunning(callback: PackagerStatusCallback) {
296
+ public open fun isPackagerRunning(callback: PackagerStatusCallback) {
297
297
  packagerStatusCheck.run(packagerConnectionSettings.debugServerHost, callback)
298
298
  }
299
299
 
300
- public fun getSourceMapUrl(mainModuleName: String): String =
300
+ public open fun getSourceMapUrl(mainModuleName: String): String =
301
301
  createBundleURL(mainModuleName, BundleType.MAP)
302
302
 
303
- public fun getSourceUrl(mainModuleName: String): String =
303
+ public open fun getSourceUrl(mainModuleName: String): String =
304
304
  createBundleURL(mainModuleName, BundleType.BUNDLE)
305
305
 
306
306
  /**
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 80,
17
17
  "patch" to 0,
18
- "prerelease" to "rc.0"
18
+ "prerelease" to "rc.2"
19
19
  )
20
20
  }
@@ -462,9 +462,9 @@ public class NativeViewHierarchyOptimizer {
462
462
  return false;
463
463
  }
464
464
 
465
- ReadableMapKeySetIterator keyIterator = props.backingMap.keySetIterator();
465
+ ReadableMapKeySetIterator keyIterator = props.internal_backingMap().keySetIterator();
466
466
  while (keyIterator.hasNextKey()) {
467
- if (!ViewProps.isLayoutOnly(props.backingMap, keyIterator.nextKey())) {
467
+ if (!ViewProps.isLayoutOnly(props.internal_backingMap(), keyIterator.nextKey())) {
468
468
  return false;
469
469
  }
470
470
  }
@@ -31,7 +31,12 @@ import com.facebook.react.bridge.ReadableMap
31
31
  */
32
32
  public class ReactStylesDiffMap(props: ReadableMap) {
33
33
 
34
- @JvmField internal val backingMap: ReadableMap = props
34
+ /**
35
+ * This backing map is annotated as JvmName("internal_backingMap") so can be accessed by Java
36
+ * consumers. This is used in Expo to override setting properties in some subclassed view-manager
37
+ * as this provides faster access to the underlying values.
38
+ */
39
+ @get:JvmName("internal_backingMap") internal val backingMap: ReadableMap = props
35
40
 
36
41
  public fun toMap(): Map<String, Any?> = backingMap.toHashMap()
37
42
 
@@ -49,7 +49,12 @@ constructor(reactContext: ReactApplicationContext? = null) :
49
49
  parent.removeViewAt(index)
50
50
  }
51
51
 
52
- public fun removeView(parent: T, view: View) {
52
+ /**
53
+ * Expo overrides this function GroupViewManagerWrapper.kt`, which is a replacement view manager
54
+ * adding support for delegates receiving callbacks whenever one of the methods in the view
55
+ * manager are called.
56
+ */
57
+ public open fun removeView(parent: T, view: View) {
53
58
  UiThreadUtil.assertOnUiThread()
54
59
 
55
60
  for (i in 0 until getChildCount(parent)) {
@@ -97,7 +97,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
97
97
  */
98
98
  public void updateProperties(@NonNull T viewToUpdate, ReactStylesDiffMap props) {
99
99
  ViewManagerDelegate<T> delegate = getOrCreateViewManagerDelegate();
100
- Iterator<Map.Entry<String, Object>> iterator = props.backingMap.getEntryIterator();
100
+ Iterator<Map.Entry<String, Object>> iterator = props.internal_backingMap().getEntryIterator();
101
101
  while (iterator.hasNext()) {
102
102
  Map.Entry<String, Object> entry = iterator.next();
103
103
  delegate.setProperty(viewToUpdate, entry.getKey(), entry.getValue());
@@ -143,11 +143,11 @@ internal data class BorderRadiusStyle(
143
143
  CornerRadii(it, width, height)
144
144
  } ?: zeroRadii,
145
145
  bottomLeft =
146
- (endEnd ?: bottomStart ?: bottomRight ?: uniform)?.let {
146
+ (endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.let {
147
147
  CornerRadii(it, width, height)
148
148
  } ?: zeroRadii,
149
149
  bottomRight =
150
- (startEnd ?: bottomEnd ?: bottomLeft ?: uniform)?.let {
150
+ (startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.let {
151
151
  CornerRadii(it, width, height)
152
152
  } ?: zeroRadii,
153
153
  width = width,