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

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 (70) hide show
  1. package/.flowconfig +3 -3
  2. package/CHANGELOG.json +93 -1
  3. package/CHANGELOG.md +33 -8
  4. package/Libraries/Animated/NativeAnimatedHelper.js +4 -0
  5. package/Libraries/Animated/NativeAnimatedHelper.win32.js +4 -0
  6. package/Libraries/Animated/createAnimatedComponent.js +10 -4
  7. package/Libraries/Animated/useAnimatedProps.js +1 -0
  8. package/Libraries/BatchedBridge/MessageQueue.js +1 -0
  9. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -0
  10. package/Libraries/Components/ScrollView/ScrollView.js +9 -1
  11. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -1
  12. package/Libraries/Components/TextInput/TextInput.js +12 -3
  13. package/Libraries/Components/TextInput/TextInput.win32.js +12 -3
  14. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  15. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
  16. package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -0
  17. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  18. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  19. package/Libraries/Components/View/View.js +0 -11
  20. package/Libraries/Components/View/View.win32.js +0 -11
  21. package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  22. package/Libraries/Components/View/ViewPropTypes.js +7 -0
  23. package/Libraries/Components/View/ViewPropTypes.win32.js +7 -0
  24. package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +153 -0
  25. package/Libraries/Core/ReactNativeVersion.js +1 -1
  26. package/Libraries/Image/ImageUtils.js +1 -0
  27. package/Libraries/Inspector/ElementBox.js +4 -0
  28. package/Libraries/IntersectionObserver/IntersectionObserverManager.js +6 -26
  29. package/Libraries/LogBox/Data/LogBoxData.js +0 -25
  30. package/Libraries/NativeComponent/BaseViewConfig.android.js +5 -0
  31. package/Libraries/NativeComponent/BaseViewConfig.ios.js +5 -0
  32. package/Libraries/NativeComponent/BaseViewConfig.win32.js +5 -0
  33. package/Libraries/NativeComponent/StaticViewConfigValidator.js +3 -0
  34. package/Libraries/Network/XMLHttpRequest.js +1 -0
  35. package/Libraries/ReactNative/AppRegistry.js +2 -4
  36. package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +1 -0
  37. package/Libraries/Renderer/shims/ReactFabric.js +0 -3
  38. package/Libraries/Renderer/shims/ReactFeatureFlags.js +0 -3
  39. package/Libraries/Renderer/shims/ReactNative.js +0 -3
  40. package/Libraries/Renderer/shims/ReactNativeTypes.js +0 -3
  41. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +0 -3
  42. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +0 -3
  43. package/Libraries/StyleSheet/StyleSheet.js +3 -10
  44. package/Libraries/StyleSheet/StyleSheet.win32.js +3 -10
  45. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +18 -18
  46. package/Libraries/StyleSheet/StyleSheetTypes.js +19 -13
  47. package/Libraries/StyleSheet/flattenStyle.js +1 -0
  48. package/Libraries/StyleSheet/processFilter.js +132 -0
  49. package/Libraries/TurboModule/TurboModuleRegistry.js +2 -1
  50. package/Libraries/Utilities/Dimensions.js +1 -0
  51. package/Libraries/Utilities/Dimensions.win32.js +1 -0
  52. package/Libraries/Utilities/RCTLog.js +1 -0
  53. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +11 -6
  54. package/jest/mockComponent.js +7 -0
  55. package/overrides.json +18 -11
  56. package/package.json +17 -17
  57. package/rn-get-polyfills.js +1 -0
  58. package/src/private/core/composeStyles.js +27 -0
  59. package/src/private/featureflags/ReactNativeFeatureFlags.js +24 -14
  60. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +6 -4
  61. package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +24 -24
  62. package/src/private/webapis/dom/nodes/ReactNativeElement.js +4 -4
  63. package/src/private/webapis/dom/oldstylecollections/DOMRectList.js +4 -4
  64. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +4 -4
  65. package/src/private/webapis/dom/oldstylecollections/NodeList.js +5 -5
  66. package/src/private/webapis/performance/MemoryInfo.js +9 -9
  67. package/src/private/webapis/performance/PerformanceObserver.js +16 -16
  68. package/src/private/webapis/performance/ReactNativeStartupTiming.js +18 -18
  69. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  70. package/jest/ReactNativeInternalFeatureFlagsMock.js +0 -13
