@office-iss/react-native-win32 0.0.0-canary.273 → 0.0.0-canary.274

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 (55) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +16 -1
  3. package/CHANGELOG.md +12 -4
  4. package/Libraries/Animated/createAnimatedComponent.js +7 -7
  5. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -1
  6. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
  7. package/Libraries/Components/ScrollView/ScrollView.js +4 -4
  8. package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
  9. package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
  10. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +2 -2
  11. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
  12. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
  13. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
  14. package/Libraries/Components/TextInput/TextInput.flow.js +5 -9
  15. package/Libraries/Components/TextInput/TextInput.win32.js +1 -0
  16. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +3 -0
  17. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  18. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
  19. package/Libraries/Components/View/ViewWin32.js +1 -0
  20. package/Libraries/Core/ExceptionsManager.js +44 -27
  21. package/Libraries/Core/ReactNativeVersion.js +1 -1
  22. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
  23. package/Libraries/Core/setUpErrorHandling.js +1 -7
  24. package/Libraries/Image/Image.d.ts +18 -29
  25. package/Libraries/Lists/SectionListModern.js +7 -7
  26. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  27. package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
  28. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  29. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  30. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
  31. package/Libraries/Modal/Modal.js +2 -3
  32. package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
  33. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
  34. package/Libraries/ReactNative/AppContainer.js +1 -1
  35. package/Libraries/ReactNative/DisplayMode.js +1 -1
  36. package/Libraries/ReactNative/RendererImplementation.js +2 -2
  37. package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
  38. package/Libraries/ReactNative/renderApplication.js +6 -4
  39. package/Libraries/ReactNative/requireNativeComponent.js +3 -1
  40. package/Libraries/Renderer/shims/ReactNativeTypes.js +9 -10
  41. package/Libraries/StyleSheet/StyleSheet.js +7 -1
  42. package/Libraries/StyleSheet/StyleSheet.win32.js +7 -1
  43. package/Libraries/Utilities/codegenNativeComponent.js +1 -1
  44. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +1 -1
  45. package/index.js +1 -1
  46. package/index.win32.js +1 -1
  47. package/overrides.json +5 -5
  48. package/package.json +10 -10
  49. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +4 -4
  50. package/src/private/featureflags/ReactNativeFeatureFlags.js +21 -11
  51. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +6 -4
  52. package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
  53. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +6 -0
  54. package/src/private/webapis/performance/Performance.js +1 -1
  55. package/src/private/webapis/performance/UserTiming.js +5 -5
package/.flowconfig CHANGED
@@ -160,4 +160,4 @@ untyped-import
160
160
  untyped-type-import
161
161
 
162
162
  [version]
163
- ^0.250.0
163
+ ^0.251.1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Sat, 23 Nov 2024 06:22:13 GMT",
5
+ "date": "Fri, 06 Dec 2024 06:21:48 GMT",
6
+ "version": "0.0.0-canary.274",
7
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.274",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "yajurgrover24@gmail.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "40c1c59be8c9046213d5eeffae7dfe45caedcb5a",
14
+ "comment": "Integrate 10/31"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Sat, 23 Nov 2024 06:23:15 GMT",
6
21
  "version": "0.0.0-canary.273",
7
22
  "tag": "@office-iss/react-native-win32_v0.0.0-canary.273",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,25 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- <!-- This log was last generated on Sat, 23 Nov 2024 06:22:13 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Fri, 06 Dec 2024 06:21:48 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.0.0-canary.273
7
+ ## 0.0.0-canary.274
8
8
 
9
- Sat, 23 Nov 2024 06:22:13 GMT
9
+ Fri, 06 Dec 2024 06:21:48 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Integrate 10/20 (yajurgrover24@gmail.com)
13
+ - Integrate 10/31 (yajurgrover24@gmail.com)
14
14
 
15
+ ## 0.0.0-canary.273
16
+
17
+ Sat, 23 Nov 2024 06:23:15 GMT
18
+
19
+ ### Changes
20
+
21
+ - Integrate 10/20 (yajurgrover24@gmail.com)
22
+
15
23
  ## 0.0.0-canary.272
16
24
 
17
25
  Fri, 15 Nov 2024 06:22:29 GMT
@@ -35,18 +35,18 @@ export type StrictAnimatedProps<Props: {...}> = $ReadOnly<{
35
35
  passthroughAnimatedPropExplicitValues?: ?Props,
36
36
  }>;
37
37
 
38
- export type AnimatedComponentType<
39
- Props: {...},
40
- +Instance = mixed,
41
- > = React.AbstractComponent<AnimatedProps<Props>, Instance>;
38
+ export type AnimatedComponentType<Props: {...}, +Instance = mixed> = component(
39
+ ref: React.RefSetter<Instance>,
40
+ ...AnimatedProps<Props>
41
+ );
42
42
 
43
43
  export type StrictAnimatedComponentType<
44
44
  Props: {...},
45
45
  +Instance = mixed,
46
- > = React.AbstractComponent<StrictAnimatedProps<Props>, Instance>;
46
+ > = component(ref: React.RefSetter<Instance>, ...StrictAnimatedProps<Props>);
47
47
 
48
48
  export default function createAnimatedComponent<TProps: {...}, TInstance>(
49
- Component: React.AbstractComponent<TProps, TInstance>,
49
+ Component: component(ref: React.RefSetter<TInstance>, ...TProps),
50
50
  ): AnimatedComponentType<TProps, TInstance> {
51
51
  return unstable_createAnimatedComponentWithAllowlist(Component, null);
52
52
  }
@@ -55,7 +55,7 @@ export function unstable_createAnimatedComponentWithAllowlist<
55
55
  TProps: {...},
56
56
  TInstance,
