@office-iss/react-native-win32 0.0.0-canary.246 → 0.0.0-canary.247

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 (27) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +40 -1
  3. package/CHANGELOG.md +21 -9
  4. package/Libraries/Core/ErrorHandlers.js +116 -0
  5. package/Libraries/Core/ReactNativeVersion.js +1 -1
  6. package/Libraries/Core/setUpReactDevTools.js +70 -10
  7. package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
  8. package/Libraries/NativeComponent/NativeComponentRegistry.js +12 -5
  9. package/Libraries/ReactNative/BridgelessUIManager.js +1 -21
  10. package/Libraries/ReactNative/RendererImplementation.js +20 -2
  11. package/Libraries/ReactNative/UIManager.d.ts +0 -21
  12. package/Libraries/ReactNative/UIManagerProperties.js +0 -3
  13. package/Libraries/ReactNative/getNativeComponentAttributes.js +3 -6
  14. package/Libraries/Renderer/shims/ReactFabric.js +3 -0
  15. package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -0
  16. package/Libraries/Renderer/shims/ReactNative.js +3 -0
  17. package/Libraries/Renderer/shims/ReactNativeTypes.js +25 -1
  18. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -0
  19. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -0
  20. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +3 -3
  21. package/Libraries/StyleSheet/StyleSheetTypes.js +3 -3
  22. package/overrides.json +2 -2
  23. package/package.json +16 -16
  24. package/src/private/featureflags/ReactNativeFeatureFlags.js +6 -1
  25. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
  26. package/src/private/fusebox/setUpFuseboxReactDevToolsDispatcher.js +1 -1
  27. package/src/private/specs/modules/NativeUIManager.js +0 -7
package/.flowconfig CHANGED
@@ -153,4 +153,4 @@ untyped-import
153
153
  untyped-type-import
154
154
 
155
155
  [version]
156
- ^0.233.0
156
+ ^0.234.0
package/CHANGELOG.json CHANGED
@@ -2,7 +2,46 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 15 May 2024 05:12:44 GMT",
5
+ "date": "Wed, 22 May 2024 05:15:59 GMT",
6
+ "version": "0.0.0-canary.247",
7
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.247",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "1422161+marlenecota@users.noreply.github.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "ef55e6fc47b9adc83afc6ddcae92d7461013512b",
14
+ "comment": "RN Integration 04/20"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@office-iss/react-native-win32",
19
+ "comment": "Bump @rnw-scripts/eslint-config to v1.2.17",
20
+ "commit": "not available"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@office-iss/react-native-win32",
25
+ "comment": "Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.21",
26
+ "commit": "not available"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@office-iss/react-native-win32",
31
+ "comment": "Bump @rnw-scripts/just-task to v2.3.33",
32
+ "commit": "not available"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@office-iss/react-native-win32",
37
+ "comment": "Bump react-native-platform-override to v1.9.34",
38
+ "commit": "not available"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Wed, 15 May 2024 05:14:52 GMT",
6
45
  "version": "0.0.0-canary.246",
7
46
  "tag": "@office-iss/react-native-win32_v0.0.0-canary.246",
8
47
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,22 +1,34 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- This log was last generated on Wed, 15 May 2024 05:12:44 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 22 May 2024 05:15:59 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.0.0-canary.246
7
+ ## 0.0.0-canary.247
8
8
 
9
- Wed, 15 May 2024 05:12:44 GMT
9
+ Wed, 22 May 2024 05:15:59 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Remove unneeded scrollview.win32.js override (30809111+acoates-ms@users.noreply.github.com)
14
- - 0413 integration (email not defined)
15
- - Bump @rnw-scripts/eslint-config to v1.2.16
16
- - Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.20
17
- - Bump @rnw-scripts/just-task to v2.3.32
18
- - Bump react-native-platform-override to v1.9.33
13
+ - RN Integration 04/20 (1422161+marlenecota@users.noreply.github.com)
14
+ - Bump @rnw-scripts/eslint-config to v1.2.17
15
+ - Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.21
16
+ - Bump @rnw-scripts/just-task to v2.3.33
17
+ - Bump react-native-platform-override to v1.9.34
19
18
 
