react-native 0.71.0-rc.4 → 0.71.0-rc.5

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 (35) hide show
  1. package/Libraries/Animated/Animated.d.ts +28 -0
  2. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +29 -0
  3. package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
  4. package/Libraries/Core/ReactNativeVersion.js +1 -1
  5. package/Libraries/Lists/FlatList.d.ts +1 -42
  6. package/Libraries/Lists/FlatList.js +1 -0
  7. package/Libraries/Lists/SectionList.d.ts +0 -42
  8. package/Libraries/Lists/VirtualizedList.d.ts +31 -1
  9. package/Libraries/Lists/VirtualizedList.js +1 -0
  10. package/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +20 -0
  11. package/Libraries/ReactNative/AppRegistry.d.ts +51 -0
  12. package/Libraries/ReactNative/AppRegistry.js +3 -1
  13. package/Libraries/ReactNative/RootTag.d.ts +13 -0
  14. package/Libraries/StyleSheet/StyleSheet.d.ts +7 -3
  15. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +0 -1
  16. package/Libraries/Utilities/createPerformanceLogger.d.ts +48 -0
  17. package/Libraries/Vibration/Vibration.d.ts +1 -1
  18. package/React/Base/RCTVersion.m +1 -1
  19. package/ReactAndroid/build.gradle +9 -1
  20. package/ReactAndroid/gradle.properties +1 -1
  21. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  22. package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.h +1 -1
  23. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  24. package/ReactCommon/yoga/yoga/Yoga.cpp +5 -0
  25. package/package.json +4 -3
  26. package/scripts/cocoapods/codegen_utils.rb +14 -3
  27. package/scripts/cocoapods/new_architecture.rb +4 -1
  28. package/scripts/cocoapods/utils.rb +22 -0
  29. package/scripts/react_native_pods.rb +9 -2
  30. package/sdks/hermesc/osx-bin/hermesc +0 -0
  31. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  32. package/template/_eslintrc.js +1 -1
  33. package/template/android/build.gradle +1 -17
  34. package/template/package.json +1 -1
  35. package/types/index.d.ts +1 -0
@@ -116,6 +116,17 @@ export namespace Animated {
116
116
 
117
117
  type ValueListenerCallback = (state: {value: number}) => void;
118
118
 
119
+ type Animation = {
120
+ start(
121
+ fromValue: number,
122
+ onUpdate: (value: number) => void,
123
+ onEnd: EndCallback | null,
124
+ previousAnimation: Animation | null,
125
+ animatedValue: AnimatedValue,
126
+ ): void;
127
+ stop(): void;
128
+ };
129
+
119
130
  /**
120
131
  * Standard value for driving animations. One `Animated.Value` can drive
121
132
  * multiple properties in a synchronized fashion, but can only be driven by one
@@ -168,6 +179,13 @@ export namespace Animated {
168
179
  */
169
180
  stopAnimation(callback?: (value: number) => void): void;
170
181
 
182
+ /**
183
+ * Stops any animation and resets the value to its original.
184
+ *
185
+ * See https://reactnative.dev/docs/animatedvalue#resetanimation
186
+ */
187
+ resetAnimation(callback?: (value: number) => void): void;
188
+
171
189
  /**
172
190
  * Interpolates the value before updating the property, e.g. mapping 0-1 to
173
191
  * 0-10.
@@ -175,6 +193,14 @@ export namespace Animated {
175
193
  interpolate<OutputT extends number | string>(
176
194
  config: InterpolationConfigType,
177
195
  ): AnimatedInterpolation<OutputT>;
196
+
197
+ /**
198
+ * Typically only used internally, but could be used by a custom Animation
199
+ * class.
200
+ *
201
+ * See https://reactnative.dev/docs/animatedvalue#animate
202
+ */
203
+ animate(animation: Animation, callback?: EndCallback | null): void;
178
204
  }
179
205
 
180
206
  type ValueXYListenerCallback = (value: {x: number; y: number}) => void;