57
57
  >(
58
- Component: React.AbstractComponent<TProps, TInstance>,
58
+ Component: component(ref: React.RefSetter<TInstance>, ...TProps),
59
59
  allowlist: ?AnimatedPropsAllowlist,
60
60
  ): StrictAnimatedComponentType<TProps, TInstance> {
61
61
  const AnimatedComponent = React.forwardRef<
@@ -154,7 +154,7 @@ const ActivityIndicator = (
154
154
  */
155
155
 
156
156
  const ActivityIndicatorWithRef: component(
157
- ref: React.RefSetter<HostComponent<mixed>>,
157
+ ref: React.RefSetter<HostComponent<empty>>,
158
158
  ...props: Props
159
159
  ) = React.forwardRef(ActivityIndicator);
160
160
  ActivityIndicatorWithRef.displayName = 'ActivityIndicator';
@@ -14,8 +14,9 @@ import type {HostComponent} from '../../../Renderer/shims/ReactNativeTypes';
14
14
  import requireNativeComponent from '../../../ReactNative/requireNativeComponent';
15
15
  import * as React from 'react';
16
16
 
17
- const RCTRefreshControl: HostComponent<mixed> =
18
- requireNativeComponent<mixed>('RCTRefreshControl');
17
+ const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
18
+ 'RCTRefreshControl',
19
+ );
19
20
 
20
21
  class RefreshControlMock extends React.Component<{...}> {
21
22
  static latestRef: ?RefreshControlMock;
@@ -371,10 +371,10 @@ type AndroidProps = $ReadOnly<{|
371
371
  fadingEdgeLength?: ?number,
372
372
  |}>;
373
373
 
374
- type StickyHeaderComponentType = React.AbstractComponent<
375
- ScrollViewStickyHeaderProps,
376
- $ReadOnly<interface {setNextHeaderY: number => void}>,
377
- >;
374
+ type StickyHeaderComponentType = component(
375
+ ref?: React.RefSetter<$ReadOnly<interface {setNextHeaderY: number => void}>>,
376
+ ...ScrollViewStickyHeaderProps
377
+ );
378
378
 
379
379
  export type Props = $ReadOnly<{|
380
380
  ...ViewProps,
@@ -14,7 +14,7 @@ import type {Double} from '../../Types/CodegenTypes';
14
14
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
15
15
  import * as React from 'react';
16
16
 
17
- type ScrollViewNativeComponentType = HostComponent<mixed>;
17
+ type ScrollViewNativeComponentType = HostComponent<{...}>;
18
18
  interface NativeCommands {
19
19
  +flashScrollIndicators: (
20
20
  viewRef: React.ElementRef<ScrollViewNativeComponentType>,
@@ -18,5 +18,7 @@ if (__DEV__) {
18
18
  }
19
19
  export default ScrollViewContext;
20
20
 
21
+ // $FlowFixMe[incompatible-type] frozen objects are readonly
21
22
  export const HORIZONTAL: Value = Object.freeze({horizontal: true});
23
+ // $FlowFixMe[incompatible-type] frozen objects are readonly
22
24
  export const VERTICAL: Value = Object.freeze({horizontal: false});
@@ -275,12 +275,12 @@ const ScrollViewStickyHeaderWithForwardedRef: component(
275
275
  : null;
276
276
 
277
277
  return (
278
- /* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly
279
- included in the Animated.View flow type. */
280
278
  <Animated.View
281
279
  collapsable={false}
282
280
  nativeID={props.nativeID}
283
281
  onLayout={_onLayout}
282
+ /* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly
283
+ included in the Animated.View flow type. */
284
284
  ref={ref}
285
285
  style={[
286
286
  child.props.style,
@@ -87,7 +87,7 @@ type Props = $ReadOnly<{|
87
87
  backgroundColor?: ?ColorValue,
88
88
  |}>;
89
89
 
90
- const InputAccessoryView: React.AbstractComponent<Props> = (props: Props) => {
90
+ const InputAccessoryView: React.ComponentType<Props> = (props: Props) => {
91
91
  const {width} = useWindowDimensions();
92
92
 
93
93
  if (Platform.OS === 'ios') {
@@ -18,7 +18,7 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
18
18
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
19
19
  import RCTTextInputViewConfig from './RCTTextInputViewConfig';
20
20
 
21
- type NativeType = HostComponent<mixed>;
21
+ type NativeType = HostComponent<{...}>;
22
22
 
23
23
  type NativeCommands = TextInputNativeCommands<NativeType>;
24
24
 
@@ -35,11 +35,11 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
35
35
  },
36
36
  };
37
37
 
38
- const MultilineTextInputNativeComponent: HostComponent<mixed> =
39
- NativeComponentRegistry.get<mixed>(
38
+ const MultilineTextInputNativeComponent: HostComponent<{...}> =
39
+ NativeComponentRegistry.get<{...}>(
40
40
  'RCTMultilineTextInputView',
41
41
  () => __INTERNAL_VIEW_CONFIG,
42
42
  );
43
43
 
44
44
  // flowlint-next-line unclear-type:off
45
- export default ((MultilineTextInputNativeComponent: any): HostComponent<mixed>);
45
+ export default ((MultilineTextInputNativeComponent: any): HostComponent<{...}>);
@@ -18,7 +18,7 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
18
18
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
19
19
  import RCTTextInputViewConfig from './RCTTextInputViewConfig';
20
20
 
21
- type NativeType = HostComponent<mixed>;
21
+ type NativeType = HostComponent<{...}>;
22
22
 
23
23
  type NativeCommands = TextInputNativeCommands<NativeType>;
24
24
 
@@ -31,11 +31,13 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
31
31
  ...RCTTextInputViewConfig,
32
32
  };
33
33
 
34
- const SinglelineTextInputNativeComponent: HostComponent<mixed> =
35
- NativeComponentRegistry.get<mixed>(
34
+ const SinglelineTextInputNativeComponent: HostComponent<{...}> =
35
+ NativeComponentRegistry.get<{...}>(
36
36
  'RCTSinglelineTextInputView',
37
37
  () => __INTERNAL_VIEW_CONFIG,
38
38
  );
39
39
 
40
40
  // flowlint-next-line unclear-type:off
41
- export default ((SinglelineTextInputNativeComponent: any): HostComponent<mixed>);
41
+ export default ((SinglelineTextInputNativeComponent: any): HostComponent<{
42
+ ...
43
+ }>);
@@ -1086,7 +1086,10 @@ type ImperativeMethods = $ReadOnly<{|
1086
1086
  * or control this param programmatically with native code.
1087
1087
  *
1088
1088
  */
1089
- type InternalTextInput = (props: Props) => React.Node;
1089
+ type InternalTextInput = component(
1090
+ ref: React.RefSetter<$ReadOnly<{...HostInstance, ...ImperativeMethods}>>,
1091
+ ...Props
1092
+ );
1090
1093
 
1091
1094
  export type TextInputComponentStatics = $ReadOnly<{|
1092
1095
  State: $ReadOnly<{|
@@ -1097,11 +1100,4 @@ export type TextInputComponentStatics = $ReadOnly<{|
1097
1100
  |}>,
1098
1101
  |}>;
1099
1102
 
1100
- export type TextInputType = React.AbstractComponent<
1101
- React.ElementConfig<InternalTextInput>,
1102
- $ReadOnly<{|
1103
- ...HostInstance,
1104
- ...ImperativeMethods,
1105
- |}>,
1106
- > &
1107
- TextInputComponentStatics;
1103
+ export type TextInputType = InternalTextInput & TextInputComponentStatics;
@@ -1368,6 +1368,7 @@ function InternalTextInput(props: Props): React.Node {
1368
1368
  mostRecentEventCount,
1369
1369
  selection,
1370
1370
  text,
1371
+ // $FlowFixMe[incompatible-call]
1371
1372
  viewCommands,
1372
1373
  });
1373
1374
 
@@ -8,6 +8,8 @@ import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
8
8
  import requireNativeComponent from '../../ReactNative/requireNativeComponent';
9
9
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
10
10
  import type {TextInputNativeCommands} from './TextInputNativeCommands';
11
+
12
+ // $FlowFixMe[incompatible-type-arg]
11
13
  type NativeType = HostComponent<mixed>;
12
14
 
13
15
  type NativeCommands = TextInputNativeCommands<NativeType>;
@@ -17,6 +19,7 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
17
19
  });
18
20
 
19
21
  const WindowsTextInputComponent: NativeType =
22
+ // $FlowFixMe[incompatible-call]
20
23
  requireNativeComponent<mixed>('RCTTextInput');
21
24
 
22
25
  export default WindowsTextInputComponent;
@@ -189,6 +189,7 @@ class TouchableBounce extends React.Component<Props, State> {
189
189
  this.props.onPress !== undefined &&
190
190
  !this.props.disabled
191
191
  }
192
+ // $FlowFixMe[prop-missing]
192
193
  ref={this.props.hostRef}
193
194
  {...eventHandlersWithoutBlurAndFocus}>
194
195
  {this.props.children}
@@ -291,6 +291,7 @@ class TouchableOpacity extends React.Component<Props, State> {
291
291
  this.props.onPress !== undefined &&
292
292
  !this.props.disabled
293
293
  }
294
+ // $FlowFixMe[prop-missing]
294
295
  ref={this.props.hostRef}
295
296
  {...eventHandlersWithoutBlurAndFocus}>
296
297
  {this.props.children}
@@ -19,6 +19,7 @@ import warnOnce from '../../Utilities/warnOnce';
19
19
  * Basic View component with additional Win32 specific functionality
20
20
  */
21
21
 
22
+ // $FlowFixMe[prop-missing]
22
23
  const ViewWin32: React.AbstractComponent<
23
24
  ViewProps,
24
25
  React.ElementRef<typeof View>,
@@ -141,24 +141,31 @@ let inExceptionHandler = false;
141
141
  * Logs exceptions to the (native) console and displays them
142
142
  */
143
143
  function handleException(e: mixed, isFatal: boolean) {
144
- let error: Error;
145
- if (e instanceof Error) {
146
- error = e;
147
- } else {
148
- // Workaround for reporting errors caused by `throw 'some string'`
149
- // Unfortunately there is no way to figure out the stacktrace in this
150
- // case, so if you ended up here trying to trace an error, look for
151
- // `throw '<error message>'` somewhere in your codebase.
152
- error = new SyntheticError(e);
153
- }
154
- try {
155
- inExceptionHandler = true;
156
- /* $FlowFixMe[class-object-subtyping] added when improving typing for this
157
- * parameters */
158
- // $FlowFixMe[incompatible-call]
159
- reportException(error, isFatal, /*reportToConsole*/ true);
160
- } finally {
161
- inExceptionHandler = false;
144
+ // TODO(T196834299): We should really use a c++ turbomodule for this
145
+ const reportToConsole = true;
146
+ if (
147
+ !global.RN$handleException ||
148
+ !global.RN$handleException(e, isFatal, reportToConsole)
149
+ ) {
150
+ let error: Error;
151
+ if (e instanceof Error) {
152
+ error = e;
153
+ } else {
154
+ // Workaround for reporting errors caused by `throw 'some string'`
155
+ // Unfortunately there is no way to figure out the stacktrace in this
156
+ // case, so if you ended up here trying to trace an error, look for
157
+ // `throw '<error message>'` somewhere in your codebase.
158
+ error = new SyntheticError(e);
159
+ }
160
+ try {
161
+ inExceptionHandler = true;
162
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for this
163
+ * parameters */
164
+ // $FlowFixMe[incompatible-call]
165
+ reportException(error, isFatal, reportToConsole);
166
+ } finally {
167
+ inExceptionHandler = false;
168
+ }
162
169
  }
163
170
  }
164
171
 
@@ -170,7 +177,10 @@ function reactConsoleErrorHandler(...args) {
170
177
  if (!console.reportErrorsAsExceptions) {
171
178
  return;
172
179
  }
173
- if (inExceptionHandler) {
180
+ if (
181
+ inExceptionHandler ||
182
+ (global.RN$inExceptionHandler && global.RN$inExceptionHandler())
183
+ ) {
174
184
  // The fundamental trick here is that are multiple entry point to logging errors:
175
185
  // (see D19743075 for more background)
176
186
  //
@@ -224,14 +234,21 @@ function reactConsoleErrorHandler(...args) {
224
234
  error.name = 'console.error';
225
235
  }
226
236
 
227
- reportException(
228
- /* $FlowFixMe[class-object-subtyping] added when improving typing for this
229
- * parameters */
230
- // $FlowFixMe[incompatible-call]
231
- error,
232
- false, // isFatal
233
- false, // reportToConsole
234
- );
237
+ const isFatal = false;
238
+ const reportToConsole = false;
239
+ if (
240
+ !global.RN$handleException ||
241
+ !global.RN$handleException(error, isFatal, reportToConsole)
242
+ ) {
243
+ reportException(
244
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for this
245
+ * parameters */
246
+ // $FlowFixMe[incompatible-call]
247
+ error,
248
+ isFatal,
249
+ reportToConsole,
250
+ );
251
+ }
235
252
  }
236
253
 
237
254
  /**
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: 'nightly-20241020-e7a3f479f',
20
+ prerelease: 'nightly-20241031-3a01a0c9c',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -14,7 +14,6 @@ import typeof NativeExceptionsManager from '../NativeExceptionsManager';
14
14
  export default ({
15
15
  reportFatalException: jest.fn(),
16
16
  reportSoftException: jest.fn(),
17
- updateExceptionMessage: jest.fn(),
18
17
  dismissRedbox: jest.fn(),
19
18
  reportException: jest.fn(),
20
19
  }: NativeExceptionsManager);
@@ -21,13 +21,7 @@ ExceptionsManager.installConsoleErrorReporter();
21
21
  if (!global.__fbDisableExceptionsManager) {
22
22
  const handleError = (e: mixed, isFatal: boolean) => {
23
23
  try {
24
- // TODO(T196834299): We should really use a c++ turbomodule for this
25
- if (
26
- !global.RN$handleException ||
27
- !global.RN$handleException(e, isFatal)
28
- ) {
29
- ExceptionsManager.handleException(e, isFatal);
30
- }
24
+ ExceptionsManager.handleException(e, isFatal);
31
25
  } catch (ee) {
32
26
  console.log('Failed to print error: ', ee.message);
33
27
  throw e;
@@ -60,18 +60,28 @@ export interface ImagePropsIOS {
60
60
  interface ImagePropsAndroid {
61
61
  /**
62
62
  * The mechanism that should be used to resize the image when the image's dimensions
63
- * differ from the image view's dimensions. Defaults to auto.
63
+ * differ from the image view's dimensions. Defaults to `auto`.
64
64
  *
65
- * 'auto': Use heuristics to pick between resize and scale.
65
+ * - `auto`: Use heuristics to pick between `resize` and `scale`.
66
66
  *
67
- * 'resize': A software operation which changes the encoded image in memory before it gets decoded.
68
- * This should be used instead of scale when the image is much larger than the view.
67
+ * - `resize`: A software operation which changes the encoded image in memory before it
68
+ * gets decoded. This should be used instead of `scale` when the image is much larger
69
+ * than the view.
69
70
  *
70
- * 'scale': The image gets drawn downscaled or upscaled. Compared to resize, scale is faster (usually hardware accelerated)
71
- * and produces higher quality images. This should be used if the image is smaller than the view.
72
- * It should also be used if the image is slightly bigger than the view.
71
+ * - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
72
+ * faster (usually hardware accelerated) and produces higher quality images. This
73
+ * should be used if the image is smaller than the view. It should also be used if the
74
+ * image is slightly bigger than the view.
75
+ *
76
+ * - `none`: No sampling is performed and the image is displayed in its full resolution. This
77
+ * should only be used in rare circumstances because it is considered unsafe as Android will
78
+ * throw a runtime exception when trying to render images that consume too much memory.
79
+ *
80
+ * More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
81
+ *
82
+ * @platform android
73
83
  */
74
- resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
84
+ resizeMethod?: 'auto' | 'resize' | 'scale' | 'none' | undefined;
75
85
 
76
86
  /**
77
87
  * Duration of fade in animation in ms. Defaults to 300
@@ -193,27 +203,6 @@ export interface ImagePropsBase
193
203
  */
194
204
  resizeMode?: ImageResizeMode | undefined;
195
205
 
196
- /**
197
- * The mechanism that should be used to resize the image when the image's dimensions
198
- * differ from the image view's dimensions. Defaults to `auto`.
199
- *
200
- * - `auto`: Use heuristics to pick between `resize` and `scale`.
201
- *
202
- * - `resize`: A software operation which changes the encoded image in memory before it
203
- * gets decoded. This should be used instead of `scale` when the image is much larger
204
- * than the view.
205
- *
206
- * - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
207
- * faster (usually hardware accelerated) and produces higher quality images. This
208
- * should be used if the image is smaller than the view. It should also be used if the
209
- * image is slightly bigger than the view.
210
- *
211
- * More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
212
- *
213
- * @platform android
214
- */
215
- resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
216
-
217
206
  /**
218
207
  * The image source (either a remote URL or a local file resource).
219
208
  *
@@ -16,7 +16,7 @@ import type {
16
16
  SectionBase as _SectionBase,
17
17
  VirtualizedSectionListProps,
18
18
  } from '@react-native/virtualized-lists';
19
- import type {AbstractComponent, ElementRef} from 'react';
19
+ import type {ElementRef} from 'react';
20
20
 
21
21
  import Platform from '../Utilities/Platform';
22
22
  import {VirtualizedSectionList} from '@react-native/virtualized-lists';
@@ -93,7 +93,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
93
93
  removeClippedSubviews?: boolean,
94
94
  |};
95
95
 
96
- export type Props<SectionT> = {|
96
+ export type Props<SectionT: SectionBase<any>> = $ReadOnly<{|
97
97
  ...$Diff<
98
98
  VirtualizedSectionListProps<SectionT>,
99
99
  {
@@ -115,7 +115,7 @@ export type Props<SectionT> = {|
115
115
  >,
116
116
  ...RequiredProps<SectionT>,
117
117
  ...OptionalProps<SectionT>,
118
- |};
118
+ |}>;
119
119
 
120
120
  /**
121
121
  * A performant interface for rendering sectioned lists, supporting the most handy features:
@@ -172,10 +172,10 @@ export type Props<SectionT> = {|
172
172
  * Alternatively, you can provide a custom `keyExtractor` prop.
173
173
  *
174
174
  */
175
- const SectionList: AbstractComponent<Props<SectionBase<any>>, any> = forwardRef<
176
- Props<SectionBase<any>>,
177
- any,
178
- >((props, ref) => {
175
+ const SectionList: component(
176
+ ref?: React.RefSetter<any>,
177
+ ...Props<SectionBase<any>>
178
+ ) = forwardRef<Props<SectionBase<any>>, any>((props, ref) => {
179
179
  const propsWithDefaults = {
180
180
  stickySectionHeadersEnabled: Platform.OS === 'ios',
181
181
  ...props,
@@ -421,7 +421,7 @@ type State = $ReadOnly<{|
421
421
  selectedLogIndex: number,
422
422
  |}>;
423
423
 
424
- type SubscribedComponent = React.AbstractComponent<
424
+ type SubscribedComponent = React.ComponentType<
425
425
  $ReadOnly<{|
426
426
  logs: $ReadOnlyArray<LogBoxLog>,
427
427
  isDisabled: boolean,
@@ -431,7 +431,7 @@ type SubscribedComponent = React.AbstractComponent<
431
431
 
432
432
  export function withSubscription(
433
433
  WrappedComponent: SubscribedComponent,
434
- ): React.AbstractComponent<{||}> {
434
+ ): React.ComponentType<{||}> {
435
435
  class LogBoxStateSubscription extends React.Component<Props, State> {
436
436
  static getDerivedStateFromError(): {hasError: boolean} {
437
437
  return {hasError: true};
@@ -65,4 +65,4 @@ export class _LogBoxInspectorContainer extends React.Component<Props> {
65
65
 
66
66
  export default (LogBoxData.withSubscription(
67
67
  _LogBoxInspectorContainer,
68
- ): React.AbstractComponent<{||}>);
68
+ ): React.ComponentType<{||}>);
@@ -102,4 +102,4 @@ const styles = StyleSheet.create({
102
102
 
103
103
  export default (LogBoxData.withSubscription(
104
104
  _LogBoxNotificationContainer,
105
- ): React.AbstractComponent<{||}>);
105
+ ): React.ComponentType<{||}>);
@@ -27,7 +27,7 @@ type Props = $ReadOnly<{
27
27
  level: LogLevel,
28
28
  }>;
29
29
 
30
- const LogBoxInspectorHeaderSafeArea: React.AbstractComponent<ViewProps> =
30
+ const LogBoxInspectorHeaderSafeArea: React.ComponentType<ViewProps> =
31
31
  Platform.OS === 'android' ? View : SafeAreaView;
32
32
 
33
33
  export default function LogBoxInspectorHeader(props: Props): React.Node {
@@ -29,7 +29,7 @@ type Props = $ReadOnly<{
29
29
  level: LogLevel,
30
30
  }>;
31
31
 
32
- const LogBoxInspectorHeaderSafeArea: React.AbstractComponent<ViewProps> =
32
+ const LogBoxInspectorHeaderSafeArea: React.ComponentType<ViewProps> =
33
33
  Platform.OS === 'android' ? View : SafeAreaView;
34
34
 
35
35
  export default function LogBoxInspectorHeader(props: Props): React.Node {
@@ -342,8 +342,7 @@ const styles = StyleSheet.create({
342
342
  },
343
343
  });
344
344
 
345
- const ExportedModal: React.AbstractComponent<
346
- React.ElementConfig<typeof Modal>,
347
- > = ModalInjection.unstable_Modal ?? Modal;
345
+ const ExportedModal: React.ComponentType<React.ElementConfig<typeof Modal>> =
346
+ ModalInjection.unstable_Modal ?? Modal;
348
347
 
349
348
  module.exports = ExportedModal;
@@ -48,7 +48,7 @@ export function setRuntimeConfigProvider(
48
48
  * The supplied `viewConfigProvider` may or may not be invoked and utilized,
49
49
  * depending on how `setRuntimeConfigProvider` is configured.
50
50
  */
51
- export function get<Config>(
51
+ export function get<Config: {...}>(
52
52
  name: string,
53
53
  viewConfigProvider: () => PartialViewConfig,
54
54
  ): HostComponent<Config> {
@@ -121,10 +121,10 @@ export function get<Config>(
121
121
  * that the return value of this is not `HostComponent` because the returned
122
122
  * component instance is not guaranteed to have native methods.
123
123
  */
124
- export function getWithFallback_DEPRECATED<Config>(
124
+ export function getWithFallback_DEPRECATED<Config: {...}>(
125
125
  name: string,
126
126
  viewConfigProvider: () => PartialViewConfig,
127
- ): React.AbstractComponent<Config> {
127
+ ): React.ComponentType<Config> {
128
128
  if (getRuntimeConfig == null) {
129
129
  // `getRuntimeConfig == null` when static view configs are disabled
130
130
  // If `setRuntimeConfigProvider` is not configured, use native reflection.
@@ -88,7 +88,7 @@ const PERMISSIONS = Object.freeze({
88
88
  */
89
89
 
90
90
  class PermissionsAndroid {
91
- PERMISSIONS: {|
91
+ PERMISSIONS: $ReadOnly<{|
92
92
  ACCEPT_HANDOVER: string,
93
93
  ACCESS_BACKGROUND_LOCATION: string,
94
94
  ACCESS_COARSE_LOCATION: string,
@@ -132,12 +132,12 @@ class PermissionsAndroid {
132
132
  WRITE_CALL_LOG: string,
133
133
  WRITE_CONTACTS: string,
134
134
  WRITE_EXTERNAL_STORAGE: string,
135
- |} = PERMISSIONS;
136
- RESULTS: {|
135
+ |}> = PERMISSIONS;
136
+ RESULTS: $ReadOnly<{|
137
137
  DENIED: 'denied',
138
138
  GRANTED: 'granted',
139
139
  NEVER_ASK_AGAIN: 'never_ask_again',
140
- |} = PERMISSION_REQUEST_RESULT;
140
+ |}> = PERMISSION_REQUEST_RESULT;
141
141
 
142
142
  /**
143
143
  * DEPRECATED - use check
@@ -24,7 +24,7 @@ export type Props = $ReadOnly<{|
24
24
  internal_excludeInspector?: boolean,
25
25
  |}>;
26
26
 
27
- const AppContainer: React.AbstractComponent<Props> = __DEV__
27
+ const AppContainer: component(...Props) = __DEV__
28
28
  ? require('./AppContainer-dev').default
29
29
  : require('./AppContainer-prod').default;
30
30
 
@@ -12,7 +12,7 @@ export opaque type DisplayModeType = number;
12
12
 
13
13
  /** DisplayMode should be in sync with the method displayModeToInt from
14
14
  * react/renderer/uimanager/primitives.h. */
15
- const DisplayMode: {[string]: DisplayModeType} = Object.freeze({
15
+ const DisplayMode: {+[string]: DisplayModeType} = Object.freeze({
16
16
  VISIBLE: 1,
17
17
  SUSPENDED: 2,
18
18
  HIDDEN: 3,
@@ -136,8 +136,8 @@ export function isProfilingRenderer(): boolean {
136
136
  }
137
137
 
138
138
  export function isChildPublicInstance(
139
- parentInstance: ReactFabricHostComponent | HostComponent<mixed>,
140
- childInstance: ReactFabricHostComponent | HostComponent<mixed>,
139
+ parentInstance: ReactFabricHostComponent | HostComponent<empty>,
140
+ childInstance: ReactFabricHostComponent | HostComponent<empty>,
141
141
  ): boolean {
142
142
  return require('../Renderer/shims/ReactNative').isChildPublicInstance(
143
143
  parentInstance,
@@ -8,11 +8,9 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {AbstractComponent} from 'react';
12
-
13
11
  import * as React from 'react';
14
12
 
15
- type NoopComponent = AbstractComponent<{children: React.Node}>;
13
+ type NoopComponent = component(children: React.Node);
16
14
 
17
15
  const cache: Map<
18
16
  string, // displayName
@@ -23,10 +23,12 @@ import * as React from 'react';
23
23
  // require BackHandler so it sets the default handler that exits the app if no listeners respond
24
24
  import '../Utilities/BackHandler';
25
25
 
26
- type ActivityType = React.AbstractComponent<{
27
- mode: 'visible' | 'hidden',
28
- children: React.Node,
29
- }>;
26
+ type ActivityType = component(
27
+ ...{
28
+ mode: 'visible' | 'hidden',
29
+ children: React.Node,
30
+ }
31
+ );
30
32
 
31
33
  export default function renderApplication<Props: Object>(
32
34
  RootComponent: React.ComponentType<Props>,
@@ -24,7 +24,9 @@ const getNativeComponentAttributes = require('./getNativeComponentAttributes');
24
24
  *
25
25
  */
26
26
 
27
- const requireNativeComponent = <T>(uiViewClassName: string): HostComponent<T> =>
27
+ const requireNativeComponent = <T: {...}>(
28
+ uiViewClassName: string,
29
+ ): HostComponent<T> =>
28
30
  ((createReactNativeComponentClass(uiViewClassName, () =>
29
31
  getNativeComponentAttributes(uiViewClassName),
30
32
  ): any): HostComponent<T>);
@@ -7,15 +7,10 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict
10
- * @generated SignedSource<<448b89d0a61a392d9c1eb921f7d51d37>>
10
+ * @generated SignedSource<<9cf3e28d6ca0299bc0bb5caa75b19556>>
11
11
  */
12
12
 
13
- import type {
14
- ElementRef,
15
- ElementType,
16
- MixedElement,
17
- AbstractComponent,
18
- } from 'react';
13
+ import type {ElementRef, ElementType, MixedElement} from 'react';
19
14
 
20
15
  export type MeasureOnSuccessCallback = (
21
16
  x: number,
@@ -138,7 +133,9 @@ declare const ensureNativeMethodsAreSynced: NativeMethods;
138
133
  (ensureNativeMethodsAreSynced: INativeMethods);
139
134
 
140
135
  export type HostInstance = NativeMethods;
141
- export type HostComponent<Config> = AbstractComponent<Config, HostInstance>;
136
+ /*::
137
+ export type HostComponent<Config: {...}> = component(ref: React$RefSetter<HostInstance>, ...Config);
138
+ */
142
139
 
143
140
  type InspectorDataProps = $ReadOnly<{
144
141
  [propName: string]: string,
@@ -209,8 +206,10 @@ export type ReactNativeType = {
209
206
  componentOrHandle: ?(ElementRef<TElementType> | number),
210
207
  ): ?number,
211
208
  isChildPublicInstance(
212
- parent: PublicInstance | HostComponent<mixed>,
213
- child: PublicInstance | HostComponent<mixed>,
209
+ // eslint-disable-next-line no-undef
210
+ parent: PublicInstance | HostComponent<empty>,
211
+ // eslint-disable-next-line no-undef
212
+ child: PublicInstance | HostComponent<empty>,
214
213
  ): boolean,
215
214
  dispatchCommand(
216
215
  handle: HostInstance,
@@ -170,7 +170,13 @@ if (hairlineWidth === 0) {
170
170
  hairlineWidth = 1 / PixelRatio.get();
171
171
  }
172
172
 
173
- const absoluteFill = {
173
+ const absoluteFill: {
174
+ +bottom: 0,
175
+ +left: 0,
176
+ +position: 'absolute',
177
+ +right: 0,
178
+ +top: 0,
179
+ } = {
174
180
  position: 'absolute',
175
181
  left: 0,
176
182
  right: 0,
@@ -172,7 +172,13 @@ if (hairlineWidth === 0) {
172
172
  hairlineWidth = 1 / PixelRatio.get();
173
173
  }
174
174
 
175
- const absoluteFill = {
175
+ const absoluteFill: {
176
+ +bottom: 0,
177
+ +left: 0,
178
+ +position: 'absolute',
179
+ +right: 0,
180
+ +top: 0,
181
+ } = {
176
182
  position: 'absolute',
177
183
  left: 0,
178
184
  right: 0,
@@ -31,7 +31,7 @@ export type NativeComponentType<T> = HostComponent<T>;
31
31
  // `requireNativeComponent` is not available in Bridgeless mode.
32
32
  // e.g. This function runs at runtime if `codegenNativeComponent` was not called
33
33
  // from a file suffixed with NativeComponent.js.
34
- function codegenNativeComponent<Props>(
34
+ function codegenNativeComponent<Props: {...}>(
35
35
  componentName: string,
36
36
  options?: Options,
37
37
  ): NativeComponentType<Props> {
@@ -17,7 +17,7 @@ import * as React from 'react';
17
17
 
18
18
  function takesHostComponentInstance(instance: HostInstance | null): void {}
19
19
 
20
- const MyHostComponent = (('Host': any): HostComponent<mixed>);
20
+ const MyHostComponent = (('Host': any): HostComponent<{...}>);
21
21
 
22
22
  <MyHostComponent
23
23
  ref={hostComponentRef => {
package/index.js CHANGED
@@ -375,7 +375,7 @@ module.exports = {
375
375
  get processColor(): processColor {
376
376
  return require('./Libraries/StyleSheet/processColor').default;
377
377
  },
378
- get requireNativeComponent(): <T>(
378
+ get requireNativeComponent(): <T: {...}>(
379
379
  uiViewClassName: string,
380
380
  ) => HostComponent<T> {
381
381
  return require('./Libraries/ReactNative/requireNativeComponent').default;
package/index.win32.js CHANGED
@@ -381,7 +381,7 @@ module.exports = {
381
381
  get processColor(): processColor {
382
382
  return require('./Libraries/StyleSheet/processColor').default;
383
383
  },
384
- get requireNativeComponent(): <T>(
384
+ get requireNativeComponent(): <T: {...}>(
385
385
  uiViewClassName: string,
386
386
  ) => HostComponent<T> {
387
387
  return require('./Libraries/ReactNative/requireNativeComponent').default;
package/overrides.json CHANGED
@@ -7,19 +7,19 @@
7
7
  "**/__snapshots__/**",
8
8
  "src-win/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.77.0-nightly-20241020-e7a3f479f",
10
+ "baseVersion": "0.77.0-nightly-20241031-3a01a0c9c",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
14
14
  "file": ".flowconfig",
15
15
  "baseFile": ".flowconfig",
16
- "baseHash": "d824685eb9983c3aecb6d8207eeb0312f3d5a743"
16
+ "baseHash": "16d33187350d986e6c2fd343ff06f8f1c6f64ebf"
17
17
  },
18
18
  {
19
19
  "type": "derived",
20
20
  "file": "src-win/index.win32.js",
21
21
  "baseFile": "packages/react-native/index.js",
22
- "baseHash": "2c80856075b7979d9119fb5e2b4b66b43456c068"
22
+ "baseHash": "5f0532348ca7440731478ef5b119a3a569529a7f"
23
23
  },
24
24
  {
25
25
  "type": "platform",
@@ -304,7 +304,7 @@
304
304
  "type": "patch",
305
305
  "file": "src-win/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js",
306
306
  "baseFile": "packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js",
307
- "baseHash": "9e394821ea51994288aa4626d0fdff7aae1aa0a1",
307
+ "baseHash": "c4a8a3591ffb65360237708c9fb919408835cb76",
308
308
  "issue": 7952
309
309
  },
310
310
  {
@@ -414,7 +414,7 @@
414
414
  "type": "patch",
415
415
  "file": "src-win/Libraries/StyleSheet/StyleSheet.win32.js",
416
416
  "baseFile": "packages/react-native/Libraries/StyleSheet/StyleSheet.js",
417
- "baseHash": "acf84f21e80cce08afd0a56a2f79690641c7228e"
417
+ "baseHash": "46f00f057f504c71fa0feb5695307e3e3806211b"
418
418
  },
419
419
  {
420
420
  "type": "derived",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.0.0-canary.273",
3
+ "version": "0.0.0-canary.274",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,13 +30,13 @@
30
30
  "@react-native-community/cli-platform-android": "15.0.0-alpha.2",
31
31
  "@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
32
32
  "@react-native/assets": "1.0.0",
33
- "@react-native/assets-registry": "0.77.0-nightly-20241020-e7a3f479f",
34
- "@react-native/codegen": "0.77.0-nightly-20241020-e7a3f479f",
35
- "@react-native/community-cli-plugin": "0.77.0-nightly-20241020-e7a3f479f",
36
- "@react-native/gradle-plugin": "0.77.0-nightly-20241020-e7a3f479f",
37
- "@react-native/js-polyfills": "0.77.0-nightly-20241020-e7a3f479f",
38
- "@react-native/normalize-colors": "0.77.0-nightly-20241020-e7a3f479f",
39
- "@react-native/virtualized-lists": "0.77.0-nightly-20241020-e7a3f479f",
33
+ "@react-native/assets-registry": "0.77.0-nightly-20241031-3a01a0c9c",
34
+ "@react-native/codegen": "0.77.0-nightly-20241031-3a01a0c9c",
35
+ "@react-native/community-cli-plugin": "0.77.0-nightly-20241031-3a01a0c9c",
36
+ "@react-native/gradle-plugin": "0.77.0-nightly-20241031-3a01a0c9c",
37
+ "@react-native/js-polyfills": "0.77.0-nightly-20241031-3a01a0c9c",
38
+ "@react-native/normalize-colors": "0.77.0-nightly-20241031-3a01a0c9c",
39
+ "@react-native/virtualized-lists": "0.77.0-nightly-20241031-3a01a0c9c",
40
40
  "abort-controller": "^3.0.0",
41
41
  "anser": "^1.4.9",
42
42
  "ansi-regex": "^5.0.0",
@@ -90,14 +90,14 @@
90
90
  "just-scripts": "^1.3.3",
91
91
  "prettier": "2.8.8",
92
92
  "react": "19.0.0-rc-fb9a90fa48-20240614",
93
- "react-native": "0.77.0-nightly-20241020-e7a3f479f",
93
+ "react-native": "0.77.0-nightly-20241031-3a01a0c9c",
94
94
  "react-native-platform-override": "^1.9.49",
95
95
  "typescript": "5.0.4"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@types/react": "^18.2.6",
99
99
  "react": "^19.0.0-rc-fb9a90fa48-20240614",
100
- "react-native": "0.77.0-nightly-20241020-e7a3f479f"
100
+ "react-native": "0.77.0-nightly-20241031-3a01a0c9c"
101
101
  },
102
102
  "beachball": {
103
103
  "defaultNpmTag": "canary",
@@ -16,10 +16,10 @@ import UIManager from '../../../Libraries/ReactNative/UIManager';
16
16
  import Platform from '../../../Libraries/Utilities/Platform';
17
17
  import * as React from 'react';
18
18
 
19
- const exported: React.AbstractComponent<
20
- ViewProps,
21
- React.ElementRef<typeof View>,
22
- > = Platform.select({
19
+ const exported: component(
20
+ ref?: React.RefSetter<React.ElementRef<typeof View>>,
21
+ ...ViewProps
22
+ ) = Platform.select({
23
23
  ios: require('../../../src/private/specs/components/RCTSafeAreaViewNativeComponent')
24
24
  .default,
25
25
  android: UIManager.hasViewManagerConfig('RCTSafeAreaView')
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<1c91049b99046065031ca8b826ab20a6>>
7
+ * @generated SignedSource<<27ae96c2bc3459bd89e52063a8ed9490>>
8
8
  * @flow strict
9
9
  */
10
10
 
@@ -15,7 +15,7 @@
15
15
  * packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
16
16
  *
17
17
  * To regenerate this code, run the following script from the repo root:
18
- * yarn featureflags-update
18
+ * yarn featureflags --update
19
19
  */
20
20
 
21
21
  import {
@@ -56,10 +56,11 @@ export type ReactNativeFeatureFlags = {
56
56
  batchRenderingUpdatesInEventLoop: Getter<boolean>,
57
57
  completeReactInstanceCreationOnBgThreadOnAndroid: Getter<boolean>,
58
58
  disableEventLoopOnBridgeless: Getter<boolean>,
59
+ disableMountItemReorderingAndroid: Getter<boolean>,
59
60
  enableAlignItemsBaselineOnFabricIOS: Getter<boolean>,
60
61
  enableAndroidLineHeightCentering: Getter<boolean>,
61
62
  enableBridgelessArchitecture: Getter<boolean>,
62
- enableCleanTextInputYogaNode: Getter<boolean>,
63
+ enableCppPropsIteratorSetter: Getter<boolean>,
63
64
  enableDeletionOfUnmountedViews: Getter<boolean>,
64
65
  enableEagerRootViewAttachment: Getter<boolean>,
65
66
  enableEventEmitterRetentionDuringGesturesOnAndroid: Getter<boolean>,
@@ -72,11 +73,11 @@ export type ReactNativeFeatureFlags = {
72
73
  enableLayoutAnimationsOnIOS: Getter<boolean>,
73
74
  enableLongTaskAPI: Getter<boolean>,
74
75
  enableMicrotasks: Getter<boolean>,
76
+ enableNewBackgroundAndBorderDrawables: Getter<boolean>,
75
77
  enablePreciseSchedulingForPremountItemsOnAndroid: Getter<boolean>,
76
78
  enablePropsUpdateReconciliationAndroid: Getter<boolean>,
77
79
  enableReportEventPaintTime: Getter<boolean>,
78
80
  enableSynchronousStateUpdates: Getter<boolean>,
79
- enableTextPreallocationOptimisation: Getter<boolean>,
80
81
  enableUIConsistency: Getter<boolean>,
81
82
  enableViewRecycling: Getter<boolean>,
82
83
  excludeYogaFromRawProps: Getter<boolean>,
@@ -90,6 +91,7 @@ export type ReactNativeFeatureFlags = {
90
91
  loadVectorDrawablesOnImages: Getter<boolean>,
91
92
  setAndroidLayoutDirection: Getter<boolean>,
92
93
  traceTurboModulePromiseRejectionsOnAndroid: Getter<boolean>,
94
+ useAlwaysAvailableJSErrorHandling: Getter<boolean>,
93
95
  useFabricInterop: Getter<boolean>,
94
96
  useImmediateExecutorInAndroidBridgeless: Getter<boolean>,
95
97
  useModernRuntimeScheduler: Getter<boolean>,
@@ -210,6 +212,10 @@ export const completeReactInstanceCreationOnBgThreadOnAndroid: Getter<boolean> =
210
212
  * The bridgeless architecture enables the event loop by default. This feature flag allows us to force disabling it in specific instances.
211
213
  */
212
214
  export const disableEventLoopOnBridgeless: Getter<boolean> = createNativeFlagGetter('disableEventLoopOnBridgeless', false);
215
+ /**
216
+ * Prevent FabricMountingManager from reordering mountitems, which may lead to invalid state on the UI thread
217
+ */
218
+ export const disableMountItemReorderingAndroid: Getter<boolean> = createNativeFlagGetter('disableMountItemReorderingAndroid', false);
213
219
  /**
214
220
  * Kill-switch to turn off support for aling-items:baseline on Fabric iOS.
215
221
  */
@@ -217,15 +223,15 @@ export const enableAlignItemsBaselineOnFabricIOS: Getter<boolean> = createNative
217
223
  /**
218
224
  * When enabled, custom line height calculation will be centered from top to bottom.
219
225
  */
220
- export const enableAndroidLineHeightCentering: Getter<boolean> = createNativeFlagGetter('enableAndroidLineHeightCentering', false);
226
+ export const enableAndroidLineHeightCentering: Getter<boolean> = createNativeFlagGetter('enableAndroidLineHeightCentering', true);
221
227
  /**
222
228
  * Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the following flags: `useTurboModules` & `enableFabricRenderer.
223
229
  */
224
230
  export const enableBridgelessArchitecture: Getter<boolean> = createNativeFlagGetter('enableBridgelessArchitecture', false);
225
231
  /**
226
- * Clean yoga node when <TextInput /> does not change.
232
+ * Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
227
233
  */
228
- export const enableCleanTextInputYogaNode: Getter<boolean> = createNativeFlagGetter('enableCleanTextInputYogaNode', false);
234
+ export const enableCppPropsIteratorSetter: Getter<boolean> = createNativeFlagGetter('enableCppPropsIteratorSetter', false);
229
235
  /**
230
236
  * Deletes views that were pre-allocated but never mounted on the screen.
231
237
  */
@@ -274,6 +280,10 @@ export const enableLongTaskAPI: Getter<boolean> = createNativeFlagGetter('enable
274
280
  * Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution).
275
281
  */
276
282
  export const enableMicrotasks: Getter<boolean> = createNativeFlagGetter('enableMicrotasks', false);
283
+ /**
284
+ * Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable
285
+ */
286
+ export const enableNewBackgroundAndBorderDrawables: Getter<boolean> = createNativeFlagGetter('enableNewBackgroundAndBorderDrawables', false);
277
287
  /**
278
288
  * Moves execution of pre-mount items to outside the choregrapher in the main thread, so we can estimate idle time more precisely (Android only).
279
289
  */
@@ -290,10 +300,6 @@ export const enableReportEventPaintTime: Getter<boolean> = createNativeFlagGette
290
300
  * Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tree synchronously from the main thread).
291
301
  */
292
302
  export const enableSynchronousStateUpdates: Getter<boolean> = createNativeFlagGetter('enableSynchronousStateUpdates', false);
293
- /**
294
- * Text preallocation optimisation where unnecessary work is removed.
295
- */
296
- export const enableTextPreallocationOptimisation: Getter<boolean> = createNativeFlagGetter('enableTextPreallocationOptimisation', false);
297
303
  /**
298
304
  * Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
299
305
  */
@@ -346,6 +352,10 @@ export const setAndroidLayoutDirection: Getter<boolean> = createNativeFlagGetter
346
352
  * Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.
347
353
  */
348
354
  export const traceTurboModulePromiseRejectionsOnAndroid: Getter<boolean> = createNativeFlagGetter('traceTurboModulePromiseRejectionsOnAndroid', false);
355
+ /**
356
+ * In Bridgeless mode, use the always available javascript error reporting pipeline.
357
+ */
358
+ export const useAlwaysAvailableJSErrorHandling: Getter<boolean> = createNativeFlagGetter('useAlwaysAvailableJSErrorHandling', false);
349
359
  /**
350
360
  * Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
351
361
  */
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<255e1fec50a4c211c3cc814eaf92ee9b>>
7
+ * @generated SignedSource<<d4297e2a804f238f538463d3d9af480a>>
8
8
  * @flow strict
9
9
  */
10
10
 
@@ -15,7 +15,7 @@
15
15
  * packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
16
16
  *
17
17
  * To regenerate this code, run the following script from the repo root:
18
- * yarn featureflags-update
18
+ * yarn featureflags --update
19
19
  */
20
20
 
21
21
  import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
@@ -29,10 +29,11 @@ export interface Spec extends TurboModule {
29
29
  +batchRenderingUpdatesInEventLoop?: () => boolean;
30
30
  +completeReactInstanceCreationOnBgThreadOnAndroid?: () => boolean;
31
31
  +disableEventLoopOnBridgeless?: () => boolean;
32
+ +disableMountItemReorderingAndroid?: () => boolean;
32
33
  +enableAlignItemsBaselineOnFabricIOS?: () => boolean;
33
34
  +enableAndroidLineHeightCentering?: () => boolean;
34
35
  +enableBridgelessArchitecture?: () => boolean;
35
- +enableCleanTextInputYogaNode?: () => boolean;
36
+ +enableCppPropsIteratorSetter?: () => boolean;
36
37
  +enableDeletionOfUnmountedViews?: () => boolean;
37
38
  +enableEagerRootViewAttachment?: () => boolean;
38
39
  +enableEventEmitterRetentionDuringGesturesOnAndroid?: () => boolean;
@@ -45,11 +46,11 @@ export interface Spec extends TurboModule {
45
46
  +enableLayoutAnimationsOnIOS?: () => boolean;
46
47
  +enableLongTaskAPI?: () => boolean;
47
48
  +enableMicrotasks?: () => boolean;
49
+ +enableNewBackgroundAndBorderDrawables?: () => boolean;
48
50
  +enablePreciseSchedulingForPremountItemsOnAndroid?: () => boolean;
49
51
  +enablePropsUpdateReconciliationAndroid?: () => boolean;
50
52
  +enableReportEventPaintTime?: () => boolean;
51
53
  +enableSynchronousStateUpdates?: () => boolean;
52
- +enableTextPreallocationOptimisation?: () => boolean;
53
54
  +enableUIConsistency?: () => boolean;
54
55
  +enableViewRecycling?: () => boolean;
55
56
  +excludeYogaFromRawProps?: () => boolean;
@@ -63,6 +64,7 @@ export interface Spec extends TurboModule {
63
64
  +loadVectorDrawablesOnImages?: () => boolean;
64
65
  +setAndroidLayoutDirection?: () => boolean;
65
66
  +traceTurboModulePromiseRejectionsOnAndroid?: () => boolean;
67
+ +useAlwaysAvailableJSErrorHandling?: () => boolean;
66
68
  +useFabricInterop?: () => boolean;
67
69
  +useImmediateExecutorInAndroidBridgeless?: () => boolean;
68
70
  +useModernRuntimeScheduler?: () => boolean;
@@ -47,11 +47,6 @@ export interface Spec extends TurboModule {
47
47
  exceptionId: number,
48
48
  ) => void;
49
49
  +reportException?: (data: ExceptionData) => void;
50
- +updateExceptionMessage: (
51
- message: string,
52
- stack: Array<StackFrame>,
53
- exceptionId: number,
54
- ) => void;
55
50
  // TODO(T53311281): This is a noop on iOS now. Implement it.
56
51
  +dismissRedbox?: () => void;
57
52
  }
@@ -74,13 +69,6 @@ const ExceptionsManager = {
74
69
  ) {
75
70
  NativeModule.reportSoftException(message, stack, exceptionId);
76
71
  },
77
- updateExceptionMessage(
78
- message: string,
79
- stack: Array<StackFrame>,
80
- exceptionId: number,
81
- ) {
82
- NativeModule.updateExceptionMessage(message, stack, exceptionId);
83
- },
84
72
  dismissRedbox(): void {
85
73
  if (Platform.OS !== 'ios' && NativeModule.dismissRedbox) {
86
74
  // TODO(T53311281): This is a noop on iOS now. Implement it.
@@ -131,6 +131,12 @@ export default class IntersectionObserver {
131
131
  * To stop observing the element, call `IntersectionObserver.unobserve()`.
132
132
  */
133
133
  observe(target: ReactNativeElement): void {
134
+ if (target == null) {
135
+ throw new TypeError(
136
+ "Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is null or undefined.",
137
+ );
138
+ }
139
+
134
140
  if (!(target instanceof ReactNativeElement)) {
135
141
  throw new TypeError(
136
142
  "Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'ReactNativeElement'.",
@@ -218,7 +218,7 @@ export default class Performance {
218
218
 
219
219
  const measure = new PerformanceMeasure(measureName, {
220
220
  startTime: computedStartTime,
221
- duration: computedDuration,
221
+ duration: computedDuration ?? 0,
222
222
  detail: options?.detail,
223
223
  });
224
224
 
@@ -25,8 +25,8 @@ export type TimeStampOrName = DOMHighResTimeStamp | string;
25
25
 
26
26
  export type PerformanceMeasureInit = {
27
27
  detail?: DetailType,
28
- startTime?: DOMHighResTimeStamp,
29
- duration?: DOMHighResTimeStamp,
28
+ startTime: DOMHighResTimeStamp,
29
+ duration: DOMHighResTimeStamp,
30
30
  };
31
31
 
32
32
  export class PerformanceMark extends PerformanceEntry {
@@ -53,12 +53,12 @@ export class PerformanceMark extends PerformanceEntry {
53
53
  export class PerformanceMeasure extends PerformanceEntry {
54
54
  #detail: DetailType;
55
55
 
56
- constructor(measureName: string, measureOptions?: PerformanceMeasureInit) {
56
+ constructor(measureName: string, measureOptions: PerformanceMeasureInit) {
57
57
  super({
58
58
  name: measureName,
59
59
  entryType: 'measure',
60
- startTime: measureOptions?.startTime ?? 0,
61
- duration: measureOptions?.duration ?? 0,
60
+ startTime: measureOptions.startTime,
61
+ duration: measureOptions.duration,
62
62
  });
63
63
 
64
64
  if (measureOptions) {