19
+ ## 0.0.0-canary.246
20
+
21
+ Wed, 15 May 2024 05:14:52 GMT
22
+
23
+ ### Changes
24
+
25
+ - Remove unneeded scrollview.win32.js override (30809111+acoates-ms@users.noreply.github.com)
26
+ - 0413 integration (email not defined)
27
+ - Bump @rnw-scripts/eslint-config to v1.2.16
28
+ - Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.20
29
+ - Bump @rnw-scripts/just-task to v2.3.32
30
+ - Bump react-native-platform-override to v1.9.33
31
+
20
32
  ## 0.0.0-canary.245
21
33
 
22
34
  Sat, 11 May 2024 05:18:28 GMT
@@ -0,0 +1,116 @@
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
+ * @flow strict
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ import type {ExtendedError} from './ExtendedError';
14
+
15
+ import {SyntheticError, handleException} from './ExceptionsManager';
16
+
17
+ type ErrorInfo = {
18
+ +componentStack?: ?string,
19
+ // $FlowFixMe[unclear-type] unknown props and state.
20
+ +errorBoundary?: ?React$Component<any, any>,
21
+ };
22
+
23
+ export function onUncaughtError(errorValue: mixed, errorInfo: ErrorInfo): void {
24
+ let error;
25
+
26
+ // Typically, `errorValue` should be an error. However, other values such as
27
+ // strings (or even null) are sometimes thrown.
28
+ if (errorValue instanceof Error) {
29
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
30
+ * this parameters */
31
+ error = (errorValue: ExtendedError);
32
+ } else if (typeof errorValue === 'string') {
33
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
34
+ * this parameters */
35
+ error = (new SyntheticError(errorValue): ExtendedError);
36
+ } else {
37
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
38
+ * this parameters */
39
+ error = (new SyntheticError('Unspecified error'): ExtendedError);
40
+ }
41
+ try {
42
+ // $FlowFixMe[incompatible-use] this is in try/catch.
43
+ error.componentStack = errorInfo.componentStack;
44
+ error.isComponentError = true;
45
+ } catch {
46
+ // Ignored.
47
+ }
48
+
49
+ // Uncaught errors are fatal.
50
+ handleException(error, true);
51
+ }
52
+
53
+ export function onCaughtError(errorValue: mixed, errorInfo: ErrorInfo): void {
54
+ let error;
55
+
56
+ // Typically, `errorValue` should be an error. However, other values such as
57
+ // strings (or even null) are sometimes thrown.
58
+ if (errorValue instanceof Error) {
59
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
60
+ * this parameters */
61
+ error = (errorValue: ExtendedError);
62
+ } else if (typeof errorValue === 'string') {
63
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
64
+ * this parameters */
65
+ error = (new SyntheticError(errorValue): ExtendedError);
66
+ } else {
67
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
68
+ * this parameters */
69
+ error = (new SyntheticError('Unspecified error'): ExtendedError);
70
+ }
71
+ try {
72
+ // $FlowFixMe[incompatible-use] this is in try/catch.
73
+ error.componentStack = errorInfo.componentStack;
74
+ error.isComponentError = true;
75
+ } catch {
76
+ // Ignored.
77
+ }
78
+
79
+ // Caught errors are not fatal.
80
+ handleException(error, false);
81
+ }
82
+
83
+ export function onRecoverableError(
84
+ errorValue: mixed,
85
+ errorInfo: ErrorInfo,
86
+ ): void {
87
+ let error;
88
+
89
+ // Typically, `errorValue` should be an error. However, other values such as
90
+ // strings (or even null) are sometimes thrown.
91
+ if (errorValue instanceof Error) {
92
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
93
+ * this parameters */
94
+ error = (errorValue: ExtendedError);
95
+ } else if (typeof errorValue === 'string') {
96
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
97
+ * this parameters */
98
+ error = (new SyntheticError(errorValue): ExtendedError);
99
+ } else {
100
+ /* $FlowFixMe[class-object-subtyping] added when improving typing for
101
+ * this parameters */
102
+ error = (new SyntheticError('Unspecified error'): ExtendedError);
103
+ }
104
+ try {
105
+ // $FlowFixMe[incompatible-use] this is in try/catch.
106
+ error.componentStack = errorInfo.componentStack;
107
+ error.isComponentError = true;
108
+ } catch {
109
+ // Ignored.
110
+ }
111
+
112
+ // Recoverable errors should only be warnings.
113
+ // This will make it a soft error in LogBox.
114
+ // TODO: improve the logging for recoverable errors in prod.
115
+ console.warn(error);
116
+ }
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 75,
19
19
  patch: 0,