@@ -201,6 +227,8 @@ export namespace Animated {
201
227
 
202
228
  extractOffset(): void;
203
229
 
230
+ resetAnimation(callback?: (value: {x: number; y: number}) => void): void;
231
+
204
232
  stopAnimation(callback?: (value: {x: number; y: number}) => void): void;
205
233
 
206
234
  addListener(callback: ValueXYListenerCallback): string;
@@ -69,6 +69,14 @@ export interface AccessibilityInfoStatic {
69
69
  */
70
70
  isReduceMotionEnabled: () => Promise<boolean>;
71
71
 
72
+ /**
73
+ * Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
74
+ *
75
+ * Returns a promise which resolves to a boolean.
76
+ * The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
77
+ */
78
+ prefersCrossFadeTransitions(): Promise<boolean>;
79
+
72
80
  /**
73
81
  * Query whether reduce transparency is currently enabled.
74
82
  *
@@ -81,6 +89,16 @@ export interface AccessibilityInfoStatic {
81
89
  */
82
90
  isScreenReaderEnabled: () => Promise<boolean>;
83
91
 
92
+ /**
93
+ * Query whether Accessibility Service is currently enabled.
94
+ *
95
+ * Returns a promise which resolves to a boolean.
96
+ * The result is `true` when any service is enabled and `false` otherwise.
97
+ *
98
+ * @platform android
99
+ */
100
+ isAccessibilityServiceEnabled(): Promise<boolean>;
101
+
84
102
  /**
85
103
  * Add an event handler. Supported events:
86
104
  * - announcementFinished: iOS-only event. Fires when the screen reader has finished making an announcement.
@@ -111,6 +129,17 @@ export interface AccessibilityInfoStatic {
111
129
  */
112
130
  announceForAccessibility: (announcement: string) => void;
113
131
 
132
+ /**
133
+ * Post a string to be announced by the screen reader.
134
+ * - `announcement`: The string announced by the screen reader.
135
+ * - `options`: An object that configures the reading options.
136
+ * - `queue`: The announcement will be queued behind existing announcements. iOS only.
137
+ */
138
+ announceForAccessibilityWithOptions(
139
+ announcement: string,
140
+ options: {queue?: boolean},
141
+ ): void;
142
+
114
143
  /**
115
144
  * Gets the timeout in millisecond that the user needs.
116
145
  * This value is set in "Time to take action (Accessibility timeout)" of "Accessibility" settings.
@@ -829,8 +829,8 @@ export class ScrollView extends ScrollViewBase {
829
829
  y?: number | undefined;
830
830
  animated?: boolean | undefined;
831
831
  },
832
- x?: number,
833
- animated?: boolean,
832
+ deprecatedX?: number,
833
+ deprecatedAnimated?: boolean,
834
834
  ): void;
835
835
 
836
836
  /**
@@ -841,7 +841,7 @@ export class ScrollView extends ScrollViewBase {
841
841
  * The options object has an animated prop, that enables the scrolling animation or not.
842
842
  * The animated prop defaults to true
843
843
  */
844
- scrollToEnd(options?: {animated: boolean}): void;
844
+ scrollToEnd(options?: {animated?: boolean}): void;
845
845
 
846
846
  /**
847
847
  * Displays the scroll indicators momentarily.
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 71,
15
15
  patch: 0,
16
- prerelease: 'rc.4',
16
+ prerelease: 'rc.5',
17
17
  };
@@ -19,48 +19,6 @@ import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
19
19
  import {View} from '../Components/View/View';
20
20
 
21
21
  export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
22
- /**
23
- * Rendered in between each item, but not at the top or bottom
24
- */
25
- ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
26
-
27
- /**
28
- * Rendered when the list is empty.
29
- */
30
- ListEmptyComponent?:
31
- | React.ComponentType<any>
32
- | React.ReactElement
33
- | null
34
- | undefined;
35
-
36
- /**
37
- * Rendered at the very end of the list.
38
- */
39
- ListFooterComponent?:
40
- | React.ComponentType<any>
41
- | React.ReactElement
42
- | null
43
- | undefined;
44
-
45
- /**
46
- * Styling for internal View for ListFooterComponent
47
- */
48
- ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
49
-
50
- /**
51
- * Rendered at the very beginning of the list.
52
- */
53
- ListHeaderComponent?:
54
- | React.ComponentType<any>
55
- | React.ReactElement
56
- | null
57
- | undefined;
58
-
59
- /**
60
- * Styling for internal View for ListHeaderComponent
61
- */
62
- ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
63
-
64
22
  /**
65
23
  * Optional custom style for multi-item rows generated when numColumns > 1
66
24
  */
@@ -248,6 +206,7 @@ export class FlatList<ItemT = any> extends React.Component<
248
206
  scrollToItem: (params: {
249
207
  animated?: boolean | null | undefined;
250
208
  item: ItemT;
209
+ viewOffset?: number | undefined;
251
210
  viewPosition?: number | undefined;
252
211
  }) => void;
253
212
 
@@ -334,6 +334,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
334
334
  scrollToItem(params: {
335
335
  animated?: ?boolean,
336
336
  item: ItemT,
337
+ viewOffset?: number,
337
338
  viewPosition?: number,
338
339
  ...
339
340
  }) {
@@ -61,48 +61,6 @@ export type SectionListRenderItem<ItemT, SectionT = DefaultSectionT> = (
61
61
 
62
62
  export interface SectionListProps<ItemT, SectionT = DefaultSectionT>
63
63
  extends VirtualizedListWithoutRenderItemProps<ItemT> {
64
- /**
65
- * Rendered in between adjacent Items within each section.
66
- */
67
- ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
68
-
69
- /**
70
- * Rendered when the list is empty.
71
- */
72
- ListEmptyComponent?:
73
- | React.ComponentType<any>
74
- | React.ReactElement
75
- | null
76
- | undefined;
77
-
78
- /**
79
- * Rendered at the very end of the list.
80
- */
81
- ListFooterComponent?:
82
- | React.ComponentType<any>
83
- | React.ReactElement
84
- | null
85
- | undefined;
86
-
87
- /**
88
- * Styling for internal View for ListFooterComponent
89
- */
90
- ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined | null;
91
-
92
- /**
93
- * Rendered at the very beginning of the list.
94
- */
95
- ListHeaderComponent?:
96
- | React.ComponentType<any>
97
- | React.ReactElement
98
- | null
99
- | undefined;
100
-
101
- /**
102
- * Styling for internal View for ListHeaderComponent
103
- */
104
- ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined | null;
105
-
106
64
  /**
107
65
  * Rendered in between each section.
108
66
  */
@@ -9,7 +9,14 @@
9
9
 
10
10
  import type * as React from 'react';
11
11
  import type {LayoutChangeEvent} from '../../types';
12
- import type {ScrollViewProps} from '../Components/ScrollView/ScrollView';
12
+ import {StyleProp} from '../StyleSheet/StyleSheet';
13
+ import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
14
+ import type {
15
+ ScrollResponderMixin,
16
+ ScrollView,
17
+ ScrollViewProps,
18
+ } from '../Components/ScrollView/ScrollView';
19
+ import type {View} from '../Components/View/View';
13
20
 
14
21
  export interface ViewToken {
15
22
  item: any;
@@ -96,6 +103,7 @@ export class VirtualizedList<ItemT> extends React.Component<
96
103
  scrollToItem: (params: {
97
104
  animated?: boolean | undefined;
98
105
  item: ItemT;
106
+ viewOffset?: number | undefined;
99
107
  viewPosition?: number | undefined;
100
108
  }) => void;
101
109
 
@@ -111,6 +119,13 @@ export class VirtualizedList<ItemT> extends React.Component<
111
119
  }) => void;
112
120
 
113
121
  recordInteraction: () => void;
122
+
123
+ getScrollRef: () =>
124
+ | React.ElementRef<typeof ScrollView>
125
+ | React.ElementRef<typeof View>
126
+ | null;
127
+
128
+ getScrollResponder: () => ScrollResponderMixin | null;
114
129
  }
115
130
 
116
131
  /**
@@ -124,6 +139,11 @@ export interface VirtualizedListProps<ItemT>
124
139
 
125
140
  export interface VirtualizedListWithoutRenderItemProps<ItemT>
126
141
  extends ScrollViewProps {
142
+ /**
143
+ * Rendered in between each item, but not at the top or bottom
144
+ */
145
+ ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
146
+
127
147
  /**
128
148
  * Rendered when the list is empty. Can be a React Component Class, a render function, or
129
149
  * a rendered element.
@@ -144,6 +164,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
144
164
  | null
145
165
  | undefined;
146
166
 
167
+ /**
168
+ * Styling for internal View for ListFooterComponent
169
+ */
170
+ ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
171
+
147
172
  /**
148
173
  * Rendered at the top of all the items. Can be a React Component Class, a render function, or
149
174
  * a rendered element.
@@ -154,6 +179,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
154
179
  | null
155
180
  | undefined;
156
181
 
182
+ /**
183
+ * Styling for internal View for ListHeaderComponent
184
+ */
185
+ ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
186
+
157
187
  /**
158
188
  * The default accessor functions assume this is an Array<{key: string}> but you can override
159
189
  * getItem, getItemCount, and keyExtractor to handle any type of index-based data.
@@ -263,6 +263,7 @@ export default class VirtualizedList extends StateSafePureComponent<
263
263
  scrollToItem(params: {
264
264
  animated?: ?boolean,
265
265
  item: Item,
266
+ viewOffset?: number,
266
267
  viewPosition?: number,
267
268
  ...
268
269
  }) {
@@ -49,6 +49,11 @@ export interface PushNotification {
49
49
  */
50
50
  getData(): Object;
51
51
 
52
+ /**
53
+ * Gets the thread ID on the notif
54
+ */
55
+ getThreadId(): string;
56
+
52
57
  /**
53
58
  * iOS Only
54
59
  * Signifies remote notification handling is complete
@@ -135,6 +140,21 @@ export interface PushNotificationIOSStatic {
135
140
  */
136
141
  cancelAllLocalNotifications(): void;
137
142
 
143
+ /**
144
+ * Remove all delivered notifications from Notification Center.
145
+ */
146
+ removeAllDeliveredNotifications(): void;
147
+
148
+ /**
149
+ * Provides you with a list of the app’s notifications that are still displayed in Notification Center.
150
+ */
151
+ getDeliveredNotifications(callback: (notifications: Object[]) => void): void;
152
+
153
+ /**
154
+ * Removes the specified notifications from Notification Center
155
+ */
156
+ removeDeliveredNotifications(identifiers: string[]): void;
157
+
138
158
  /**
139
159
  * Cancel local notifications.
140
160
  * Optionally restricts the set of canceled notifications to those notifications whose userInfo fields match the corresponding fields in the userInfo argument.
@@ -8,9 +8,12 @@
8
8
  */
9
9
 
10
10
  import type * as React from 'react';
11
+ import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
11
12
 
12
13
  type Task = (taskData: any) => Promise<void>;
13
14
  type TaskProvider = () => Task;
15
+ type TaskCanceller = () => void;
16
+ type TaskCancelProvider = () => TaskCanceller;
14
17
 
15
18
  export type ComponentProvider = () => React.ComponentType<any>;
16
19
 
@@ -22,6 +25,15 @@ export type AppConfig = {
22
25
  run?: Runnable | undefined;
23
26
  };
24
27
 
28
+ export type ComponentProviderInstrumentationHook = (
29
+ component: ComponentProvider,
30
+ scopedPerformanceLogger: IPerformanceLogger,
31
+ ) => React.ComponentType<any>;
32
+
33
+ export type WrapperComponentProvider = (
34
+ appParameters: any,
35
+ ) => React.ComponentType<any>;
36
+
25
37
  /**
26
38
  * `AppRegistry` is the JS entry point to running all React Native apps. App
27
39
  * root components should register themselves with
@@ -38,17 +50,31 @@ export type AppConfig = {
38
50
  * `require`d.
39
51
  */
40
52
  export namespace AppRegistry {
53
+ export function setWrapperComponentProvider(
54
+ provider: WrapperComponentProvider,
55
+ ): void;
56
+
41
57
  export function registerConfig(config: AppConfig[]): void;
42
58
 
43
59
  export function registerComponent(
44
60
  appKey: string,
45
61
  getComponentFunc: ComponentProvider,
62
+ section?: boolean,
46
63
  ): string;
47
64
 
48
65
  export function registerRunnable(appKey: string, func: Runnable): string;
49
66
 
67
+ export function registerSection(
68
+ appKey: string,
69
+ component: ComponentProvider,
70
+ ): void;
71
+
50
72
  export function getAppKeys(): string[];
51
73
 
74
+ export function getSectionKeys(): string[];
75
+
76
+ export function getSections(): Record<string, Runnable>;
77
+
52
78
  export function unmountApplicationComponentAtRootTag(rootTag: number): void;
53
79
 
54
80
  export function runApplication(appKey: string, appParameters: any): void;
@@ -65,4 +91,29 @@ export namespace AppRegistry {
65
91
  ): void;
66
92
 
67
93
  export function getRunnable(appKey: string): Runnable | undefined;
94
+
95
+ export function getRegistry(): {sections: string[]; runnables: Runnable[]};
96
+
97
+ export function setComponentProviderInstrumentationHook(
98
+ hook: ComponentProviderInstrumentationHook,
99
+ ): void;
100
+
101
+ export function registerHeadlessTask(
102
+ taskKey: string,
103
+ taskProvider: TaskProvider,
104
+ ): void;
105
+
106
+ export function registerCancellableHeadlessTask(
107
+ taskKey: string,
108
+ taskProvider: TaskProvider,
109
+ taskCancelProvider: TaskCancelProvider,
110
+ ): void;
111
+
112
+ export function startHeadlessTask(
113
+ taskId: number,
114
+ taskKey: string,
115
+ data: any,
116
+ ): void;
117
+
118
+ export function cancelHeadlessTask(taskId: number, taskKey: string): void;
68
119
  }
@@ -51,7 +51,9 @@ export type Registry = {
51
51
  runnables: Runnables,
52
52
  ...
53
53
  };
54
- export type WrapperComponentProvider = any => React$ComponentType<any>;
54
+ export type WrapperComponentProvider = (
55
+ appParameters: any,
56
+ ) => React$ComponentType<any>;
55
57
 
56
58
  const runnables: Runnables = {};
57
59
  let runCount = 1;
@@ -0,0 +1,13 @@
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
+ * @format
8
+ */
9
+
10
+ import type * as React from 'react';
11
+
12
+ export type RootTag = number;
13
+ export const RootTagContext: React.Context<RootTag>;
@@ -87,9 +87,13 @@ export namespace StyleSheet {
87
87
  * an array, saving allocations and maintaining reference equality for
88
88
  * PureComponent checks.
89
89
  */
90
- export function compose<T>(
91
- style1: StyleProp<T> | Array<StyleProp<T>>,
92
- style2: StyleProp<T> | Array<StyleProp<T>>,
90
+ export function compose<
91
+ T extends ViewStyle | TextStyle | ImageStyle,
92
+ U extends T,
93
+ V extends T,
94
+ >(
95
+ style1: StyleProp<U> | Array<StyleProp<U>>,
96
+ style2: StyleProp<V> | Array<StyleProp<V>>,
93
97
  ): StyleProp<T>;
94
98
 
95
99
  /**
@@ -236,7 +236,6 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
236
236
  borderTopWidth?: number | undefined;
237
237
  borderWidth?: number | undefined;
238
238
  opacity?: number | undefined;
239
- testID?: string | undefined;
240
239
  /**
241
240
  * Sets the elevation of a view, using Android's underlying
242
241
  * [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
@@ -0,0 +1,48 @@
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
+ * @format
8
+ */
9
+
10
+ export type Timespan = {
11
+ startTime: number;
12
+ endTime?: number;
13
+ totalTime?: number;
14
+ startExtras?: Extras;
15
+ endExtras?: Extras;
16
+ };
17
+
18
+ // Extra values should be serializable primitives
19
+ export type ExtraValue = number | string | boolean;
20
+
21
+ export type Extras = {[key: string]: ExtraValue};
22
+
23
+ export interface IPerformanceLogger {
24
+ addTimespan(
25
+ key: string,
26
+ startTime: number,
27
+ endTime: number,
28
+ startExtras?: Extras,
29
+ endExtras?: Extras,
30
+ ): void;
31
+ append(logger: IPerformanceLogger): void;
32
+ clear(): void;
33
+ clearCompleted(): void;
34
+ close(): void;
35
+ currentTimestamp(): number;
36
+ getExtras(): {[key: string]: ExtraValue | null};
37
+ getPoints(): {[key: string]: number | null};
38
+ getPointExtras(): {[key: string]: Extras | null};
39
+ getTimespans(): {[key: string]: Timespan | null};
40
+ hasTimespan(key: string): boolean;
41
+ isClosed(): boolean;
42
+ logEverything(): void;
43
+ markPoint(key: string, timestamp?: number, extras?: Extras): void;
44
+ removeExtra(key: string): ExtraValue | null;
45
+ setExtra(key: string, value: ExtraValue): void;
46
+ startTimespan(key: string, timestamp?: number, extras?: Extras): void;
47
+ stopTimespan(key: string, timestamp?: number, extras?: Extras): void;
48
+ }
@@ -31,7 +31,7 @@
31
31
  * V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed)
32
32
  */
33
33
  export interface VibrationStatic {
34
- vibrate(pattern?: number | number[] | null, repeat?: boolean | null): void;
34
+ vibrate(pattern?: number | number[], repeat?: boolean): void;
35
35
 
36
36
  /**
37
37
  * Stop vibration
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(71),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.4",
27
+ RCTVersionPrerelease: @"rc.5",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -92,6 +92,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
92
92
  "react_newarchdefaults",
93
93
  new Pair("src/main/jni/react/newarchdefaults", "")
94
94
  ),
95
+ new PrefabPreprocessingEntry(
96
+ "react_render_animations",
97
+ new Pair("../ReactCommon/react/renderer/animations/", "react/renderer/animations/")
98
+ ),
95
99
  new PrefabPreprocessingEntry(
96
100
  "react_render_core",
97
101
  new Pair("../ReactCommon/react/renderer/core/", "react/renderer/core/")
@@ -118,7 +122,7 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
118
122
  new PrefabPreprocessingEntry(
119
123
  "fabricjni",
120
124
  [
121
- new Pair("src/main/jni/react/fabric", ""),
125
+ new Pair("src/main/jni/react/fabric", "react/fabric/"),
122
126
  new Pair("src/main/jni/react/cxxcomponents", "react/cxxcomponents/")
123
127
  ]
124
128
  ),
@@ -453,6 +457,7 @@ android {
453
457
  "react_debug",
454
458
  "react_render_componentregistry",
455
459
  "react_newarchdefaults",
460
+ "react_render_animations",
456
461
  "react_render_core",
457
462
  "react_render_graphics",
458
463
  "rrc_image",
@@ -538,6 +543,9 @@ android {
538
543
  react_newarchdefaults {
539
544
  headers(new File(prefabHeadersDir, "react_newarchdefaults").absolutePath)
540
545
  }
546
+ react_render_animations {
547
+ headers(new File(prefabHeadersDir, "react_render_animations").absolutePath)
548
+ }
541
549
  react_render_core {
542
550
  headers(new File(prefabHeadersDir, "react_render_core").absolutePath)
543
551
  }
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.71.0-rc.4
1
+ VERSION_NAME=0.71.0-rc.5
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 71,
20
20
  "patch", 0,
21
- "prerelease", "rc.4");
21
+ "prerelease", "rc.5");
22
22
  }
@@ -7,8 +7,8 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #include <ComponentFactory.h>
11
10
  #include <fbjni/fbjni.h>
11
+ #include <react/fabric/ComponentFactory.h>
12
12
  #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
13
13
  #include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
14
14
  #include <react/renderer/core/ConcreteComponentDescriptor.h>
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 71;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.4";
21
+ std::string_view Prerelease = "rc.5";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -2540,6 +2540,11 @@ static void YGJustifyMainAxis(
2540
2540
  const YGNodeRef child = node->getChild(i);
2541
2541
  const YGStyle& childStyle = child->getStyle();
2542
2542
  const YGLayout childLayout = child->getLayout();
2543
+ const bool isLastChild = i == collectedFlexItemsValues.endOfLineIndex - 1;
2544
+ // remove the gap if it is the last element of the line
2545
+ if (isLastChild) {
2546
+ betweenMainDim -= gap;
2547
+ }
2543
2548
  if (childStyle.display() == YGDisplayNone) {
2544
2549
  continue;
2545
2550
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.71.0-rc.4",
3
+ "version": "0.71.0-rc.5",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -97,7 +97,8 @@
97
97
  "test-e2e-local": "node ./scripts/test-e2e-local.js",
98
98
  "test-e2e-local-clean": "node ./scripts/test-e2e-local-clean.js",
99
99
  "test-ios": "./scripts/objc-test.sh test",
100
- "test-typescript": "dtslint types"
100
+ "test-typescript": "dtslint types",
101
+ "test-typescript-offline": "dtslint --localTs node_modules/typescript/lib types"
101
102
  },
102
103
  "peerDependencies": {
103
104
  "react": "18.2.0"
@@ -127,7 +128,7 @@
127
128
  "pretty-format": "^26.5.2",
128
129
  "promise": "^8.3.0",
129
130
  "react-devtools-core": "^4.26.1",
130
- "react-native-gradle-plugin": "^0.71.11",
131
+ "react-native-gradle-plugin": "^0.71.12",
131
132
  "react-refresh": "^0.4.0",
132
133
  "react-shallow-renderer": "^16.15.0",
133
134
  "regenerator-runtime": "^0.13.2",
@@ -306,14 +306,25 @@ class CodegenUtils
306
306
  return @@CLEANUP_DONE
307
307
  end
308
308
 
309
- def self.clean_up_build_folder(app_path, codegen_dir)
309
+ def self.clean_up_build_folder(app_path, ios_folder, codegen_dir)
310
310
  return if CodegenUtils.cleanup_done()
311
311
  CodegenUtils.set_cleanup_done(true)
312
312
 
313
- codegen_path = File.join(app_path, codegen_dir)
313
+ codegen_path = File.join(app_path, ios_folder, codegen_dir)
314
314
  return if !Dir.exist?(codegen_path)
315
315
 
316
316
  FileUtils.rm_rf(Dir.glob("#{codegen_path}/*"))
317
- CodegenUtils.set_cleanup_done(true)
317
+ CodegenUtils.assert_codegen_folder_is_empty(app_path, ios_folder, codegen_dir)
318
+ end
319
+
320
+ # Need to split this function from the previous one to be able to test it properly.
321
+ def self.assert_codegen_folder_is_empty(app_path, ios_folder, codegen_dir)
322
+ # double check that the files have actually been deleted.
323
+ # Emit an error message if not.
324
+ codegen_path = File.join(app_path, ios_folder, codegen_dir)
325
+ if Dir.exist?(codegen_path) && Dir.glob("#{codegen_path}/*").length() != 0
326
+ Pod::UI.warn "Unable to remove the content of #{codegen_path} folder. Please run rm -rf #{codegen_path} and try again."
327
+ abort
328
+ end
318
329
  end
319
330
  end
@@ -76,12 +76,13 @@ class NewArchitectureHelper
76
76
  spec.compiler_flags = compiler_flags.empty? ? @@folly_compiler_flags : "#{compiler_flags} #{@@folly_compiler_flags}"
77
77
  current_config["HEADER_SEARCH_PATHS"] = current_headers.empty? ? boost_search_path : "#{current_headers} #{boost_search_path}"
78
78
  current_config["CLANG_CXX_LANGUAGE_STANDARD"] = @@cplusplus_version
79
- spec.pod_target_xcconfig = current_config
79
+
80
80
 
81
81
  spec.dependency "React-Core"
82
82
  spec.dependency "RCT-Folly", '2021.07.22.00'
83
83
 
84
84
  if new_arch_enabled
85
+ current_config["OTHER_CPLUSPLUSFLAGS"] = @@new_arch_cpp_flags
85
86
  spec.dependency "React-RCTFabric" # This is for Fabric Component
86
87
  spec.dependency "React-Codegen"
87
88
 
@@ -90,6 +91,8 @@ class NewArchitectureHelper
90
91
  spec.dependency "ReactCommon/turbomodule/bridging"
91
92
  spec.dependency "ReactCommon/turbomodule/core"
92
93
  end
94
+
95
+ spec.pod_target_xcconfig = current_config
93
96
  end
94
97
 
95
98
  def self.folly_compiler_flags
@@ -163,4 +163,26 @@ class ReactNativePodsUtils
163
163
 
164
164
  system("echo 'export NODE_BINARY=$(command -v node)' > #{file_path}")
165
165
  end
166
+
167
+ # It examines the target_definition property and sets the appropriate value for
168
+ # ENV['USE_FRAMEWORKS'] variable.
169
+ #
170
+ # - parameter target_definition: The current target definition
171
+ def self.detect_use_frameworks(target_definition)
172
+ if ENV['USE_FRAMEWORKS'] != nil
173
+ return
174
+ end
175
+
176
+ framework_build_type = target_definition.build_type.to_s
177
+
178
+ Pod::UI.puts("Framework build type is #{framework_build_type}")
179
+
180
+ if framework_build_type === "static framework"
181
+ ENV['USE_FRAMEWORKS'] = 'static'
182
+ elsif framework_build_type === "dynamic framework"
183
+ ENV['USE_FRAMEWORKS'] = 'dynamic'
184
+ else
185
+ ENV['USE_FRAMEWORKS'] = nil
186
+ end
187
+ end
166
188
  end
@@ -51,6 +51,7 @@ end
51
51
  # - flipper_configuration: The configuration to use for flipper.
52
52
  # - app_path: path to the React Native app. Required by the New Architecture.
53
53
  # - config_file_dir: directory of the `package.json` file, required by the New Architecture.
54
+ # - ios_folder: the folder where the iOS code base lives. For a template app, it is `ios`, the default. For RNTester, it is `.`.
54
55
  def use_react_native! (
55
56
  path: "../node_modules/react-native",
56
57
  fabric_enabled: false,
@@ -59,9 +60,15 @@ def use_react_native! (
59
60
  hermes_enabled: ENV['USE_HERMES'] && ENV['USE_HERMES'] == '0' ? false : true,
60
61
  flipper_configuration: FlipperConfiguration.disabled,
61
62
  app_path: '..',
62
- config_file_dir: '')
63
+ config_file_dir: '',
64
+ ios_folder: 'ios'
65
+ )
63
66
 
64
- CodegenUtils.clean_up_build_folder(app_path, $CODEGEN_OUTPUT_DIR)
67
+ # Current target definition is provided by Cocoapods and it refers to the target
68
+ # that has invoked the `use_react_native!` function.
69
+ ReactNativePodsUtils.detect_use_frameworks(current_target_definition)
70
+
71
+ CodegenUtils.clean_up_build_folder(app_path, ios_folder, $CODEGEN_OUTPUT_DIR)
65
72
 
66
73
  # We are relying on this flag also in third parties libraries to proper install dependencies.
67
74
  # Better to rely and enable this environment flag if the new architecture is turned on using flags.
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
2
  root: true,
3
- extends: '@react-native',
3
+ extends: '@react-native-community',
4
4
  };
@@ -15,23 +15,7 @@ buildscript {
15
15
  mavenCentral()
16
16
  }
17
17
  dependencies {
18
- classpath("com.android.tools.build:gradle:7.4.0-beta05")
18
+ classpath("com.android.tools.build:gradle:7.3.1")
19
19
  classpath("com.facebook.react:react-native-gradle-plugin")
20
20
  }
21
21
  }
22
-
23
- allprojects {
24
- repositories {
25
- maven {
26
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27
- url("$rootDir/../node_modules/react-native/android")
28
- }
29
- maven {
30
- // Android JSC is installed from npm
31
- url("$rootDir/../node_modules/jsc-android/dist")
32
- }
33
- mavenCentral()
34
- google()
35
- maven { url 'https://www.jitpack.io' }
36
- }
37
- }
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.71.0-rc.4"
14
+ "react-native": "0.71.0-rc.5"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",
package/types/index.d.ts CHANGED
@@ -127,6 +127,7 @@ export * from '../Libraries/PushNotificationIOS/PushNotificationIOS';
127
127
  export * from '../Libraries/ReactNative/AppRegistry';
128
128
  export * from '../Libraries/ReactNative/I18nManager';
129
129
  export * from '../Libraries/ReactNative/RendererProxy';
130
+ export * from '../Libraries/ReactNative/RootTag';
130
131
  export * from '../Libraries/ReactNative/UIManager';
131
132
  export * from '../Libraries/ReactNative/requireNativeComponent';
132
133
  export * from '../Libraries/Settings/Settings';