@@ -0,0 +1,132 @@
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
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ export type FilterPrimitive =
14
+ | {brightness: number | string}
15
+ | {blur: number | string}
16
+ | {contrast: number | string}
17
+ | {grayscale: number | string}
18
+ | {hueRotate: number | string}
19
+ | {invert: number | string}
20
+ | {opacity: number | string}
21
+ | {saturate: number | string}
22
+ | {sepia: number | string};
23
+
24
+ export default function processFilter(
25
+ filter: $ReadOnlyArray<FilterPrimitive> | string,
26
+ ): $ReadOnlyArray<FilterPrimitive> {
27
+ let result: Array<FilterPrimitive> = [];
28
+ if (typeof filter === 'string') {
29
+ // matches on functions with args like "brightness(1.5)"
30
+ const regex = new RegExp(/(\w+)\(([^)]+)\)/g);
31
+ let matches;
32
+
33
+ while ((matches = regex.exec(filter))) {
34
+ const amount = _getFilterAmount(matches[1], matches[2]);
35
+
36
+ if (amount != null) {
37
+ const filterPrimitive = {};
38
+ // $FlowFixMe The key will be the correct one but flow can't see that.
39
+ filterPrimitive[matches[1]] = amount;
40
+ // $FlowFixMe The key will be the correct one but flow can't see that.
41
+ result.push(filterPrimitive);
42
+ } else {
43
+ // If any primitive is invalid then apply none of the filters. This is how
44
+ // web works and makes it clear that something is wrong becuase no
45
+ // graphical effects are happening.
46
+ return [];
47
+ }
48
+ }
49
+ } else {
50
+ for (const filterPrimitive of filter) {
51
+ const [filterName, filterValue] = Object.entries(filterPrimitive)[0];
52
+ const amount = _getFilterAmount(filterName, filterValue);
53
+
54
+ if (amount != null) {
55
+ const resultObject = {};
56
+ // $FlowFixMe
57
+ resultObject[filterName] = amount;
58
+ // $FlowFixMe
59
+ result.push(resultObject);
60
+ } else {
61
+ // If any primitive is invalid then apply none of the filters. This is how
62
+ // web works and makes it clear that something is wrong becuase no
63
+ // graphical effects are happening.
64
+ return [];
65
+ }
66
+ }
67
+ }
68
+
69
+ return result;
70
+ }
71
+
72
+ function _getFilterAmount(filterName: string, filterArgs: mixed): ?number {
73
+ let filterArgAsNumber: number;
74
+ let unit: string;
75
+ if (typeof filterArgs === 'string') {
76
+ // matches on args with units like "1.5 5% -80deg"
77
+ const argsWithUnitsRegex = new RegExp(/([+-]?\d*(\.\d+)?)([a-zA-Z%]+)?/g);
78
+ const match = argsWithUnitsRegex.exec(filterArgs);
79
+
80
+ if (!match || isNaN(Number(match[1]))) {
81
+ return undefined;
82
+ }
83
+
84
+ filterArgAsNumber = Number(match[1]);
85
+ unit = match[3];
86
+ } else if (typeof filterArgs === 'number') {
87
+ filterArgAsNumber = filterArgs;
88
+ } else {
89
+ return undefined;
90
+ }
91
+
92
+ switch (filterName) {
93
+ // Hue rotate takes some angle that can have a unit and can be
94
+ // negative. Additionally, 0 with no unit is allowed.
95
+ case 'hueRotate':
96
+ if (filterArgAsNumber === 0) {
97
+ return 0;
98
+ }
99
+ if (unit !== 'deg' && unit !== 'rad') {
100
+ return undefined;
101
+ }
102
+ return unit === 'rad'
103
+ ? (180 * filterArgAsNumber) / Math.PI
104
+ : filterArgAsNumber;
105
+ // blur takes any positive CSS length that is not a percent. In RN
106
+ // we currently only have DIPs, so we are not parsing units here.
107
+ case 'blur':
108
+ if ((unit && unit !== 'px') || filterArgAsNumber < 0) {
109
+ return undefined;
110
+ }
111
+ return filterArgAsNumber;
112
+ // All other filters except take a non negative number or percentage. There
113
+ // are no units associated with this value and percentage numbers map 1-to-1
114
+ // to a non-percentage number (e.g. 50% == 0.5).
115
+ case 'brightness':
116
+ case 'contrast':
117
+ case 'grayscale':
118
+ case 'invert':
119
+ case 'opacity':
120
+ case 'saturate':
121
+ case 'sepia':
122
+ if ((unit && unit !== '%' && unit !== 'px') || filterArgAsNumber < 0) {
123
+ return undefined;
124
+ }
125
+ if (unit === '%') {
126
+ filterArgAsNumber /= 100;
127
+ }
128
+ return filterArgAsNumber;
129
+ default:
130
+ return undefined;
131
+ }
132
+ }
@@ -76,7 +76,8 @@ export function getEnforcing<T: TurboModule>(name: string): T {
76
76
  'Verify that a module by this name is registered in the native binary.';
77
77
 
78
78
  if (shouldReportDebugInfo()) {
79
- message += 'Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. ';
79
+ message +=
80
+ ' Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. ';
80
81
  message +=
81
82
  'TurboModule interop: ' +
82
83
  (isTurboModuleInteropEnabled() ? 'true' : 'false') +
@@ -44,6 +44,7 @@ class Dimensions {
44
44
  * @returns {DisplayMetrics? | DisplayMetricsAndroid?} Value for the dimension.
45
45
  */
46
46
  static get(dim: string): DisplayMetrics | DisplayMetricsAndroid {
47
+ // $FlowFixMe[invalid-computed-prop]
47
48
  invariant(dimensions[dim], 'No dimension set for key ' + dim);
48
49
  return dimensions[dim];
49
50
  }
@@ -48,6 +48,7 @@ class Dimensions {
48
48
  * @returns {DisplayMetrics? | DisplayMetricsAndroid?} Value for the dimension.
49
49
  */
50
50
  static get(dim: string): DisplayMetrics | DisplayMetricsAndroid {
51
+ // $FlowFixMe[invalid-computed-prop]
51
52
  invariant(dimensions[dim], 'No dimension set for key ' + dim);
52
53
  return dimensions[dim];
53
54
  }
@@ -38,6 +38,7 @@ const RCTLog = {
38
38
 
39
39
  // Log to console regardless of nativeLoggingHook
40
40
  logToConsole(level: string, ...args: Array<mixed>): void {
41
+ // $FlowFixMe[invalid-computed-prop]
41
42
  const logFn = levelsMap[level];
42
43
  invariant(
43
44
  logFn,
@@ -104,16 +104,21 @@ export function getConfigWithoutViewProps(
104
104
  viewConfig: ViewConfig,
105
105
  propName: string,
106
106
  ): {...} {
107
+ // $FlowFixMe[invalid-computed-prop]
107
108
  if (!viewConfig[propName]) {
108
109
  return {};
109
110
  }
110
111
 
111
- return Object.keys(viewConfig[propName])
112
- .filter(prop => !PlatformBaseViewConfig[propName][prop])
113
- .reduce<{[string]: any}>((obj, prop) => {
114
- obj[prop] = viewConfig[propName][prop];
115
- return obj;
116
- }, {});
112
+ return (
113
+ Object.keys(viewConfig[propName])
114
+ // $FlowFixMe[invalid-computed-prop]
115
+ .filter(prop => !PlatformBaseViewConfig[propName][prop])
116
+ .reduce<{[string]: any}>((obj, prop) => {
117
+ // $FlowFixMe[invalid-computed-prop]
118
+ obj[prop] = viewConfig[propName][prop];
119
+ return obj;
120
+ }, {})
121
+ );
117
122
  }
118
123
 
119
124
  export function stringifyViewConfig(viewConfig: any): string {
@@ -50,6 +50,13 @@ module.exports = (moduleName, instanceMethods, isESModule) => {
50
50
  }
51
51
  };
52
52
 
53
+ Object.defineProperty(Component, 'name', {
54
+ value: name,
55
+ writable: false,
56
+ enumerable: false,
57
+ configurable: true,
58
+ });
59
+
53
60
  Component.displayName = nameWithoutPrefix;
54
61
 
55
62
  Object.keys(RealComponent).forEach(classStatic => {
package/overrides.json CHANGED
@@ -7,13 +7,13 @@
7
7
  "**/__snapshots__/**",
8
8
  "src-win/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.75.0-nightly-20240420-03a51da72",
10
+ "baseVersion": "0.75.0-nightly-20240511-3f17c8b5f",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
14
14
  "file": ".flowconfig",
15
15
  "baseFile": ".flowconfig",
16
- "baseHash": "4f8e1f39d8ed29d7d0e21455cac407d352a6824d"
16
+ "baseHash": "bd274caf8faae09b1f0513a4086c07b778072e78"
17
17
  },
18
18
  {
19
19
  "type": "derived",
@@ -35,7 +35,7 @@
35
35
  "type": "derived",
36
36
  "file": "src-win/Libraries/Animated/NativeAnimatedHelper.win32.js",
37
37
  "baseFile": "packages/react-native/Libraries/Animated/NativeAnimatedHelper.js",
38
- "baseHash": "96eb39e775435801b031cd1a41265ed73705cd72",
38
+ "baseHash": "2cefe6e59aa26f98158be3f35452f9a49d8395c4",
39
39
  "issue": 11041
40
40
  },
41
41
  {
@@ -116,7 +116,7 @@
116
116
  "type": "derived",
117
117
  "file": "src-win/Libraries/Components/TextInput/TextInput.win32.js",
118
118
  "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js",
119
- "baseHash": "b1ef5981a6abbb0548fc5fd835ad711c10712d61"
119
+ "baseHash": "dad569fd3dd81f212afd7b35ffe75108e926eb5e"
120
120
  },
121
121
  {
122
122
  "type": "patch",
@@ -174,13 +174,13 @@
174
174
  "type": "patch",
175
175
  "file": "src-win/Libraries/Components/View/ReactNativeViewAttributes.win32.js",
176
176
  "baseFile": "packages/react-native/Libraries/Components/View/ReactNativeViewAttributes.js",
177
- "baseHash": "0aabb0825ab9d65cb39f526ad3ac10874d6cde7e"
177
+ "baseHash": "8fc645a55ff86ceeac9c45f09d232586589ee7dc"
178
178
  },
179
179
  {
180
180
  "type": "patch",
181
181
  "file": "src-win/Libraries/Components/View/View.win32.js",
182
182
  "baseFile": "packages/react-native/Libraries/Components/View/View.js",
183
- "baseHash": "d621a2fb669bbc2fc0657db1233c9a930a073fba"
183
+ "baseHash": "1905f72f4d202d466ea7d8ed4b36df0845f2c310"
184
184
  },
185
185
  {
186
186
  "type": "derived",
@@ -198,13 +198,13 @@
198
198
  "type": "derived",
199
199
  "file": "src-win/Libraries/Components/View/ViewPropTypes.d.ts",
200
200
  "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts",
201
- "baseHash": "59baf00fff15e8fefbc0bce732af1c247d4695be"
201
+ "baseHash": "8e33800dfdd3b50e26c3331abb8b4682c091602f"
202
202
  },
203
203
  {
204
204
  "type": "patch",
205
205
  "file": "src-win/Libraries/Components/View/ViewPropTypes.win32.js",
206
206
  "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.js",
207
- "baseHash": "6eecfbf0d3028d1838463a66b3acbda6f9a2c651",
207
+ "baseHash": "50bd550ba0710173ca3533b7b103075ecdda6b56",
208
208
  "issue": 6240
209
209
  },
210
210
  {
@@ -217,6 +217,13 @@
217
217
  "type": "platform",
218
218
  "file": "src-win/Libraries/Components/View/ViewWin32.js"
219
219
  },
220
+ {
221
+ "type": "patch",
222
+ "file": "src-win/Libraries/Core/Devtools/loadBundleFromServer.win32.js",
223
+ "baseFile": "packages/react-native/Libraries/Core/Devtools/loadBundleFromServer.js",
224
+ "baseHash": "14662281c97222b45893308b744a7dc7c2000801",
225
+ "issue": 12704
226
+ },
220
227
  {
221
228
  "type": "patch",
222
229
  "file": "src-win/Libraries/Core/ReactNativeVersionCheck.win32.js",
@@ -337,7 +344,7 @@
337
344
  "type": "derived",
338
345
  "file": "src-win/Libraries/NativeComponent/BaseViewConfig.win32.js",
339
346
  "baseFile": "packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js",
340
- "baseHash": "ae7bdcfff1117d4a349b7b9bcc108a22ae7099ae"
347
+ "baseHash": "d7b9540d5e637cb86b29d119838a4024bfc2b7d6"
341
348
  },
342
349
  {
343
350
  "type": "copy",
@@ -420,7 +427,7 @@
420
427
  "type": "patch",
421
428
  "file": "src-win/Libraries/StyleSheet/StyleSheet.win32.js",
422
429
  "baseFile": "packages/react-native/Libraries/StyleSheet/StyleSheet.js",
423
- "baseHash": "7c42da708bc5cf4e3135ae81a45dddae48e0bfec"
430
+ "baseHash": "5c01bd55040fb9d31534bd27b98fe9c3671994c0"
424
431
  },
425
432
  {
426
433
  "type": "derived",
@@ -471,7 +478,7 @@
471
478
  "type": "derived",
472
479
  "file": "src-win/Libraries/Utilities/Dimensions.win32.js",
473
480
  "baseFile": "packages/react-native/Libraries/Utilities/Dimensions.js",
474
- "baseHash": "e2c1d4379abf083b11f3e853d160068ad6b55ba0"
481
+ "baseHash": "bac146d616013f6da06bba9f6c0f52633e4a0737"
475
482
  },
476
483
  {
477
484
  "type": "platform",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.0.0-canary.247",
3
+ "version": "0.0.0-canary.249",
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-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",
33
+ "@react-native/assets-registry": "0.75.0-nightly-20240511-3f17c8b5f",
34
+ "@react-native/codegen": "0.75.0-nightly-20240511-3f17c8b5f",
35
+ "@react-native/community-cli-plugin": "0.75.0-nightly-20240511-3f17c8b5f",
36
+ "@react-native/gradle-plugin": "0.75.0-nightly-20240511-3f17c8b5f",
37
+ "@react-native/js-polyfills": "0.75.0-nightly-20240511-3f17c8b5f",
38
+ "@react-native/normalize-colors": "0.75.0-nightly-20240511-3f17c8b5f",
39
+ "@react-native/virtualized-lists": "0.75.0-nightly-20240511-3f17c8b5f",
40
40
  "abort-controller": "^3.0.0",
41
41
  "anser": "^1.4.9",
42
42
  "ansi-regex": "^5.0.0",
@@ -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-20240420-03a51da72",
73
+ "@react-native/metro-config": "0.75.0-nightly-20240511-3f17c8b5f",
74
74
  "@rnw-scripts/babel-react-native-config": "0.0.0",
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",
75
+ "@rnw-scripts/eslint-config": "1.2.19",
76
+ "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.23",
77
+ "@rnw-scripts/just-task": "2.3.35",
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",
@@ -85,15 +85,15 @@
85
85
  "jscodeshift": "^0.14.0",
86
86
  "just-scripts": "^1.3.3",
87
87
  "prettier": "2.8.8",
88
- "react": "18.2.0",
89
- "react-native": "0.75.0-nightly-20240420-03a51da72",
90
- "react-native-platform-override": "^1.9.34",
88
+ "react": "18.3.1",
89
+ "react-native": "0.75.0-nightly-20240511-3f17c8b5f",
90
+ "react-native-platform-override": "^1.9.36",
91
91
  "typescript": "5.0.4"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "@types/react": "^18.2.6",
95
- "react": "18.2.0",
96
- "react-native": "0.75.0-nightly-20240420-03a51da72"
95
+ "react": "^18.2.0",
96
+ "react-native": "0.75.0-nightly-20240511-3f17c8b5f"
97
97
  },
98
98
  "beachball": {
99
99
  "defaultNpmTag": "canary",
@@ -4,6 +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
+ * @flow strict-local
7
8
  * @format
8
9
  */
9
10
 
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ /**
12
+ * Combines two styles such that `style2` will override any styles in `style1`.
13
+ * If either style is null or undefined, the other one is returned without
14
+ * allocating an array, saving allocations and enabling memoization.
15
+ */
16
+ export default function composeStyles<T1, T2>(
17
+ style1: ?T1,
18
+ style2: ?T2,
19
+ ): ?(T1 | T2 | $ReadOnlyArray<T1 | T2>) {
20
+ if (style1 == null) {
21
+ return style2;
22
+ }
23
+ if (style2 == null) {
24
+ return style1;
25
+ }
26
+ return [style1, style2];
27
+ }
@@ -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<<0e0858557eb27f3eebfecae18ee13c0b>>
7
+ * @generated SignedSource<<953d2d7e7adb016bf30c2be62ee0d89a>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -41,18 +41,20 @@ export type ReactNativeFeatureFlagsJsOnlyOverrides = Partial<ReactNativeFeatureF
41
41
  export type ReactNativeFeatureFlags = {
42
42
  ...ReactNativeFeatureFlagsJsOnly,
43
43
  commonTestFlag: Getter<boolean>,
44
+ allowCollapsableChildren: Getter<boolean>,
45
+ androidEnablePendingFabricTransactions: Getter<boolean>,
44
46
  batchRenderingUpdatesInEventLoop: Getter<boolean>,
47
+ destroyFabricSurfacesInReactInstanceManager: Getter<boolean>,
45
48
  enableBackgroundExecutor: Getter<boolean>,
46
49
  enableCleanTextInputYogaNode: Getter<boolean>,
47
- enableCustomDrawOrderFabric: Getter<boolean>,
50
+ enableGranularShadowTreeStateReconciliation: Getter<boolean>,
48
51
  enableMicrotasks: Getter<boolean>,
49
- enableMountHooksAndroid: Getter<boolean>,
50
- enableSpannableBuildingUnification: Getter<boolean>,
51
52
  enableSynchronousStateUpdates: Getter<boolean>,
52
53
  enableUIConsistency: Getter<boolean>,
53
54
  forceBatchingMountItemsOnAndroid: Getter<boolean>,
54
55
  inspectorEnableCxxInspectorPackagerConnection: Getter<boolean>,
55
56
  inspectorEnableModernCDPRegistry: Getter<boolean>,
57
+ lazyAnimationCallbacks: Getter<boolean>,
56
58
  preventDoubleTextMeasure: Getter<boolean>,
57
59
  useModernRuntimeScheduler: Getter<boolean>,
58
60
  useNativeViewConfigsInBridgelessMode: Getter<boolean>,
@@ -103,10 +105,22 @@ export const shouldUseSetNativePropsInFabric: Getter<boolean> = createJavaScript
103
105
  * Common flag for testing. Do NOT modify.
104
106
  */
105
107
  export const commonTestFlag: Getter<boolean> = createNativeFlagGetter('commonTestFlag', false);
108
+ /**
109
+ * Enables the differentiator to understand the "collapsableChildren" prop
110
+ */
111
+ export const allowCollapsableChildren: Getter<boolean> = createNativeFlagGetter('allowCollapsableChildren', true);
112
+ /**
113
+ * To be used with batchRenderingUpdatesInEventLoop. When enbled, the Android mounting layer will concatenate pending transactions to ensure they're applied atomatically
114
+ */
115
+ export const androidEnablePendingFabricTransactions: Getter<boolean> = createNativeFlagGetter('androidEnablePendingFabricTransactions', false);
106
116
  /**
107
117
  * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
108
118
  */
109
119
  export const batchRenderingUpdatesInEventLoop: Getter<boolean> = createNativeFlagGetter('batchRenderingUpdatesInEventLoop', false);
120
+ /**
121
+ * When enabled, ReactInstanceManager will clean up Fabric surfaces on destroy().
122
+ */
123
+ export const destroyFabricSurfacesInReactInstanceManager: Getter<boolean> = createNativeFlagGetter('destroyFabricSurfacesInReactInstanceManager', false);
110
124
  /**
111
125
  * Enables the use of a background executor to compute layout and commit updates on Fabric (this system is deprecated and should not be used).
112
126
  */
@@ -116,21 +130,13 @@ export const enableBackgroundExecutor: Getter<boolean> = createNativeFlagGetter(
116
130
  */
117
131
  export const enableCleanTextInputYogaNode: Getter<boolean> = createNativeFlagGetter('enableCleanTextInputYogaNode', false);
118
132
  /**
119
- * When enabled, Fabric will use customDrawOrder in ReactViewGroup (similar to old architecture).
133
+ * When enabled, the renderer would only fail commits when they propagate state and the last commit that updated state changed before committing.
120
134
  */
121
- export const enableCustomDrawOrderFabric: Getter<boolean> = createNativeFlagGetter('enableCustomDrawOrderFabric', false);
135
+ export const enableGranularShadowTreeStateReconciliation: Getter<boolean> = createNativeFlagGetter('enableGranularShadowTreeStateReconciliation', false);
122
136
  /**
123
137
  * Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution).
124
138
  */
125
139
  export const enableMicrotasks: Getter<boolean> = createNativeFlagGetter('enableMicrotasks', false);
126
- /**
127
- * Enables the notification of mount operations to mount hooks on Android.
128
- */
129
- export const enableMountHooksAndroid: Getter<boolean> = createNativeFlagGetter('enableMountHooksAndroid', false);
130
- /**
131
- * Uses new, deduplicated logic for constructing Android Spannables from text fragments
132
- */
133
- export const enableSpannableBuildingUnification: Getter<boolean> = createNativeFlagGetter('enableSpannableBuildingUnification', false);
134
140
  /**
135
141
  * Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tree synchronously from the main thread).
136
142
  */
@@ -151,6 +157,10 @@ export const inspectorEnableCxxInspectorPackagerConnection: Getter<boolean> = cr
151
157
  * Flag determining if the modern CDP backend should be enabled. This flag is global and should not be changed across React Host lifetimes.
152
158
  */
153
159
  export const inspectorEnableModernCDPRegistry: Getter<boolean> = createNativeFlagGetter('inspectorEnableModernCDPRegistry', false);
160
+ /**
161
+ * Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.
162
+ */
163
+ export const lazyAnimationCallbacks: Getter<boolean> = createNativeFlagGetter('lazyAnimationCallbacks', false);
154
164
  /**
155
165
  * When enabled, ParagraphShadowNode will no longer call measure twice.
156
166
  */
@@ -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<<4ba909c3b360c6a4fc9c6ed5996b6a13>>
7
+ * @generated SignedSource<<446991ce24c5765399940bfda55c0e5c>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -24,18 +24,20 @@ import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboMod
24
24
 
25
25
  export interface Spec extends TurboModule {
26
26
  +commonTestFlag?: () => boolean;
27
+ +allowCollapsableChildren?: () => boolean;
28
+ +androidEnablePendingFabricTransactions?: () => boolean;
27
29
  +batchRenderingUpdatesInEventLoop?: () => boolean;
30
+ +destroyFabricSurfacesInReactInstanceManager?: () => boolean;
28
31
  +enableBackgroundExecutor?: () => boolean;
29
32
  +enableCleanTextInputYogaNode?: () => boolean;
30
- +enableCustomDrawOrderFabric?: () => boolean;
33
+ +enableGranularShadowTreeStateReconciliation?: () => boolean;
31
34
  +enableMicrotasks?: () => boolean;
32
- +enableMountHooksAndroid?: () => boolean;
33
- +enableSpannableBuildingUnification?: () => boolean;
34
35
  +enableSynchronousStateUpdates?: () => boolean;
35
36
  +enableUIConsistency?: () => boolean;
36
37
  +forceBatchingMountItemsOnAndroid?: () => boolean;
37
38
  +inspectorEnableCxxInspectorPackagerConnection?: () => boolean;
38
39
  +inspectorEnableModernCDPRegistry?: () => boolean;
40
+ +lazyAnimationCallbacks?: () => boolean;
39
41
  +preventDoubleTextMeasure?: () => boolean;
40
42
  +useModernRuntimeScheduler?: () => boolean;
41
43
  +useNativeViewConfigsInBridgelessMode?: () => boolean;