20
- prerelease: 'nightly-20240413-1b152f6ec',
20
+ prerelease: 'nightly-20240420-03a51da72',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -10,12 +10,52 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {Domain} from '../../src/private/fusebox/setUpFuseboxReactDevToolsDispatcher';
14
+
13
15
  if (__DEV__) {
14
- let isWebSocketOpen = false;
15
- let ws = null;
16
+ // Register dispatcher on global, which can be used later by Chrome DevTools frontend
17
+ require('../../src/private/fusebox/setUpFuseboxReactDevToolsDispatcher');
16
18
 
19
+ // Install hook before React is loaded.
17
20
  const reactDevTools = require('react-devtools-core');
18
- const connectToDevTools = () => {
21
+ // This should be defined in DEV, otherwise error is expected.
22
+ const fuseboxReactDevToolsDispatcher =
23
+ global.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__;
24
+ const reactDevToolsFuseboxGlobalBindingName =
25
+ fuseboxReactDevToolsDispatcher.BINDING_NAME;
26
+
27
+ const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
28
+ const devToolsSettingsManager = require('../DevToolsSettings/DevToolsSettingsManager');
29
+ const resolveRNStyle = require('../StyleSheet/flattenStyle');
30
+
31
+ let disconnect = null;
32
+ function disconnectBackendFromReactDevToolsInFuseboxIfNeeded() {
33
+ if (disconnect != null) {
34
+ disconnect();
35
+ disconnect = null;
36
+ }
37
+ }
38
+
39
+ function connectToReactDevToolsInFusebox(domain: Domain) {
40
+ disconnect = reactDevTools.connectWithCustomMessagingProtocol({
41
+ onSubscribe: listener => {
42
+ domain.onMessage.addEventListener(listener);
43
+ },
44
+ onUnsubscribe: listener => {
45
+ domain.onMessage.removeEventListener(listener);
46
+ },
47
+ onMessage: (event, payload) => {
48
+ domain.sendMessage({event, payload});
49
+ },
50
+ settingsManager: devToolsSettingsManager,
51
+ nativeStyleEditorValidAttributes: Object.keys(ReactNativeStyleAttributes),
52
+ resolveRNStyle,
53
+ });
54
+ }
55
+
56
+ let isWebSocketOpen = false;
57
+ let ws = null;
58
+ function connectToWSBasedReactDevToolsFrontend() {
19
59
  if (ws !== null && isWebSocketOpen) {
20
60
  // If the DevTools backend is already connected, don't recreate the WebSocket.
21
61
  // This would break the connection.
@@ -61,12 +101,9 @@ if (__DEV__) {
61
101
  isWebSocketOpen = true;
62
102
  });
63
103
 
64
- const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
65
- const devToolsSettingsManager = require('../DevToolsSettings/DevToolsSettingsManager');
66
-
67
104
  reactDevTools.connectToDevTools({
68
105
  isAppActive,
69
- resolveRNStyle: require('../StyleSheet/flattenStyle'),
106
+ resolveRNStyle,
70
107
  nativeStyleEditorValidAttributes: Object.keys(
71
108
  ReactNativeStyleAttributes,
72
109
  ),
@@ -74,9 +111,32 @@ if (__DEV__) {
74
111
  devToolsSettingsManager,
75
112
  });
76
113
  }
77
- };
114
+ }
115
+
116
+ // 1. If React DevTools has already been opened and initialized in Fusebox, bindings survive reloads
117
+ if (global[reactDevToolsFuseboxGlobalBindingName] != null) {
118
+ disconnectBackendFromReactDevToolsInFuseboxIfNeeded();
119
+ const domain =
120
+ fuseboxReactDevToolsDispatcher.initializeDomain('react-devtools');
121
+ connectToReactDevToolsInFusebox(domain);
122
+ }
123
+
124
+ // 2. If React DevTools panel in Fusebox was opened for the first time after the runtime has been created
125
+ // 2. OR if React DevTools frontend was re-initialized: Chrome DevTools was closed and then re-opened
126
+ global.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(
127
+ (domain: Domain) => {
128
+ if (domain.name === 'react-devtools') {
129
+ disconnectBackendFromReactDevToolsInFuseboxIfNeeded();
130
+ connectToReactDevToolsInFusebox(domain);
131
+ }
132
+ },
133
+ );
78
134
 
135
+ // 3. Fallback to attempting to connect WS-based RDT frontend
79
136
  const RCTNativeAppEventEmitter = require('../EventEmitter/RCTNativeAppEventEmitter');
80
- RCTNativeAppEventEmitter.addListener('RCTDevMenuShown', connectToDevTools);
81
- connectToDevTools(); // Try connecting once on load
137
+ RCTNativeAppEventEmitter.addListener(
138
+ 'RCTDevMenuShown',
139
+ connectToWSBasedReactDevToolsFrontend,
140
+ );
141
+ connectToWSBasedReactDevToolsFrontend(); // Try connecting once on load
82
142
  }
