Skip to content

Commit 9ae49b1

Browse files
committed
Merge branch 'upstream/main'
# Conflicts: # .circleci/config.yml # .flowconfig # .flowconfig.android # CHANGELOG.md # Libraries/AppDelegate/RCTAppDelegate.h # React/Fabric/RCTSurfaceTouchHandler.mm # ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt # ReactAndroid/src/main/jni/CMakeLists.txt # ReactCommon/hermes/inspector/chrome/MessageTypes.cpp # ReactCommon/hermes/inspector/chrome/MessageTypes.h # ReactCommon/hermes/inspector/tools/message_types.txt # package.json # packages/rn-tester/android/app/build.gradle # packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterActivity.java # repo-config/package.json # scripts/react_native_pods.rb # template/_flowconfig # template/android/app/build.gradle # template/android/app/src/main/java/com/helloworld/MainApplication.java # template/android/app/src/main/jni/CMakeLists.txt # template/ios/HelloWorld/AppDelegate.mm # template/package.json # yarn.lock
2 parents f204f5d + 9e169da commit 9ae49b1

File tree

134 files changed

+2867
-726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+2867
-726
lines changed

.circleci/config.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ references:
3434
# Dependency Anchors
3535
# -------------------------
3636
dependency_versions:
37-
# The Xcode version used on CircleCI OSS tests must be kept in sync with
38-
# the Xcode version used on Sandcastle OSS tests. See _XCODE_VERSION in
39-
# tools/utd/migrated_nbtd_jobs/react_native_oss.td
4037
xcode_version: &xcode_version "13.3.1"
4138
nodelts_image: &nodelts_image "cimg/node:16.14"
4239
nodeprevlts_image: &nodeprevlts_image "cimg/node:14.19"
@@ -50,10 +47,10 @@ references:
5047
checkout_cache_key: &checkout_cache_key v1-checkout
5148
gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
5249
gradle_cache_key: &gradle_cache_key v1-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "ReactAndroid/gradle.properties" }}
53-
hermes_cache_key: &hermes_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
54-
hermes_windows_cache_key: &hermes_windows_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
55-
hermes_tarball_cache_key: &hermes_tarball_cache_key v2-hermes-tarball-{{ checksum "/tmp/hermes/hermesversion" }}
56-
pods_cache_key: &pods_cache_key v7-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
50+
hermes_cache_key: &hermes_cache_key v3-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
51+
hermes_windows_cache_key: &hermes_windows_cache_key v3-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
52+
hermes_tarball_cache_key: &hermes_tarball_cache_key v3-hermes-tarball-{{ checksum "/tmp/hermes/hermesversion" }}
53+
pods_cache_key: &pods_cache_key v8-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
5754
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
5855
yarn_cache_key: &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
5956

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ untyped-import
7474
untyped-type-import
7575

7676
[version]
77-
^0.184.0
77+
^0.185.1

.flowconfig.android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ untyped-import
7474
untyped-type-import
7575

7676
[version]
77-
^0.184.0
77+
^0.185.1

BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ REACT_PUBLIC_HEADERS = {
255255
"React/RCTBridgeMethod.h": RCTBASE_PATH + "RCTBridgeMethod.h",
256256
"React/RCTBridgeModule.h": RCTBASE_PATH + "RCTBridgeModule.h",
257257
"React/RCTBridgeModuleDecorator.h": RCTBASE_PATH + "RCTBridgeModuleDecorator.h",
258+
"React/RCTBundleManager.h": RCTBASE_PATH + "RCTBundleManager.h",
258259
"React/RCTBundleURLProvider.h": RCTBASE_PATH + "RCTBundleURLProvider.h",
259260
"React/RCTComponent.h": RCTVIEWS_PATH + "RCTComponent.h",
260261
"React/RCTComponentData.h": RCTVIEWS_PATH + "RCTComponentData.h",

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## v0.69.5
4+
5+
### Changed
6+
7+
- Bump react-native-codegen to 0.69.2 ([df3d52bfbf](https://github.com/facebook/react-native/commit/df3d52bfbf4254cd16e1dc0ca0af2743cd7e11c1) by [@dmitryrykun](https://github.com/dmitryrykun))
8+
9+
#### Android specific
10+
11+
- Replaced reactnativeutilsjni with reactnativejni in the build process to reduce size ([54a4fcbfdc](https://github.com/facebook/react-native/commit/54a4fcbfdcc8111b3010b2c31ed3c1d48632ce4c) by [@SparshaSaha](https://github.com/SparshaSaha))
12+
13+
### Fixed
14+
15+
- Codegen should ignore `.d.ts` files ([0f0d52067c](https://github.com/facebook/react-native/commit/0f0d52067cb89fdb39a99021f0745282ce087fc2) by [@tido64](https://github.com/tido64))
16+
317
## v0.69.4
418

519
### Changed

Libraries/Animated/useAnimatedProps.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
useMemo,
2222
useReducer,
2323
useRef,
24-
useState,
2524
} from 'react';
2625

2726
type ReducedProps<TProps> = {
@@ -31,8 +30,6 @@ type ReducedProps<TProps> = {
3130
};
3231
type CallbackRef<T> = T => mixed;
3332

34-
let animatedComponentNextId = 1;
35-
3633
export default function useAnimatedProps<TProps: {...}, TInstance>(
3734
props: TProps,
3835
): [ReducedProps<TProps>, CallbackRef<TInstance | null>] {
@@ -141,16 +138,11 @@ function useAnimatedPropsLifecycle(node: AnimatedProps): void {
141138
const prevNodeRef = useRef<?AnimatedProps>(null);
142139
const isUnmountingRef = useRef<boolean>(false);
143140

144-
const [animatedComponentId] = useState(
145-
() => `${animatedComponentNextId++}:animatedComponent`,
146-
);
147-
148-
useLayoutEffect(() => {
149-
NativeAnimatedHelper.API.setWaitingForIdentifier(animatedComponentId);
150-
});
151-
152141
useEffect(() => {
153-
NativeAnimatedHelper.API.unsetWaitingForIdentifier(animatedComponentId);
142+
// It is ok for multiple components to call `flushQueue` because it noops
143+
// if the queue is empty. When multiple animated components are mounted at
144+
// the same time. Only first component flushes the queue and the others will noop.
145+
NativeAnimatedHelper.API.flushQueue();
154146
});
155147

156148
useLayoutEffect(() => {

Libraries/AppDelegate/RCTAppDelegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
///
6868
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
6969
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
70-
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
70+
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
7171
- (BOOL)concurrentRootEnabled;
7272

7373
@end
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
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+
*/
10+
11+
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12+
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
13+
import type {ElementRef} from 'react';
14+
15+
// Events that are only supported on Android.
16+
type AccessibilityEventDefinitionsAndroid = {
17+
accessibilityServiceChanged: [boolean],
18+
};
19+
20+
// Events that are only supported on iOS.
21+
type AccessibilityEventDefinitionsIOS = {
22+
announcementFinished: [{announcement: string, success: boolean}],
23+
boldTextChanged: [boolean],
24+
grayscaleChanged: [boolean],
25+
invertColorsChanged: [boolean],
26+
reduceTransparencyChanged: [boolean],
27+
};
28+
29+
type AccessibilityEventDefinitions = {
30+
...AccessibilityEventDefinitionsAndroid,
31+
...AccessibilityEventDefinitionsIOS,
32+
change: [boolean], // screenReaderChanged
33+
reduceMotionChanged: [boolean],
34+
screenReaderChanged: [boolean],
35+
};
36+
37+
type AccessibilityEventTypes = 'click' | 'focus';
38+
/**
39+
* Sometimes it's useful to know whether or not the device has a screen reader
40+
* that is currently active. The `AccessibilityInfo` API is designed for this
41+
* purpose. You can use it to query the current state of the screen reader as
42+
* well as to register to be notified when the state of the screen reader
43+
* changes.
44+
*
45+
* See https://reactnative.dev/docs/accessibilityinfo
46+
*/
47+
export type AccessibilityInfoType = {
48+
/**
49+
* Query whether bold text is currently enabled.
50+
*
51+
* Returns a promise which resolves to a boolean.
52+
* The result is `true` when bold text is enabled and `false` otherwise.
53+
*
54+
* See https://reactnative.dev/docs/accessibilityinfo#isBoldTextEnabled
55+
*/
56+
isBoldTextEnabled: () => Promise<boolean>,
57+
58+
/**
59+
* Query whether grayscale is currently enabled.
60+
*
61+
* Returns a promise which resolves to a boolean.
62+
* The result is `true` when grayscale is enabled and `false` otherwise.
63+
*
64+
* See https://reactnative.dev/docs/accessibilityinfo#isGrayscaleEnabled
65+
*/
66+
isGrayscaleEnabled: () => Promise<boolean>,
67+
68+
/**
69+
* Query whether inverted colors are currently enabled.
70+
*
71+
* Returns a promise which resolves to a boolean.
72+
* The result is `true` when invert color is enabled and `false` otherwise.
73+
*
74+
* See https://reactnative.dev/docs/accessibilityinfo#isInvertColorsEnabled
75+
*/
76+
isInvertColorsEnabled: () => Promise<boolean>,
77+
78+
/**
79+
* Query whether reduced motion is currently enabled.
80+
*
81+
* Returns a promise which resolves to a boolean.
82+
* The result is `true` when a reduce motion is enabled and `false` otherwise.
83+
*
84+
* See https://reactnative.dev/docs/accessibilityinfo#isReduceMotionEnabled
85+
*/
86+
isReduceMotionEnabled: () => Promise<boolean>,
87+
88+
/**
89+
* Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
90+
*
91+
* Returns a promise which resolves to a boolean.
92+
* The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
93+
*
94+
* See https://reactnative.dev/docs/accessibilityinfo#prefersCrossFadeTransitions
95+
*/
96+
prefersCrossFadeTransitions: () => Promise<boolean>,
97+
98+
/**
99+
* Query whether reduced transparency is currently enabled.
100+
*
101+
* Returns a promise which resolves to a boolean.
102+
* The result is `true` when a reduce transparency is enabled and `false` otherwise.
103+
*
104+
* See https://reactnative.dev/docs/accessibilityinfo#isReduceTransparencyEnabled
105+
*/
106+
isReduceTransparencyEnabled: () => Promise<boolean>,
107+
108+
/**
109+
* Query whether a screen reader is currently enabled.
110+
*
111+
* Returns a promise which resolves to a boolean.
112+
* The result is `true` when a screen reader is enabled and `false` otherwise.
113+
*
114+
* See https://reactnative.dev/docs/accessibilityinfo#isScreenReaderEnabled
115+
*/
116+
isScreenReaderEnabled: () => Promise<boolean>,
117+
118+
/**
119+
* Query whether Accessibility Service is currently enabled.
120+
*
121+
* Returns a promise which resolves to a boolean.
122+
* The result is `true` when any service is enabled and `false` otherwise.
123+
*
124+
* @platform android
125+
*
126+
* See https://reactnative.dev/docs/accessibilityinfo/#isaccessibilityserviceenabled-android
127+
*/
128+
isAccessibilityServiceEnabled: () => Promise<boolean>,
129+
130+
/**
131+
* Add an event handler. Supported events:
132+
*
133+
* - `reduceMotionChanged`: Fires when the state of the reduce motion toggle changes.
134+
* The argument to the event handler is a boolean. The boolean is `true` when a reduce
135+
* motion is enabled (or when "Transition Animation Scale" in "Developer options" is
136+
* "Animation off") and `false` otherwise.
137+
* - `screenReaderChanged`: Fires when the state of the screen reader changes. The argument
138+
* to the event handler is a boolean. The boolean is `true` when a screen
139+
* reader is enabled and `false` otherwise.
140+
*
141+
* These events are only supported on iOS:
142+
*
143+
* - `boldTextChanged`: iOS-only event. Fires when the state of the bold text toggle changes.
144+
* The argument to the event handler is a boolean. The boolean is `true` when a bold text
145+
* is enabled and `false` otherwise.
146+
* - `grayscaleChanged`: iOS-only event. Fires when the state of the gray scale toggle changes.
147+
* The argument to the event handler is a boolean. The boolean is `true` when a gray scale
148+
* is enabled and `false` otherwise.
149+
* - `invertColorsChanged`: iOS-only event. Fires when the state of the invert colors toggle
150+
* changes. The argument to the event handler is a boolean. The boolean is `true` when a invert
151+
* colors is enabled and `false` otherwise.
152+
* - `reduceTransparencyChanged`: iOS-only event. Fires when the state of the reduce transparency
153+
* toggle changes. The argument to the event handler is a boolean. The boolean is `true`
154+
* when a reduce transparency is enabled and `false` otherwise.
155+
* - `announcementFinished`: iOS-only event. Fires when the screen reader has
156+
* finished making an announcement. The argument to the event handler is a
157+
* dictionary with these keys:
158+
* - `announcement`: The string announced by the screen reader.
159+
* - `success`: A boolean indicating whether the announcement was
160+
* successfully made.
161+
*
162+
* See https://reactnative.dev/docs/accessibilityinfo#addeventlistener
163+
*/
164+
addEventListener<K: $Keys<AccessibilityEventDefinitions>>(
165+
eventName: K,
166+
handler: (...$ElementType<AccessibilityEventDefinitions, K>) => void,
167+
): EventSubscription,
168+
169+
/**
170+
* Set accessibility focus to a React component.
171+
*
172+
* See https://reactnative.dev/docs/accessibilityinfo#setaccessibilityfocus
173+
*/
174+
setAccessibilityFocus: (reactTag: number) => void,
175+
176+
/**
177+
* Send a named accessibility event to a HostComponent.
178+
*/
179+
sendAccessibilityEvent: (
180+
handle: ElementRef<HostComponent<mixed>>,
181+
eventType: AccessibilityEventTypes,
182+
) => void,
183+
184+
/**
185+
* Post a string to be announced by the screen reader.
186+
*
187+
* See https://reactnative.dev/docs/accessibilityinfo#announceforaccessibility
188+
*/
189+
announceForAccessibility: (announcement: string) => void,
190+
191+
/**
192+
* Post a string to be announced by the screen reader.
193+
* - `announcement`: The string announced by the screen reader.
194+
* - `options`: An object that configures the reading options.
195+
* - `queue`: The announcement will be queued behind existing announcements. iOS only.
196+
*/
197+
announceForAccessibilityWithOptions: (
198+
announcement: string,
199+
options: {queue?: boolean},
200+
) => void,
201+
202+
/**
203+
* Get the recommended timeout for changes to the UI needed by this user.
204+
*
205+
* See https://reactnative.dev/docs/accessibilityinfo#getrecommendedtimeoutmillis
206+
*/
207+
getRecommendedTimeoutMillis: (originalTimeout: number) => Promise<number>,
208+
};

Libraries/Components/AccessibilityInfo/AccessibilityInfo.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import NativeAccessibilityInfoAndroid from './NativeAccessibilityInfo';
1717
import NativeAccessibilityManagerIOS from './NativeAccessibilityManager';
1818
import legacySendAccessibilityEvent from './legacySendAccessibilityEvent';
1919
import type {ElementRef} from 'react';
20+
import type {AccessibilityInfoType} from './AccessibilityInfo.flow';
2021

2122
// Events that are only supported on Android.
2223
type AccessibilityEventDefinitionsAndroid = {
@@ -73,7 +74,7 @@ const EventNames: Map<
7374
*
7475
* See https://reactnative.dev/docs/accessibilityinfo
7576
*/
76-
const AccessibilityInfo = {
77+
const AccessibilityInfo: AccessibilityInfoType = {
7778
/**
7879
* Query whether bold text is currently enabled.
7980
*
@@ -178,6 +179,34 @@ const AccessibilityInfo = {
178179
});
179180
},
180181

182+
/**
183+
* Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
184+
*
185+
* Returns a promise which resolves to a boolean.
186+
* The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
187+
*
188+
* See https://reactnative.dev/docs/accessibilityinfo#prefersCrossFadeTransitions
189+
*/
190+
prefersCrossFadeTransitions(): Promise<boolean> {
191+
return new Promise((resolve, reject) => {
192+
if (Platform.OS === 'android') {
193+
return Promise.resolve(false);
194+
} else {
195+
if (
196+
NativeAccessibilityManagerIOS?.getCurrentPrefersCrossFadeTransitionsState !=
197+
null
198+
) {
199+
NativeAccessibilityManagerIOS.getCurrentPrefersCrossFadeTransitionsState(
200+
resolve,
201+
reject,
202+
);
203+
} else {
204+
reject(null);
205+
}
206+
}
207+
});
208+
},
209+
181210
/**
182211
* Query whether reduced transparency is currently enabled.
183212
*
@@ -295,6 +324,7 @@ const AccessibilityInfo = {
295324
*/
296325
addEventListener<K: $Keys<AccessibilityEventDefinitions>>(
297326
eventName: K,
327+
// $FlowIssue[incompatible-type] - Flow bug with unions and generics (T128099423)
298328
handler: (...$ElementType<AccessibilityEventDefinitions, K>) => void,
299329
): EventSubscription {
300330
const deviceEventName = EventNames.get(eventName);

Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export interface Spec extends TurboModule {
2828
onSuccess: (isReduceMotionEnabled: boolean) => void,
2929
onError: (error: Object) => void,
3030
) => void;
31+
+getCurrentPrefersCrossFadeTransitionsState?: (
32+
onSuccess: (prefersCrossFadeTransitions: boolean) => void,
33+
onError: (error: Object) => void,
34+
) => void;
3135
+getCurrentReduceTransparencyState: (
3236
onSuccess: (isReduceTransparencyEnabled: boolean) => void,
3337
onError: (error: Object) => void,

0 commit comments

Comments
 (0)