@@ -62,9 +62,9 @@ class DebuggingOverlayRegistry {
62
62
  constructor() {
63
63
  if (reactDevToolsHook?.reactDevtoolsAgent != null) {
64
64
  this.#onReactDevToolsAgentAttached(reactDevToolsHook.reactDevtoolsAgent);
65
- return;
66
65
  }
67
66
 
67
+ // There could be cases when frontend is disconnected and then connected again for the same React Native runtime.
68
68
  reactDevToolsHook?.on?.(
69
69
  'react-devtools',
70
70
  this.#onReactDevToolsAgentAttached,
@@ -62,14 +62,21 @@ export function get<Config>(
62
62
 
63
63
  let viewConfig;
64
64
  if (native) {
65
- viewConfig = getNativeComponentAttributes(name);
65
+ viewConfig =
66
+ getNativeComponentAttributes(name) ??
67
+ createViewConfig(viewConfigProvider());
66
68
  } else {
67
- viewConfig = createViewConfig(viewConfigProvider());
68
- if (viewConfig == null) {
69
- viewConfig = getNativeComponentAttributes(name);
70
- }
69
+ viewConfig =
70
+ createViewConfig(viewConfigProvider()) ??
71
+ getNativeComponentAttributes(name);
71
72
  }
72
73
 
74
+ invariant(
75
+ viewConfig != null,
76
+ 'NativeComponentRegistry.get: both static and native view config are missing for native component "%s".',
77
+ name,
78
+ );
79
+
73
80
  if (verify) {
74
81
  const nativeViewConfig = native
75
82
  ? viewConfig
@@ -160,27 +160,7 @@ const UIManagerJSUnusedInNewArchAPIs = {
160
160
  * them from React Native.
161
161
  */
162
162
  const UIManagerJSDeprecatedPlatformAPIs = Platform.select({
163
- android: {
164
- // TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
165
- showPopupMenu: (
166
- reactTag: number,
167
- items: Array<string>,
168
- error: (error: Object) => void,
169
- success: (event: string, selected?: number) => void,
170
- ): void => {
171
- raiseSoftError(
172
- 'showPopupMenu',
173
- 'Please use the <PopupMenuAndroid /> component instead.',
174
- );
175
- },
176
- // TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
177
- dismissPopupMenu: (): void => {
178
- raiseSoftError(
179
- 'dismissPopupMenu',
180
- 'Please use the <PopupMenuAndroid /> component instead.',
181
- );
182
- },
183
- },
163
+ android: {},
184
164
  });
185
165
 
186
166
  const UIManagerJSPlatformAPIs = Platform.select({
@@ -12,8 +12,12 @@ import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
12
12
  import type ReactFabricHostComponent from './ReactFabricPublicInstance/ReactFabricHostComponent';
13
13
  import type {Element, ElementRef, ElementType} from 'react';
14
14
 
15
+ import {
16
+ onCaughtError,
17
+ onRecoverableError,
18
+ onUncaughtError,
19
+ } from '../Core/ErrorHandlers';
15
20
  import {type RootTag} from './RootTag';
16
-
17
21
  export function renderElement({
18
22
  element,
19
23
  rootTag,
@@ -31,9 +35,23 @@ export function renderElement({
31
35
  rootTag,
32
36
  null,
33
37
  useConcurrentRoot,
38
+ {
39
+ onCaughtError,
40
+ onUncaughtError,
41
+ onRecoverableError,
42
+ },
34
43
  );
35
44
  } else {
36
- require('../Renderer/shims/ReactNative').render(element, rootTag);
45
+ require('../Renderer/shims/ReactNative').render(
46
+ element,
47
+ rootTag,
48
+ undefined,
49
+ {
50
+ onCaughtError,
51
+ onUncaughtError,
52
+ onRecoverableError,
53
+ },
54
+ );
37
55
  }
38
56
  }
39
57
 
@@ -89,27 +89,6 @@ export interface UIManagerStatic {
89
89
  | ((value: boolean) => void)
90
90
  | undefined;
91
91
 
92
- /**
93
- * Used to display an Android PopupMenu. If a menu item is pressed, the success callback will
94
- * be called with the following arguments:
95
- *
96
- * - item - the menu item.
97
- * - index - index of the pressed item in array. Returns `undefined` if cancelled.
98
- *
99
- * To obtain a native node handle for a component, you can use
100
- * `React.findNodeHandle(component)`.
101
- *
102
- * Note that this works only on Android
103
- */
104
- showPopupMenu?:
105
- | ((
106
- node: number,
107
- items: string[],
108
- error: () => void /* currently unused */,
109
- success: (item: string, index: number | undefined) => void,
110
- ) => void)
111
- | undefined;
112
-
113
92
  getViewManagerConfig: (name: string) => {
114
93
  Commands: {[key: string]: number};
115
94
  };
@@ -30,7 +30,6 @@ module.exports = [
30
30
  'clearJSResponder',
31
31
  'configureNextLayoutAnimation',
32
32
  'createView',
33
- 'dismissPopupMenu',
34
33
  'dispatchViewManagerCommand',
35
34
  'findSubviewIn',
36
35
  'getConstantsForViewManager',
@@ -45,10 +44,8 @@ module.exports = [
45
44
  'setChildren',
46
45
  'setJSResponder',
47
46
  'setLayoutAnimationEnabledExperimental',
48
- 'showPopupMenu',
49
47
  'updateView',
50
48
  'viewIsDescendantOf',
51
- 'PopupMenu',
52
49
  'LazyViewManagersEnabled',
53
50
  'ViewManagerNames',
54
51
  'StyleConstants',
@@ -19,17 +19,14 @@ const matricesDiffer = require('../Utilities/differ/matricesDiffer');
19
19
  const pointsDiffer = require('../Utilities/differ/pointsDiffer');
20
20
  const sizesDiffer = require('../Utilities/differ/sizesDiffer');
21
21
  const UIManager = require('./UIManager');
22
- const invariant = require('invariant');
23
22
  const nullthrows = require('nullthrows');
24
23
 
25
24
  function getNativeComponentAttributes(uiViewClassName: string): any {
26
25
  const viewConfig = UIManager.getViewManagerConfig(uiViewClassName);
27
26
 
28
- invariant(
29
- viewConfig != null && viewConfig.NativeProps != null,
30
- 'requireNativeComponent: "%s" was not found in the UIManager.',
31
- uiViewClassName,
32
- );
27
+ if (viewConfig == null) {
28
+ return null;
29
+ }
33
30
 
34
31
  // TODO: This seems like a whole lot of runtime initialization for every
35
32
  // native component that can be either avoided or simplified.
@@ -8,6 +8,9 @@
8
8
  * @flow
9
9
  * @nolint
10
10
  * @generated SignedSource<<c1cc197c110e3a49a5e8f6bd5d32b23f>>
11
+ * @generated SignedSource<<19f13c8d8dac82cd391ad408f5ad8893>>
12
+ *
13
+ * This file was sync'd from the facebook/react repository.
11
14
  */
12
15
 
13
16
  'use strict';
@@ -8,6 +8,9 @@
8
8
  * @flow strict-local
9
9
  * @nolint
10
10
  * @generated SignedSource<<2881c8e89ef0f73f4cf6612cb518b197>>
11
+ * @generated SignedSource<<f48352b25600c8534f28130f5256d937>>
12
+ *
13
+ * This file was sync'd from the facebook/react repository.
11
14
  */
12
15
 
13
16
  'use strict';
@@ -8,6 +8,9 @@
8
8
  * @flow
9
9
  * @nolint
10
10
  * @generated SignedSource<<0debd6e5a17dc037cb4661315a886de6>>
11
+ * @generated SignedSource<<228cd610b28ff12c92264be0d9be9374>>
12
+ *
13
+ * This file was sync'd from the facebook/react repository.
11
14
  */
12
15
 
13
16
  'use strict';
@@ -7,7 +7,10 @@
7
7
  * @noformat
8
8
  * @flow strict
9
9
  * @nolint
10
- * @generated SignedSource<<b35184ab7e1e173fd34278def089e277>>
10
+ * @generated SignedSource<<c41f61379973354629ee7bf55ba92541>>
11
+ * @generated SignedSource<<39aa3fa373095c6b192fac24f5b6c30c>>
12
+ *
13
+ * This file was sync'd from the facebook/react repository.
11
14
  */
12
15
 
13
16
  import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
@@ -176,6 +179,25 @@ export type TouchedViewDataAtPoint = $ReadOnly<{
176
179
  ...InspectorData,
177
180
  }>;
178
181
 
182
+ export type RenderRootOptions = {
183
+ onUncaughtError?: (
184
+ error: mixed,
185
+ errorInfo: {+componentStack?: ?string},
186
+ ) => void,
187
+ onCaughtError?: (
188
+ error: mixed,
189
+ errorInfo: {
190
+ +componentStack?: ?string,
191
+ // $FlowFixMe[unclear-type] unknown props and state.
192
+ +errorBoundary?: ?React$Component<any, any>,
193
+ },
194
+ ) => void,
195
+ onRecoverableError?: (
196
+ error: mixed,
197
+ errorInfo: {+componentStack?: ?string},
198
+ ) => void,
199
+ };
200
+
179
201
  /**
180
202
  * Flat ReactNative renderer bundles are too big for Flow to parse efficiently.
181
203
  * Provide minimal Flow typing for the high-level RN API and call it a day.
@@ -204,6 +226,7 @@ export type ReactNativeType = {
204
226
  element: Element<ElementType>,
205
227
  containerTag: number,
206
228
  callback: ?() => void,
229
+ options: ?RenderRootOptions,
207
230
  ): ?ElementRef<ElementType>,
208
231
  unmountComponentAtNode(containerTag: number): void,
209
232
  unmountComponentAtNodeAndRemoveContainer(containerTag: number): void,
@@ -239,6 +262,7 @@ export type ReactFabricType = {
239
262
  containerTag: number,
240
263
  callback: ?() => void,
241
264
  concurrentRoot: ?boolean,
265
+ options: ?RenderRootOptions,
242
266
  ): ?ElementRef<ElementType>,
243
267
  unmountComponentAtNode(containerTag: number): void,
244
268
  getNodeFromInternalInstanceHandle(
@@ -8,6 +8,9 @@
8
8
  * @flow strict-local
9
9
  * @nolint
10
10
  * @generated SignedSource<<73af5b3fe29d226634ed64bc861634df>>
11
+ * @generated SignedSource<<b616e9e4f0bcab37292324fd9dd1b01d>>
12
+ *
13
+ * This file was sync'd from the facebook/react repository.
11
14
  */
12
15
 
13
16
  'use strict';
@@ -8,6 +8,9 @@
8
8
  * @flow strict-local
9
9
  * @nolint
10
10
  * @generated SignedSource<<ede54ac2fa1b9a09e234cdf098048989>>
11
+ * @generated SignedSource<<c20bad591efa52fa416567851318b8ca>>
12
+ *
13
+ * This file was sync'd from the facebook/react repository.
11
14
  */
12
15
 
13
16
  'use strict';
@@ -65,9 +65,9 @@ export interface FlexStyle {
65
65
  | 'row-reverse'
66
66
  | 'column-reverse'
67
67
  | undefined;
68
- rowGap?: number | undefined;
69
- gap?: number | undefined;
70
- columnGap?: number | undefined;
68
+ rowGap?: number | string | undefined;
69
+ gap?: number | string | undefined;
70
+ columnGap?: number | string | undefined;
71
71
  flexGrow?: number | undefined;
72
72
  flexShrink?: number | undefined;
73
73
  flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse' | undefined;
@@ -644,9 +644,9 @@ type ____LayoutStyle_Internal = $ReadOnly<{
644
644
  * between children may be larger than the gap value.
645
645
  * See https://developer.mozilla.org/en-US/docs/Web/CSS/gap for more details.
646
646
  */
647
- rowGap?: number,
648
- columnGap?: number,
649
- gap?: number,
647
+ rowGap?: number | string,
648
+ columnGap?: number | string,
649
+ gap?: number | string,
650
650
  }>;
651
651
 
652
652
  /**
package/overrides.json CHANGED
@@ -7,13 +7,13 @@
7
7
  "**/__snapshots__/**",
8
8
  "src-win/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.75.0-nightly-20240413-1b152f6ec",
10
+ "baseVersion": "0.75.0-nightly-20240420-03a51da72",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
14
14
  "file": ".flowconfig",
15
15
  "baseFile": ".flowconfig",
16
- "baseHash": "207887dce4d232e4ded4dbeefe4188766b24144a"
16
+ "baseHash": "4f8e1f39d8ed29d7d0e21455cac407d352a6824d"
17
17
  },
18
18
  {
19
19
  "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.246",
3
+ "version": "0.0.0-canary.247",
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": "14.0.0-alpha.2",
31
31
  "@react-native-community/cli-platform-ios": "14.0.0-alpha.2",
32
32
  "@react-native/assets": "1.0.0",
33
- "@react-native/assets-registry": "0.75.0-nightly-20240413-1b152f6ec",
34
- "@react-native/codegen": "0.75.0-nightly-20240413-1b152f6ec",
35
- "@react-native/community-cli-plugin": "0.75.0-nightly-20240413-1b152f6ec",
36
- "@react-native/gradle-plugin": "0.75.0-nightly-20240413-1b152f6ec",
37
- "@react-native/js-polyfills": "0.75.0-nightly-20240413-1b152f6ec",
38
- "@react-native/normalize-colors": "0.75.0-nightly-20240413-1b152f6ec",
39
- "@react-native/virtualized-lists": "0.75.0-nightly-20240413-1b152f6ec",
33
+ "@react-native/assets-registry": "0.75.0-nightly-20240420-03a51da72",
34
+ "@react-native/codegen": "0.75.0-nightly-20240420-03a51da72",
35
+ "@react-native/community-cli-plugin": "0.75.0-nightly-20240420-03a51da72",
36
+ "@react-native/gradle-plugin": "0.75.0-nightly-20240420-03a51da72",
37
+ "@react-native/js-polyfills": "0.75.0-nightly-20240420-03a51da72",
38
+ "@react-native/normalize-colors": "0.75.0-nightly-20240420-03a51da72",
39
+ "@react-native/virtualized-lists": "0.75.0-nightly-20240420-03a51da72",
40
40
  "abort-controller": "^3.0.0",
41
41
  "anser": "^1.4.9",
42
42
  "ansi-regex": "^5.0.0",
@@ -56,7 +56,7 @@
56
56
  "pretty-format": "^26.5.2",
57
57
  "promise": "^8.3.0",
58
58
  "react-clone-referenced-element": "^1.0.1",
59
- "react-devtools-core": "^5.0.2",
59
+ "react-devtools-core": "5.1.0",
60
60
  "react-refresh": "^0.14.0",
61
61
  "react-shallow-renderer": "^16.15.0",
62
62
  "regenerator-runtime": "^0.13.2",
@@ -70,11 +70,11 @@
70
70
  "devDependencies": {
71
71
  "@babel/core": "^7.20.0",
72
72
  "@babel/eslint-parser": "^7.20.0",
73
- "@react-native/metro-config": "0.75.0-nightly-20240413-1b152f6ec",
73
+ "@react-native/metro-config": "0.75.0-nightly-20240420-03a51da72",
74
74
  "@rnw-scripts/babel-react-native-config": "0.0.0",
75
- "@rnw-scripts/eslint-config": "1.2.16",
76
- "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.20",
77
- "@rnw-scripts/just-task": "2.3.32",
75
+ "@rnw-scripts/eslint-config": "1.2.17",
76
+ "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.21",
77
+ "@rnw-scripts/just-task": "2.3.33",
78
78
  "@rnw-scripts/metro-dev-config": "0.0.0",
79
79
  "@rnx-kit/jest-preset": "^0.1.0",
80
80
  "@types/node": "^18.0.0",
@@ -86,14 +86,14 @@
86
86
  "just-scripts": "^1.3.3",
87
87
  "prettier": "2.8.8",
88
88
  "react": "18.2.0",
89
- "react-native": "0.75.0-nightly-20240413-1b152f6ec",
90
- "react-native-platform-override": "^1.9.33",
89
+ "react-native": "0.75.0-nightly-20240420-03a51da72",
90
+ "react-native-platform-override": "^1.9.34",
91
91
  "typescript": "5.0.4"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "@types/react": "^18.2.6",
95
95
  "react": "18.2.0",
96
- "react-native": "0.75.0-nightly-20240413-1b152f6ec"
96
+ "react-native": "0.75.0-nightly-20240420-03a51da72"
97
97
  },
98
98
  "beachball": {
99
99
  "defaultNpmTag": "canary",
@@ -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<<39fd96ed670e0acae857e7fce3377452>>
7
+ * @generated SignedSource<<0e0858557eb27f3eebfecae18ee13c0b>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -53,6 +53,7 @@ export type ReactNativeFeatureFlags = {
53
53
  forceBatchingMountItemsOnAndroid: Getter<boolean>,
54
54
  inspectorEnableCxxInspectorPackagerConnection: Getter<boolean>,
55
55
  inspectorEnableModernCDPRegistry: Getter<boolean>,
56
+ preventDoubleTextMeasure: Getter<boolean>,
56
57
  useModernRuntimeScheduler: Getter<boolean>,
57
58
  useNativeViewConfigsInBridgelessMode: Getter<boolean>,
58
59
  useStateAlignmentMechanism: Getter<boolean>,
@@ -150,6 +151,10 @@ export const inspectorEnableCxxInspectorPackagerConnection: Getter<boolean> = cr
150
151
  * Flag determining if the modern CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
151
152
  */
152
153
  export const inspectorEnableModernCDPRegistry: Getter<boolean> = createNativeFlagGetter('inspectorEnableModernCDPRegistry', false);
154
+ /**
155
+ * When enabled, ParagraphShadowNode will no longer call measure twice.
156
+ */
157
+ export const preventDoubleTextMeasure: Getter<boolean> = createNativeFlagGetter('preventDoubleTextMeasure', false);
153
158
  /**
154
159
  * When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with priorities from any thread.
155
160
  */
@@ -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<<99ddb55dadff7adfb02c105984d47cbf>>
7
+ * @generated SignedSource<<4ba909c3b360c6a4fc9c6ed5996b6a13>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -36,6 +36,7 @@ export interface Spec extends TurboModule {
36
36
  +forceBatchingMountItemsOnAndroid?: () => boolean;
37
37
  +inspectorEnableCxxInspectorPackagerConnection?: () => boolean;
38
38
  +inspectorEnableModernCDPRegistry?: () => boolean;
39
+ +preventDoubleTextMeasure?: () => boolean;
39
40
  +useModernRuntimeScheduler?: () => boolean;
40
41
  +useNativeViewConfigsInBridgelessMode?: () => boolean;
41
42
  +useStateAlignmentMechanism?: () => boolean;
@@ -37,7 +37,7 @@ class EventScope<T> {
37
37
  }
38
38
  }
39
39
 
40
- class Domain {
40
+ export class Domain {
41
41
  name: DomainName;
42
42
  onMessage: EventScope<JSONValue>;
43
43
 
@@ -101,13 +101,6 @@ export interface Spec extends TurboModule {
101
101
  +getDefaultEventTypes?: () => Array<string>;
102
102
  +setLayoutAnimationEnabledExperimental?: (enabled: boolean) => void;
103
103
  +sendAccessibilityEvent?: (reactTag: number, eventType: number) => void;
104
- +showPopupMenu?: (
105
- reactTag: number,
106
- items: Array<string>,
107
- error: (error: Object) => void,
108
- success: (event: string, selected?: number) => void,
109
- ) => void;
110
- +dismissPopupMenu?: () => void;
111
104
 
112
105
  // ios only
113
106
  +lazilyLoadView?: (name: string) => Object; // revisit return