From 6c6d5f6bd3fb847db2b8bace3b9871f5ed29c76f Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:36:34 +0530 Subject: [PATCH 01/11] Integrate 0.83.0-nightly-20251104-502efe1cc committing with conflicts https://github.com/facebook/react-native/compare/6f482708b...502efe1cc --- .../react-native-win32-tester/overrides.json | 4 +- .../react-native-win32-tester/package.json | 6 +- .../src/js/utils/RNTesterList.win32.js | 5 + .../react-native-win32/.flowconfig | 2 +- .../react-native-win32/overrides.json | 12 +- .../react-native-win32/package.json | 20 +- .../AccessibilityInfo.win32.js | 58 +- .../Libraries/Components/View/ViewWin32.d.ts | 10 + .../Renderer/shims/ReactNativeTypes.win32.js | 4 +- .../src-win/Libraries/Text/Text.d.ts | 4 +- .../automation-channel/package.json | 2 +- .../tester/overrides.json | 6 +- .../@react-native-windows/tester/package.json | 8 +- .../src/js/utils/RNTesterList.windows.js | 5 + .../@react-native/monorepo/overrides.json | 4 +- packages/@react-native/monorepo/package.json | 9 +- .../NativeScreenshotManager.js | 2 +- .../tester/js/utils/RNTesterList.android.js | 5 + .../tester/js/utils/RNTesterList.ios.js | 5 + packages/@react-native/tester/overrides.json | 14 +- packages/@react-native/tester/package.json | 6 +- .../babel-react-native-config/package.json | 4 +- .../@rnw-scripts/eslint-config/package.json | 2 +- .../metro-dev-config/package.json | 2 +- packages/e2e-test-app-fabric/package.json | 4 +- packages/playground/package.json | 4 +- packages/sample-app-fabric/package.json | 4 +- packages/sample-custom-component/package.json | 4 +- vnext/.flowconfig | 2 +- .../WindowsTextInputComponentDescriptor.h | 75 +- .../TextInput/WindowsTextInputShadowNode.cpp | 8 + .../TextInput/WindowsTextInputShadowNode.h | 7 +- .../TextInput/WindowsTextInputState.h | 14 +- .../cxxreact/NativeToJsBridge.cpp | 4 +- .../cxxreact/TraceSection.h | 59 +- .../jsi/jsi/test/testlib.cpp | 153 ++-- .../jsinspector-modern/NetworkIOAgent.cpp | 122 +-- .../jsinspector-modern/NetworkIOAgent.h | 66 +- .../jsinspector-modern/Utf8.h | 9 +- .../core/ReactCommon/TurboModule.h | 60 +- .../react/nativemodule/dom/NativeDOM.h | 94 +-- .../renderer/components/image/conversions.h | 20 + .../components/text/ParagraphShadowNode.cpp | 33 +- .../renderer/components/text/ParagraphState.h | 17 +- .../components/view/AccessibilityPrimitives.h | 58 +- .../view/accessibilityPropsConversions.h | 91 +- .../renderer/components/view/conversions.h | 776 ++++++++---------- .../react/renderer/core/ShadowNode.cpp | 4 + .../react/renderer/imagemanager/primitives.h | 54 +- vnext/overrides.json | 52 +- vnext/package.json | 22 +- .../AccessibilityInfo.windows.js | 58 +- .../shims/ReactNativeTypes.windows.js | 4 +- vnext/src-win/Libraries/Text/Text.d.ts | 4 +- yarn.lock | 117 ++- 55 files changed, 1138 insertions(+), 1060 deletions(-) diff --git a/packages/@office-iss/react-native-win32-tester/overrides.json b/packages/@office-iss/react-native-win32-tester/overrides.json index 9c352e53359..fc2ace5294e 100644 --- a/packages/@office-iss/react-native-win32-tester/overrides.json +++ b/packages/@office-iss/react-native-win32-tester/overrides.json @@ -5,7 +5,7 @@ "excludePatterns": [ "src/js/examples-win32/**" ], - "baseVersion": "0.83.0-nightly-20251012-6f482708b", + "baseVersion": "0.83.0-nightly-20251104-502efe1cc", "overrides": [ { "type": "patch", @@ -42,7 +42,7 @@ "type": "derived", "file": "src/js/utils/RNTesterList.win32.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.android.js", - "baseHash": "aeb0275507e7c508cdf7c2ceec49f9e95ef4e1ec" + "baseHash": "419d588f738d7f9fc252019e74ca7bc92c6a03bf" } ] } \ No newline at end of file diff --git a/packages/@office-iss/react-native-win32-tester/package.json b/packages/@office-iss/react-native-win32-tester/package.json index 038a61e1762..cacb984fb6b 100644 --- a/packages/@office-iss/react-native-win32-tester/package.json +++ b/packages/@office-iss/react-native-win32-tester/package.json @@ -11,7 +11,7 @@ "validate-overrides": "react-native-platform-override validate" }, "dependencies": { - "@react-native/tester": "0.83.0-nightly-20251012-6f482708b", + "@react-native/tester": "0.83.0-nightly-20251104-502efe1cc", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "flow-enums-runtime": "^0.0.6" @@ -19,7 +19,7 @@ "peerDependencies": { "@office-iss/react-native-win32": "^0.0.0-canary.305", "react": "19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b" + "react-native": "0.83.0-nightly-20251104-502efe1cc" }, "devDependencies": { "@office-iss/react-native-win32": "^0.0.0-canary.305", @@ -30,7 +30,7 @@ "@types/node": "^22.14.0", "eslint": "^8.19.0", "just-scripts": "^1.3.3", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-platform-override": "0.0.0-canary.1019", "typescript": "5.0.4" }, diff --git a/packages/@office-iss/react-native-win32-tester/src/js/utils/RNTesterList.win32.js b/packages/@office-iss/react-native-win32-tester/src/js/utils/RNTesterList.win32.js index c951141a754..62255f911e1 100644 --- a/packages/@office-iss/react-native-win32-tester/src/js/utils/RNTesterList.win32.js +++ b/packages/@office-iss/react-native-win32-tester/src/js/utils/RNTesterList.win32.js @@ -330,6 +330,11 @@ const APIs: Array = ([ category: 'UI', module: require('../examples/RadialGradient/RadialGradientExample'), }, + { + key: 'BackgroundImageExample', + category: 'UI', + module: require('../examples/BackgroundImage/BackgroundImageExample'), + }, { key: 'MixBlendModeExample', category: 'UI', diff --git a/packages/@office-iss/react-native-win32/.flowconfig b/packages/@office-iss/react-native-win32/.flowconfig index dc05aeb0a85..12eb888bc23 100644 --- a/packages/@office-iss/react-native-win32/.flowconfig +++ b/packages/@office-iss/react-native-win32/.flowconfig @@ -175,4 +175,4 @@ untyped-import untyped-type-import [version] -^0.287.0 +^0.289.0 diff --git a/packages/@office-iss/react-native-win32/overrides.json b/packages/@office-iss/react-native-win32/overrides.json index c2bec4aef7e..8c1deb72816 100644 --- a/packages/@office-iss/react-native-win32/overrides.json +++ b/packages/@office-iss/react-native-win32/overrides.json @@ -7,13 +7,13 @@ "**/__snapshots__/**", "src-win/rntypes/**" ], - "baseVersion": "0.83.0-nightly-20251012-6f482708b", + "baseVersion": "0.83.0-nightly-20251104-502efe1cc", "overrides": [ { "type": "derived", "file": ".flowconfig", "baseFile": ".flowconfig", - "baseHash": "40952c5ed2905d0daf6988169293ed3e24f77241" + "baseHash": "5a5f25ce055b9b4465410b513de9dc6d4db39a90" }, { "type": "derived", @@ -47,7 +47,7 @@ "type": "derived", "file": "src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js", "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js", - "baseHash": "b77b87e32a86265a3c8c29ebbbee46558596aec8" + "baseHash": "93b9eb92a1237885cdbff255d473584226421dd3" }, { "type": "copy", @@ -214,7 +214,7 @@ "type": "derived", "file": "src-win/Libraries/Components/View/ViewWin32.d.ts", "baseFile": "packages/react-native/Libraries/Components/View/View.d.ts", - "baseHash": "c71957187cbae0b40995198a2d7a18d5cae6d662" + "baseHash": "27bf94d4a6d5ae4034c2da165fb5bc06fd98d1a3" }, { "type": "platform", @@ -400,7 +400,7 @@ "type": "patch", "file": "src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js", "baseFile": "packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js", - "baseHash": "41da351b1e8d090e5ecf0859738218a5dcd4c08f", + "baseHash": "333afc05f5a42a5321196f5f7a14d14c8fd5dd0f", "issue": 0 }, { @@ -425,7 +425,7 @@ "type": "derived", "file": "src-win/Libraries/Text/Text.d.ts", "baseFile": "packages/react-native/Libraries/Text/Text.d.ts", - "baseHash": "3540a1a36fc487e54c1cec9b0c57b4fdc2124b60" + "baseHash": "0289a5c0fbb168f20602451fe314f3787f1ac66f" }, { "type": "derived", diff --git a/packages/@office-iss/react-native-win32/package.json b/packages/@office-iss/react-native-win32/package.json index b75c2a28b7a..83ba6e39918 100644 --- a/packages/@office-iss/react-native-win32/package.json +++ b/packages/@office-iss/react-native-win32/package.json @@ -30,13 +30,13 @@ "@react-native-community/cli-platform-android": "20.0.0", "@react-native-community/cli-platform-ios": "20.0.0", "@react-native/assets": "1.0.0", - "@react-native/assets-registry": "0.83.0-nightly-20251012-6f482708b", - "@react-native/codegen": "0.83.0-nightly-20251012-6f482708b", - "@react-native/community-cli-plugin": "0.83.0-nightly-20251012-6f482708b", - "@react-native/gradle-plugin": "0.83.0-nightly-20251012-6f482708b", - "@react-native/js-polyfills": "0.83.0-nightly-20251012-6f482708b", - "@react-native/normalize-colors": "0.83.0-nightly-20251012-6f482708b", - "@react-native/virtualized-lists": "0.83.0-nightly-20251012-6f482708b", + "@react-native/assets-registry": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/codegen": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/community-cli-plugin": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/gradle-plugin": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/js-polyfills": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/normalize-colors": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/virtualized-lists": "0.83.0-nightly-20251104-502efe1cc", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", @@ -72,7 +72,7 @@ "devDependencies": { "@babel/core": "^7.25.2", "@babel/eslint-parser": "^7.25.1", - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.42", @@ -88,14 +88,14 @@ "just-scripts": "^1.3.3", "prettier": "2.8.8", "react": "19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-platform-override": "0.0.0-canary.1019", "typescript": "5.0.4" }, "peerDependencies": { "@types/react": "^19.2.0", "react": "^19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b" + "react-native": "0.83.0-nightly-20251104-502efe1cc" }, "beachball": { "defaultNpmTag": "canary", diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js index efd8dc05ee3..9fbd984e4a4 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js @@ -107,7 +107,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } }); } @@ -127,7 +127,11 @@ const AccessibilityInfo = { if (NativeAccessibilityInfoAndroid?.isGrayscaleEnabled != null) { NativeAccessibilityInfoAndroid.isGrayscaleEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isGrayscaleEnabled is not available', + ), + ); } }); } else if (Platform.OS === 'win32') { @@ -140,7 +144,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('AccessibilityInfo native module is not available')); } }); } @@ -160,7 +164,11 @@ const AccessibilityInfo = { if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) { NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isInvertColorsEnabled is not available', + ), + ); } }); } else if (Platform.OS === 'win32') { @@ -173,7 +181,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('AccessibilityInfo native module is not available')); } }); } @@ -199,7 +207,7 @@ const AccessibilityInfo = { if (NativeAccessibilityInfoWin32 != null) { NativeAccessibilityInfoWin32.isReduceMotionEnabled(resolve); } else { - reject(null); + reject(new Error('AccessibilityInfo native module is not available')); } } else { if (NativeAccessibilityManagerIOS != null) { @@ -208,7 +216,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } } }); @@ -226,7 +234,11 @@ const AccessibilityInfo = { if (NativeAccessibilityInfo?.isHighTextContrastEnabled != null) { NativeAccessibilityInfo.isHighTextContrastEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isHighTextContrastEnabled is not available', + ), + ); } } else { return Promise.resolve(false); @@ -254,7 +266,11 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityManagerIOS.getCurrentDarkerSystemColorsState is not available', + ), + ); } } }); @@ -282,7 +298,11 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityManagerIOS.getCurrentPrefersCrossFadeTransitionsState is not available', + ), + ); } } }); @@ -307,7 +327,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } }); } @@ -333,7 +353,7 @@ const AccessibilityInfo = { if (NativeAccessibilityInfoWin32 != null) { NativeAccessibilityInfoWin32.isTouchExplorationEnabled(resolve); } else { - reject(null); + reject(new Error('NativeAccessibilityInfoAndroid is not available')); } } else { if (NativeAccessibilityManagerIOS != null) { @@ -342,7 +362,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } } }); @@ -367,10 +387,18 @@ const AccessibilityInfo = { ) { NativeAccessibilityInfo.isAccessibilityServiceEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isAccessibilityServiceEnabled is not available', + ), + ); } } else { - reject(null); + reject( + new Error( + 'isAccessibilityServiceEnabled is only available on Android', + ), + ); } }); }, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts index d2b93152a0a..fb5e3d49274 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts @@ -10,7 +10,11 @@ import type * as React from 'react'; import {Constructor} from 'react-native/types/private/Utilities'; import {ViewProps} from './ViewPropTypes'; +<<<<<<< Upstream +import {HostInstance} from '../../../types/public/ReactNativeTypes'; +======= import {NativeMethods} from 'react-native/types/public/ReactNativeTypes'; +>>>>>>> Override /** * The most fundamental component for building UI, View is a container that supports layout with flexbox, style, some touch handling, @@ -18,10 +22,16 @@ import {NativeMethods} from 'react-native/types/public/ReactNativeTypes'; * View maps directly to the native view equivalent on whatever platform React is running on, * whether that is a UIView,
, android.view, etc. */ +<<<<<<< Upstream +declare class ViewComponent extends React.Component {} +declare const ViewBase: Constructor & typeof ViewComponent; +export class View extends ViewBase { +======= declare class ViewWin32Component extends React.Component {} declare const ViewWin32Base: Constructor & typeof ViewWin32Component; export class ViewWin32 extends ViewWin32Base { +>>>>>>> Override /** * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) * @platform ios diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js index 3226d4b538b..ee6ae134cac 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Renderer/shims/ReactNativeTypes.win32.js @@ -7,9 +7,7 @@ * @noformat * @nolint * @flow strict - * @generated SignedSource<<989e6e2e860dc2af7ba983849111bda8>> - * - * This file was sync'd from the facebook/react repository. + * @generated SignedSource<> */ import type { diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts index ff3ceec9358..4179d173130 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts @@ -10,7 +10,7 @@ import type * as React from 'react'; import {Constructor} from '../../types/private/Utilities'; import {AccessibilityProps} from '../Components/View/ViewAccessibility'; -import {NativeMethods} from '../../types/public/ReactNativeTypes'; +import {HostInstance} from '../../types/public/ReactNativeTypes'; import {ColorValue, StyleProp} from '../StyleSheet/StyleSheet'; import {TextStyle, ViewStyle} from '../StyleSheet/StyleSheetTypes'; import { @@ -309,5 +309,5 @@ export interface TextProps * A React component for displaying text which supports nesting, styling, and touch handling. */ declare class TextComponent extends React.Component {} -declare const TextBase: Constructor & typeof TextComponent; +declare const TextBase: Constructor & typeof TextComponent; export class Text extends TextBase {} diff --git a/packages/@react-native-windows/automation-channel/package.json b/packages/@react-native-windows/automation-channel/package.json index 1970f96f962..5b0b7d58bc4 100644 --- a/packages/@react-native-windows/automation-channel/package.json +++ b/packages/@react-native-windows/automation-channel/package.json @@ -33,7 +33,7 @@ "just-scripts": "^1.3.2", "prettier": "2.8.8", "react": "19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-windows": "^0.0.0-canary.1031", "typescript": "5.0.4" }, diff --git a/packages/@react-native-windows/tester/overrides.json b/packages/@react-native-windows/tester/overrides.json index 09eae3f5ce6..a5d272781c6 100644 --- a/packages/@react-native-windows/tester/overrides.json +++ b/packages/@react-native-windows/tester/overrides.json @@ -5,13 +5,13 @@ "excludePatterns": [ "src/js/examples-win/**" ], - "baseVersion": "0.83.0-nightly-20251012-6f482708b", + "baseVersion": "0.83.0-nightly-20251104-502efe1cc", "overrides": [ { "type": "copy", "file": "js/examples/ContentURLAndroid/ContentURLAndroid.js", "baseFile": "packages/rn-tester/js/examples/ContentURLAndroid/ContentURLAndroid.js", - "baseHash": "f85a06b7cdb2820871b524a0946f23738aa4eabe", + "baseHash": "99a33bffbea3e776edbfca9f26de146995cbe9d0", "issue": 14844 }, { @@ -156,7 +156,7 @@ "type": "derived", "file": "src/js/utils/RNTesterList.windows.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.android.js", - "baseHash": "aeb0275507e7c508cdf7c2ceec49f9e95ef4e1ec" + "baseHash": "419d588f738d7f9fc252019e74ca7bc92c6a03bf" } ] } \ No newline at end of file diff --git a/packages/@react-native-windows/tester/package.json b/packages/@react-native-windows/tester/package.json index ba28872b12d..f2f6d397e74 100644 --- a/packages/@react-native-windows/tester/package.json +++ b/packages/@react-native-windows/tester/package.json @@ -19,13 +19,13 @@ "peerDependencies": { "@react-native-picker/picker": "2.11.0", "react": "19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-windows": "^0.0.0-canary.1031", "react-native-xaml": "^0.0.80" }, "devDependencies": { - "@react-native/new-app-screen": "0.83.0-nightly-20251012-6f482708b", - "@react-native/tester": "0.83.0-nightly-20251012-6f482708b", + "@react-native/new-app-screen": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/tester": "0.83.0-nightly-20251104-502efe1cc", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", "@rnw-scripts/just-task": "2.3.58", @@ -33,7 +33,7 @@ "@types/node": "^22.14.0", "eslint": "^8.19.0", "just-scripts": "^1.3.3", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-platform-override": "0.0.0-canary.1019", "react-native-windows": "^0.0.0-canary.1031", "typescript": "5.0.4" diff --git a/packages/@react-native-windows/tester/src/js/utils/RNTesterList.windows.js b/packages/@react-native-windows/tester/src/js/utils/RNTesterList.windows.js index b7f6b88df51..c9c15047b6c 100644 --- a/packages/@react-native-windows/tester/src/js/utils/RNTesterList.windows.js +++ b/packages/@react-native-windows/tester/src/js/utils/RNTesterList.windows.js @@ -420,6 +420,11 @@ const APIs: Array = ([ category: 'UI', module: require('../examples/RadialGradient/RadialGradientExample'), }, + { + key: 'BackgroundImageExample', + category: 'UI', + module: require('../examples/BackgroundImage/BackgroundImageExample'), + }, { key: 'MixBlendModeExample', category: 'UI', diff --git a/packages/@react-native/monorepo/overrides.json b/packages/@react-native/monorepo/overrides.json index 4c750e2ece5..0056c53d30f 100644 --- a/packages/@react-native/monorepo/overrides.json +++ b/packages/@react-native/monorepo/overrides.json @@ -1,11 +1,11 @@ { - "baseVersion": "0.83.0-nightly-20251012-6f482708b", + "baseVersion": "0.83.0-nightly-20251104-502efe1cc", "overrides": [ { "type": "patch", "file": "package.json", "baseFile": "package.json", - "baseHash": "e52d5e00d4d9ae139272570eabb411e9afc5b67a" + "baseHash": "f3928d713d62f3d7f52eaf3adcfabb386b926bf1" } ] } \ No newline at end of file diff --git a/packages/@react-native/monorepo/package.json b/packages/@react-native/monorepo/package.json index ffbda7d0a72..b2cd0f347aa 100644 --- a/packages/@react-native/monorepo/package.json +++ b/packages/@react-native/monorepo/package.json @@ -51,8 +51,8 @@ "@jest/create-cache-key-function": "^29.7.0", "@microsoft/api-extractor": "^7.52.2", "@octokit/rest": "^22.0.0", - "@react-native/metro-babel-transformer": "0.83.0-nightly-20251012-6f482708b", - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-babel-transformer": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@tsconfig/node22": "22.0.2", "@types/react": "^19.2.0", "@typescript-eslint/parser": "^8.36.0", @@ -79,7 +79,7 @@ "eslint-plugin-relay": "^1.8.3", "fb-dotslash": "0.5.8", "flow-api-translator": "0.32.0", - "flow-bin": "^0.287.0", + "flow-bin": "^0.289.0", "glob": "^7.1.1", "hermes-eslint": "0.32.0", "hermes-transform": "0.32.0", @@ -114,9 +114,8 @@ "ws": "^7.5.10" }, "resolutions": { - "eslint-plugin-react-hooks": "6.1.0-canary-12bc60f5-20250613", "react-is": "19.2.0", "on-headers": "1.1.0", "compression": "1.8.1" } -} \ No newline at end of file +} diff --git a/packages/@react-native/tester/NativeModuleExample/NativeScreenshotManager.js b/packages/@react-native/tester/NativeModuleExample/NativeScreenshotManager.js index a04cca85a83..0f6b0682777 100644 --- a/packages/@react-native/tester/NativeModuleExample/NativeScreenshotManager.js +++ b/packages/@react-native/tester/NativeModuleExample/NativeScreenshotManager.js @@ -30,5 +30,5 @@ export function takeScreenshot( if (NativeModule != null) { return NativeModule.takeScreenshot(id, options); } - return Promise.reject(); + return Promise.reject(new Error('ScreenshotManager is not defined.')); } diff --git a/packages/@react-native/tester/js/utils/RNTesterList.android.js b/packages/@react-native/tester/js/utils/RNTesterList.android.js index 3d982eb5d32..b3555cd6667 100644 --- a/packages/@react-native/tester/js/utils/RNTesterList.android.js +++ b/packages/@react-native/tester/js/utils/RNTesterList.android.js @@ -329,6 +329,11 @@ const APIs: Array = ([ category: 'UI', module: require('../examples/RadialGradient/RadialGradientExample'), }, + { + key: 'BackgroundImageExample', + category: 'UI', + module: require('../examples/BackgroundImage/BackgroundImageExample'), + }, { key: 'MixBlendModeExample', category: 'UI', diff --git a/packages/@react-native/tester/js/utils/RNTesterList.ios.js b/packages/@react-native/tester/js/utils/RNTesterList.ios.js index dbf2e5b91c2..759881e2cc9 100644 --- a/packages/@react-native/tester/js/utils/RNTesterList.ios.js +++ b/packages/@react-native/tester/js/utils/RNTesterList.ios.js @@ -309,6 +309,11 @@ const APIs: Array = ([ category: 'UI', module: require('../examples/RadialGradient/RadialGradientExample'), }, + { + key: 'BackgroundImageExample', + category: 'UI', + module: require('../examples/BackgroundImage/BackgroundImageExample'), + }, { key: 'MixBlendModeExample', module: require('../examples/MixBlendMode/MixBlendModeExample'), diff --git a/packages/@react-native/tester/overrides.json b/packages/@react-native/tester/overrides.json index 600e23b4d28..59e8e585085 100644 --- a/packages/@react-native/tester/overrides.json +++ b/packages/@react-native/tester/overrides.json @@ -1,5 +1,5 @@ { - "baseVersion": "0.83.0-nightly-20251012-6f482708b", + "baseVersion": "0.83.0-nightly-20251104-502efe1cc", "overrides": [ { "type": "copy", @@ -96,7 +96,7 @@ "type": "copy", "directory": "js/examples/ContentURLAndroid", "baseDirectory": "packages/rn-tester/js/examples/ContentURLAndroid", - "baseHash": "b68ab3fbff1dd27263c6f79cac4b100387031ba6", + "baseHash": "0f61e3c10482cf7847be84e53e5a2aedd89e12e2", "issue": 14844 }, { @@ -152,7 +152,7 @@ "type": "copy", "directory": "js/examples/Filter", "baseDirectory": "packages/rn-tester/js/examples/Filter", - "baseHash": "82f47b13c7ca626f0f663ae1282ee8eab9c669cf", + "baseHash": "9bc059e0a4229fb148b6498d0d3fa0fa50fbe059", "issue": 4054 }, { @@ -215,7 +215,7 @@ "type": "copy", "directory": "js/examples/LinearGradient", "baseDirectory": "packages/rn-tester/js/examples/LinearGradient/", - "baseHash": "1f9a8cb4d023214e768ba729b7c97870de8f61ab", + "baseHash": "8ac057256faa96b22b3a41c4506d6379959fbf00", "issue": 4054 }, { @@ -584,14 +584,14 @@ "type": "copy", "file": "js/utils/RNTesterList.android.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.android.js", - "baseHash": "aeb0275507e7c508cdf7c2ceec49f9e95ef4e1ec", + "baseHash": "419d588f738d7f9fc252019e74ca7bc92c6a03bf", "issue": 13228 }, { "type": "copy", "file": "js/utils/RNTesterList.ios.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.ios.js", - "baseHash": "a93dea4da7d61b0ad13e1d90f9a0b34dbac57994", + "baseHash": "b164cd5f108ebdeed2fc45512e72ab4d53e6e5ed", "issue": 13228 }, { @@ -654,7 +654,7 @@ "type": "copy", "file": "NativeModuleExample/NativeScreenshotManager.js", "baseFile": "packages/rn-tester/NativeModuleExample/NativeScreenshotManager.js", - "baseHash": "8eeff755fab7fa507c7663e3681963579f19d900", + "baseHash": "6eca67ffe577705a40034632effffd4cb2a96308", "issue": 4054 }, { diff --git a/packages/@react-native/tester/package.json b/packages/@react-native/tester/package.json index f36b83fbef2..55c504f95c4 100644 --- a/packages/@react-native/tester/package.json +++ b/packages/@react-native/tester/package.json @@ -1,6 +1,6 @@ { "name": "@react-native/tester", - "version": "0.83.0-nightly-20251012-6f482708b", + "version": "0.83.0-nightly-20251104-502efe1cc", "private": true, "description": "React Native tester app.", "license": "MIT", @@ -26,8 +26,8 @@ "e2e-test-ios": "./scripts/maestro-test-ios.sh" }, "dependencies": { - "@react-native/new-app-screen": "0.83.0-nightly-20251012-6f482708b", - "@react-native/popup-menu-android": "0.83.0-nightly-20251012-6f482708b", + "@react-native/new-app-screen": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/popup-menu-android": "0.83.0-nightly-20251104-502efe1cc", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "nullthrows": "^1.1.1" diff --git a/packages/@rnw-scripts/babel-react-native-config/package.json b/packages/@rnw-scripts/babel-react-native-config/package.json index 52ca2999c71..f1a036672e7 100644 --- a/packages/@rnw-scripts/babel-react-native-config/package.json +++ b/packages/@rnw-scripts/babel-react-native-config/package.json @@ -11,12 +11,12 @@ }, "dependencies": { "@babel/core": "^7.25.2", - "@react-native/babel-preset": "0.83.0-nightly-20251012-6f482708b", + "@react-native/babel-preset": "0.83.0-nightly-20251104-502efe1cc", "babel-plugin-transform-flow-enums": "^0.0.2" }, "devDependencies": { "@babel/core": "^7.25.2", - "@react-native/babel-preset": "0.83.0-nightly-20251012-6f482708b", + "@react-native/babel-preset": "0.83.0-nightly-20251104-502efe1cc", "eslint": "^8.19.0", "prettier": "2.8.8" }, diff --git a/packages/@rnw-scripts/eslint-config/package.json b/packages/@rnw-scripts/eslint-config/package.json index ec2ad0200c7..f6e82e13be3 100644 --- a/packages/@rnw-scripts/eslint-config/package.json +++ b/packages/@rnw-scripts/eslint-config/package.json @@ -13,7 +13,7 @@ "@babel/core": "^7.25.2", "@babel/eslint-parser": "^7.25.1", "@microsoft/eslint-plugin-sdl": "^0.2.0", - "@react-native/eslint-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/eslint-config": "0.83.0-nightly-20251104-502efe1cc", "eslint-config-prettier": "^8.5.0", "eslint-plugin-ft-flow": "^2.0.1", "hermes-eslint": "0.23.1" diff --git a/packages/@rnw-scripts/metro-dev-config/package.json b/packages/@rnw-scripts/metro-dev-config/package.json index a5e5deddbf0..dc54c5a33e8 100644 --- a/packages/@rnw-scripts/metro-dev-config/package.json +++ b/packages/@rnw-scripts/metro-dev-config/package.json @@ -17,7 +17,7 @@ "lint:fix": "rnw-scripts lint:fix" }, "dependencies": { - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@rnx-kit/metro-config": "^2.1.2", "@rnx-kit/metro-plugin-duplicates-checker": "^3.0.2", "@rnx-kit/metro-serializer": "^2.0.3", diff --git a/packages/e2e-test-app-fabric/package.json b/packages/e2e-test-app-fabric/package.json index 892a9607624..ba7a7eee70a 100644 --- a/packages/e2e-test-app-fabric/package.json +++ b/packages/e2e-test-app-fabric/package.json @@ -20,7 +20,7 @@ "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "react": "^19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-windows": "^0.0.0-canary.1031" }, "devDependencies": { @@ -30,7 +30,7 @@ "@babel/preset-typescript": "^7.8.3", "@babel/runtime": "^7.20.0", "@react-native-community/cli": "20.0.0", - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@react-native-windows/automation": "0.0.0-canary.1031", "@react-native-windows/automation-commands": "0.0.0-canary.1031", "@rnw-scripts/babel-node-config": "2.3.3", diff --git a/packages/playground/package.json b/packages/playground/package.json index 3f2405f9056..a0bbe903750 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -15,14 +15,14 @@ "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "react": "^19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-windows": "^0.0.0-canary.1031" }, "devDependencies": { "@babel/core": "^7.25.2", "@babel/runtime": "^7.20.0", "@react-native-community/cli": "20.0.0", - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", "@rnw-scripts/just-task": "2.3.58", diff --git a/packages/sample-app-fabric/package.json b/packages/sample-app-fabric/package.json index a4bfad4e535..12eac31d61e 100644 --- a/packages/sample-app-fabric/package.json +++ b/packages/sample-app-fabric/package.json @@ -17,7 +17,7 @@ "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "react": "^19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-windows": "^0.0.0-canary.1031" }, "devDependencies": { @@ -28,7 +28,7 @@ "@babel/runtime": "^7.20.0", "@jest/globals": "^29.7.0", "@react-native-community/cli": "20.0.0", - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@rnw-scripts/babel-node-config": "2.3.3", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", diff --git a/packages/sample-custom-component/package.json b/packages/sample-custom-component/package.json index 7bcc3c57c98..37b8f3dac7e 100644 --- a/packages/sample-custom-component/package.json +++ b/packages/sample-custom-component/package.json @@ -23,7 +23,7 @@ "@types/react": "^19.2.0", "react": "^19.2.0", "minimatch": "^10.0.3", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-windows": "^0.0.0-canary.1031" }, "devDependencies": { @@ -33,7 +33,7 @@ "@babel/preset-typescript": "^7.8.3", "@babel/runtime": "^7.20.0", "@react-native-community/cli": "20.0.0", - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@rnw-scripts/babel-node-config": "2.3.3", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", diff --git a/vnext/.flowconfig b/vnext/.flowconfig index f6a15e57e3c..6d705a48522 100644 --- a/vnext/.flowconfig +++ b/vnext/.flowconfig @@ -173,4 +173,4 @@ untyped-import untyped-type-import [version] -^0.287.0 +^0.289.0 diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h index fc547bf36aa..6871c50d68f 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h @@ -18,6 +18,19 @@ namespace facebook::react { /* * Descriptor for component. */ +<<<<<<< Upstream +class AndroidTextInputComponentDescriptor final : public ConcreteComponentDescriptor { + public: + AndroidTextInputComponentDescriptor(const ComponentDescriptorParameters ¶meters) + : ConcreteComponentDescriptor(parameters), + textLayoutManager_(std::make_shared(contextContainer_)) + { + } + + virtual State::Shared createInitialState(const Props::Shared &props, const ShadowNodeFamily::Shared &family) + const override + { +======= class WindowsTextInputComponentDescriptor final : public ConcreteComponentDescriptor { public: WindowsTextInputComponentDescriptor(const ComponentDescriptorParameters ¶meters) @@ -28,89 +41,89 @@ class WindowsTextInputComponentDescriptor final : public ConcreteComponentDescri virtual State::Shared createInitialState( const Props::Shared& props, const ShadowNodeFamily::Shared& family) const override { +>>>>>>> Override int surfaceId = family->getSurfaceId(); ThemePadding theme; // TODO: figure out RTL/start/end/left/right stuff here - if (surfaceIdToThemePaddingMap_.find(surfaceId) != - surfaceIdToThemePaddingMap_.end()) { + if (surfaceIdToThemePaddingMap_.find(surfaceId) != surfaceIdToThemePaddingMap_.end()) { theme = surfaceIdToThemePaddingMap_[surfaceId]; } else { - const jni::global_ref& fabricUIManager = + const jni::global_ref &fabricUIManager = contextContainer_->at>("FabricUIManager"); auto env = jni::Environment::current(); auto defaultTextInputPaddingArray = env->NewFloatArray(4); static auto getThemeData = - jni::findClassStatic(UIManagerJavaDescriptor) - ->getMethod("getThemeData"); + jni::findClassStatic(UIManagerJavaDescriptor)->getMethod("getThemeData"); - if (getThemeData( - fabricUIManager, surfaceId, defaultTextInputPaddingArray) != 0u) { - jfloat* defaultTextInputPadding = - env->GetFloatArrayElements(defaultTextInputPaddingArray, nullptr); + if (getThemeData(fabricUIManager, surfaceId, defaultTextInputPaddingArray) != 0u) { + jfloat *defaultTextInputPadding = env->GetFloatArrayElements(defaultTextInputPaddingArray, nullptr); theme.start = defaultTextInputPadding[0]; theme.end = defaultTextInputPadding[1]; theme.top = defaultTextInputPadding[2]; theme.bottom = defaultTextInputPadding[3]; surfaceIdToThemePaddingMap_.emplace(std::make_pair(surfaceId, theme)); - env->ReleaseFloatArrayElements( - defaultTextInputPaddingArray, defaultTextInputPadding, JNI_ABORT); + env->ReleaseFloatArrayElements(defaultTextInputPaddingArray, defaultTextInputPadding, JNI_ABORT); } return std::make_shared( - std::make_shared( - AndroidTextInputState({}, {}, {}, 0)), - family); + std::make_shared(AndroidTextInputState({}, {}, {}, 0)), family); } */ protected: +<<<<<<< Upstream + void adopt(ShadowNode &shadowNode) const override + { + auto &textInputShadowNode = static_cast(shadowNode); +======= void adopt(ShadowNode &shadowNode) const override { auto &textInputShadowNode = static_cast(shadowNode); +>>>>>>> Override // `TextInputShadowNode` uses `TextLayoutManager` to measure text content // and communicate text rendering metrics to mounting layer. textInputShadowNode.setTextLayoutManager(textLayoutManager_); +<<<<<<< Upstream + int surfaceId = textInputShadowNode.getSurfaceId(); + if (surfaceIdToThemePaddingMap_.find(surfaceId) != surfaceIdToThemePaddingMap_.end()) { + const auto &theme = surfaceIdToThemePaddingMap_[surfaceId]; +======= /* int surfaceId = textInputShadowNode.getSurfaceId(); if (surfaceIdToThemePaddingMap_.find(surfaceId) != surfaceIdToThemePaddingMap_.end()) { const auto& theme = surfaceIdToThemePaddingMap_[surfaceId]; +>>>>>>> Override - auto& textInputProps = textInputShadowNode.getConcreteProps(); + auto &textInputProps = textInputShadowNode.getConcreteProps(); // Override padding // Node is still unsealed during adoption, before layout is complete // TODO: T62959168 account for RTL and paddingLeft when setting default // paddingStart, and vice-versa with paddingRight/paddingEnd. // For now this assumes no RTL. - auto& style = const_cast(textInputProps.yogaStyle); + auto &style = const_cast(textInputProps.yogaStyle); bool changedPadding = false; - if (!textInputProps.hasPadding && !textInputProps.hasPaddingStart && - !textInputProps.hasPaddingLeft && + if (!textInputProps.hasPadding && !textInputProps.hasPaddingStart && !textInputProps.hasPaddingLeft && !textInputProps.hasPaddingHorizontal) { changedPadding = true; - style.setPadding( - yoga::Edge::Start, yoga::StyleLength::points(theme.start)); + style.setPadding(yoga::Edge::Start, yoga::StyleLength::points(theme.start)); } - if (!textInputProps.hasPadding && !textInputProps.hasPaddingEnd && - !textInputProps.hasPaddingRight && + if (!textInputProps.hasPadding && !textInputProps.hasPaddingEnd && !textInputProps.hasPaddingRight && !textInputProps.hasPaddingHorizontal) { changedPadding = true; style.setPadding(yoga::Edge::End, yoga::StyleLength::points(theme.end)); } - if (!textInputProps.hasPadding && !textInputProps.hasPaddingTop && - !textInputProps.hasPaddingVertical) { + if (!textInputProps.hasPadding && !textInputProps.hasPaddingTop && !textInputProps.hasPaddingVertical) { changedPadding = true; style.setPadding(yoga::Edge::Top, yoga::StyleLength::points(theme.top)); } - if (!textInputProps.hasPadding && !textInputProps.hasPaddingBottom && - !textInputProps.hasPaddingVertical) { + if (!textInputProps.hasPadding && !textInputProps.hasPaddingBottom && !textInputProps.hasPaddingVertical) { changedPadding = true; - style.setPadding( - yoga::Edge::Bottom, yoga::StyleLength::points(theme.bottom)); + style.setPadding(yoga::Edge::Bottom, yoga::StyleLength::points(theme.bottom)); } // If the TextInput initially does not have paddingLeft or paddingStart, a @@ -118,13 +131,11 @@ virtual State::Shared createInitialState( // paddingLeft update, we must explicitly unset paddingStart... (same with // paddingEnd) // TODO: support RTL - if ((textInputProps.hasPadding || textInputProps.hasPaddingLeft || - textInputProps.hasPaddingHorizontal) && + if ((textInputProps.hasPadding || textInputProps.hasPaddingLeft || textInputProps.hasPaddingHorizontal) && !textInputProps.hasPaddingStart) { style.setPadding(yoga::Edge::Start, yoga::StyleLength::undefined()); } - if ((textInputProps.hasPadding || textInputProps.hasPaddingRight || - textInputProps.hasPaddingHorizontal) && + if ((textInputProps.hasPadding || textInputProps.hasPaddingRight || textInputProps.hasPaddingHorizontal) && !textInputProps.hasPaddingEnd) { style.setPadding(yoga::Edge::End, yoga::StyleLength::undefined()); } diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp index da88f541fad..f0bcd44f284 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp @@ -128,7 +128,15 @@ void WindowsTextInputShadowNode::updateStateIfNeeded(const LayoutContext &layout // flowing to Java, so we just ensure it's a noop in those cases. setStateData( +<<<<<<< Upstream + AndroidTextInputState{ + AttributedStringBox(newAttributedString), + reactTreeAttributedString, + props.paragraphAttributes, + newEventCount}); +======= WindowsTextInputState{AttributedStringBox(newAttributedString), reactTreeAttributedString, {}, newEventCount}); +>>>>>>> Override } AttributedString WindowsTextInputShadowNode::getAttributedString(const LayoutContext &layoutContext) const { diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h index 95ca1149fd9..b8e785ba73a 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h @@ -30,7 +30,8 @@ class WindowsTextInputShadowNode final : public ConcreteViewShadowNode< public: using ConcreteViewShadowNode::ConcreteViewShadowNode; - static ShadowNodeTraits BaseTraits() { + static ShadowNodeTraits BaseTraits() + { auto traits = ConcreteViewShadowNode::BaseTraits(); traits.set(ShadowNodeTraits::Trait::LeafYogaNode); traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode); @@ -51,10 +52,14 @@ class WindowsTextInputShadowNode final : public ConcreteViewShadowNode< void layout(LayoutContext layoutContext) override; +<<<<<<< Upstream + Float baseline(const LayoutContext &layoutContext, Size size) const override; +======= Float baseline(const LayoutContext &layoutContext, Size size) const override { // Calculate baseline as 80% of the text height return size.height * 0.8f; } +>>>>>>> Override std::shared_ptr textLayoutManager_; diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h index a1ff376ddf4..54909570712 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h @@ -32,14 +32,26 @@ class WindowsTextInputState final { : attributedStringBox(std::move(attributedStringBox)), reactTreeAttributedString(std::move(reactTreeAttributedString)), paragraphAttributes(std::move(paragraphAttributes)), - mostRecentEventCount(mostRecentEventCount) {} + mostRecentEventCount(mostRecentEventCount) + { + } +<<<<<<< Upstream + AndroidTextInputState(const AndroidTextInputState &previousState, const folly::dynamic &data) +======= WindowsTextInputState(const WindowsTextInputState &previousState, const folly::dynamic &data) +>>>>>>> Override : attributedStringBox(previousState.attributedStringBox), reactTreeAttributedString(previousState.reactTreeAttributedString), paragraphAttributes(previousState.paragraphAttributes), mostRecentEventCount(data.getDefault("mostRecentEventCount", previousState.mostRecentEventCount).getInt()), +<<<<<<< Upstream + cachedAttributedStringId(data.getDefault("opaqueCacheId", previousState.cachedAttributedStringId).getInt()) + { + } +======= cachedAttributedStringId(data.getDefault("opaqueCacheId", previousState.cachedAttributedStringId).getInt()) {} +>>>>>>> Override folly::dynamic getDynamic() const; MapBuffer getMapBuffer() const; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp index def99b6b773..d4a7b10e037 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp @@ -38,8 +38,8 @@ namespace facebook::react { // This class manages calls from JS to native code. class [[deprecated( - "This API will be removed along with the legacy architecture.")]] JsToNativeBridge - : public react::ExecutorDelegate { + "This API will be removed along with the legacy architecture.")]] +JsToNativeBridge : public react::ExecutorDelegate { public: JsToNativeBridge( std::shared_ptr registry, diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h index 4dd91a82d29..eef0adb77db 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h @@ -69,13 +69,13 @@ namespace facebook::react { struct TraceSection { public: template - explicit TraceSection( - [[maybe_unused]] const char* name, - [[maybe_unused]] ConvertsToStringPiece&&... args) { + explicit TraceSection([[maybe_unused]] const char *name, [[maybe_unused]] ConvertsToStringPiece &&...args) + { TRACE_EVENT_BEGIN("react-native", perfetto::DynamicString{name}, args...); } - ~TraceSection() { + ~TraceSection() + { TRACE_EVENT_END("react-native"); } }; @@ -84,10 +84,17 @@ using TraceSectionUnwrapped = TraceSection; struct ConcreteTraceSection { public: template +<<<<<<< Upstream + explicit ConcreteTraceSection(const char *name, ConvertsToStringPiece &&...args) + : m_section(TRACE_TAG_REACT, name, args...) + { + } +======= explicit ConcreteTraceSection( const char* name, ConvertsToStringPiece&&... args) : m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...) {} // [Windows][issue #14819] +>>>>>>> Override private: fbsystrace::FbSystraceSection m_section; @@ -97,9 +104,9 @@ using TraceSectionUnwrapped = ConcreteTraceSection; struct DummyTraceSection { public: template - explicit DummyTraceSection( - [[maybe_unused]] const char* name, - [[maybe_unused]] ConvertsToStringPiece&&... args) {} + explicit DummyTraceSection([[maybe_unused]] const char *name, [[maybe_unused]] ConvertsToStringPiece &&...args) + { + } }; using TraceSectionUnwrapped = DummyTraceSection; #endif @@ -110,14 +117,14 @@ using TraceSectionUnwrapped = DummyTraceSection; * In the case of WITH_LOOM_TRACE we don't use the signposts APIs because of the * templated type for TraceSection. */ -#if defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && \ - !defined(WITH_LOOM_TRACE) +#if defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && !defined(WITH_LOOM_TRACE) namespace systrace { template struct renderer { - static std::string render(const T& t) { + static std::string render(const T &t) + { std::ostringstream oss; oss << t; return oss.str(); @@ -125,19 +132,19 @@ struct renderer { }; template -static auto render(const T& t) - -> decltype(renderer::render(std::declval())) { +static auto render(const T &t) -> decltype(renderer::render(std::declval())) +{ return renderer::render(t); } inline os_log_t instrumentsLogHandle = nullptr; -static inline os_log_t getOrCreateInstrumentsLogHandle() { +static inline os_log_t getOrCreateInstrumentsLogHandle() +{ static std::once_flag flag{}; std::call_once(flag, []() { if (!instrumentsLogHandle) { - instrumentsLogHandle = os_log_create( - "dev.reactnative.instruments", OS_LOG_CATEGORY_DYNAMIC_TRACING); + instrumentsLogHandle = os_log_create("dev.reactnative.instruments", OS_LOG_CATEGORY_DYNAMIC_TRACING); } }); return instrumentsLogHandle; @@ -148,8 +155,8 @@ static inline os_log_t getOrCreateInstrumentsLogHandle() { struct TraceSection { public: template - explicit TraceSection(const char* name, ConvertsToStringPiece&&... args) - : systraceSectionUnwrapped_(name, args...) { + explicit TraceSection(const char *name, ConvertsToStringPiece &&...args) : systraceSectionUnwrapped_(name, args...) + { os_log_t instrumentsLogHandle = systrace::getOrCreateInstrumentsLogHandle(); // If the log isn't enabled, we don't want the performance overhead of the @@ -168,24 +175,14 @@ struct TraceSection { signpostID_ = os_signpost_id_make_with_pointer(instrumentsLogHandle, this); - os_signpost_interval_begin( - instrumentsLogHandle, - signpostID_, - "Systrace", - "%s begin: %s", - name, - argsString.c_str()); + os_signpost_interval_begin(instrumentsLogHandle, signpostID_, "Systrace", "%s begin: %s", name, argsString.c_str()); } - ~TraceSection() { + ~TraceSection() + { // We don't need to gate on os_signpost_enabled here because it's already // checked in os_signpost_interval_end. - os_signpost_interval_end( - systrace::instrumentsLogHandle, - signpostID_, - "Systrace", - "%s end", - name_.data()); + os_signpost_interval_end(systrace::instrumentsLogHandle, signpostID_, "Systrace", "%s end", name_.data()); } private: diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp index b8b9427403d..a9e14c6883b 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp @@ -44,19 +44,23 @@ TEST_P(JSITest, PropNameIDTest) { EXPECT_TRUE(PropNameID::compare(rt, movedQuux, copiedQuux)); EXPECT_TRUE(PropNameID::compare(rt, movedQuux, movedQuux)); - EXPECT_TRUE(PropNameID::compare( - rt, movedQuux, PropNameID::forAscii(rt, std::string("quux2")))); - EXPECT_FALSE(PropNameID::compare( - rt, movedQuux, PropNameID::forAscii(rt, std::string("foo")))); + EXPECT_TRUE( + PropNameID::compare( + rt, movedQuux, PropNameID::forAscii(rt, std::string("quux2")))); + EXPECT_FALSE( + PropNameID::compare( + rt, movedQuux, PropNameID::forAscii(rt, std::string("foo")))); uint8_t utf8[] = {0xF0, 0x9F, 0x86, 0x97}; PropNameID utf8PropNameID = PropNameID::forUtf8(rt, utf8, sizeof(utf8)); EXPECT_EQ( utf8PropNameID.utf8(rt), reinterpret_cast(u8"\U0001F197")); - EXPECT_TRUE(PropNameID::compare( - rt, utf8PropNameID, PropNameID::forUtf8(rt, utf8, sizeof(utf8)))); + EXPECT_TRUE( + PropNameID::compare( + rt, utf8PropNameID, PropNameID::forUtf8(rt, utf8, sizeof(utf8)))); PropNameID nonUtf8PropNameID = PropNameID::forUtf8(rt, "meow"); - EXPECT_TRUE(PropNameID::compare( - rt, nonUtf8PropNameID, PropNameID::forAscii(rt, "meow"))); + EXPECT_TRUE( + PropNameID::compare( + rt, nonUtf8PropNameID, PropNameID::forAscii(rt, "meow"))); EXPECT_EQ(nonUtf8PropNameID.utf8(rt), "meow"); PropNameID strPropNameID = PropNameID::forString(rt, String::createFromAscii(rt, "meow")); @@ -149,11 +153,12 @@ TEST_P(JSITest, ObjectTest) { obj.setProperty(rt, "oprop", oprop); obj.setProperty(rt, "aprop", Array(rt, 1)); - EXPECT_TRUE(function("function (obj) { return " - "obj.roses == 'red' && " - "obj['violets'] == 'blue' && " - "typeof obj.oprop == 'object' && " - "Array.isArray(obj.aprop); }") + EXPECT_TRUE(function( + "function (obj) { return " + "obj.roses == 'red' && " + "obj['violets'] == 'blue' && " + "typeof obj.oprop == 'object' && " + "Array.isArray(obj.aprop); }") .call(rt, obj) .getBool()); @@ -247,7 +252,7 @@ TEST_P(JSITest, HostObjectTest) { EXPECT_TRUE(cho.getHostObject(rt).get() != nullptr); struct SameRuntimeHostObject : HostObject { - SameRuntimeHostObject(Runtime& rt) : rt_(rt){}; + SameRuntimeHostObject(Runtime& rt) : rt_(rt) {}; Value get(Runtime& rt, const PropNameID& sym) override { EXPECT_EQ(&rt, &rt_); @@ -731,14 +736,15 @@ TEST_P(JSITest, HostFunctionTest) { EXPECT_TRUE(eval("cons.length == 2").getBool()); EXPECT_TRUE(eval("cons instanceof Function").getBool()); - EXPECT_TRUE(eval("(function() {" - " try {" - " cons('fail'); return false;" - " } catch (e) {" - " return ((e instanceof Error) &&" - " (e.message == 'Exception in HostFunction: ' +" - " 'expected 2 args'));" - " }})()") + EXPECT_TRUE(eval( + "(function() {" + " try {" + " cons('fail'); return false;" + " } catch (e) {" + " return ((e instanceof Error) &&" + " (e.message == 'Exception in HostFunction: ' +" + " 'expected 2 args'));" + " }})()") .getBool()); Function coolify = Function::createFromHostFunction( @@ -755,10 +761,11 @@ TEST_P(JSITest, HostFunctionTest) { EXPECT_TRUE(eval("coolify.name == 'coolify'").getBool()); EXPECT_TRUE(eval("coolify.length == 0").getBool()); EXPECT_TRUE(eval("coolify.bind('R&M')() == 'R&M is cool'").getBool()); - EXPECT_TRUE(eval("(function() {" - " var s = coolify.bind(function(){})();" - " return s.lastIndexOf(' is cool') == (s.length - 8);" - "})()") + EXPECT_TRUE(eval( + "(function() {" + " var s = coolify.bind(function(){})();" + " return s.lastIndexOf(' is cool') == (s.length - 8);" + "})()") .getBool()); Function lookAtMe = Function::createFromHostFunction( @@ -887,14 +894,15 @@ TEST_P(JSITest, ValueTest) { uint8_t utf8[] = "[null, 2, \"c\", \"emoji: \xf0\x9f\x86\x97\", {}]"; EXPECT_TRUE( - function("function (arr) { return " - "Array.isArray(arr) && " - "arr.length == 5 && " - "arr[0] === null && " - "arr[1] == 2 && " - "arr[2] == 'c' && " - "arr[3] == 'emoji: \\uD83C\\uDD97' && " - "typeof arr[4] == 'object'; }") + function( + "function (arr) { return " + "Array.isArray(arr) && " + "arr.length == 5 && " + "arr[0] === null && " + "arr[1] == 2 && " + "arr[2] == 'c' && " + "arr[3] == 'emoji: \\uD83C\\uDD97' && " + "typeof arr[4] == 'object'; }") .call(rt, Value::createFromJsonUtf8(rt, utf8, sizeof(utf8) - 1)) .getBool()); @@ -936,14 +944,16 @@ TEST_P(JSITest, EqualsTest) { EXPECT_TRUE(Value::strictEquals(rt, nullptr, nullptr)); EXPECT_TRUE(Value::strictEquals(rt, Value::undefined(), Value())); EXPECT_TRUE(Value::strictEquals(rt, rt.global(), Value(rt.global()))); - EXPECT_FALSE(Value::strictEquals( - rt, - std::numeric_limits::quiet_NaN(), - std::numeric_limits::quiet_NaN())); - EXPECT_FALSE(Value::strictEquals( - rt, - std::numeric_limits::signaling_NaN(), - std::numeric_limits::signaling_NaN())); + EXPECT_FALSE( + Value::strictEquals( + rt, + std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN())); + EXPECT_FALSE( + Value::strictEquals( + rt, + std::numeric_limits::signaling_NaN(), + std::numeric_limits::signaling_NaN())); EXPECT_TRUE(Value::strictEquals(rt, +0.0, -0.0)); EXPECT_TRUE(Value::strictEquals(rt, -0.0, +0.0)); @@ -1089,8 +1099,9 @@ TEST_P(JSITest, JSErrorDoesNotInfinitelyRecurse) { return rt.global().getPropertyAsObject(rt, "NotAProperty"); }; EXPECT_EQ( - function("function (f) { try { f(); return 'undefined'; }" - "catch (e) { return typeof e; } }") + function( + "function (f) { try { f(); return 'undefined'; }" + "catch (e) { return typeof e; } }") .call( rt, Function::createFromHostFunction( @@ -1330,18 +1341,21 @@ TEST_P(JSITest, SymbolTest) { EXPECT_EQ(eval("Symbol('sym')").getSymbol(rt).toString(rt), "Symbol(sym)"); // EqualsTest - EXPECT_FALSE(Symbol::strictEquals( - rt, - eval("Symbol('a')").getSymbol(rt), - eval("Symbol('a')").getSymbol(rt))); - EXPECT_TRUE(Symbol::strictEquals( - rt, - eval("Symbol.for('a')").getSymbol(rt), - eval("Symbol.for('a')").getSymbol(rt))); + EXPECT_FALSE( + Symbol::strictEquals( + rt, + eval("Symbol('a')").getSymbol(rt), + eval("Symbol('a')").getSymbol(rt))); + EXPECT_TRUE( + Symbol::strictEquals( + rt, + eval("Symbol.for('a')").getSymbol(rt), + eval("Symbol.for('a')").getSymbol(rt))); EXPECT_FALSE( Value::strictEquals(rt, eval("Symbol('a')"), eval("Symbol('a')"))); - EXPECT_TRUE(Value::strictEquals( - rt, eval("Symbol.for('a')"), eval("Symbol.for('a')"))); + EXPECT_TRUE( + Value::strictEquals( + rt, eval("Symbol.for('a')"), eval("Symbol.for('a')"))); EXPECT_FALSE(Value::strictEquals(rt, eval("Symbol('a')"), eval("'a'"))); } @@ -1352,13 +1366,15 @@ TEST_P(JSITest, JSErrorTest) { // Getting message property can throw EXPECT_THROW( - eval("var GetMessageThrows = {get message() { throw Error('ex'); }};" - "throw GetMessageThrows;"), + eval( + "var GetMessageThrows = {get message() { throw Error('ex'); }};" + "throw GetMessageThrows;"), JSIException); EXPECT_THROW( - eval("var GetMessageThrows = {get message() { throw GetMessageThrows; }};" - "throw GetMessageThrows;"), + eval( + "var GetMessageThrows = {get message() { throw GetMessageThrows; }};" + "throw GetMessageThrows;"), JSIException); // Converting exception message to String can throw @@ -1381,18 +1397,20 @@ TEST_P(JSITest, JSErrorTest) { JSIException); EXPECT_THROW( - eval("var e = Error();" - "String = function() { throw Error('ctor'); };" - "throw e;"), + eval( + "var e = Error();" + "String = function() { throw Error('ctor'); };" + "throw e;"), JSIException); // Converting an exception message to String can return a non-String EXPECT_THROW( - eval("String = function() { return 42; };" - "var e = Error();" - "e.message = 17;" - "throw e;"), + eval( + "String = function() { return 42; };" + "var e = Error();" + "e.message = 17;" + "throw e;"), JSIException); // Exception can be non-Object @@ -1404,8 +1422,9 @@ TEST_P(JSITest, JSErrorTest) { // Converting exception with no message or stack property to String can throw EXPECT_THROW( - eval("var e = {toString() { throw new Error('errstr'); }};" - "throw e;"), + eval( + "var e = {toString() { throw new Error('errstr'); }};" + "throw e;"), JSIException); } diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp index 8e364e496b7..9fc24c1e77e 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp @@ -312,17 +312,19 @@ void NetworkIOAgent::handleLoadNetworkResource( LoadNetworkResourceRequest params; if (!req.params.isObject()) { - frontendChannel_(cdp::jsonError( - req.id, - cdp::ErrorCode::InvalidParams, - "Invalid params: not an object.")); + frontendChannel_( + cdp::jsonError( + req.id, + cdp::ErrorCode::InvalidParams, + "Invalid params: not an object.")); return; } if ((req.params.count("url") == 0u) || !req.params.at("url").isString()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: url is missing or not a string.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: url is missing or not a string.")); return; } else { params.url = req.params.at("url").asString(); @@ -395,18 +397,20 @@ void NetworkIOAgent::handleLoadNetworkResource( void NetworkIOAgent::handleIoRead(const cdp::PreparsedRequest& req) { long long requestId = req.id; if (!req.params.isObject()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: not an object.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: not an object.")); return; } if ((req.params.count("handle") == 0u) || !req.params.at("handle").isString()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: handle is missing or not a string.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: handle is missing or not a string.")); return; } std::optional size = std::nullopt; @@ -414,10 +418,11 @@ void NetworkIOAgent::handleIoRead(const cdp::PreparsedRequest& req) { size = req.params.at("size").asInt(); if (size > MAX_BYTES_PER_READ) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: size cannot be greater than 10MB.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: size cannot be greater than 10MB.")); return; } } @@ -425,10 +430,11 @@ void NetworkIOAgent::handleIoRead(const cdp::PreparsedRequest& req) { auto streamId = req.params.at("handle").asString(); auto it = streams_->find(streamId); if (it == streams_->end()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InternalError, - "Stream not found with handle " + streamId)); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InternalError, + "Stream not found with handle " + streamId)); return; } else { it->second->read( @@ -440,8 +446,9 @@ void NetworkIOAgent::handleIoRead(const cdp::PreparsedRequest& req) { if (auto* error = std::get_if(&resultOrError)) { // NB: Chrome DevTools calls IO.close after a read error, so any // continuing download or retained data is cleaned up at that point. - frontendChannel(cdp::jsonError( - requestId, cdp::ErrorCode::InternalError, *error)); + frontendChannel( + cdp::jsonError( + requestId, cdp::ErrorCode::InternalError, *error)); } else if (auto* result = std::get_if(&resultOrError)) { frontendChannel(cdp::jsonResult(requestId, result->toDynamic())); } else { @@ -455,28 +462,31 @@ void NetworkIOAgent::handleIoRead(const cdp::PreparsedRequest& req) { void NetworkIOAgent::handleIoClose(const cdp::PreparsedRequest& req) { long long requestId = req.id; if (!req.params.isObject()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: not an object.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: not an object.")); return; } if ((req.params.count("handle") == 0u) || !req.params.at("handle").isString()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: handle is missing or not a string.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: handle is missing or not a string.")); return; } auto streamId = req.params.at("handle").asString(); auto it = streams_->find(streamId); if (it == streams_->end()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InternalError, - "Stream not found: " + streamId)); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InternalError, + "Stream not found: " + streamId)); } else { it->second->cancel(); streams_->erase(it->first); @@ -487,28 +497,31 @@ void NetworkIOAgent::handleIoClose(const cdp::PreparsedRequest& req) { void NetworkIOAgent::handleGetResponseBody(const cdp::PreparsedRequest& req) { long long requestId = req.id; if (!req.params.isObject()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: not an object.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: not an object.")); return; } if ((req.params.count("requestId") == 0u) || !req.params.at("requestId").isString()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidParams, - "Invalid params: requestId is missing or not a string.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidParams, + "Invalid params: requestId is missing or not a string.")); return; } auto& networkHandler = NetworkHandler::getInstance(); if (!networkHandler.isEnabled()) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InvalidRequest, - "Invalid request: The \"Network\" domain is not enabled.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InvalidRequest, + "Invalid request: The \"Network\" domain is not enabled.")); return; } @@ -516,10 +529,11 @@ void NetworkIOAgent::handleGetResponseBody(const cdp::PreparsedRequest& req) { networkHandler.getResponseBody(req.params.at("requestId").asString()); if (!storedResponse) { - frontendChannel_(cdp::jsonError( - requestId, - cdp::ErrorCode::InternalError, - "Internal error: Could not retrieve response body for the given requestId.")); + frontendChannel_( + cdp::jsonError( + requestId, + cdp::ErrorCode::InternalError, + "Internal error: Could not retrieve response body for the given requestId.")); return; } diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h index 756c4911f4b..297d7d13401 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h @@ -40,11 +40,12 @@ struct ReadStreamParams { struct NetworkResource { bool success{}; - std::optional stream; - std::optional httpStatusCode; - std::optional netErrorName; - std::optional headers; - folly::dynamic toDynamic() const { + std::optional stream{}; + std::optional httpStatusCode{}; + std::optional netErrorName{}; + std::optional headers{}; + folly::dynamic toDynamic() const + { auto dynamicResource = folly::dynamic::object("success", success); if (success) { // stream IFF successful @@ -65,7 +66,7 @@ struct NetworkResource { if (headers) { // Guaranteed if successful auto dynamicHeaders = folly::dynamic::object(); - for (const auto& pair : *headers) { + for (const auto &pair : *headers) { dynamicHeaders(pair.first, pair.second); } dynamicResource("headers", std::move(dynamicHeaders)); @@ -80,7 +81,8 @@ struct IOReadResult { std::string data; bool eof; bool base64Encoded; - folly::dynamic toDynamic() const { + folly::dynamic toDynamic() const + { auto obj = folly::dynamic::object("data", data); obj("eof", eof); obj("base64Encoded", base64Encoded); @@ -91,7 +93,8 @@ struct IOReadResult { struct GetResponseBodyResult { std::string body; bool base64Encoded; - folly::dynamic toDynamic() const { + folly::dynamic toDynamic() const + { folly::dynamic params = folly::dynamic::object; params["body"] = body; params["base64Encoded"] = base64Encoded; @@ -106,11 +109,10 @@ struct GetResponseBodyResult { class NetworkRequestListener { public: NetworkRequestListener() = default; - NetworkRequestListener(const NetworkRequestListener&) = delete; - NetworkRequestListener& operator=(const NetworkRequestListener&) = delete; - NetworkRequestListener(NetworkRequestListener&&) noexcept = default; - NetworkRequestListener& operator=(NetworkRequestListener&&) noexcept = - default; + NetworkRequestListener(const NetworkRequestListener &) = delete; + NetworkRequestListener &operator=(const NetworkRequestListener &) = delete; + NetworkRequestListener(NetworkRequestListener &&) noexcept = default; + NetworkRequestListener &operator=(NetworkRequestListener &&) noexcept = default; virtual ~NetworkRequestListener() = default; /** @@ -120,7 +122,7 @@ class NetworkRequestListener { * \param httpStatusCode The HTTP status code received. * \param headers Response headers as an unordered_map. */ - virtual void onHeaders(uint32_t httpStatusCode, const Headers& headers) = 0; + virtual void onHeaders(uint32_t httpStatusCode, const Headers &headers) = 0; /** * To be called by the delegate on receipt of data chunks. @@ -137,7 +139,7 @@ class NetworkRequestListener { * were not yet received), or as a CDP error in response to a subsequent * `IO.read`. */ - virtual void onError(const std::string& message) = 0; + virtual void onError(const std::string &message) = 0; /** * To be called by the delegate on successful completion of the request. @@ -163,12 +165,10 @@ class NetworkRequestListener { class LoadNetworkResourceDelegate { public: LoadNetworkResourceDelegate() = default; - LoadNetworkResourceDelegate(const LoadNetworkResourceDelegate&) = delete; - LoadNetworkResourceDelegate& operator=(const LoadNetworkResourceDelegate&) = - delete; - LoadNetworkResourceDelegate(LoadNetworkResourceDelegate&&) noexcept = delete; - LoadNetworkResourceDelegate& operator=( - LoadNetworkResourceDelegate&&) noexcept = delete; + LoadNetworkResourceDelegate(const LoadNetworkResourceDelegate &) = delete; + LoadNetworkResourceDelegate &operator=(const LoadNetworkResourceDelegate &) = delete; + LoadNetworkResourceDelegate(LoadNetworkResourceDelegate &&) noexcept = delete; + LoadNetworkResourceDelegate &operator=(LoadNetworkResourceDelegate &&) noexcept = delete; virtual ~LoadNetworkResourceDelegate() = default; /** @@ -185,7 +185,7 @@ class LoadNetworkResourceDelegate { * called to abort any in-flight network operation that is no longer needed. */ virtual void loadNetworkResource( - [[maybe_unused]] const LoadNetworkResourceRequest& params, + [[maybe_unused]] const LoadNetworkResourceRequest ¶ms, [[maybe_unused]] ScopedExecutor executor) = 0; }; @@ -207,18 +207,16 @@ class NetworkIOAgent { * processing incoming data or other events from network operations. */ NetworkIOAgent(FrontendChannel frontendChannel, VoidExecutor executor) - : frontendChannel_(frontendChannel), - executor_(executor), - streams_(std::make_shared()) {} + : frontendChannel_(frontendChannel), executor_(executor), streams_(std::make_shared()) + { + } /** * Handle a CDP request. The response will be sent over the provided * \c FrontendChannel synchronously or asynchronously. * \param req The parsed request. */ - bool handleRequest( - const cdp::PreparsedRequest& req, - LoadNetworkResourceDelegate& delegate); + bool handleRequest(const cdp::PreparsedRequest &req, LoadNetworkResourceDelegate &delegate); private: /** @@ -255,26 +253,24 @@ class NetworkIOAgent { * Does not catch exceptions thrown by the delegate (such as * NotImplementedException). */ - void handleLoadNetworkResource( - const cdp::PreparsedRequest& req, - LoadNetworkResourceDelegate& delegate); + void handleLoadNetworkResource(const cdp::PreparsedRequest &req, LoadNetworkResourceDelegate &delegate); /** * Handle an IO.read CDP request. Emit a chunk of data from the stream, once * enough has been downloaded, or report an error. */ - void handleIoRead(const cdp::PreparsedRequest& req); + void handleIoRead(const cdp::PreparsedRequest &req); /** * Handle an IO.close CDP request. Safely aborts any in-flight request. * Reports CDP ok if the stream is found, or a CDP error if not. */ - void handleIoClose(const cdp::PreparsedRequest& req); + void handleIoClose(const cdp::PreparsedRequest &req); /** * Handle a Network.getResponseBody CDP request. */ - void handleGetResponseBody(const cdp::PreparsedRequest& req); + void handleGetResponseBody(const cdp::PreparsedRequest &req); }; -} // namespace facebook::react::jsinspector_modern \ No newline at end of file +} // namespace facebook::react::jsinspector_modern diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h index 1d08d46e489..de1f4687e7e 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h @@ -19,7 +19,8 @@ namespace facebook::react::jsinspector_modern { * * \param buffer Buffer to operate on - will be resized if necessary. */ -inline void truncateToValidUTF8(std::vector& buffer) { +inline void truncateToValidUTF8(std::vector &buffer) +{ const auto length = buffer.size(); // Ensure we don't cut a UTF-8 code point in the middle by removing any // trailing bytes representing an incomplete UTF-8 code point. @@ -31,8 +32,7 @@ inline void truncateToValidUTF8(std::vector& buffer) { size_t continuationBytes = 0; // [Windows #13587] // Find the first byte of the UTF-8 code point (topmost bits 11) and count // the number of continuation bytes following it. - while ((buffer[length - continuationBytes - 1] & 0b11000000) != - 0b11000000) { + while ((buffer[length - continuationBytes - 1] & 0b11000000) != 0b11000000) { continuationBytes++; if (continuationBytes > 3 || continuationBytes >= length - 1) { throw std::runtime_error("Invalid UTF-8 sequence"); @@ -46,8 +46,7 @@ inline void truncateToValidUTF8(std::vector& buffer) { // by a 0. char mask = static_cast(0b11111000 << (3 - continuationBytes)); char expectedBitsAfterMask = static_cast(mask << 1); - if (continuationBytes == 0 || - (firstByteOfSequence & mask) != expectedBitsAfterMask) { + if (continuationBytes == 0 || (firstByteOfSequence & mask) != expectedBitsAfterMask) { // Remove the trailing continuation bytes, if any, and the first byte. buffer.resize(length - (continuationBytes + 1)); } diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h index f9221d83e36..2256c0cbfe6 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h @@ -36,9 +36,7 @@ enum TurboModuleMethodValueKind { /** * Determines TurboModuleMethodValueKind based on the jsi::Value type. */ -TurboModuleMethodValueKind getTurboModuleMethodValueKind( - jsi::Runtime& rt, - const jsi::Value* value); +TurboModuleMethodValueKind getTurboModuleMethodValueKind(jsi::Runtime &rt, const jsi::Value *value); class TurboCxxModule; class TurboModuleBinding; @@ -55,8 +53,8 @@ class JSI_EXPORT TurboModule : public jsi::HostObject { // JS representation. To customize lookup of properties, override `create`. // Note: keep this method declared inline to avoid conflicts // between RTTI and non-RTTI compilation units - jsi::Value get(jsi::Runtime& runtime, const jsi::PropNameID& propName) - override { + jsi::Value get(jsi::Runtime &runtime, const jsi::PropNameID &propName) override + { auto prop = create(runtime, propName); // If we have a JS wrapper, cache the result of this lookup // We don't cache misses, to allow for methodMap_ to dynamically be @@ -64,15 +62,14 @@ class JSI_EXPORT TurboModule : public jsi::HostObject { // [Windows] Reenable once https://github.com/microsoft/react-native-windows/issues/14128 is fixed #ifndef WINAPI_FAMILY if (jsRepresentation_ && !prop.isUndefined()) { - jsRepresentation_->lock(runtime).asObject(runtime).setProperty( - runtime, propName, prop); + jsRepresentation_->lock(runtime).asObject(runtime).setProperty(runtime, propName, prop); } #endif return prop; } - std::vector getPropertyNames( - jsi::Runtime& runtime) override { + std::vector getPropertyNames(jsi::Runtime &runtime) override + { std::vector result; result.reserve(methodMap_.size()); for (auto it = methodMap_.cbegin(); it != methodMap_.cend(); ++it) { @@ -87,18 +84,14 @@ class JSI_EXPORT TurboModule : public jsi::HostObject { struct MethodMetadata { size_t argCount; - jsi::Value (*invoker)( - jsi::Runtime& rt, - TurboModule& turboModule, - const jsi::Value* args, - size_t count); + jsi::Value (*invoker)(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value *args, size_t count); }; std::unordered_map methodMap_; - std::unordered_map> - eventEmitterMap_; - using ArgFactory = - std::function& args)>; + friend class TurboModuleTestFixtureInternal; + std::unordered_map> eventEmitterMap_; + + using ArgFactory = std::function &args)>; /** * Calls RCTDeviceEventEmitter.emit to JavaScript, with given event name and @@ -112,35 +105,31 @@ class JSI_EXPORT TurboModule : public jsi::HostObject { * args.emplace_back(jsi::Value(42)); * }); */ - void emitDeviceEvent( - const std::string& eventName, - ArgFactory&& argFactory = nullptr); + void emitDeviceEvent(const std::string &eventName, ArgFactory &&argFactory = nullptr); // Backwards compatibility version void emitDeviceEvent( - jsi::Runtime& /*runtime*/, + jsi::Runtime & /*runtime*/, - const std::string& eventName, - ArgFactory&& argFactory = nullptr) { + const std::string &eventName, + ArgFactory &&argFactory = nullptr) + { emitDeviceEvent(eventName, std::move(argFactory)); } - virtual jsi::Value create( - jsi::Runtime& runtime, - const jsi::PropNameID& propName) { + virtual jsi::Value create(jsi::Runtime &runtime, const jsi::PropNameID &propName) + { std::string propNameUtf8 = propName.utf8(runtime); - if (auto methodIter = methodMap_.find(propNameUtf8); - methodIter != methodMap_.end()) { - const MethodMetadata& meta = methodIter->second; + if (auto methodIter = methodMap_.find(propNameUtf8); methodIter != methodMap_.end()) { + const MethodMetadata &meta = methodIter->second; return jsi::Function::createFromHostFunction( runtime, propName, static_cast(meta.argCount), [this, meta]( - jsi::Runtime& rt, - [[maybe_unused]] const jsi::Value& thisVal, - const jsi::Value* args, - size_t count) { return meta.invoker(rt, *this, args, count); }); + jsi::Runtime &rt, [[maybe_unused]] const jsi::Value &thisVal, const jsi::Value *args, size_t count) { + return meta.invoker(rt, *this, args, count); + }); } else if (auto eventEmitterIter = eventEmitterMap_.find(propNameUtf8); eventEmitterIter != eventEmitterMap_.end()) { return eventEmitterIter->second->get(runtime, jsInvoker_); @@ -159,7 +148,6 @@ class JSI_EXPORT TurboModule : public jsi::HostObject { * An app/platform-specific provider function to get an instance of a module * given a name. */ -using TurboModuleProviderFunctionType = - std::function(const std::string& name)>; +using TurboModuleProviderFunctionType = std::function(const std::string &name)>; } // namespace facebook::react diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h index d6ea633c9db..3318d3fb97d 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h @@ -23,14 +23,11 @@ namespace facebook::react { -using MeasureOnSuccessCallback = - SyncCallback; +using MeasureOnSuccessCallback = SyncCallback; -using MeasureInWindowOnSuccessCallback = - SyncCallback; +using MeasureInWindowOnSuccessCallback = SyncCallback; -using MeasureLayoutOnSuccessCallback = - SyncCallback; +using MeasureLayoutOnSuccessCallback = SyncCallback; class NativeDOM : public NativeDOMCxxSpec { public: @@ -38,21 +35,15 @@ class NativeDOM : public NativeDOMCxxSpec { #pragma mark - Methods from the Node interface (for ReadOnlyNode). - double compareDocumentPosition( - jsi::Runtime& rt, - jsi::Value nativeNodeReference, - jsi::Value otherNativeNodeReference); + double compareDocumentPosition(jsi::Runtime &rt, jsi::Value nativeNodeReference, jsi::Value otherNativeNodeReference); - std::vector getChildNodes( - jsi::Runtime& rt, - jsi::Value nativeNodeReference); + std::vector getChildNodes(jsi::Runtime &rt, jsi::Value nativeNodeReference); - jsi::Value - getElementById(jsi::Runtime& rt, SurfaceId surfaceId, const std::string& id); + jsi::Value getElementById(jsi::Runtime &rt, SurfaceId surfaceId, const std::string &id); - jsi::Value getParentNode(jsi::Runtime& rt, jsi::Value nativeNodeReference); + jsi::Value getParentNode(jsi::Runtime &rt, jsi::Value nativeNodeReference); - bool isConnected(jsi::Runtime& rt, jsi::Value nativeNodeReference); + bool isConnected(jsi::Runtime &rt, jsi::Value nativeNodeReference); #pragma mark - Methods from the Element interface (for ReactNativeElement). @@ -60,99 +51,70 @@ class NativeDOM : public NativeDOMCxxSpec { /* topWidth: */ int, /* rightWidth: */ int, /* bottomWidth: */ int, - /* leftWidth: */ int> - getBorderWidth( - jsi::Runtime& rt, - std::shared_ptr shadowNode); + /* leftWidth: */ int> getBorderWidth(jsi::Runtime &rt, std::shared_ptr shadowNode); std::tuple< /* x: */ double, /* y: */ double, /* width: */ double, /* height: */ double> - getBoundingClientRect( - jsi::Runtime& rt, - std::shared_ptr shadowNode, - bool includeTransform); + getBoundingClientRect(jsi::Runtime &rt, std::shared_ptr shadowNode, bool includeTransform); std::tuple getInnerSize( - jsi::Runtime& rt, + jsi::Runtime &rt, std::shared_ptr shadowNode); - std::tuple - getScrollPosition( - jsi::Runtime& rt, + std::tuple getScrollPosition( + jsi::Runtime &rt, std::shared_ptr shadowNode); std::tuple getScrollSize( - jsi::Runtime& rt, + jsi::Runtime &rt, std::shared_ptr shadowNode); - std::string getTagName( - jsi::Runtime& rt, - std::shared_ptr shadowNode); + std::string getTagName(jsi::Runtime &rt, std::shared_ptr shadowNode); - std::string getTextContent( - jsi::Runtime& rt, - std::shared_ptr shadowNode); + std::string getTextContent(jsi::Runtime &rt, std::shared_ptr shadowNode); - bool hasPointerCapture( - jsi::Runtime& rt, - std::shared_ptr shadowNode, - double pointerId); + bool hasPointerCapture(jsi::Runtime &rt, std::shared_ptr shadowNode, double pointerId); - void releasePointerCapture( - jsi::Runtime& rt, - std::shared_ptr shadowNode, - double pointerId); + void releasePointerCapture(jsi::Runtime &rt, std::shared_ptr shadowNode, double pointerId); - void setPointerCapture( - jsi::Runtime& rt, - std::shared_ptr shadowNode, - double pointerId); + void setPointerCapture(jsi::Runtime &rt, std::shared_ptr shadowNode, double pointerId); #pragma mark - Methods from the HTMLElement interface (for ReactNativeElement). std::tuple< /* offsetParent: */ jsi::Value, /* top: */ double, - /* left: */ double> - getOffset(jsi::Runtime& rt, std::shared_ptr shadowNode); + /* left: */ double> getOffset(jsi::Runtime &rt, std::shared_ptr shadowNode); #pragma mark - Special methods to handle the root node. - jsi::Value linkRootNode( - jsi::Runtime& rt, - SurfaceId surfaceId, - jsi::Value instanceHandle); + jsi::Value linkRootNode(jsi::Runtime &rt, SurfaceId surfaceId, jsi::Value instanceHandle); #pragma mark - Legacy layout APIs (for ReactNativeElement). - void measure( - jsi::Runtime& rt, - std::shared_ptr shadowNode, - const MeasureOnSuccessCallback& callback); + void + measure(jsi::Runtime &rt, std::shared_ptr shadowNode, const MeasureOnSuccessCallback &callback); void measureInWindow( - jsi::Runtime& rt, + jsi::Runtime &rt, std::shared_ptr shadowNode, - const MeasureInWindowOnSuccessCallback& callback); + const MeasureInWindowOnSuccessCallback &callback); void measureLayout( - jsi::Runtime& rt, + jsi::Runtime &rt, std::shared_ptr shadowNode, std::shared_ptr relativeToShadowNode, jsi::Function onFail, - const MeasureLayoutOnSuccessCallback& onSuccess); + const MeasureLayoutOnSuccessCallback &onSuccess); // [windows MSVC cant handle backtick character in a preprocessor line #pragma mark - Legacy direct manipulation APIs (for ReactNativeElement). // windows] - void setNativeProps( - jsi::Runtime& rt, - std::shared_ptr shadowNode, - jsi::Value updatePayload); + void setNativeProps(jsi::Runtime &rt, std::shared_ptr shadowNode, jsi::Value updatePayload); }; } // namespace facebook::react diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h index 10bf41acd4b..be60a6dee9c 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h @@ -18,7 +18,12 @@ namespace facebook::react { +<<<<<<< Upstream +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) +{ +======= inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) { +>>>>>>> Override if (value.hasType()) { result = { /* .type = */ ImageSource::Type::Remote, @@ -111,11 +116,21 @@ inline void fromRawValue(const PropsParserContext &context, const RawValue &valu result.type = ImageSource::Type::Invalid; } +<<<<<<< Upstream +inline std::string toString(const ImageSource &value) +{ + return "{uri: " + value.uri + "}"; +} + +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageResizeMode &result) +{ +======= inline std::string toString(const ImageSource &value) { return "{uri: " + value.uri + "}"; } inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageResizeMode &result) { +>>>>>>> Override react_native_expect(value.hasType()); if (!value.hasType()) { LOG(ERROR) << "Unsupported ImageResizeMode type"; @@ -145,7 +160,12 @@ inline void fromRawValue(const PropsParserContext &context, const RawValue &valu } } +<<<<<<< Upstream +inline std::string toString(const ImageResizeMode &value) +{ +======= inline std::string toString(const ImageResizeMode &value) { +>>>>>>> Override switch (value) { case ImageResizeMode::Cover: return "cover"; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp index 4563b825a5f..e6010322f22 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp @@ -158,11 +158,12 @@ void ParagraphShadowNode::updateStateIfNeeded( return; } - setStateData(ParagraphStateT{ - content.attributedString, - content.paragraphAttributes, - textLayoutManager_, - layout}); + setStateData( + ParagraphStateT{ + content.attributedString, + content.paragraphAttributes, + textLayoutManager_, + layout}); } void ParagraphShadowNode::updateStateIfNeeded(const Content& content) { @@ -175,10 +176,11 @@ void ParagraphShadowNode::updateStateIfNeeded(const Content& content) { return; } - setStateData(ParagraphState{ - content.attributedString, - content.paragraphAttributes, - textLayoutManager_}); + setStateData( + ParagraphState{ + content.attributedString, + content.paragraphAttributes, + textLayoutManager_}); } MeasuredPreparedLayout* ParagraphShadowNode::findUsableLayout() { @@ -249,12 +251,13 @@ Size ParagraphShadowNode::measureContent( auto measurement = tme.measurePreparedLayout( preparedLayout, textLayoutContext, layoutConstraints); - measuredLayouts_.push_back(MeasuredPreparedLayout{ - .layoutConstraints = layoutConstraints, - .measurement = measurement, - // PreparedLayout is not trivially copyable on all platforms - // NOLINTNEXTLINE(performance-move-const-arg) - .preparedLayout = std::move(preparedLayout)}); + measuredLayouts_.push_back( + MeasuredPreparedLayout{ + .layoutConstraints = layoutConstraints, + .measurement = measurement, + // PreparedLayout is not trivially copyable on all platforms + // NOLINTNEXTLINE(performance-move-const-arg) + .preparedLayout = std::move(preparedLayout)}); assert_valid_size(measurement.size, layoutConstraints); return measurement.size; } diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h index d44e9e34a55..d85b80ae148 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h @@ -65,22 +65,21 @@ class ParagraphState final { : attributedString(std::move(attributedString)), paragraphAttributes(std::move(paragraphAttributes)), layoutManager(std::move(layoutManager)), - measuredLayout(std::move(measuredLayout)) {} + measuredLayout(std::move(measuredLayout)) + { + } ParagraphState( AttributedString attributedString, ParagraphAttributes paragraphAttributes, std::weak_ptr layoutManager) - : ParagraphState( - std::move(attributedString), - std::move(paragraphAttributes), - std::move(layoutManager), - {}) {} + : ParagraphState(std::move(attributedString), std::move(paragraphAttributes), std::move(layoutManager), {}) + { + } ParagraphState() = default; - ParagraphState( - const ParagraphState& /*previousState*/, - const folly::dynamic& /*data*/) { + ParagraphState(const ParagraphState & /*previousState*/, const folly::dynamic & /*data*/) + { react_native_assert(false && "Not supported"); }; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h index 3c2eb2fc187..8b9dbc44ab8 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h @@ -36,15 +36,13 @@ enum class AccessibilityTraits : uint32_t { TabBar = (1 << 17), }; -constexpr enum AccessibilityTraits operator|( - const enum AccessibilityTraits lhs, - const enum AccessibilityTraits rhs) { +constexpr enum AccessibilityTraits operator|(const enum AccessibilityTraits lhs, const enum AccessibilityTraits rhs) +{ return (enum AccessibilityTraits)((uint32_t)lhs | (uint32_t)rhs); } -constexpr enum AccessibilityTraits operator&( - const enum AccessibilityTraits lhs, - const enum AccessibilityTraits rhs) { +constexpr enum AccessibilityTraits operator&(const enum AccessibilityTraits lhs, const enum AccessibilityTraits rhs) +{ return (enum AccessibilityTraits)((uint32_t)lhs & (uint32_t)rhs); } @@ -53,15 +51,13 @@ struct AccessibilityAction { std::optional label{}; }; -inline static bool operator==( - const AccessibilityAction& lhs, - const AccessibilityAction& rhs) { +inline static bool operator==(const AccessibilityAction &lhs, const AccessibilityAction &rhs) +{ return lhs.name == rhs.name && lhs.label == rhs.label; } -inline static bool operator!=( - const AccessibilityAction& lhs, - const AccessibilityAction& rhs) { +inline static bool operator!=(const AccessibilityAction &lhs, const AccessibilityAction &rhs) +{ return !(rhs == lhs); } @@ -76,17 +72,14 @@ struct AccessibilityState { std::optional required{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionProvider Implementation }; -constexpr bool operator==( - const AccessibilityState& lhs, - const AccessibilityState& rhs) { - return lhs.disabled == rhs.disabled && lhs.selected == rhs.selected && - lhs.checked == rhs.checked && lhs.busy == rhs.busy && - lhs.expanded == rhs.expanded; +constexpr bool operator==(const AccessibilityState &lhs, const AccessibilityState &rhs) +{ + return lhs.disabled == rhs.disabled && lhs.selected == rhs.selected && lhs.checked == rhs.checked && + lhs.busy == rhs.busy && lhs.expanded == rhs.expanded; } -constexpr bool operator!=( - const AccessibilityState& lhs, - const AccessibilityState& rhs) { +constexpr bool operator!=(const AccessibilityState &lhs, const AccessibilityState &rhs) +{ return !(rhs == lhs); } @@ -94,15 +87,13 @@ struct AccessibilityLabelledBy { std::vector value{}; }; -inline static bool operator==( - const AccessibilityLabelledBy& lhs, - const AccessibilityLabelledBy& rhs) { +inline static bool operator==(const AccessibilityLabelledBy &lhs, const AccessibilityLabelledBy &rhs) +{ return lhs.value == rhs.value; } -inline static bool operator!=( - const AccessibilityLabelledBy& lhs, - const AccessibilityLabelledBy& rhs) { +inline static bool operator!=(const AccessibilityLabelledBy &lhs, const AccessibilityLabelledBy &rhs) +{ return !(lhs == rhs); } @@ -113,16 +104,13 @@ struct AccessibilityValue { std::optional text{}; }; -constexpr bool operator==( - const AccessibilityValue& lhs, - const AccessibilityValue& rhs) { - return lhs.min == rhs.min && lhs.max == rhs.max && lhs.now == rhs.now && - lhs.text == rhs.text; +constexpr bool operator==(const AccessibilityValue &lhs, const AccessibilityValue &rhs) +{ + return lhs.min == rhs.min && lhs.max == rhs.max && lhs.now == rhs.now && lhs.text == rhs.text; } -constexpr bool operator!=( - const AccessibilityValue& lhs, - const AccessibilityValue& rhs) { +constexpr bool operator!=(const AccessibilityValue &lhs, const AccessibilityValue &rhs) +{ return !(rhs == lhs); } diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h index 3c6ded537cb..0e395f97d36 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h @@ -20,7 +20,8 @@ namespace facebook::react { -inline void fromString(const std::string& string, AccessibilityTraits& result) { +inline void fromString(const std::string &string, AccessibilityTraits &result) +{ if (string == "none") { result = AccessibilityTraits::None; return; @@ -108,10 +109,8 @@ inline void fromString(const std::string& string, AccessibilityTraits& result) { result = AccessibilityTraits::None; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - AccessibilityTraits& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, AccessibilityTraits &result) +{ if (value.hasType()) { fromString((std::string)value, result); return; @@ -122,7 +121,7 @@ inline void fromRawValue( react_native_expect(value.hasType>()); if (value.hasType>()) { auto items = (std::vector)value; - for (auto& item : items) { + for (auto &item : items) { AccessibilityTraits itemAccessibilityTraits; fromString(item, itemAccessibilityTraits); result = result | itemAccessibilityTraits; @@ -132,10 +131,8 @@ inline void fromRawValue( } } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - AccessibilityState& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, AccessibilityState &result) +{ auto map = (std::unordered_map)value; auto selected = map.find("selected"); if (selected != map.end()) { @@ -187,8 +184,8 @@ inline void fromRawValue( // [Windows] - DO NOT REMOVE } -inline std::string toString( - const ImportantForAccessibility& importantForAccessibility) { +inline std::string toString(const ImportantForAccessibility &importantForAccessibility) +{ switch (importantForAccessibility) { case ImportantForAccessibility::Auto: return "auto"; @@ -201,10 +198,8 @@ inline std::string toString( } } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - ImportantForAccessibility& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImportantForAccessibility &result) +{ result = ImportantForAccessibility::Auto; react_native_expect(value.hasType()); if (value.hasType()) { @@ -226,10 +221,8 @@ inline void fromRawValue( } } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - AccessibilityAction& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, AccessibilityAction &result) +{ auto map = (std::unordered_map)value; auto name = map.find("name"); @@ -246,10 +239,8 @@ inline void fromRawValue( } } -inline void fromRawValue( - const PropsParserContext& /*unused*/, - const RawValue& value, - AccessibilityValue& result) { +inline void fromRawValue(const PropsParserContext & /*unused*/, const RawValue &value, AccessibilityValue &result) +{ auto map = (std::unordered_map)value; auto min = map.find("min"); @@ -281,10 +272,8 @@ inline void fromRawValue( } } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - AccessibilityLabelledBy& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, AccessibilityLabelledBy &result) +{ if (value.hasType()) { result.value.push_back((std::string)value); } else if (value.hasType>()) { @@ -292,10 +281,8 @@ inline void fromRawValue( } } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - AccessibilityLiveRegion& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, AccessibilityLiveRegion &result) +{ result = AccessibilityLiveRegion::None; react_native_expect(value.hasType()); if (value.hasType()) { @@ -315,7 +302,8 @@ inline void fromRawValue( } } -inline std::string toString(const AccessibilityRole& accessibilityRole) { +inline std::string toString(const AccessibilityRole &accessibilityRole) +{ switch (accessibilityRole) { case AccessibilityRole::None: return "none"; @@ -405,10 +393,8 @@ inline std::string toString(const AccessibilityRole& accessibilityRole) { return "none"; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - AccessibilityRole& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, AccessibilityRole &result) +{ react_native_expect(value.hasType()); if (value.hasType()) { auto string = (std::string)value; @@ -505,7 +491,8 @@ inline void fromRawValue( result = AccessibilityRole::None; } -inline std::string toString(const Role& role) { +inline std::string toString(const Role &role) +{ switch (role) { case Role::Alert: return "alert"; @@ -645,10 +632,8 @@ inline std::string toString(const Role& role) { return "none"; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - Role& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, Role &result) +{ react_native_expect(value.hasType()); if (value.hasType()) { auto string = (std::string)value; @@ -797,7 +782,8 @@ inline void fromRawValue( result = Role::None; } -inline std::string toString(AccessibilityLiveRegion accessibilityLiveRegion) { +inline std::string toString(AccessibilityLiveRegion accessibilityLiveRegion) +{ switch (accessibilityLiveRegion) { case AccessibilityLiveRegion::None: return "none"; @@ -809,7 +795,8 @@ inline std::string toString(AccessibilityLiveRegion accessibilityLiveRegion) { } #if RN_DEBUG_STRING_CONVERTIBLE -inline std::string toString(AccessibilityState::CheckedState state) { +inline std::string toString(AccessibilityState::CheckedState state) +{ switch (state) { case AccessibilityState::Unchecked: return "Unchecked"; @@ -822,7 +809,8 @@ inline std::string toString(AccessibilityState::CheckedState state) { } } -inline std::string toString(const AccessibilityAction& accessibilityAction) { +inline std::string toString(const AccessibilityAction &accessibilityAction) +{ std::string result = accessibilityAction.name; if (accessibilityAction.label.has_value()) { result += ": '" + accessibilityAction.label.value() + "'"; @@ -830,8 +818,8 @@ inline std::string toString(const AccessibilityAction& accessibilityAction) { return result; } -inline std::string toString( - std::vector accessibilityActions) { +inline std::string toString(std::vector accessibilityActions) +{ std::string result = "["; for (size_t i = 0; i < accessibilityActions.size(); i++) { result += toString(accessibilityActions[i]); @@ -843,11 +831,10 @@ inline std::string toString( return result; } -inline std::string toString(const AccessibilityState& accessibilityState) { - return "{disabled:" + toString(accessibilityState.disabled) + - ",selected:" + toString(accessibilityState.selected) + - ",checked:" + toString(accessibilityState.checked) + - ",busy:" + toString(accessibilityState.busy) + +inline std::string toString(const AccessibilityState &accessibilityState) +{ + return "{disabled:" + toString(accessibilityState.disabled) + ",selected:" + toString(accessibilityState.selected) + + ",checked:" + toString(accessibilityState.checked) + ",busy:" + toString(accessibilityState.busy) + ",expanded:" + toString(accessibilityState.expanded) + "}"; } #endif diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h index b50964cb005..7c931b2f58f 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h @@ -18,7 +18,10 @@ #include #include #include -#include +#include +#include +#include +#include #include #include #include @@ -44,10 +47,9 @@ namespace facebook::react { * values have special "no limit" meaning in Yoga, therefore ` YGUndefined` * usually corresponds to `Infinity` value. */ -inline Float floatFromYogaFloat(float value) { - static_assert( - YGUndefined != YGUndefined, - "The code of this function assumes that YGUndefined is NaN."); +inline Float floatFromYogaFloat(float value) +{ + static_assert(YGUndefined != YGUndefined, "The code of this function assumes that YGUndefined is NaN."); if (std::isnan(value) /* means: `value == YGUndefined` */) { return std::numeric_limits::infinity(); } @@ -55,7 +57,8 @@ inline Float floatFromYogaFloat(float value) { return (Float)value; } -inline float yogaFloatFromFloat(Float value) { +inline float yogaFloatFromFloat(Float value) +{ if (!std::isfinite(value)) { return YGUndefined; } @@ -73,7 +76,8 @@ inline float yogaFloatFromFloat(Float value) { * which usually has some special corresponding representation for an empty * value. */ -inline Float floatFromYogaOptionalFloat(yoga::FloatOptional value) { +inline Float floatFromYogaOptionalFloat(yoga::FloatOptional value) +{ if (value.isUndefined()) { return std::numeric_limits::quiet_NaN(); } @@ -81,7 +85,8 @@ inline Float floatFromYogaOptionalFloat(yoga::FloatOptional value) { return floatFromYogaFloat(value.unwrap()); } -inline yoga::FloatOptional yogaOptionalFloatFromFloat(Float value) { +inline yoga::FloatOptional yogaOptionalFloatFromFloat(Float value) +{ if (std::isnan(value)) { return yoga::FloatOptional(); } @@ -90,22 +95,21 @@ inline yoga::FloatOptional yogaOptionalFloatFromFloat(Float value) { } inline std::optional optionalFloatFromYogaValue( - const yoga::Style::Length& length, - std::optional base = {}) { + const yoga::Style::Length &length, + std::optional base = {}) +{ if (length.isPoints()) { return floatFromYogaOptionalFloat(length.value()); } else if (length.isPercent()) { - return base.has_value() - ? std::optional( - base.value() * floatFromYogaOptionalFloat(length.value())) - : std::optional(); + return base.has_value() ? std::optional(base.value() * floatFromYogaOptionalFloat(length.value())) + : std::optional(); } else { return {}; } } -static inline PositionType positionTypeFromYogaPositionType( - yoga::PositionType positionType) { +static inline PositionType positionTypeFromYogaPositionType(yoga::PositionType positionType) +{ switch (positionType) { case yoga::PositionType::Static: return PositionType::Static; @@ -116,7 +120,8 @@ static inline PositionType positionTypeFromYogaPositionType( } } -inline DisplayType displayTypeFromYGDisplay(YGDisplay display) { +inline DisplayType displayTypeFromYGDisplay(YGDisplay display) +{ switch (display) { case YGDisplayNone: return DisplayType::None; @@ -127,7 +132,8 @@ inline DisplayType displayTypeFromYGDisplay(YGDisplay display) { } } -inline LayoutMetrics layoutMetricsFromYogaNode(yoga::Node& yogaNode) { +inline LayoutMetrics layoutMetricsFromYogaNode(yoga::Node &yogaNode) +{ auto layoutMetrics = LayoutMetrics{}; layoutMetrics.frame = Rect{ @@ -146,30 +152,23 @@ inline LayoutMetrics layoutMetricsFromYogaNode(yoga::Node& yogaNode) { floatFromYogaFloat(YGNodeLayoutGetBorder(&yogaNode, YGEdgeBottom))}; layoutMetrics.contentInsets = EdgeInsets{ - layoutMetrics.borderWidth.left + - floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeLeft)), - layoutMetrics.borderWidth.top + - floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeTop)), - layoutMetrics.borderWidth.right + - floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeRight)), - layoutMetrics.borderWidth.bottom + - floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeBottom))}; - - layoutMetrics.displayType = - displayTypeFromYGDisplay(YGNodeStyleGetDisplay(&yogaNode)); - - layoutMetrics.positionType = - positionTypeFromYogaPositionType(yogaNode.style().positionType()); - - layoutMetrics.layoutDirection = - YGNodeLayoutGetDirection(&yogaNode) == YGDirectionRTL - ? LayoutDirection::RightToLeft - : LayoutDirection::LeftToRight; + layoutMetrics.borderWidth.left + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeLeft)), + layoutMetrics.borderWidth.top + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeTop)), + layoutMetrics.borderWidth.right + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeRight)), + layoutMetrics.borderWidth.bottom + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeBottom))}; + + layoutMetrics.displayType = displayTypeFromYGDisplay(YGNodeStyleGetDisplay(&yogaNode)); + + layoutMetrics.positionType = positionTypeFromYogaPositionType(yogaNode.style().positionType()); + + layoutMetrics.layoutDirection = YGNodeLayoutGetDirection(&yogaNode) == YGDirectionRTL ? LayoutDirection::RightToLeft + : LayoutDirection::LeftToRight; return layoutMetrics; } -inline YGDirection yogaDirectionFromLayoutDirection(LayoutDirection direction) { +inline YGDirection yogaDirectionFromLayoutDirection(LayoutDirection direction) +{ switch (direction) { case LayoutDirection::Undefined: return YGDirectionInherit; @@ -180,10 +179,8 @@ inline YGDirection yogaDirectionFromLayoutDirection(LayoutDirection direction) { } } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::Direction& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Direction &result) +{ result = yoga::Direction::Inherit; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -205,10 +202,8 @@ inline void fromRawValue( LOG(ERROR) << "Could not parse yoga::Direction: " << stringValue; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::FlexDirection& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::FlexDirection &result) +{ result = yoga::FlexDirection::Column; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -234,10 +229,8 @@ inline void fromRawValue( LOG(ERROR) << "Could not parse yoga::FlexDirection: " << stringValue; } -inline void fromRawValue( - const PropsParserContext& /*context*/, - const RawValue& value, - yoga::BoxSizing& result) { +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, yoga::BoxSizing &result) +{ result = yoga::BoxSizing::BorderBox; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -256,10 +249,8 @@ inline void fromRawValue( LOG(ERROR) << "Could not parse yoga::BoxSizing: " << stringValue; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::Justify& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Justify &result) +{ result = yoga::Justify::FlexStart; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -293,10 +284,8 @@ inline void fromRawValue( LOG(ERROR) << "Could not parse yoga::Justify: " << stringValue; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::Align& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Align &result) +{ result = yoga::Align::Stretch; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -343,10 +332,8 @@ inline void fromRawValue( react_native_expect(false); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::PositionType& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::PositionType &result) +{ result = yoga::PositionType::Relative; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -368,10 +355,8 @@ inline void fromRawValue( LOG(ERROR) << "Could not parse yoga::PositionType: " << stringValue; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::Wrap& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Wrap &result) +{ result = yoga::Wrap::NoWrap; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -393,10 +378,8 @@ inline void fromRawValue( LOG(ERROR) << "Could not parse yoga::Wrap: " << stringValue; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::Overflow& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Overflow &result) +{ result = yoga::Overflow::Visible; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -419,10 +402,8 @@ inline void fromRawValue( react_native_expect(false); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::Display& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Display &result) +{ result = yoga::Display::Flex; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -444,10 +425,8 @@ inline void fromRawValue( LOG(ERROR) << "Could not parse yoga::Display: " << stringValue; } -inline void fromRawValue( - const PropsParserContext& /*context*/, - const RawValue& value, - yoga::Style::SizeLength& result) { +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, yoga::Style::SizeLength &result) +{ if (value.hasType()) { result = yoga::StyleSizeLength::points((float)value); return; @@ -468,12 +447,10 @@ inline void fromRawValue( } else { auto parsed = parseCSSProperty(stringValue); if (std::holds_alternative(parsed)) { - result = yoga::StyleSizeLength::percent( - std::get(parsed).value); + result = yoga::StyleSizeLength::percent(std::get(parsed).value); return; } else if (std::holds_alternative(parsed)) { - result = - yoga::StyleSizeLength::points(std::get(parsed).value); + result = yoga::StyleSizeLength::points(std::get(parsed).value); return; } } @@ -481,10 +458,8 @@ inline void fromRawValue( result = yoga::StyleSizeLength::undefined(); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::Style::Length& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Style::Length &result) +{ if (value.hasType()) { result = yoga::StyleLength::points((float)value); return; @@ -496,8 +471,7 @@ inline void fromRawValue( } else { auto parsed = parseCSSProperty(stringValue); if (std::holds_alternative(parsed)) { - result = - yoga::StyleLength::percent(std::get(parsed).value); + result = yoga::StyleLength::percent(std::get(parsed).value); return; } else if (std::holds_alternative(parsed)) { result = yoga::StyleLength::points(std::get(parsed).value); @@ -508,24 +482,20 @@ inline void fromRawValue( result = yoga::StyleLength::undefined(); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - YGValue& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, YGValue &result) +{ yoga::Style::Length length{}; fromRawValue(context, value, length); result = (YGValue)length; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - yoga::FloatOptional& result) { - result = value.hasType() ? yoga::FloatOptional((float)value) - : yoga::FloatOptional(); +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::FloatOptional &result) +{ + result = value.hasType() ? yoga::FloatOptional((float)value) : yoga::FloatOptional(); } -inline std::optional toRadians(const RawValue& value) { +inline std::optional toRadians(const RawValue &value) +{ if (value.hasType()) { return (Float)value; } @@ -535,13 +505,18 @@ inline std::optional toRadians(const RawValue& value) { auto angle = parseCSSProperty((std::string)value); if (std::holds_alternative(angle)) { +<<<<<<< Upstream + return static_cast(std::get(angle).degrees * M_PI / 180.0f); +======= return static_cast(std::get(angle).degrees * M_PI / 180.0f); // [Windows #14698] +>>>>>>> Override } return {}; } -inline ValueUnit toValueUnit(const RawValue& value) { +inline ValueUnit toValueUnit(const RawValue &value) +{ if (value.hasType()) { return ValueUnit((Float)value, UnitType::Point); } @@ -557,17 +532,13 @@ inline ValueUnit toValueUnit(const RawValue& value) { return {}; } -inline void fromRawValue( - const PropsParserContext& /*context*/, - const RawValue& value, - ValueUnit& result) { +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, ValueUnit &result) +{ result = toValueUnit(value); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - Transform& result) { +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, Transform &result) +{ auto transformMatrix = Transform{}; react_native_expect(value.hasType>()); if (!value.hasType>()) { @@ -576,14 +547,13 @@ inline void fromRawValue( } auto configurations = static_cast>(value); - for (const auto& configuration : configurations) { + for (const auto &configuration : configurations) { if (!configuration.hasType>()) { result = {}; return; } - auto configurationPair = - static_cast>(configuration); + auto configurationPair = static_cast>(configuration); if (configurationPair.size() != 1) { result = {}; return; @@ -591,7 +561,7 @@ inline void fromRawValue( auto pair = configurationPair.begin(); auto operation = pair->first; - auto& parameters = pair->second; + auto ¶meters = pair->second; auto Zero = ValueUnit(0, UnitType::Point); auto One = ValueUnit(1, UnitType::Point); @@ -645,22 +615,20 @@ inline void fromRawValue( transformMatrix.matrix[14] = 0; transformMatrix.matrix[15] = numbers[8]; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Arbitrary, - .x = Zero, - .y = Zero, - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{.type = TransformOperationType::Arbitrary, .x = Zero, .y = Zero, .z = Zero}); } else if (operation == "perspective") { if (!parameters.hasType()) { result = {}; return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Perspective, - .x = ValueUnit((Float)parameters, UnitType::Point), - .y = Zero, - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Perspective, + .x = ValueUnit((Float)parameters, UnitType::Point), + .y = Zero, + .z = Zero}); } else if (operation == "rotateX") { auto radians = toRadians(parameters); if (!radians.has_value()) { @@ -668,11 +636,9 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Rotate, - .x = ValueUnit(*radians, UnitType::Point), - .y = Zero, - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Rotate, .x = ValueUnit(*radians, UnitType::Point), .y = Zero, .z = Zero}); } else if (operation == "rotateY") { auto radians = toRadians(parameters); if (!radians.has_value()) { @@ -680,11 +646,9 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Rotate, - .x = Zero, - .y = ValueUnit(*radians, UnitType::Point), - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Rotate, .x = Zero, .y = ValueUnit(*radians, UnitType::Point), .z = Zero}); } else if (operation == "rotateZ" || operation == "rotate") { auto radians = toRadians(parameters); if (!radians.has_value()) { @@ -692,11 +656,9 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Rotate, - .x = Zero, - .y = Zero, - .z = ValueUnit(*radians, UnitType::Point)}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Rotate, .x = Zero, .y = Zero, .z = ValueUnit(*radians, UnitType::Point)}); } else if (operation == "scale") { if (!parameters.hasType()) { result = {}; @@ -704,44 +666,44 @@ inline void fromRawValue( } auto number = ValueUnit((Float)parameters, UnitType::Point); - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Scale, - .x = number, - .y = number, - .z = number}); + transformMatrix.operations.push_back( + TransformOperation{.type = TransformOperationType::Scale, .x = number, .y = number, .z = number}); } else if (operation == "scaleX") { if (!parameters.hasType()) { result = {}; return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Scale, - .x = ValueUnit((Float)parameters, UnitType::Point), - .y = One, - .z = One}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Scale, + .x = ValueUnit((Float)parameters, UnitType::Point), + .y = One, + .z = One}); } else if (operation == "scaleY") { if (!parameters.hasType()) { result = {}; return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Scale, - .x = One, - .y = ValueUnit((Float)parameters, UnitType::Point), - .z = One}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Scale, + .x = One, + .y = ValueUnit((Float)parameters, UnitType::Point), + .z = One}); } else if (operation == "scaleZ") { if (!parameters.hasType()) { result = {}; return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Scale, - .x = One, - .y = One, - .z = ValueUnit((Float)parameters, UnitType::Point)}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Scale, + .x = One, + .y = One, + .z = ValueUnit((Float)parameters, UnitType::Point)}); } else if (operation == "translate") { if (!parameters.hasType>()) { result = {}; @@ -766,11 +728,8 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Translate, - .x = valueX, - .y = valueY, - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{.type = TransformOperationType::Translate, .x = valueX, .y = valueY, .z = Zero}); } else if (operation == "translateX") { auto valueX = toValueUnit(parameters); if (!valueX) { @@ -778,11 +737,8 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Translate, - .x = valueX, - .y = Zero, - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{.type = TransformOperationType::Translate, .x = valueX, .y = Zero, .z = Zero}); } else if (operation == "translateY") { auto valueY = toValueUnit(parameters); if (!valueY) { @@ -790,11 +746,8 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Translate, - .x = Zero, - .y = valueY, - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{.type = TransformOperationType::Translate, .x = Zero, .y = valueY, .z = Zero}); } else if (operation == "skewX") { auto radians = toRadians(parameters); if (!radians.has_value()) { @@ -802,11 +755,9 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Skew, - .x = ValueUnit(*radians, UnitType::Point), - .y = Zero, - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Skew, .x = ValueUnit(*radians, UnitType::Point), .y = Zero, .z = Zero}); } else if (operation == "skewY") { auto radians = toRadians(parameters); if (!radians.has_value()) { @@ -814,21 +765,17 @@ inline void fromRawValue( return; } - transformMatrix.operations.push_back(TransformOperation{ - .type = TransformOperationType::Skew, - .x = Zero, - .y = ValueUnit(*radians, UnitType::Point), - .z = Zero}); + transformMatrix.operations.push_back( + TransformOperation{ + .type = TransformOperationType::Skew, .x = Zero, .y = ValueUnit(*radians, UnitType::Point), .z = Zero}); } } result = transformMatrix; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - TransformOrigin& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, TransformOrigin &result) +{ if (!value.hasType>()) { result = {}; return; @@ -861,10 +808,8 @@ inline void fromRawValue( result = transformOrigin; } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - PointerEventsMode& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, PointerEventsMode &result) +{ result = PointerEventsMode::Auto; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -891,7 +836,8 @@ inline void fromRawValue( react_native_expect(false); } -inline std::string toString(PointerEventsMode value) { +inline std::string toString(PointerEventsMode value) +{ switch (value) { case PointerEventsMode::Auto: return "auto"; @@ -904,10 +850,8 @@ inline std::string toString(PointerEventsMode value) { } } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - BackfaceVisibility& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, BackfaceVisibility &result) +{ result = BackfaceVisibility::Auto; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -930,10 +874,8 @@ inline void fromRawValue( react_native_expect(false); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - BorderCurve& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, BorderCurve &result) +{ result = BorderCurve::Circular; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -952,10 +894,8 @@ inline void fromRawValue( react_native_expect(false); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - BorderStyle& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, BorderStyle &result) +{ result = BorderStyle::Solid; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -978,10 +918,8 @@ inline void fromRawValue( react_native_expect(false); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - OutlineStyle& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, OutlineStyle &result) +{ result = OutlineStyle::Solid; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -1004,10 +942,8 @@ inline void fromRawValue( react_native_expect(false); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - Cursor& result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, Cursor &result) +{ result = Cursor::Auto; react_native_expect(value.hasType()); if (!value.hasType()) { @@ -1162,10 +1098,8 @@ inline void fromRawValue( react_native_expect(false); } -inline void fromRawValue( - const PropsParserContext& /*context*/, - const RawValue& value, - LayoutConformance& result) { +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, LayoutConformance &result) +{ react_native_expect(value.hasType()); result = LayoutConformance::Strict; if (!value.hasType()) { @@ -1183,10 +1117,8 @@ inline void fromRawValue( } } -inline void fromRawValue( - const PropsParserContext& /*context*/, - const RawValue& value, - BlendMode& result) { +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, BlendMode &result) +{ react_native_expect(value.hasType()); result = BlendMode::Normal; if (!value.hasType()) { @@ -1204,201 +1136,174 @@ inline void fromRawValue( result = blendMode.value(); } -inline void fromRawValue( - const PropsParserContext& context, - const RawValue& value, - std::vector& result) { +inline void +fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, std::vector &result) +{ react_native_expect(value.hasType>()); if (!value.hasType>()) { result = {}; return; } - std::vector backgroundImage{}; - auto rawBackgroundImage = static_cast>(value); - for (const auto& rawBackgroundImageValue : rawBackgroundImage) { - bool isMap = rawBackgroundImageValue - .hasType>(); - react_native_expect(isMap); - if (!isMap) { - result = {}; - return; - } - - auto rawBackgroundImageMap = - static_cast>( - rawBackgroundImageValue); + std::vector backgroundSizes{}; + auto rawBackgroundSizes = static_cast>(value); - auto typeIt = rawBackgroundImageMap.find("type"); - if (typeIt == rawBackgroundImageMap.end() || - !typeIt->second.hasType()) { - continue; - } + for (const auto &rawBackgroundSizeValue : rawBackgroundSizes) { + if (rawBackgroundSizeValue.hasType()) { + auto sizeStr = (std::string)rawBackgroundSizeValue; + if (sizeStr == "cover") { + backgroundSizes.emplace_back(BackgroundSizeKeyword::Cover); + } else if (sizeStr == "contain") { + backgroundSizes.emplace_back(BackgroundSizeKeyword::Contain); + } + } else if (rawBackgroundSizeValue.hasType>()) { + auto sizeMap = static_cast>(rawBackgroundSizeValue); + + BackgroundSizeLengthPercentage sizeLengthPercentage; + + auto xIt = sizeMap.find("x"); + if (xIt != sizeMap.end()) { + if (xIt->second.hasType() && (std::string)(xIt->second) == "auto") { + sizeLengthPercentage.x = std::monostate{}; + } else { + auto valueUnit = toValueUnit(xIt->second); + if (valueUnit) { + sizeLengthPercentage.x = valueUnit; + } + } + } - std::string type = (std::string)(typeIt->second); - std::vector colorStops; - auto colorStopsIt = rawBackgroundImageMap.find("colorStops"); - - if (colorStopsIt != rawBackgroundImageMap.end() && - colorStopsIt->second.hasType>()) { - auto rawColorStops = - static_cast>(colorStopsIt->second); - - for (const auto& stop : rawColorStops) { - if (stop.hasType>()) { - auto stopMap = - static_cast>(stop); - auto positionIt = stopMap.find("position"); - auto colorIt = stopMap.find("color"); - - if (positionIt != stopMap.end() && colorIt != stopMap.end()) { - ColorStop colorStop; - if (positionIt->second.hasValue()) { - auto valueUnit = toValueUnit(positionIt->second); - if (!valueUnit) { - result = {}; - return; - } - colorStop.position = valueUnit; - } - if (colorIt->second.hasValue()) { - fromRawValue( - context.contextContainer, - context.surfaceId, - colorIt->second, - colorStop.color); - } - colorStops.push_back(colorStop); + auto yIt = sizeMap.find("y"); + if (yIt != sizeMap.end()) { + if (yIt->second.hasType() && (std::string)(yIt->second) == "auto") { + sizeLengthPercentage.y = std::monostate{}; + } else { + auto valueUnit = toValueUnit(yIt->second); + if (valueUnit) { + sizeLengthPercentage.y = valueUnit; } } } + + backgroundSizes.emplace_back(sizeLengthPercentage); } + } - if (type == "linear-gradient") { - LinearGradient linearGradient; - - auto directionIt = rawBackgroundImageMap.find("direction"); - if (directionIt != rawBackgroundImageMap.end() && - directionIt->second - .hasType>()) { - auto directionMap = - static_cast>( - directionIt->second); - - auto directionTypeIt = directionMap.find("type"); - auto valueIt = directionMap.find("value"); - - if (directionTypeIt != directionMap.end() && - valueIt != directionMap.end()) { - std::string directionType = (std::string)(directionTypeIt->second); - - if (directionType == "angle") { - linearGradient.direction.type = GradientDirectionType::Angle; - if (valueIt->second.hasType()) { - linearGradient.direction.value = (Float)(valueIt->second); - } - } else if (directionType == "keyword") { - linearGradient.direction.type = GradientDirectionType::Keyword; - if (valueIt->second.hasType()) { - linearGradient.direction.value = - parseGradientKeyword((std::string)(valueIt->second)); - } - } + result = backgroundSizes; +} + +inline void +fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, std::vector &result) +{ + react_native_expect(value.hasType>()); + if (!value.hasType>()) { + result = {}; + return; + } + + std::vector backgroundPositions{}; + auto rawBackgroundPositions = static_cast>(value); + + for (const auto &rawBackgroundPositionValue : rawBackgroundPositions) { + if (rawBackgroundPositionValue.hasType>()) { + auto positionMap = static_cast>(rawBackgroundPositionValue); + + BackgroundPosition backgroundPosition; + + auto topIt = positionMap.find("top"); + if (topIt != positionMap.end()) { + auto valueUnit = toValueUnit(topIt->second); + if (valueUnit) { + backgroundPosition.top = valueUnit; } } - if (!colorStops.empty()) { - linearGradient.colorStops = colorStops; + auto bottomIt = positionMap.find("bottom"); + if (bottomIt != positionMap.end()) { + auto valueUnit = toValueUnit(bottomIt->second); + if (valueUnit) { + backgroundPosition.bottom = valueUnit; + } } - backgroundImage.emplace_back(std::move(linearGradient)); - } else if (type == "radial-gradient") { - RadialGradient radialGradient; - auto shapeIt = rawBackgroundImageMap.find("shape"); - if (shapeIt != rawBackgroundImageMap.end() && - shapeIt->second.hasType()) { - auto shape = (std::string)(shapeIt->second); - radialGradient.shape = shape == "circle" ? RadialGradientShape::Circle - : RadialGradientShape::Ellipse; + auto leftIt = positionMap.find("left"); + if (leftIt != positionMap.end()) { + auto valueUnit = toValueUnit(leftIt->second); + if (valueUnit) { + backgroundPosition.left = valueUnit; + } } - auto sizeIt = rawBackgroundImageMap.find("size"); - if (sizeIt != rawBackgroundImageMap.end()) { - if (sizeIt->second.hasType()) { - auto sizeStr = (std::string)(sizeIt->second); - if (sizeStr == "closest-side") { - radialGradient.size.value = - RadialGradientSize::SizeKeyword::ClosestSide; - } else if (sizeStr == "farthest-side") { - radialGradient.size.value = - RadialGradientSize::SizeKeyword::FarthestSide; - } else if (sizeStr == "closest-corner") { - radialGradient.size.value = - RadialGradientSize::SizeKeyword::ClosestCorner; - } else if (sizeStr == "farthest-corner") { - radialGradient.size.value = - RadialGradientSize::SizeKeyword::FarthestCorner; - } - } else if (sizeIt->second - .hasType>()) { - auto sizeMap = static_cast>( - sizeIt->second); - auto xIt = sizeMap.find("x"); - auto yIt = sizeMap.find("y"); - if (xIt != sizeMap.end() && yIt != sizeMap.end()) { - RadialGradientSize sizeObj; - sizeObj.value = RadialGradientSize::Dimensions{ - .x = toValueUnit(xIt->second), .y = toValueUnit(yIt->second)}; - radialGradient.size = sizeObj; - } + auto rightIt = positionMap.find("right"); + if (rightIt != positionMap.end()) { + auto valueUnit = toValueUnit(rightIt->second); + if (valueUnit) { + backgroundPosition.right = valueUnit; } + } - auto positionIt = rawBackgroundImageMap.find("position"); - if (positionIt != rawBackgroundImageMap.end() && - positionIt->second - .hasType>()) { - auto positionMap = - static_cast>( - positionIt->second); - - auto topIt = positionMap.find("top"); - auto bottomIt = positionMap.find("bottom"); - auto leftIt = positionMap.find("left"); - auto rightIt = positionMap.find("right"); - - if (topIt != positionMap.end()) { - auto topValue = toValueUnit(topIt->second); - radialGradient.position.top = topValue; - } else if (bottomIt != positionMap.end()) { - auto bottomValue = toValueUnit(bottomIt->second); - radialGradient.position.bottom = bottomValue; - } + backgroundPositions.emplace_back(backgroundPosition); + } + } - if (leftIt != positionMap.end()) { - auto leftValue = toValueUnit(leftIt->second); - radialGradient.position.left = leftValue; - } else if (rightIt != positionMap.end()) { - auto rightValue = toValueUnit(rightIt->second); - radialGradient.position.right = rightValue; - } + result = backgroundPositions; +} + +inline void +fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, std::vector &result) +{ + react_native_expect(value.hasType>()); + if (!value.hasType>()) { + result = {}; + return; + } + + std::vector backgroundRepeats{}; + auto rawBackgroundRepeats = static_cast>(value); + + for (const auto &rawBackgroundRepeatValue : rawBackgroundRepeats) { + if (rawBackgroundRepeatValue.hasType>()) { + auto repeatMap = static_cast>(rawBackgroundRepeatValue); + + BackgroundRepeat backgroundRepeat; + + auto xIt = repeatMap.find("x"); + if (xIt != repeatMap.end() && xIt->second.hasType()) { + auto xStr = (std::string)(xIt->second); + if (xStr == "repeat") { + backgroundRepeat.x = BackgroundRepeatStyle::Repeat; + } else if (xStr == "space") { + backgroundRepeat.x = BackgroundRepeatStyle::Space; + } else if (xStr == "round") { + backgroundRepeat.x = BackgroundRepeatStyle::Round; + } else if (xStr == "no-repeat") { + backgroundRepeat.x = BackgroundRepeatStyle::NoRepeat; } } - if (!colorStops.empty()) { - radialGradient.colorStops = colorStops; + auto yIt = repeatMap.find("y"); + if (yIt != repeatMap.end() && yIt->second.hasType()) { + auto yStr = (std::string)(yIt->second); + if (yStr == "repeat") { + backgroundRepeat.y = BackgroundRepeatStyle::Repeat; + } else if (yStr == "space") { + backgroundRepeat.y = BackgroundRepeatStyle::Space; + } else if (yStr == "round") { + backgroundRepeat.y = BackgroundRepeatStyle::Round; + } else if (yStr == "no-repeat") { + backgroundRepeat.y = BackgroundRepeatStyle::NoRepeat; + } } - backgroundImage.emplace_back(std::move(radialGradient)); + backgroundRepeats.emplace_back(backgroundRepeat); } } - result = backgroundImage; + result = backgroundRepeats; } -inline void fromRawValue( - const PropsParserContext& /*context*/, - const RawValue& value, - Isolation& result) { +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, Isolation &result) +{ react_native_expect(value.hasType()); result = Isolation::Auto; if (!value.hasType()) { @@ -1416,8 +1321,10 @@ inline void fromRawValue( result = isolation.value(); } +#if RN_DEBUG_STRING_CONVERTIBLE template -inline std::string toString(const std::array vec) { +inline std::string toString(const std::array vec) +{ std::string s; s.append("{"); @@ -1430,39 +1337,48 @@ inline std::string toString(const std::array vec) { return s; } -inline std::string toString(const yoga::Direction& value) { +inline std::string toString(const yoga::Direction &value) +{ return YGDirectionToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::FlexDirection& value) { +inline std::string toString(const yoga::FlexDirection &value) +{ return YGFlexDirectionToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::Justify& value) { +inline std::string toString(const yoga::Justify &value) +{ return YGJustifyToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::Align& value) { +inline std::string toString(const yoga::Align &value) +{ return YGAlignToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::PositionType& value) { +inline std::string toString(const yoga::PositionType &value) +{ return YGPositionTypeToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::Wrap& value) { +inline std::string toString(const yoga::Wrap &value) +{ return YGWrapToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::Overflow& value) { +inline std::string toString(const yoga::Overflow &value) +{ return YGOverflowToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::Display& value) { +inline std::string toString(const yoga::Display &value) +{ return YGDisplayToString(yoga::unscopedEnum(value)); } -inline std::string toString(const yoga::Style::Length& length) { +inline std::string toString(const yoga::Style::Length &length) +{ if (length.isUndefined()) { return "undefined"; } else if (length.isAuto()) { @@ -1476,7 +1392,8 @@ inline std::string toString(const yoga::Style::Length& length) { } } -inline std::string toString(const yoga::Style::SizeLength& length) { +inline std::string toString(const yoga::Style::SizeLength &length) +{ if (length.isUndefined()) { return "undefined"; } else if (length.isAuto()) { @@ -1496,7 +1413,8 @@ inline std::string toString(const yoga::Style::SizeLength& length) { } } -inline std::string toString(const yoga::FloatOptional& value) { +inline std::string toString(const yoga::FloatOptional &value) +{ if (value.isUndefined()) { return "undefined"; } @@ -1504,7 +1422,8 @@ inline std::string toString(const yoga::FloatOptional& value) { return std::to_string(value.unwrap()); } -inline std::string toString(const LayoutConformance& value) { +inline std::string toString(const LayoutConformance &value) +{ switch (value) { case LayoutConformance::Strict: return "strict"; @@ -1513,24 +1432,26 @@ inline std::string toString(const LayoutConformance& value) { } } -inline std::string toString(const std::array& m) { +inline std::string toString(const std::array &m) +{ std::string result; - result += "[ " + std::to_string(m[0]) + " " + std::to_string(m[1]) + " " + - std::to_string(m[2]) + " " + std::to_string(m[3]) + " ]\n"; - result += "[ " + std::to_string(m[4]) + " " + std::to_string(m[5]) + " " + - std::to_string(m[6]) + " " + std::to_string(m[7]) + " ]\n"; - result += "[ " + std::to_string(m[8]) + " " + std::to_string(m[9]) + " " + - std::to_string(m[10]) + " " + std::to_string(m[11]) + " ]\n"; - result += "[ " + std::to_string(m[12]) + " " + std::to_string(m[13]) + " " + - std::to_string(m[14]) + " " + std::to_string(m[15]) + " ]"; + result += "[ " + std::to_string(m[0]) + " " + std::to_string(m[1]) + " " + std::to_string(m[2]) + " " + + std::to_string(m[3]) + " ]\n"; + result += "[ " + std::to_string(m[4]) + " " + std::to_string(m[5]) + " " + std::to_string(m[6]) + " " + + std::to_string(m[7]) + " ]\n"; + result += "[ " + std::to_string(m[8]) + " " + std::to_string(m[9]) + " " + std::to_string(m[10]) + " " + + std::to_string(m[11]) + " ]\n"; + result += "[ " + std::to_string(m[12]) + " " + std::to_string(m[13]) + " " + std::to_string(m[14]) + " " + + std::to_string(m[15]) + " ]"; return result; } -inline std::string toString(const Transform& transform) { +inline std::string toString(const Transform &transform) +{ std::string result = "["; bool first = true; - for (const auto& operation : transform.operations) { + for (const auto &operation : transform.operations) { if (!first) { result += ", "; } @@ -1538,31 +1459,21 @@ inline std::string toString(const Transform& transform) { switch (operation.type) { case TransformOperationType::Perspective: { - result += - "{\"perspective\": " + std::to_string(operation.x.value) + "}"; + result += "{\"perspective\": " + std::to_string(operation.x.value) + "}"; break; } case TransformOperationType::Rotate: { - if (operation.x.value != 0 && operation.y.value == 0 && - operation.z.value == 0) { - result += - R"({"rotateX": ")" + std::to_string(operation.x.value) + "rad\"}"; - } else if ( - operation.x.value == 0 && operation.y.value != 0 && - operation.z.value == 0) { - result += - R"({"rotateY": ")" + std::to_string(operation.y.value) + "rad\"}"; - } else if ( - operation.x.value == 0 && operation.y.value == 0 && - operation.z.value != 0) { - result += - R"({"rotateZ": ")" + std::to_string(operation.z.value) + "rad\"}"; + if (operation.x.value != 0 && operation.y.value == 0 && operation.z.value == 0) { + result += R"({"rotateX": ")" + std::to_string(operation.x.value) + "rad\"}"; + } else if (operation.x.value == 0 && operation.y.value != 0 && operation.z.value == 0) { + result += R"({"rotateY": ")" + std::to_string(operation.y.value) + "rad\"}"; + } else if (operation.x.value == 0 && operation.y.value == 0 && operation.z.value != 0) { + result += R"({"rotateZ": ")" + std::to_string(operation.z.value) + "rad\"}"; } break; } case TransformOperationType::Scale: { - if (operation.x.value == operation.y.value && - operation.x.value == operation.z.value) { + if (operation.x.value == operation.y.value && operation.x.value == operation.z.value) { result += "{\"scale\": " + std::to_string(operation.x.value) + "}"; } else if (operation.y.value == 1 && operation.z.value == 1) { result += "{\"scaleX\": " + std::to_string(operation.x.value) + "}"; @@ -1574,28 +1485,22 @@ inline std::string toString(const Transform& transform) { break; } case TransformOperationType::Translate: { - if (operation.x.value != 0 && operation.y.value != 0 && - operation.z.value == 0) { + if (operation.x.value != 0 && operation.y.value != 0 && operation.z.value == 0) { result += "{\"translate\": ["; - result += std::to_string(operation.x.value) + ", " + - std::to_string(operation.y.value); + result += std::to_string(operation.x.value) + ", " + std::to_string(operation.y.value); result += "]}"; } else if (operation.x.value != 0 && operation.y.value == 0) { - result += - "{\"translateX\": " + std::to_string(operation.x.value) + "}"; + result += "{\"translateX\": " + std::to_string(operation.x.value) + "}"; } else if (operation.x.value == 0 && operation.y.value != 0) { - result += - "{\"translateY\": " + std::to_string(operation.y.value) + "}"; + result += "{\"translateY\": " + std::to_string(operation.y.value) + "}"; } break; } case TransformOperationType::Skew: { if (operation.x.value != 0 && operation.y.value == 0) { - result += - R"({"skewX": ")" + std::to_string(operation.x.value) + "rad\"}"; + result += R"({"skewX": ")" + std::to_string(operation.x.value) + "rad\"}"; } else if (operation.x.value == 0 && operation.y.value != 0) { - result += - R"({"skewY": ")" + std::to_string(operation.y.value) + "rad\"}"; + result += R"({"skewY": ")" + std::to_string(operation.y.value) + "rad\"}"; } break; } @@ -1613,5 +1518,6 @@ inline std::string toString(const Transform& transform) { result += "]"; return result; } +#endif } // namespace facebook::react diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp index 50f834bd92e..47c4b1f3016 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp @@ -420,9 +420,13 @@ std::shared_ptr cloneMultipleRecursive( std::shared_ptr>> newChildren; auto count = childrenCount.at(family); +<<<<<<< Upstream + for (size_t i = 0; count > 0 && i < children.size(); i++) { +======= // [Windows Remove when issue #15292 is resolved (the fix goes upstream and comes back) for (size_t i = 0; count > 0 && i < children.size(); i++) { // Windows] +>>>>>>> Override const auto childFamily = &children[i]->getFamily(); if (childrenCount.contains(childFamily)) { count--; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h index 27c404a5763..bebc79da207 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h @@ -33,16 +33,19 @@ class ImageSource { CacheStategy cache = CacheStategy::Default; std::vector> headers{}; - bool operator==(const ImageSource& rhs) const { + bool operator==(const ImageSource &rhs) const + { return std::tie(this->type, this->uri) == std::tie(rhs.type, rhs.uri); } - bool operator!=(const ImageSource& rhs) const { + bool operator!=(const ImageSource &rhs) const + { return !(*this == rhs); } #ifdef RN_SERIALIZABLE_STATE - folly::dynamic toDynamic() const { + folly::dynamic toDynamic() const + { folly::dynamic imageSourceResult = folly::dynamic::object(); switch (type) { case ImageSource::Type::Invalid: @@ -84,7 +87,7 @@ class ImageSource { } folly::dynamic headersObject = folly::dynamic::object(); - for (const auto& header : headers) { + for (const auto &header : headers) { headersObject[header.first] = header.second; } imageSourceResult["headers"] = headersObject; @@ -94,41 +97,30 @@ class ImageSource { #endif #if RN_DEBUG_STRING_CONVERTIBLE - SharedDebugStringConvertibleList getDebugProps( - const std::string& prefix) const { + SharedDebugStringConvertibleList getDebugProps(const std::string &prefix) const + { ImageSource imageSource{}; SharedDebugStringConvertibleList headersList; - for (const auto& header : headers) { - headersList.push_back(debugStringConvertibleItem( - prefix + "-header-" + header.first, header.second)); + for (const auto &header : headers) { + headersList.push_back(debugStringConvertibleItem(prefix + "-header-" + header.first, header.second)); } return headersList + SharedDebugStringConvertibleList{ - debugStringConvertibleItem( - prefix + "-type", toString(type), toString(imageSource.type)), + debugStringConvertibleItem(prefix + "-type", toString(type), toString(imageSource.type)), debugStringConvertibleItem(prefix + "-uri", uri, imageSource.uri), - debugStringConvertibleItem( - prefix + "-bundle", bundle, imageSource.bundle), - debugStringConvertibleItem( - prefix + "-scale", scale, imageSource.scale), - debugStringConvertibleItem( - prefix + "-size", - react::toString(size), - react::toString(imageSource.size)), - debugStringConvertibleItem( - prefix + "-body", body, imageSource.body), - debugStringConvertibleItem( - prefix + "-method", method, imageSource.method), - debugStringConvertibleItem( - prefix + "-cache", - toString(cache), - toString(imageSource.cache)), + debugStringConvertibleItem(prefix + "-bundle", bundle, imageSource.bundle), + debugStringConvertibleItem(prefix + "-scale", scale, imageSource.scale), + debugStringConvertibleItem(prefix + "-size", react::toString(size), react::toString(imageSource.size)), + debugStringConvertibleItem(prefix + "-body", body, imageSource.body), + debugStringConvertibleItem(prefix + "-method", method, imageSource.method), + debugStringConvertibleItem(prefix + "-cache", toString(cache), toString(imageSource.cache)), }; } - std::string toString(const Type& typeValue) const { + std::string toString(const Type &typeValue) const + { switch (typeValue) { case ImageSource::Type::Invalid: return "invalid"; @@ -143,7 +135,8 @@ class ImageSource { } } - std::string toString(const CacheStategy& cacheValue) const { + std::string toString(const CacheStategy &cacheValue) const + { switch (cacheValue) { case ImageSource::CacheStategy::Default: return "default"; @@ -163,7 +156,8 @@ class ImageSource { }; #ifdef RN_SERIALIZABLE_STATE -inline folly::dynamic toDynamic(const ImageSource& imageSource) { +inline folly::dynamic toDynamic(const ImageSource &imageSource) +{ return imageSource.toDynamic(); } #endif diff --git a/vnext/overrides.json b/vnext/overrides.json index bfe6a2804b9..25505268d4b 100644 --- a/vnext/overrides.json +++ b/vnext/overrides.json @@ -8,31 +8,31 @@ "**/__snapshots__/**", "src-win/rntypes/**" ], - "baseVersion": "0.83.0-nightly-20251012-6f482708b", + "baseVersion": "0.83.0-nightly-20251104-502efe1cc", "overrides": [ { "type": "derived", "file": ".flowconfig", "baseFile": ".flowconfig", - "baseHash": "40952c5ed2905d0daf6988169293ed3e24f77241" + "baseHash": "5a5f25ce055b9b4465410b513de9dc6d4db39a90" }, { "type": "derived", "file": "Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h", - "baseHash": "5fafd9ed2a1b095d5898629ba9d8d1e878dd5561" + "baseHash": "7e9b5b28143fcf5a252d822dc114bdbf15e0a87e" }, { "type": "derived", "file": "Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp", - "baseHash": "98920c4a259ff3bd2b4b8237beb2e732bc03d0a3" + "baseHash": "e5d07cfb5b6c760d19254e5dc8e323288327eda9" }, { "type": "derived", "file": "Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h", - "baseHash": "eca30db4d5a5fc49d83c9da8253e51f79d92c449" + "baseHash": "917e183d5c012412e04b7df5694d59daba6ef498" }, { "type": "derived", @@ -45,7 +45,7 @@ "type": "derived", "file": "Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputState.h", - "baseHash": "0bcda2f2c9935a96e0512ce8139035cdbe21a257", + "baseHash": "2423517ee97a680d1abb047997fc4956826eb426", "issue": 15017 }, { @@ -65,21 +65,21 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp", "baseFile": "packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp", - "baseHash": "d2212848d614987c3c60d951f615318c694d7ac9", + "baseHash": "3d9d0634c89b91fc9bbf94a36a29633e7e0f0b44", "issue": 13172 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h", "baseFile": "packages/react-native/ReactCommon/cxxreact/TraceSection.h", - "baseHash": "3b3d5fe4da75fb182f9b0066f0803d59b729a455", + "baseHash": "853af760f17a918f4fcc3d139daf0497576055f9", "issue": 14819 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp", "baseFile": "packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp", - "baseHash": "fb38db987176918ac2158c74ed5473018d4acab5", + "baseHash": "f3e2a444eeafb3d6c16645e29a9cde6cc865ad8d", "issue": 12210 }, { @@ -93,21 +93,21 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp", "baseFile": "packages/react-native/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp", - "baseHash": "b0ff7c34119acb921d9bb24b7934191c8d6d5848", + "baseHash": "4bd7c8481ea6e3cae81bdbc81536c71a928fd761", "issue": 13587 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h", "baseFile": "packages/react-native/ReactCommon/jsinspector-modern/NetworkIOAgent.h", - "baseHash": "d9dff538dba234600e8e0d7d7a8243891f414c29", + "baseHash": "e7689c2a5bf0d15c219280d586cd7c64833d91dd", "issue": 13587 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h", "baseFile": "packages/react-native/ReactCommon/jsinspector-modern/Utf8.h", - "baseHash": "1d81aa08f37619a8e9e05c2cf3d76f8f878fb9df", + "baseHash": "cbe18ad5acfe050fde962d26f6af5544aa616a43", "issue": 13587 }, { @@ -121,7 +121,7 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h", "baseFile": "packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h", - "baseHash": "a0bc700b3960f771cf6d4e63be30ab45f6ef3683", + "baseHash": "6819513cd614e77b71e94edbf48dde1a89a120c0", "issue": 14128 }, { @@ -142,7 +142,7 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h", "baseFile": "packages/react-native/ReactCommon/react/nativemodule/dom/NativeDOM.h", - "baseHash": "cd1204f9544fa50672c57966ef2d4f66a5559067", + "baseHash": "d6acbe5683b2cc276509305f9cafc721ad92a88c", "issue": 14654 }, { @@ -156,7 +156,7 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/image/conversions.h", - "baseHash": "7fdf1967fa9c3421b11e841afcf207624df18706", + "baseHash": "89a009bbcea54f0c6acf4479fbc8be7bdde6d4e9", "issue": 15379 }, { @@ -170,54 +170,54 @@ "type": "derived", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/BaseParagraphProps.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/text/BaseParagraphProps.h", - "baseHash": "7661ba5c8392034cbda48f5d4b721a1ff30fe68d", + "baseHash": "07d5672525fb041c4a7b9f197a76f53430a7be5b", "issue": 15552 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp", - "baseHash": "d2bab2a241c29af71db0f52ffb4a47d1b2720318", + "baseHash": "dd357c5df2214908bb4220d22d31ab1477f2b1e4", "issue": 15132 }, { "type": "derived", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h", - "baseHash": "022e5643b7f9aee4290b1e456eaab61fb05df358", + "baseHash": "e3c032d8e9001dee2893e385135689d3ec33618d", "issue": 15020 }, { "type": "derived", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h", - "baseHash": "ad6263ebaa34f1753daccc09d19bf2328cde48fa" + "baseHash": "ce1afd228ac7b82b7ecd614039af4f0be1618fbf" }, { "type": "derived", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h", - "baseHash": "af5bc7ad1914fa10784c4aff2357471d37aca2eb" + "baseHash": "72cc422293c0e70f454225476cdabd3458bbce5e" }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/view/conversions.h", - "baseHash": "93ebad9e1c020ebb04101bd27039145da82dfd2c", + "baseHash": "07075be2e9ae81728bab85d0ddf2d334fee2d43a", "issue": 14698 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp", "baseFile": "packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp", - "baseHash": "b56e467ee394e08d4e0dd0a8d71a8a9919603ff9", + "baseHash": "8078adaeb0c8187fd9ff5bc857f041f2cbfc3b3e", "issue": 15292 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h", "baseFile": "packages/react-native/ReactCommon/react/renderer/imagemanager/primitives.h", - "baseHash": "889f41e0ec86f788121eadd2af900151aeb4f0a0", + "baseHash": "bba2fec2301bbf05f8e47436ad48723c8890e4d7", "issue": 15263 }, { @@ -312,7 +312,7 @@ "type": "patch", "file": "src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js", "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js", - "baseHash": "b77b87e32a86265a3c8c29ebbbee46558596aec8", + "baseHash": "93b9eb92a1237885cdbff255d473584226421dd3", "issue": 4578 }, { @@ -625,7 +625,7 @@ "type": "patch", "file": "src-win/Libraries/Renderer/shims/ReactNativeTypes.windows.js", "baseFile": "packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js", - "baseHash": "41da351b1e8d090e5ecf0859738218a5dcd4c08f", + "baseHash": "333afc05f5a42a5321196f5f7a14d14c8fd5dd0f", "issue": 4578 }, { @@ -636,7 +636,7 @@ "type": "derived", "file": "src-win/Libraries/Text/Text.d.ts", "baseFile": "packages/react-native/Libraries/Text/Text.d.ts", - "baseHash": "3540a1a36fc487e54c1cec9b0c57b4fdc2124b60" + "baseHash": "0289a5c0fbb168f20602451fe314f3787f1ac66f" }, { "type": "derived", diff --git a/vnext/package.json b/vnext/package.json index 48d7a8f0a10..ba62df4295f 100644 --- a/vnext/package.json +++ b/vnext/package.json @@ -28,14 +28,14 @@ "@react-native-community/cli-platform-ios": "20.0.0", "@react-native-windows/cli": "0.0.0-canary.283", "@react-native/assets": "1.0.0", - "@react-native/assets-registry": "0.83.0-nightly-20251012-6f482708b", - "@react-native/codegen": "0.83.0-nightly-20251012-6f482708b", - "@react-native/community-cli-plugin": "0.83.0-nightly-20251012-6f482708b", - "@react-native/gradle-plugin": "0.83.0-nightly-20251012-6f482708b", - "@react-native/js-polyfills": "0.83.0-nightly-20251012-6f482708b", - "@react-native/new-app-screen": "0.83.0-nightly-20251012-6f482708b", - "@react-native/normalize-colors": "0.83.0-nightly-20251012-6f482708b", - "@react-native/virtualized-lists": "0.83.0-nightly-20251012-6f482708b", + "@react-native/assets-registry": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/codegen": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/community-cli-plugin": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/gradle-plugin": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/js-polyfills": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/new-app-screen": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/normalize-colors": "0.83.0-nightly-20251104-502efe1cc", + "@react-native/virtualized-lists": "0.83.0-nightly-20251104-502efe1cc", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", @@ -68,7 +68,7 @@ "yargs": "^17.6.2" }, "devDependencies": { - "@react-native/metro-config": "0.83.0-nightly-20251012-6f482708b", + "@react-native/metro-config": "0.83.0-nightly-20251104-502efe1cc", "@react-native-windows/codegen": "0.0.0-canary.129", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.38", @@ -84,7 +84,7 @@ "just-scripts": "^1.3.3", "prettier": "2.8.8", "react": "19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b", + "react-native": "0.83.0-nightly-20251104-502efe1cc", "react-native-platform-override": "0.0.0-canary.1019", "react-refresh": "^0.14.0", "typescript": "5.0.4" @@ -92,7 +92,7 @@ "peerDependencies": { "@types/react": "^19.2.0", "react": "^19.2.0", - "react-native": "0.83.0-nightly-20251012-6f482708b" + "react-native": "0.83.0-nightly-20251104-502efe1cc" }, "beachball": { "defaultNpmTag": "canary", diff --git a/vnext/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js b/vnext/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js index 29e10c8c057..b0400c142cf 100644 --- a/vnext/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +++ b/vnext/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js @@ -106,7 +106,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } }); } @@ -126,7 +126,11 @@ const AccessibilityInfo = { if (NativeAccessibilityInfoAndroid?.isGrayscaleEnabled != null) { NativeAccessibilityInfoAndroid.isGrayscaleEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isGrayscaleEnabled is not available', + ), + ); } }); } else if (Platform.OS === 'windows') { @@ -139,7 +143,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('AccessibilityInfo native module is not available')); } }); } @@ -159,7 +163,11 @@ const AccessibilityInfo = { if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) { NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isInvertColorsEnabled is not available', + ), + ); } }); } else if (Platform.OS === 'windows') { @@ -172,7 +180,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('AccessibilityInfo native module is not available')); } }); } @@ -192,7 +200,7 @@ const AccessibilityInfo = { if (NativeAccessibilityInfo != null) { NativeAccessibilityInfo.isReduceMotionEnabled(resolve); } else { - reject(null); + reject(new Error('AccessibilityInfo native module is not available')); } } else { if (NativeAccessibilityManagerIOS != null) { @@ -201,7 +209,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } } }); @@ -219,7 +227,11 @@ const AccessibilityInfo = { if (NativeAccessibilityInfo?.isHighTextContrastEnabled != null) { NativeAccessibilityInfo.isHighTextContrastEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isHighTextContrastEnabled is not available', + ), + ); } } else { return Promise.resolve(false); @@ -247,7 +259,11 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityManagerIOS.getCurrentDarkerSystemColorsState is not available', + ), + ); } } }); @@ -275,7 +291,11 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityManagerIOS.getCurrentPrefersCrossFadeTransitionsState is not available', + ), + ); } } }); @@ -300,7 +320,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } }); } @@ -320,7 +340,7 @@ const AccessibilityInfo = { if (NativeAccessibilityInfo != null) { NativeAccessibilityInfo.isTouchExplorationEnabled(resolve); } else { - reject(null); + reject(new Error('NativeAccessibilityInfoAndroid is not available')); } } else { if (NativeAccessibilityManagerIOS != null) { @@ -329,7 +349,7 @@ const AccessibilityInfo = { reject, ); } else { - reject(null); + reject(new Error('NativeAccessibilityManagerIOS is not available')); } } }); @@ -354,10 +374,18 @@ const AccessibilityInfo = { ) { NativeAccessibilityInfo.isAccessibilityServiceEnabled(resolve); } else { - reject(null); + reject( + new Error( + 'NativeAccessibilityInfoAndroid.isAccessibilityServiceEnabled is not available', + ), + ); } } else { - reject(null); + reject( + new Error( + 'isAccessibilityServiceEnabled is only available on Android', + ), + ); } }); }, diff --git a/vnext/src-win/Libraries/Renderer/shims/ReactNativeTypes.windows.js b/vnext/src-win/Libraries/Renderer/shims/ReactNativeTypes.windows.js index 3226d4b538b..ee6ae134cac 100644 --- a/vnext/src-win/Libraries/Renderer/shims/ReactNativeTypes.windows.js +++ b/vnext/src-win/Libraries/Renderer/shims/ReactNativeTypes.windows.js @@ -7,9 +7,7 @@ * @noformat * @nolint * @flow strict - * @generated SignedSource<<989e6e2e860dc2af7ba983849111bda8>> - * - * This file was sync'd from the facebook/react repository. + * @generated SignedSource<> */ import type { diff --git a/vnext/src-win/Libraries/Text/Text.d.ts b/vnext/src-win/Libraries/Text/Text.d.ts index cbd04fa8986..1c5b3ac4f36 100644 --- a/vnext/src-win/Libraries/Text/Text.d.ts +++ b/vnext/src-win/Libraries/Text/Text.d.ts @@ -10,7 +10,7 @@ import type * as React from 'react'; import {Constructor} from '../../types/private/Utilities'; import {AccessibilityProps} from '../Components/View/ViewAccessibility'; -import {NativeMethods} from '../../types/public/ReactNativeTypes'; +import {HostInstance} from '../../types/public/ReactNativeTypes'; import {ColorValue, StyleProp} from '../StyleSheet/StyleSheet'; import {TextStyle, ViewStyle} from '../StyleSheet/StyleSheetTypes'; import { @@ -234,5 +234,5 @@ export interface TextProps * A React component for displaying text which supports nesting, styling, and touch handling. */ declare class TextComponent extends React.Component {} -declare const TextBase: Constructor & typeof TextComponent; +declare const TextBase: Constructor & typeof TextComponent; export class Text extends TextBase {} diff --git a/yarn.lock b/yarn.lock index 8b1b04f848a..3036b81e0cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2422,6 +2422,11 @@ resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.83.0-nightly-20251012-6f482708b.tgz#ea42aa216f4c28015878ed70461116830253bbbc" integrity sha512-ToCYjnTV9Wexs+aqPu4Ib+6T92JXzjtDYwYj6CiCtjHrAIFbVCk49MmJQD/CF3aNp5PvfZ3WUc5FTqdaSKA0ZQ== +"@react-native/assets-registry@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.83.0-nightly-20251104-502efe1cc.tgz#8f4d5f45b1d624e8dc373435b6187d00feedfe57" + integrity sha512-qMZIX+5xyEGHwcn45OBpSnXdLl9YIq7byy32SmEfvd2ywe4zv6RYCyjf0T6ecfafyCo+ZPAV1q/HdWgw67qYww== + "@react-native/assets@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e" @@ -2499,6 +2504,19 @@ nullthrows "^1.1.1" yargs "^17.6.2" +"@react-native/codegen@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.83.0-nightly-20251104-502efe1cc.tgz#effa08722928c682bb6fe4cba8feedb2f9b60ea6" + integrity sha512-Ew7EM5zhwk4mdHMuRipi3cLfry8fJRRNEo5afg/Id8O0dGynW0GGD/ZKkNIJUSBzcv4ZXY6XR8ND+mNnqVzrXg== + dependencies: + "@babel/core" "^7.25.2" + "@babel/parser" "^7.25.3" + glob "^7.1.1" + hermes-parser "0.32.0" + invariant "^2.2.4" + nullthrows "^1.1.1" + yargs "^17.6.2" + "@react-native/community-cli-plugin@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.83.0-nightly-20251012-6f482708b.tgz#893b2598412f6dd12be581716ef7bc3da5300dde" @@ -2512,11 +2530,29 @@ metro-core "^0.83.3" semver "^7.1.3" +"@react-native/community-cli-plugin@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.83.0-nightly-20251104-502efe1cc.tgz#2f4c30c9bbdd8b9b4930a194deef4f1c7ca17e11" + integrity sha512-Oc4VfFqIb1iDZAB6nC1S4WqsAjuYWWui3ZSqGrieH6forVWXFE94yAMvdc4g3q+/XF99M+jHiUkIRV73cOBR3w== + dependencies: + "@react-native/dev-middleware" "0.83.0-nightly-20251104-502efe1cc" + debug "^4.4.0" + invariant "^2.2.4" + metro "^0.83.3" + metro-config "^0.83.3" + metro-core "^0.83.3" + semver "^7.1.3" + "@react-native/debugger-frontend@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.83.0-nightly-20251012-6f482708b.tgz#fabc17792c69f2ff9c5a375f27e9e81ff0437e2d" integrity sha512-iDwRBiEVqqqlOi0xhtzmrttwp53aTRb3U66P/0mBEYqIeGTgxZ37kI2lzxqyyITI5EcCNOUl/47w8stR4asLfw== +"@react-native/debugger-frontend@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.83.0-nightly-20251104-502efe1cc.tgz#0453bf2eb3c40c296b6ade448794ce29e6b1aa60" + integrity sha512-YyAC8vJTuxg2bVhQij6zNKH+qcHpn+3S0cK72Fyapgh96BdwG6Lr4upAYqQJnI+8rA8Ram/BUchDqkT2HWEcBA== + "@react-native/debugger-shell@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/debugger-shell/-/debugger-shell-0.83.0-nightly-20251012-6f482708b.tgz#490d9bbf98aebd841fa53019f0d7878c20772d95" @@ -2525,6 +2561,14 @@ cross-spawn "^7.0.6" fb-dotslash "0.5.8" +"@react-native/debugger-shell@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/debugger-shell/-/debugger-shell-0.83.0-nightly-20251104-502efe1cc.tgz#980416fba85bfb8ab1eb8fac45336c11e84b0e3c" + integrity sha512-e5H4vuYXFFV5ZLffkMV81SE3U0sPvshn7eADrsbPdqnwGZh5GHSMHk5Kw5RSU39ADWNtpfARrEGfXC+WkJd4Fw== + dependencies: + cross-spawn "^7.0.6" + fb-dotslash "0.5.8" + "@react-native/dev-middleware@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.83.0-nightly-20251012-6f482708b.tgz#7c487b42c57928d4a1b824840fd3a126065c4ffe" @@ -2543,6 +2587,24 @@ serve-static "^1.16.2" ws "^7.5.10" +"@react-native/dev-middleware@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.83.0-nightly-20251104-502efe1cc.tgz#f46dad915f30c4ff7b355175379ae890101dcead" + integrity sha512-Wvh/mxYRsHmqAYOsds1M0Zw00mHv0mJRuhN3THvmqe5YN4jpDVF+KPdZeF1KXD8dNEXjbCbhEtSkqSrw16THtw== + dependencies: + "@isaacs/ttlcache" "^1.4.1" + "@react-native/debugger-frontend" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/debugger-shell" "0.83.0-nightly-20251104-502efe1cc" + chrome-launcher "^0.15.2" + chromium-edge-launcher "^0.2.0" + connect "^3.6.5" + debug "^4.4.0" + invariant "^2.2.4" + nullthrows "^1.1.1" + open "^7.0.3" + serve-static "^1.16.2" + ws "^7.5.10" + "@react-native/eslint-config@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/eslint-config/-/eslint-config-0.83.0-nightly-20251012-6f482708b.tgz#060e866a40a1c364eaefc5f716789323d536ef38" @@ -2571,11 +2633,21 @@ resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.83.0-nightly-20251012-6f482708b.tgz#1656b7d7943c73b1b5fa86a8ae29721e6a67a096" integrity sha512-B+thkpA3Kx7ESKyyDEGxLOw/lfQwwqR272DmaM7g3Xp4kY760xr9ky2H/qK3Cy89fZXNOUWGOImgEWrCaY6QKg== +"@react-native/gradle-plugin@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.83.0-nightly-20251104-502efe1cc.tgz#f91846863f98506c7f260eed66ec2bffa10d5082" + integrity sha512-B++pfoh0/I+PHS9xCF9jFB2wV1i2PlyQ0fbeUpGg90hiM+DVmFdWbtvVGh3NGQsuelPbeuCxNizjdklYcXawVg== + "@react-native/js-polyfills@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.83.0-nightly-20251012-6f482708b.tgz#c5dfe91a9bb3ebb1974e74d93425aa82ffc564de" integrity sha512-PbzaH7/PQ8ocpgbdg6uIU0pilXfknhvUs3OxtFSWq3TrTzW+FXm+ultia1Oy1txMKtk1s7kmxjTp3NXUNBUqqA== +"@react-native/js-polyfills@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.83.0-nightly-20251104-502efe1cc.tgz#f388af658bf8586c9d7d48d5d6201ebcbe7bd83f" + integrity sha512-O4a0C1H5BU7h30xb72x4+8XLu3vEId07UCkMk5Hfwts3eANarKOajD8tCk9Abo5eN13S4AmYvn00+DZ1in+/Vw== + "@react-native/metro-babel-transformer@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.83.0-nightly-20251012-6f482708b.tgz#e42f81108642f85a219af6542a72088812d66dfa" @@ -2611,6 +2683,11 @@ resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.83.0-nightly-20251012-6f482708b.tgz#59979dd490bcce94cc14eb570fc418476d304a84" integrity sha512-7cXFv5T44g8qEACrpbsewVGpruLYJVCHdCua0Ti2c4L95oyrNSsi51LpUIPXgO7A0Lx66TIfGxmpB4KO3K94fg== +"@react-native/normalize-colors@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.83.0-nightly-20251104-502efe1cc.tgz#60be84b59e60cf43d95db29f4793a09952e95828" + integrity sha512-LVJuk+/CA5TpzCLkFQP6klKjnSRG0mNv1O5C7pLFSBDfChpkbTuZBow07GcHR0lkha71vFQDsMTaMsDhbCJSDw== + "@react-native/popup-menu-android@0.83.0-nightly-20251012-6f482708b": version "0.83.0-nightly-20251012-6f482708b" resolved "https://registry.yarnpkg.com/@react-native/popup-menu-android/-/popup-menu-android-0.83.0-nightly-20251012-6f482708b.tgz#45c430494c1741f41416db13e03e9a46adeb0226" @@ -2626,6 +2703,14 @@ invariant "^2.2.4" nullthrows "^1.1.1" +"@react-native/virtualized-lists@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.83.0-nightly-20251104-502efe1cc.tgz#6ba1949fb90393151366f3e4eaeb26c980030669" + integrity sha512-LuYH9DC3Qns+Fs/kFOyc7q1vtRCNDEAL879tW8pS5nk0RdAXh+zSXhTRzl60l+9JDGToMcSQIeqs/UdZjHeANA== + dependencies: + invariant "^2.2.4" + nullthrows "^1.1.1" + "@rnx-kit/align-deps@^2.5.0": version "2.5.5" resolved "https://registry.yarnpkg.com/@rnx-kit/align-deps/-/align-deps-2.5.5.tgz#708b4fd65941699e1ef33c728d34bc568e648b73" @@ -7207,10 +7292,10 @@ hasown@^2.0.2: dependencies: function-bind "^1.1.2" -hermes-compiler@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/hermes-compiler/-/hermes-compiler-0.0.0.tgz#8d9f6a0b2740ce34d71258fec684e7b6bfd97efa" - integrity sha512-boVFutx6ME/Km2mB6vvsQcdnazEYYI/jV1pomx1wcFUG/EVqTkr5CU0CW9bKipOA/8Hyu3NYwW3THg2Q1kNCfA== +hermes-compiler@0.14.0-commitly-202511031701-9c948b8c9: + version "0.14.0-commitly-202511031701-9c948b8c9" + resolved "https://registry.yarnpkg.com/hermes-compiler/-/hermes-compiler-0.14.0-commitly-202511031701-9c948b8c9.tgz#fffa4492cc69be1daa6f4e5b34c76dce82e8f491" + integrity sha512-7/cVEpC/cPJnmpQXXmHnY2EREmEuJvypOn1xbgSM3duhju+f/utcWvF86N3Nue6x/XzECML/X3bLO/SKjNn6BQ== hermes-eslint@0.23.1: version "0.23.1" @@ -11006,19 +11091,19 @@ react-native-platform-override@0.0.0-canary.1017: upath "^1.2.0" yargs "^16.2.0" -react-native@0.83.0-nightly-20251012-6f482708b: - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.83.0-nightly-20251012-6f482708b.tgz#a08c869954b21aa950f9b15cc0bf3cf3d43409dd" - integrity sha512-XW54IzcjLtZQQ9cz3N7v+UwQj0T/aJtczqiibcmMp0jPQYXyCGLOVcWPnxtvs7Mts/Ciy4xXuqGY+G6fNwPfwQ== +react-native@0.83.0-nightly-20251104-502efe1cc: + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.83.0-nightly-20251104-502efe1cc.tgz#9f0ff8e318ffe55d167ceac84d1060619fd17e08" + integrity sha512-spKOs7iiXkgtzJsGQvTLLbSUfv4iFKK0/d7Bayuohm9ahW9urbFXX27Yk4uC4yG3Pc3/zHduk6+wxEe1A6XYRQ== dependencies: "@jest/create-cache-key-function" "^29.7.0" - "@react-native/assets-registry" "0.83.0-nightly-20251012-6f482708b" - "@react-native/codegen" "0.83.0-nightly-20251012-6f482708b" - "@react-native/community-cli-plugin" "0.83.0-nightly-20251012-6f482708b" - "@react-native/gradle-plugin" "0.83.0-nightly-20251012-6f482708b" - "@react-native/js-polyfills" "0.83.0-nightly-20251012-6f482708b" - "@react-native/normalize-colors" "0.83.0-nightly-20251012-6f482708b" - "@react-native/virtualized-lists" "0.83.0-nightly-20251012-6f482708b" + "@react-native/assets-registry" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/codegen" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/community-cli-plugin" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/gradle-plugin" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/js-polyfills" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/normalize-colors" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/virtualized-lists" "0.83.0-nightly-20251104-502efe1cc" abort-controller "^3.0.0" anser "^1.4.9" ansi-regex "^5.0.0" @@ -11028,7 +11113,7 @@ react-native@0.83.0-nightly-20251012-6f482708b: commander "^12.0.0" flow-enums-runtime "^0.0.6" glob "^7.1.1" - hermes-compiler "0.0.0" + hermes-compiler "0.14.0-commitly-202511031701-9c948b8c9" invariant "^2.2.4" jest-environment-node "^29.7.0" memoize-one "^5.0.0" From b6315a67451f9a2526ba1a5f3814d4ca6564342c Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:04:15 +0530 Subject: [PATCH 02/11] fix merge conflicts and removed forked files --- .../Libraries/Components/View/ViewWin32.d.ts | 14 +- .../WindowsTextInputComponentDescriptor.h | 26 - .../TextInput/WindowsTextInputShadowNode.cpp | 8 - .../TextInput/WindowsTextInputShadowNode.h | 4 - .../TextInput/WindowsTextInputState.h | 10 - .../cxxreact/TraceSection.h | 7 - .../renderer/components/image/conversions.h | 17 - .../renderer/components/view/conversions.h | 1523 ----------------- .../react/renderer/core/ShadowNode.cpp | 532 ------ vnext/overrides.json | 14 - 10 files changed, 2 insertions(+), 2153 deletions(-) delete mode 100644 vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h delete mode 100644 vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts index fb5e3d49274..eaaa6533149 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts @@ -10,11 +10,7 @@ import type * as React from 'react'; import {Constructor} from 'react-native/types/private/Utilities'; import {ViewProps} from './ViewPropTypes'; -<<<<<<< Upstream -import {HostInstance} from '../../../types/public/ReactNativeTypes'; -======= -import {NativeMethods} from 'react-native/types/public/ReactNativeTypes'; ->>>>>>> Override +import {HostInstance} from 'react-native/types/public/ReactNativeTypes'; /** * The most fundamental component for building UI, View is a container that supports layout with flexbox, style, some touch handling, @@ -22,16 +18,10 @@ import {NativeMethods} from 'react-native/types/public/ReactNativeTypes'; * View maps directly to the native view equivalent on whatever platform React is running on, * whether that is a UIView,
, android.view, etc. */ -<<<<<<< Upstream -declare class ViewComponent extends React.Component {} -declare const ViewBase: Constructor & typeof ViewComponent; -export class View extends ViewBase { -======= declare class ViewWin32Component extends React.Component {} -declare const ViewWin32Base: Constructor & +declare const ViewWin32Base: Constructor & typeof ViewWin32Component; export class ViewWin32 extends ViewWin32Base { ->>>>>>> Override /** * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) * @platform ios diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h index 6871c50d68f..c1ec8027982 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h @@ -18,19 +18,6 @@ namespace facebook::react { /* * Descriptor for component. */ -<<<<<<< Upstream -class AndroidTextInputComponentDescriptor final : public ConcreteComponentDescriptor { - public: - AndroidTextInputComponentDescriptor(const ComponentDescriptorParameters ¶meters) - : ConcreteComponentDescriptor(parameters), - textLayoutManager_(std::make_shared(contextContainer_)) - { - } - - virtual State::Shared createInitialState(const Props::Shared &props, const ShadowNodeFamily::Shared &family) - const override - { -======= class WindowsTextInputComponentDescriptor final : public ConcreteComponentDescriptor { public: WindowsTextInputComponentDescriptor(const ComponentDescriptorParameters ¶meters) @@ -41,7 +28,6 @@ class WindowsTextInputComponentDescriptor final : public ConcreteComponentDescri virtual State::Shared createInitialState( const Props::Shared& props, const ShadowNodeFamily::Shared& family) const override { ->>>>>>> Override int surfaceId = family->getSurfaceId(); ThemePadding theme; @@ -73,30 +59,18 @@ virtual State::Shared createInitialState( */ protected: -<<<<<<< Upstream - void adopt(ShadowNode &shadowNode) const override - { - auto &textInputShadowNode = static_cast(shadowNode); -======= void adopt(ShadowNode &shadowNode) const override { auto &textInputShadowNode = static_cast(shadowNode); ->>>>>>> Override // `TextInputShadowNode` uses `TextLayoutManager` to measure text content // and communicate text rendering metrics to mounting layer. textInputShadowNode.setTextLayoutManager(textLayoutManager_); -<<<<<<< Upstream - int surfaceId = textInputShadowNode.getSurfaceId(); - if (surfaceIdToThemePaddingMap_.find(surfaceId) != surfaceIdToThemePaddingMap_.end()) { - const auto &theme = surfaceIdToThemePaddingMap_[surfaceId]; -======= /* int surfaceId = textInputShadowNode.getSurfaceId(); if (surfaceIdToThemePaddingMap_.find(surfaceId) != surfaceIdToThemePaddingMap_.end()) { const auto& theme = surfaceIdToThemePaddingMap_[surfaceId]; ->>>>>>> Override auto &textInputProps = textInputShadowNode.getConcreteProps(); diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp index f0bcd44f284..da88f541fad 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp @@ -128,15 +128,7 @@ void WindowsTextInputShadowNode::updateStateIfNeeded(const LayoutContext &layout // flowing to Java, so we just ensure it's a noop in those cases. setStateData( -<<<<<<< Upstream - AndroidTextInputState{ - AttributedStringBox(newAttributedString), - reactTreeAttributedString, - props.paragraphAttributes, - newEventCount}); -======= WindowsTextInputState{AttributedStringBox(newAttributedString), reactTreeAttributedString, {}, newEventCount}); ->>>>>>> Override } AttributedString WindowsTextInputShadowNode::getAttributedString(const LayoutContext &layoutContext) const { diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h index b8e785ba73a..094cc2dea51 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h @@ -52,14 +52,10 @@ class WindowsTextInputShadowNode final : public ConcreteViewShadowNode< void layout(LayoutContext layoutContext) override; -<<<<<<< Upstream - Float baseline(const LayoutContext &layoutContext, Size size) const override; -======= Float baseline(const LayoutContext &layoutContext, Size size) const override { // Calculate baseline as 80% of the text height return size.height * 0.8f; } ->>>>>>> Override std::shared_ptr textLayoutManager_; diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h index 54909570712..9a88aebd5ee 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h @@ -36,22 +36,12 @@ class WindowsTextInputState final { { } -<<<<<<< Upstream - AndroidTextInputState(const AndroidTextInputState &previousState, const folly::dynamic &data) -======= WindowsTextInputState(const WindowsTextInputState &previousState, const folly::dynamic &data) ->>>>>>> Override : attributedStringBox(previousState.attributedStringBox), reactTreeAttributedString(previousState.reactTreeAttributedString), paragraphAttributes(previousState.paragraphAttributes), mostRecentEventCount(data.getDefault("mostRecentEventCount", previousState.mostRecentEventCount).getInt()), -<<<<<<< Upstream - cachedAttributedStringId(data.getDefault("opaqueCacheId", previousState.cachedAttributedStringId).getInt()) - { - } -======= cachedAttributedStringId(data.getDefault("opaqueCacheId", previousState.cachedAttributedStringId).getInt()) {} ->>>>>>> Override folly::dynamic getDynamic() const; MapBuffer getMapBuffer() const; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h index eef0adb77db..f03d9fa4b51 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h @@ -84,17 +84,10 @@ using TraceSectionUnwrapped = TraceSection; struct ConcreteTraceSection { public: template -<<<<<<< Upstream - explicit ConcreteTraceSection(const char *name, ConvertsToStringPiece &&...args) - : m_section(TRACE_TAG_REACT, name, args...) - { - } -======= explicit ConcreteTraceSection( const char* name, ConvertsToStringPiece&&... args) : m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...) {} // [Windows][issue #14819] ->>>>>>> Override private: fbsystrace::FbSystraceSection m_section; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h index be60a6dee9c..daa9a96fa12 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h @@ -18,12 +18,7 @@ namespace facebook::react { -<<<<<<< Upstream -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) -{ -======= inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) { ->>>>>>> Override if (value.hasType()) { result = { /* .type = */ ImageSource::Type::Remote, @@ -116,7 +111,6 @@ inline void fromRawValue(const PropsParserContext &context, const RawValue &valu result.type = ImageSource::Type::Invalid; } -<<<<<<< Upstream inline std::string toString(const ImageSource &value) { return "{uri: " + value.uri + "}"; @@ -124,13 +118,6 @@ inline std::string toString(const ImageSource &value) inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageResizeMode &result) { -======= -inline std::string toString(const ImageSource &value) { - return "{uri: " + value.uri + "}"; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageResizeMode &result) { ->>>>>>> Override react_native_expect(value.hasType()); if (!value.hasType()) { LOG(ERROR) << "Unsupported ImageResizeMode type"; @@ -160,12 +147,8 @@ inline void fromRawValue(const PropsParserContext &context, const RawValue &valu } } -<<<<<<< Upstream inline std::string toString(const ImageResizeMode &value) { -======= -inline std::string toString(const ImageResizeMode &value) { ->>>>>>> Override switch (value) { case ImageResizeMode::Cover: return "cover"; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h deleted file mode 100644 index 7c931b2f58f..00000000000 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +++ /dev/null @@ -1,1523 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace facebook::react { - -/* - * Yoga's `float` <-> React Native's `Float` (can be `double` or `float`) - * - * Regular Yoga `float` values represent some onscreen-position-related values. - * They can be real numbers or special value `YGUndefined` (which actually is - * `NaN`). Conceptually, layout computation process inside Yoga should never - * produce `NaN` values from non-`NaN` values. At the same time, ` YGUndefined` - * values have special "no limit" meaning in Yoga, therefore ` YGUndefined` - * usually corresponds to `Infinity` value. - */ -inline Float floatFromYogaFloat(float value) -{ - static_assert(YGUndefined != YGUndefined, "The code of this function assumes that YGUndefined is NaN."); - if (std::isnan(value) /* means: `value == YGUndefined` */) { - return std::numeric_limits::infinity(); - } - - return (Float)value; -} - -inline float yogaFloatFromFloat(Float value) -{ - if (!std::isfinite(value)) { - return YGUndefined; - } - - return (float)value; -} - -/* - * `yoga::FloatOptional` <-> React Native's `Float` - * - * `yoga::FloatOptional` represents optional dimensionless float values in Yoga - * Style object (e.g. `flex`). The most suitable analogy to empty - * `yoga::FloatOptional` is `NaN` value. - * `yoga::FloatOptional` values are usually parsed from some outside data source - * which usually has some special corresponding representation for an empty - * value. - */ -inline Float floatFromYogaOptionalFloat(yoga::FloatOptional value) -{ - if (value.isUndefined()) { - return std::numeric_limits::quiet_NaN(); - } - - return floatFromYogaFloat(value.unwrap()); -} - -inline yoga::FloatOptional yogaOptionalFloatFromFloat(Float value) -{ - if (std::isnan(value)) { - return yoga::FloatOptional(); - } - - return yoga::FloatOptional((float)value); -} - -inline std::optional optionalFloatFromYogaValue( - const yoga::Style::Length &length, - std::optional base = {}) -{ - if (length.isPoints()) { - return floatFromYogaOptionalFloat(length.value()); - } else if (length.isPercent()) { - return base.has_value() ? std::optional(base.value() * floatFromYogaOptionalFloat(length.value())) - : std::optional(); - } else { - return {}; - } -} - -static inline PositionType positionTypeFromYogaPositionType(yoga::PositionType positionType) -{ - switch (positionType) { - case yoga::PositionType::Static: - return PositionType::Static; - case yoga::PositionType::Relative: - return PositionType::Relative; - case yoga::PositionType::Absolute: - return PositionType::Absolute; - } -} - -inline DisplayType displayTypeFromYGDisplay(YGDisplay display) -{ - switch (display) { - case YGDisplayNone: - return DisplayType::None; - case YGDisplayContents: - return DisplayType::Contents; - case YGDisplayFlex: - return DisplayType::Flex; - } -} - -inline LayoutMetrics layoutMetricsFromYogaNode(yoga::Node &yogaNode) -{ - auto layoutMetrics = LayoutMetrics{}; - - layoutMetrics.frame = Rect{ - .origin = - Point{ - .x = floatFromYogaFloat(YGNodeLayoutGetLeft(&yogaNode)), - .y = floatFromYogaFloat(YGNodeLayoutGetTop(&yogaNode))}, - .size = Size{ - .width = floatFromYogaFloat(YGNodeLayoutGetWidth(&yogaNode)), - .height = floatFromYogaFloat(YGNodeLayoutGetHeight(&yogaNode))}}; - - layoutMetrics.borderWidth = EdgeInsets{ - floatFromYogaFloat(YGNodeLayoutGetBorder(&yogaNode, YGEdgeLeft)), - floatFromYogaFloat(YGNodeLayoutGetBorder(&yogaNode, YGEdgeTop)), - floatFromYogaFloat(YGNodeLayoutGetBorder(&yogaNode, YGEdgeRight)), - floatFromYogaFloat(YGNodeLayoutGetBorder(&yogaNode, YGEdgeBottom))}; - - layoutMetrics.contentInsets = EdgeInsets{ - layoutMetrics.borderWidth.left + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeLeft)), - layoutMetrics.borderWidth.top + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeTop)), - layoutMetrics.borderWidth.right + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeRight)), - layoutMetrics.borderWidth.bottom + floatFromYogaFloat(YGNodeLayoutGetPadding(&yogaNode, YGEdgeBottom))}; - - layoutMetrics.displayType = displayTypeFromYGDisplay(YGNodeStyleGetDisplay(&yogaNode)); - - layoutMetrics.positionType = positionTypeFromYogaPositionType(yogaNode.style().positionType()); - - layoutMetrics.layoutDirection = YGNodeLayoutGetDirection(&yogaNode) == YGDirectionRTL ? LayoutDirection::RightToLeft - : LayoutDirection::LeftToRight; - - return layoutMetrics; -} - -inline YGDirection yogaDirectionFromLayoutDirection(LayoutDirection direction) -{ - switch (direction) { - case LayoutDirection::Undefined: - return YGDirectionInherit; - case LayoutDirection::LeftToRight: - return YGDirectionLTR; - case LayoutDirection::RightToLeft: - return YGDirectionRTL; - } -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Direction &result) -{ - result = yoga::Direction::Inherit; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "inherit") { - result = yoga::Direction::Inherit; - return; - } - if (stringValue == "ltr") { - result = yoga::Direction::LTR; - return; - } - if (stringValue == "rtl") { - result = yoga::Direction::RTL; - return; - } - LOG(ERROR) << "Could not parse yoga::Direction: " << stringValue; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::FlexDirection &result) -{ - result = yoga::FlexDirection::Column; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "row") { - result = yoga::FlexDirection::Row; - return; - } - if (stringValue == "column") { - result = yoga::FlexDirection::Column; - return; - } - if (stringValue == "column-reverse") { - result = yoga::FlexDirection::ColumnReverse; - return; - } - if (stringValue == "row-reverse") { - result = yoga::FlexDirection::RowReverse; - return; - } - LOG(ERROR) << "Could not parse yoga::FlexDirection: " << stringValue; -} - -inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, yoga::BoxSizing &result) -{ - result = yoga::BoxSizing::BorderBox; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "border-box") { - result = yoga::BoxSizing::BorderBox; - return; - } - if (stringValue == "content-box") { - result = yoga::BoxSizing::ContentBox; - return; - } - - LOG(ERROR) << "Could not parse yoga::BoxSizing: " << stringValue; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Justify &result) -{ - result = yoga::Justify::FlexStart; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "flex-start") { - result = yoga::Justify::FlexStart; - return; - } - if (stringValue == "center") { - result = yoga::Justify::Center; - return; - } - if (stringValue == "flex-end") { - result = yoga::Justify::FlexEnd; - return; - } - if (stringValue == "space-between") { - result = yoga::Justify::SpaceBetween; - return; - } - if (stringValue == "space-around") { - result = yoga::Justify::SpaceAround; - return; - } - if (stringValue == "space-evenly") { - result = yoga::Justify::SpaceEvenly; - return; - } - LOG(ERROR) << "Could not parse yoga::Justify: " << stringValue; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Align &result) -{ - result = yoga::Align::Stretch; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "auto") { - result = yoga::Align::Auto; - return; - } - if (stringValue == "flex-start") { - result = yoga::Align::FlexStart; - return; - } - if (stringValue == "center") { - result = yoga::Align::Center; - return; - } - if (stringValue == "flex-end") { - result = yoga::Align::FlexEnd; - return; - } - if (stringValue == "stretch") { - result = yoga::Align::Stretch; - return; - } - if (stringValue == "baseline") { - result = yoga::Align::Baseline; - return; - } - if (stringValue == "space-between") { - result = yoga::Align::SpaceBetween; - return; - } - if (stringValue == "space-around") { - result = yoga::Align::SpaceAround; - return; - } - if (stringValue == "space-evenly") { - result = yoga::Align::SpaceEvenly; - return; - } - LOG(ERROR) << "Could not parse yoga::Align: " << stringValue; - react_native_expect(false); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::PositionType &result) -{ - result = yoga::PositionType::Relative; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "static") { - result = yoga::PositionType::Static; - return; - } - if (stringValue == "relative") { - result = yoga::PositionType::Relative; - return; - } - if (stringValue == "absolute") { - result = yoga::PositionType::Absolute; - return; - } - LOG(ERROR) << "Could not parse yoga::PositionType: " << stringValue; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Wrap &result) -{ - result = yoga::Wrap::NoWrap; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "nowrap") { - result = yoga::Wrap::NoWrap; - return; - } - if (stringValue == "wrap") { - result = yoga::Wrap::Wrap; - return; - } - if (stringValue == "wrap-reverse") { - result = yoga::Wrap::WrapReverse; - return; - } - LOG(ERROR) << "Could not parse yoga::Wrap: " << stringValue; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Overflow &result) -{ - result = yoga::Overflow::Visible; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "visible") { - result = yoga::Overflow::Visible; - return; - } - if (stringValue == "hidden") { - result = yoga::Overflow::Hidden; - return; - } - if (stringValue == "scroll") { - result = yoga::Overflow::Scroll; - return; - } - LOG(ERROR) << "Could not parse yoga::Overflow:" << stringValue; - react_native_expect(false); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Display &result) -{ - result = yoga::Display::Flex; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "flex") { - result = yoga::Display::Flex; - return; - } - if (stringValue == "none") { - result = yoga::Display::None; - return; - } - if (stringValue == "contents") { - result = yoga::Display::Contents; - return; - } - LOG(ERROR) << "Could not parse yoga::Display: " << stringValue; -} - -inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, yoga::Style::SizeLength &result) -{ - if (value.hasType()) { - result = yoga::StyleSizeLength::points((float)value); - return; - } else if (value.hasType()) { - const auto stringValue = (std::string)value; - if (stringValue == "auto") { - result = yoga::StyleSizeLength::ofAuto(); - return; - } else if (stringValue == "max-content") { - result = yoga::StyleSizeLength::ofMaxContent(); - return; - } else if (stringValue == "stretch") { - result = yoga::StyleSizeLength::ofStretch(); - return; - } else if (stringValue == "fit-content") { - result = yoga::StyleSizeLength::ofFitContent(); - return; - } else { - auto parsed = parseCSSProperty(stringValue); - if (std::holds_alternative(parsed)) { - result = yoga::StyleSizeLength::percent(std::get(parsed).value); - return; - } else if (std::holds_alternative(parsed)) { - result = yoga::StyleSizeLength::points(std::get(parsed).value); - return; - } - } - } - result = yoga::StyleSizeLength::undefined(); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::Style::Length &result) -{ - if (value.hasType()) { - result = yoga::StyleLength::points((float)value); - return; - } else if (value.hasType()) { - const auto stringValue = (std::string)value; - if (stringValue == "auto") { - result = yoga::StyleLength::ofAuto(); - return; - } else { - auto parsed = parseCSSProperty(stringValue); - if (std::holds_alternative(parsed)) { - result = yoga::StyleLength::percent(std::get(parsed).value); - return; - } else if (std::holds_alternative(parsed)) { - result = yoga::StyleLength::points(std::get(parsed).value); - return; - } - } - } - result = yoga::StyleLength::undefined(); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, YGValue &result) -{ - yoga::Style::Length length{}; - fromRawValue(context, value, length); - result = (YGValue)length; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, yoga::FloatOptional &result) -{ - result = value.hasType() ? yoga::FloatOptional((float)value) : yoga::FloatOptional(); -} - -inline std::optional toRadians(const RawValue &value) -{ - if (value.hasType()) { - return (Float)value; - } - if (!value.hasType()) { - return {}; - } - - auto angle = parseCSSProperty((std::string)value); - if (std::holds_alternative(angle)) { -<<<<<<< Upstream - return static_cast(std::get(angle).degrees * M_PI / 180.0f); -======= - return static_cast(std::get(angle).degrees * M_PI / 180.0f); // [Windows #14698] ->>>>>>> Override - } - - return {}; -} - -inline ValueUnit toValueUnit(const RawValue &value) -{ - if (value.hasType()) { - return ValueUnit((Float)value, UnitType::Point); - } - if (!value.hasType()) { - return {}; - } - - auto pct = parseCSSProperty((std::string)value); - if (std::holds_alternative(pct)) { - return ValueUnit(std::get(pct).value, UnitType::Percent); - } - - return {}; -} - -inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, ValueUnit &result) -{ - result = toValueUnit(value); -} - -inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, Transform &result) -{ - auto transformMatrix = Transform{}; - react_native_expect(value.hasType>()); - if (!value.hasType>()) { - result = transformMatrix; - return; - } - - auto configurations = static_cast>(value); - for (const auto &configuration : configurations) { - if (!configuration.hasType>()) { - result = {}; - return; - } - - auto configurationPair = static_cast>(configuration); - if (configurationPair.size() != 1) { - result = {}; - return; - } - - auto pair = configurationPair.begin(); - auto operation = pair->first; - auto ¶meters = pair->second; - auto Zero = ValueUnit(0, UnitType::Point); - auto One = ValueUnit(1, UnitType::Point); - - if (operation == "matrix") { - // T215634510: We should support matrix transforms as part of a list of - // transforms - if (configurations.size() > 1) { - result = {}; - return; - } - - if (!parameters.hasType>()) { - result = {}; - return; - } - - auto numbers = (std::vector)parameters; - if (numbers.size() != 9 && numbers.size() != 16) { - result = {}; - return; - } - - if (numbers.size() == 16) { - size_t i = 0; - - for (auto number : numbers) { - transformMatrix.matrix[i++] = number; - } - } else if (numbers.size() == 9) { - // We need to convert the 2d transform matrix into a 3d one as such: - // [ - // x00, x01, 0, x02 - // x10, x11, 0, x12 - // 0, 0, 1, 0 - // x20, x21, 0, x22 - // ] - transformMatrix.matrix[0] = numbers[0]; - transformMatrix.matrix[1] = numbers[1]; - transformMatrix.matrix[2] = 0; - transformMatrix.matrix[3] = numbers[2]; - transformMatrix.matrix[4] = numbers[3]; - transformMatrix.matrix[5] = numbers[4]; - transformMatrix.matrix[6] = 0; - transformMatrix.matrix[7] = numbers[5]; - transformMatrix.matrix[8] = 0; - transformMatrix.matrix[9] = 0; - transformMatrix.matrix[10] = 1; - transformMatrix.matrix[11] = 0; - transformMatrix.matrix[12] = numbers[6]; - transformMatrix.matrix[13] = numbers[7]; - transformMatrix.matrix[14] = 0; - transformMatrix.matrix[15] = numbers[8]; - } - transformMatrix.operations.push_back( - TransformOperation{.type = TransformOperationType::Arbitrary, .x = Zero, .y = Zero, .z = Zero}); - } else if (operation == "perspective") { - if (!parameters.hasType()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Perspective, - .x = ValueUnit((Float)parameters, UnitType::Point), - .y = Zero, - .z = Zero}); - } else if (operation == "rotateX") { - auto radians = toRadians(parameters); - if (!radians.has_value()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Rotate, .x = ValueUnit(*radians, UnitType::Point), .y = Zero, .z = Zero}); - } else if (operation == "rotateY") { - auto radians = toRadians(parameters); - if (!radians.has_value()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Rotate, .x = Zero, .y = ValueUnit(*radians, UnitType::Point), .z = Zero}); - } else if (operation == "rotateZ" || operation == "rotate") { - auto radians = toRadians(parameters); - if (!radians.has_value()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Rotate, .x = Zero, .y = Zero, .z = ValueUnit(*radians, UnitType::Point)}); - } else if (operation == "scale") { - if (!parameters.hasType()) { - result = {}; - return; - } - - auto number = ValueUnit((Float)parameters, UnitType::Point); - transformMatrix.operations.push_back( - TransformOperation{.type = TransformOperationType::Scale, .x = number, .y = number, .z = number}); - } else if (operation == "scaleX") { - if (!parameters.hasType()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Scale, - .x = ValueUnit((Float)parameters, UnitType::Point), - .y = One, - .z = One}); - } else if (operation == "scaleY") { - if (!parameters.hasType()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Scale, - .x = One, - .y = ValueUnit((Float)parameters, UnitType::Point), - .z = One}); - } else if (operation == "scaleZ") { - if (!parameters.hasType()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Scale, - .x = One, - .y = One, - .z = ValueUnit((Float)parameters, UnitType::Point)}); - } else if (operation == "translate") { - if (!parameters.hasType>()) { - result = {}; - return; - } - - auto numbers = (std::vector)parameters; - if (numbers.size() != 2) { - result = {}; - return; - } - - auto valueX = toValueUnit(numbers[0]); - if (!valueX) { - result = {}; - return; - } - - auto valueY = toValueUnit(numbers[1]); - if (!valueY) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{.type = TransformOperationType::Translate, .x = valueX, .y = valueY, .z = Zero}); - } else if (operation == "translateX") { - auto valueX = toValueUnit(parameters); - if (!valueX) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{.type = TransformOperationType::Translate, .x = valueX, .y = Zero, .z = Zero}); - } else if (operation == "translateY") { - auto valueY = toValueUnit(parameters); - if (!valueY) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{.type = TransformOperationType::Translate, .x = Zero, .y = valueY, .z = Zero}); - } else if (operation == "skewX") { - auto radians = toRadians(parameters); - if (!radians.has_value()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Skew, .x = ValueUnit(*radians, UnitType::Point), .y = Zero, .z = Zero}); - } else if (operation == "skewY") { - auto radians = toRadians(parameters); - if (!radians.has_value()) { - result = {}; - return; - } - - transformMatrix.operations.push_back( - TransformOperation{ - .type = TransformOperationType::Skew, .x = Zero, .y = ValueUnit(*radians, UnitType::Point), .z = Zero}); - } - } - - result = transformMatrix; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, TransformOrigin &result) -{ - if (!value.hasType>()) { - result = {}; - return; - } - - auto origins = (std::vector)value; - if (origins.size() != 3) { - result = {}; - return; - } - - TransformOrigin transformOrigin; - - for (size_t i = 0; i < 2; i++) { - auto origin = toValueUnit(origins[i]); - if (!origin) { - result = {}; - return; - } - - transformOrigin.xy[i] = origin; - } - - if (!origins[2].hasType()) { - result = {}; - return; - } - transformOrigin.z = (Float)origins[2]; - - result = transformOrigin; -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, PointerEventsMode &result) -{ - result = PointerEventsMode::Auto; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "auto") { - result = PointerEventsMode::Auto; - return; - } - if (stringValue == "none") { - result = PointerEventsMode::None; - return; - } - if (stringValue == "box-none") { - result = PointerEventsMode::BoxNone; - return; - } - if (stringValue == "box-only") { - result = PointerEventsMode::BoxOnly; - return; - } - LOG(ERROR) << "Could not parse PointerEventsMode:" << stringValue; - react_native_expect(false); -} - -inline std::string toString(PointerEventsMode value) -{ - switch (value) { - case PointerEventsMode::Auto: - return "auto"; - case PointerEventsMode::None: - return "none"; - case PointerEventsMode::BoxNone: - return "box-none"; - case PointerEventsMode::BoxOnly: - return "box-only"; - } -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, BackfaceVisibility &result) -{ - result = BackfaceVisibility::Auto; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "auto") { - result = BackfaceVisibility::Auto; - return; - } - if (stringValue == "visible") { - result = BackfaceVisibility::Visible; - return; - } - if (stringValue == "hidden") { - result = BackfaceVisibility::Hidden; - return; - } - LOG(ERROR) << "Could not parse BackfaceVisibility:" << stringValue; - react_native_expect(false); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, BorderCurve &result) -{ - result = BorderCurve::Circular; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "circular") { - result = BorderCurve::Circular; - return; - } - if (stringValue == "continuous") { - result = BorderCurve::Continuous; - return; - } - LOG(ERROR) << "Could not parse BorderCurve:" << stringValue; - react_native_expect(false); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, BorderStyle &result) -{ - result = BorderStyle::Solid; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "solid") { - result = BorderStyle::Solid; - return; - } - if (stringValue == "dotted") { - result = BorderStyle::Dotted; - return; - } - if (stringValue == "dashed") { - result = BorderStyle::Dashed; - return; - } - LOG(ERROR) << "Could not parse BorderStyle:" << stringValue; - react_native_expect(false); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, OutlineStyle &result) -{ - result = OutlineStyle::Solid; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "solid") { - result = OutlineStyle::Solid; - return; - } - if (stringValue == "dotted") { - result = OutlineStyle::Dotted; - return; - } - if (stringValue == "dashed") { - result = OutlineStyle::Dashed; - return; - } - LOG(ERROR) << "Could not parse OutlineStyle:" << stringValue; - react_native_expect(false); -} - -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, Cursor &result) -{ - result = Cursor::Auto; - react_native_expect(value.hasType()); - if (!value.hasType()) { - return; - } - auto stringValue = (std::string)value; - if (stringValue == "alias") { - result = Cursor::Alias; - return; - } - if (stringValue == "all-scroll") { - result = Cursor::AllScroll; - return; - } - if (stringValue == "auto") { - result = Cursor::Auto; - return; - } - if (stringValue == "cell") { - result = Cursor::Cell; - return; - } - if (stringValue == "col-resize") { - result = Cursor::ColResize; - return; - } - if (stringValue == "context-menu") { - result = Cursor::ContextMenu; - return; - } - if (stringValue == "copy") { - result = Cursor::Copy; - return; - } - if (stringValue == "crosshair") { - result = Cursor::Crosshair; - return; - } - if (stringValue == "default") { - result = Cursor::Default; - return; - } - if (stringValue == "e-resize") { - result = Cursor::EResize; - return; - } - if (stringValue == "ew-resize") { - result = Cursor::EWResize; - return; - } - if (stringValue == "grab") { - result = Cursor::Grab; - return; - } - if (stringValue == "grabbing") { - result = Cursor::Grabbing; - return; - } - if (stringValue == "help") { - result = Cursor::Help; - return; - } - if (stringValue == "move") { - result = Cursor::Move; - return; - } - if (stringValue == "n-resize") { - result = Cursor::NResize; - return; - } - if (stringValue == "ne-resize") { - result = Cursor::NEResize; - return; - } - if (stringValue == "nesw-resize") { - result = Cursor::NESWResize; - return; - } - if (stringValue == "ns-resize") { - result = Cursor::NSResize; - return; - } - if (stringValue == "nw-resize") { - result = Cursor::NWResize; - return; - } - if (stringValue == "nwse-resize") { - result = Cursor::NWSEResize; - return; - } - if (stringValue == "no-drop") { - result = Cursor::NoDrop; - return; - } - if (stringValue == "none") { - result = Cursor::None; - return; - } - if (stringValue == "not-allowed") { - result = Cursor::NotAllowed; - return; - } - if (stringValue == "pointer") { - result = Cursor::Pointer; - return; - } - if (stringValue == "progress") { - result = Cursor::Progress; - return; - } - if (stringValue == "row-resize") { - result = Cursor::RowResize; - return; - } - if (stringValue == "s-resize") { - result = Cursor::SResize; - return; - } - if (stringValue == "se-resize") { - result = Cursor::SEResize; - return; - } - if (stringValue == "sw-resize") { - result = Cursor::SWResize; - return; - } - if (stringValue == "text") { - result = Cursor::Text; - return; - } - if (stringValue == "url") { - result = Cursor::Url; - return; - } - if (stringValue == "w-resize") { - result = Cursor::WResize; - return; - } - if (stringValue == "wait") { - result = Cursor::Wait; - return; - } - if (stringValue == "zoom-in") { - result = Cursor::ZoomIn; - return; - } - if (stringValue == "zoom-out") { - result = Cursor::ZoomOut; - return; - } - LOG(ERROR) << "Could not parse Cursor:" << stringValue; - react_native_expect(false); -} - -inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, LayoutConformance &result) -{ - react_native_expect(value.hasType()); - result = LayoutConformance::Strict; - if (!value.hasType()) { - return; - } - - auto stringValue = (std::string)value; - if (stringValue == "strict") { - result = LayoutConformance::Strict; - } else if (stringValue == "compatibility") { - result = LayoutConformance::Compatibility; - } else { - LOG(ERROR) << "Unexpected LayoutConformance value:" << stringValue; - react_native_expect(false); - } -} - -inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, BlendMode &result) -{ - react_native_expect(value.hasType()); - result = BlendMode::Normal; - if (!value.hasType()) { - return; - } - - auto rawBlendMode = static_cast(value); - std::optional blendMode = blendModeFromString(rawBlendMode); - - if (!blendMode) { - LOG(ERROR) << "Could not parse blend mode: " << rawBlendMode; - return; - } - - result = blendMode.value(); -} - -inline void -fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, std::vector &result) -{ - react_native_expect(value.hasType>()); - if (!value.hasType>()) { - result = {}; - return; - } - - std::vector backgroundSizes{}; - auto rawBackgroundSizes = static_cast>(value); - - for (const auto &rawBackgroundSizeValue : rawBackgroundSizes) { - if (rawBackgroundSizeValue.hasType()) { - auto sizeStr = (std::string)rawBackgroundSizeValue; - if (sizeStr == "cover") { - backgroundSizes.emplace_back(BackgroundSizeKeyword::Cover); - } else if (sizeStr == "contain") { - backgroundSizes.emplace_back(BackgroundSizeKeyword::Contain); - } - } else if (rawBackgroundSizeValue.hasType>()) { - auto sizeMap = static_cast>(rawBackgroundSizeValue); - - BackgroundSizeLengthPercentage sizeLengthPercentage; - - auto xIt = sizeMap.find("x"); - if (xIt != sizeMap.end()) { - if (xIt->second.hasType() && (std::string)(xIt->second) == "auto") { - sizeLengthPercentage.x = std::monostate{}; - } else { - auto valueUnit = toValueUnit(xIt->second); - if (valueUnit) { - sizeLengthPercentage.x = valueUnit; - } - } - } - - auto yIt = sizeMap.find("y"); - if (yIt != sizeMap.end()) { - if (yIt->second.hasType() && (std::string)(yIt->second) == "auto") { - sizeLengthPercentage.y = std::monostate{}; - } else { - auto valueUnit = toValueUnit(yIt->second); - if (valueUnit) { - sizeLengthPercentage.y = valueUnit; - } - } - } - - backgroundSizes.emplace_back(sizeLengthPercentage); - } - } - - result = backgroundSizes; -} - -inline void -fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, std::vector &result) -{ - react_native_expect(value.hasType>()); - if (!value.hasType>()) { - result = {}; - return; - } - - std::vector backgroundPositions{}; - auto rawBackgroundPositions = static_cast>(value); - - for (const auto &rawBackgroundPositionValue : rawBackgroundPositions) { - if (rawBackgroundPositionValue.hasType>()) { - auto positionMap = static_cast>(rawBackgroundPositionValue); - - BackgroundPosition backgroundPosition; - - auto topIt = positionMap.find("top"); - if (topIt != positionMap.end()) { - auto valueUnit = toValueUnit(topIt->second); - if (valueUnit) { - backgroundPosition.top = valueUnit; - } - } - - auto bottomIt = positionMap.find("bottom"); - if (bottomIt != positionMap.end()) { - auto valueUnit = toValueUnit(bottomIt->second); - if (valueUnit) { - backgroundPosition.bottom = valueUnit; - } - } - - auto leftIt = positionMap.find("left"); - if (leftIt != positionMap.end()) { - auto valueUnit = toValueUnit(leftIt->second); - if (valueUnit) { - backgroundPosition.left = valueUnit; - } - } - - auto rightIt = positionMap.find("right"); - if (rightIt != positionMap.end()) { - auto valueUnit = toValueUnit(rightIt->second); - if (valueUnit) { - backgroundPosition.right = valueUnit; - } - } - - backgroundPositions.emplace_back(backgroundPosition); - } - } - - result = backgroundPositions; -} - -inline void -fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, std::vector &result) -{ - react_native_expect(value.hasType>()); - if (!value.hasType>()) { - result = {}; - return; - } - - std::vector backgroundRepeats{}; - auto rawBackgroundRepeats = static_cast>(value); - - for (const auto &rawBackgroundRepeatValue : rawBackgroundRepeats) { - if (rawBackgroundRepeatValue.hasType>()) { - auto repeatMap = static_cast>(rawBackgroundRepeatValue); - - BackgroundRepeat backgroundRepeat; - - auto xIt = repeatMap.find("x"); - if (xIt != repeatMap.end() && xIt->second.hasType()) { - auto xStr = (std::string)(xIt->second); - if (xStr == "repeat") { - backgroundRepeat.x = BackgroundRepeatStyle::Repeat; - } else if (xStr == "space") { - backgroundRepeat.x = BackgroundRepeatStyle::Space; - } else if (xStr == "round") { - backgroundRepeat.x = BackgroundRepeatStyle::Round; - } else if (xStr == "no-repeat") { - backgroundRepeat.x = BackgroundRepeatStyle::NoRepeat; - } - } - - auto yIt = repeatMap.find("y"); - if (yIt != repeatMap.end() && yIt->second.hasType()) { - auto yStr = (std::string)(yIt->second); - if (yStr == "repeat") { - backgroundRepeat.y = BackgroundRepeatStyle::Repeat; - } else if (yStr == "space") { - backgroundRepeat.y = BackgroundRepeatStyle::Space; - } else if (yStr == "round") { - backgroundRepeat.y = BackgroundRepeatStyle::Round; - } else if (yStr == "no-repeat") { - backgroundRepeat.y = BackgroundRepeatStyle::NoRepeat; - } - } - - backgroundRepeats.emplace_back(backgroundRepeat); - } - } - - result = backgroundRepeats; -} - -inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, Isolation &result) -{ - react_native_expect(value.hasType()); - result = Isolation::Auto; - if (!value.hasType()) { - return; - } - - auto rawIsolation = static_cast(value); - std::optional isolation = isolationFromString(rawIsolation); - - if (!isolation) { - LOG(ERROR) << "Could not parse isolation: " << rawIsolation; - return; - } - - result = isolation.value(); -} - -#if RN_DEBUG_STRING_CONVERTIBLE -template -inline std::string toString(const std::array vec) -{ - std::string s; - - s.append("{"); - for (size_t i = 0; i < N - 1; i++) { - s.append(std::to_string(vec[i]) + ", "); - } - s.append(std::to_string(vec[N - 1])); - s.append("}"); - - return s; -} - -inline std::string toString(const yoga::Direction &value) -{ - return YGDirectionToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::FlexDirection &value) -{ - return YGFlexDirectionToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::Justify &value) -{ - return YGJustifyToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::Align &value) -{ - return YGAlignToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::PositionType &value) -{ - return YGPositionTypeToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::Wrap &value) -{ - return YGWrapToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::Overflow &value) -{ - return YGOverflowToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::Display &value) -{ - return YGDisplayToString(yoga::unscopedEnum(value)); -} - -inline std::string toString(const yoga::Style::Length &length) -{ - if (length.isUndefined()) { - return "undefined"; - } else if (length.isAuto()) { - return "auto"; - } else if (length.isPoints()) { - return std::to_string(length.value().unwrap()); - } else if (length.isPercent()) { - return std::to_string(length.value().unwrap()) + "%"; - } else { - return "unknown"; - } -} - -inline std::string toString(const yoga::Style::SizeLength &length) -{ - if (length.isUndefined()) { - return "undefined"; - } else if (length.isAuto()) { - return "auto"; - } else if (length.isPoints()) { - return std::to_string(length.value().unwrap()); - } else if (length.isPercent()) { - return std::to_string(length.value().unwrap()) + "%"; - } else if (length.isMaxContent()) { - return "max-content"; - } else if (length.isFitContent()) { - return "fit-content"; - } else if (length.isStretch()) { - return "stretch"; - } else { - return "unknown"; - } -} - -inline std::string toString(const yoga::FloatOptional &value) -{ - if (value.isUndefined()) { - return "undefined"; - } - - return std::to_string(value.unwrap()); -} - -inline std::string toString(const LayoutConformance &value) -{ - switch (value) { - case LayoutConformance::Strict: - return "strict"; - case LayoutConformance::Compatibility: - return "compatibility"; - } -} - -inline std::string toString(const std::array &m) -{ - std::string result; - result += "[ " + std::to_string(m[0]) + " " + std::to_string(m[1]) + " " + std::to_string(m[2]) + " " + - std::to_string(m[3]) + " ]\n"; - result += "[ " + std::to_string(m[4]) + " " + std::to_string(m[5]) + " " + std::to_string(m[6]) + " " + - std::to_string(m[7]) + " ]\n"; - result += "[ " + std::to_string(m[8]) + " " + std::to_string(m[9]) + " " + std::to_string(m[10]) + " " + - std::to_string(m[11]) + " ]\n"; - result += "[ " + std::to_string(m[12]) + " " + std::to_string(m[13]) + " " + std::to_string(m[14]) + " " + - std::to_string(m[15]) + " ]"; - return result; -} - -inline std::string toString(const Transform &transform) -{ - std::string result = "["; - bool first = true; - - for (const auto &operation : transform.operations) { - if (!first) { - result += ", "; - } - first = false; - - switch (operation.type) { - case TransformOperationType::Perspective: { - result += "{\"perspective\": " + std::to_string(operation.x.value) + "}"; - break; - } - case TransformOperationType::Rotate: { - if (operation.x.value != 0 && operation.y.value == 0 && operation.z.value == 0) { - result += R"({"rotateX": ")" + std::to_string(operation.x.value) + "rad\"}"; - } else if (operation.x.value == 0 && operation.y.value != 0 && operation.z.value == 0) { - result += R"({"rotateY": ")" + std::to_string(operation.y.value) + "rad\"}"; - } else if (operation.x.value == 0 && operation.y.value == 0 && operation.z.value != 0) { - result += R"({"rotateZ": ")" + std::to_string(operation.z.value) + "rad\"}"; - } - break; - } - case TransformOperationType::Scale: { - if (operation.x.value == operation.y.value && operation.x.value == operation.z.value) { - result += "{\"scale\": " + std::to_string(operation.x.value) + "}"; - } else if (operation.y.value == 1 && operation.z.value == 1) { - result += "{\"scaleX\": " + std::to_string(operation.x.value) + "}"; - } else if (operation.x.value == 1 && operation.z.value == 1) { - result += "{\"scaleY\": " + std::to_string(operation.y.value) + "}"; - } else if (operation.x.value == 1 && operation.y.value == 1) { - result += "{\"scaleZ\": " + std::to_string(operation.z.value) + "}"; - } - break; - } - case TransformOperationType::Translate: { - if (operation.x.value != 0 && operation.y.value != 0 && operation.z.value == 0) { - result += "{\"translate\": ["; - result += std::to_string(operation.x.value) + ", " + std::to_string(operation.y.value); - result += "]}"; - } else if (operation.x.value != 0 && operation.y.value == 0) { - result += "{\"translateX\": " + std::to_string(operation.x.value) + "}"; - } else if (operation.x.value == 0 && operation.y.value != 0) { - result += "{\"translateY\": " + std::to_string(operation.y.value) + "}"; - } - break; - } - case TransformOperationType::Skew: { - if (operation.x.value != 0 && operation.y.value == 0) { - result += R"({"skewX": ")" + std::to_string(operation.x.value) + "rad\"}"; - } else if (operation.x.value == 0 && operation.y.value != 0) { - result += R"({"skewY": ")" + std::to_string(operation.y.value) + "rad\"}"; - } - break; - } - case TransformOperationType::Arbitrary: { - result += "{\"matrix\": " + toString(transform.matrix) + "}"; - break; - } - case TransformOperationType::Identity: { - result += "{\"identity\": true}"; - break; - } - } - } - - result += "]"; - return result; -} -#endif - -} // namespace facebook::react diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp deleted file mode 100644 index 47c4b1f3016..00000000000 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include "ShadowNode.h" -#include "DynamicPropsUtilities.h" -#include "ShadowNodeFragment.h" - -#include -#include -#include -#include -#include -#include - -#include - -namespace facebook::react { - -/* - * Runtime shadow node reference updates should only run from one thread at all - * times to avoid having more than one shadow tree updating the current fiber - * tree simultaneously. This thread_local flag allows enabling the updates for - * choses threads. - */ -thread_local bool useRuntimeShadowNodeReferenceUpdateOnThread{false}; // NOLINT - -/* static */ void ShadowNode::setUseRuntimeShadowNodeReferenceUpdateOnThread( - bool isEnabled) { - useRuntimeShadowNodeReferenceUpdateOnThread = isEnabled; -} - -ShadowNode::SharedListOfShared ShadowNode::emptySharedShadowNodeSharedList() { - static const auto emptySharedShadowNodeSharedList = - std::make_shared>>(); - return emptySharedShadowNodeSharedList; -} - -/* - * On iOS, this method returns `props` if provided, `sourceShadowNode`'s props - * otherwise. On Android, we forward props in case `sourceShadowNode` hasn't - * been mounted. `Props::rawProps` are merged from `props` to a copy of - * `sourceShadowNode.props_` and returned. This is necessary to enable - * Background Executor and should be removed once reimplementation of JNI layer - * is finished. - */ -Props::Shared ShadowNode::propsForClonedShadowNode( - const ShadowNode& sourceShadowNode, - const Props::Shared& props) { -#ifdef RN_SERIALIZABLE_STATE - bool hasBeenMounted = sourceShadowNode.hasBeenMounted_; - bool sourceNodeHasRawProps = !sourceShadowNode.getProps()->rawProps.empty(); - if (!hasBeenMounted && sourceNodeHasRawProps && props) { - auto& castedProps = const_cast(*props); - castedProps.rawProps = mergeDynamicProps( - sourceShadowNode.getProps()->rawProps, - props->rawProps, - NullValueStrategy::Override); - return props; - } -#endif - return props ? props : sourceShadowNode.getProps(); -} - -bool ShadowNode::sameFamily(const ShadowNode& first, const ShadowNode& second) { - return first.family_ == second.family_; -} - -#pragma mark - Constructors - -ShadowNode::ShadowNode( - const ShadowNodeFragment& fragment, - ShadowNodeFamily::Shared family, - ShadowNodeTraits traits) - : -#if RN_DEBUG_STRING_CONVERTIBLE - revision_(1), -#endif - props_(fragment.props), - children_( - fragment.children ? fragment.children - : emptySharedShadowNodeSharedList()), - state_(fragment.state), - orderIndex_(0), - family_(std::move(family)), - traits_(traits) { - react_native_assert(props_); - react_native_assert(children_); - - traits_.set(ShadowNodeTraits::Trait::ChildrenAreShared); - - for (const auto& child : *children_) { - child->family_->setParent(family_); - } - - updateTraitsIfNeccessary(); - - // The first node of the family gets its state committed automatically. - family_->setMostRecentState(state_); -} - -ShadowNode::ShadowNode( - const ShadowNode& sourceShadowNode, - const ShadowNodeFragment& fragment) - : -#if RN_DEBUG_STRING_CONVERTIBLE - revision_(sourceShadowNode.revision_ + 1), -#endif - props_(propsForClonedShadowNode(sourceShadowNode, fragment.props)), - children_( - fragment.children ? fragment.children : sourceShadowNode.children_), - state_( - fragment.state ? fragment.state - : (ReactNativeFeatureFlags::useShadowNodeStateOnClone() - ? sourceShadowNode.state_ - : sourceShadowNode.getMostRecentState())), - orderIndex_(sourceShadowNode.orderIndex_), - family_(sourceShadowNode.family_), - traits_(sourceShadowNode.traits_) { - - react_native_assert(props_); - react_native_assert(children_); - - // State could have been progressed above by checking - // `sourceShadowNode.getMostRecentState()`. - traits_.set(ShadowNodeTraits::Trait::ChildrenAreShared); - - if (fragment.children) { - for (const auto& child : *children_) { - child->family_->setParent(family_); - } - updateTraitsIfNeccessary(); - } -} - -std::shared_ptr ShadowNode::clone( - const ShadowNodeFragment& fragment) const { - const auto& family = *family_; - const auto& componentDescriptor = family.componentDescriptor_; - if (family.nativeProps_DEPRECATED != nullptr) { - auto propsParserContext = PropsParserContext{family_->getSurfaceId(), {}}; - if (fragment.props == ShadowNodeFragment::propsPlaceholder()) { - // Clone existing `props_` with `family.nativeProps_DEPRECATED` to apply - // previously set props via `setNativeProps` API. - auto props = componentDescriptor.cloneProps( - propsParserContext, props_, RawProps(*family.nativeProps_DEPRECATED)); - auto clonedNode = componentDescriptor.cloneShadowNode( - *this, - {.props = props, - .children = fragment.children, - .state = fragment.state}); - return clonedNode; - } else { - // TODO: We might need to merge fragment.priops with - // `family.nativeProps_DEPRECATED`. - return componentDescriptor.cloneShadowNode(*this, fragment); - } - } else { - return componentDescriptor.cloneShadowNode(*this, fragment); - } -} - -std::shared_ptr ShadowNode::getContextContainer() const { - return family_->componentDescriptor_.getContextContainer(); -} - -#pragma mark - Getters - -ComponentName ShadowNode::getComponentName() const { - return family_->getComponentName(); -} - -ComponentHandle ShadowNode::getComponentHandle() const { - return family_->getComponentHandle(); -} - -const std::vector>& ShadowNode::getChildren() - const { - return *children_; -} - -ShadowNodeTraits ShadowNode::getTraits() const { - return traits_; -} - -const Props::Shared& ShadowNode::getProps() const { - return props_; -} - -const SharedEventEmitter& ShadowNode::getEventEmitter() const { - return family_->eventEmitter_; -} - -jsi::Value ShadowNode::getInstanceHandle(jsi::Runtime& runtime) const { - return family_->getInstanceHandle(runtime); -} - -Tag ShadowNode::getTag() const { - return family_->tag_; -} - -SurfaceId ShadowNode::getSurfaceId() const { - return family_->surfaceId_; -} - -const ComponentDescriptor& ShadowNode::getComponentDescriptor() const { - return family_->componentDescriptor_; -} - -const State::Shared& ShadowNode::getState() const { - return state_; -} - -State::Shared ShadowNode::getMostRecentState() const { - return family_->getMostRecentState(); -} - -int ShadowNode::getOrderIndex() const { - return orderIndex_; -} - -void ShadowNode::sealRecursive() const { - if (getSealed()) { - return; - } - - seal(); - - props_->seal(); - - for (const auto& child : *children_) { - child->sealRecursive(); - } -} - -#pragma mark - Mutating Methods - -void ShadowNode::appendChild(const std::shared_ptr& child) { - ensureUnsealed(); - - cloneChildrenIfShared(); - auto& children = - const_cast>&>(*children_); - children.push_back(child); - - child->family_->setParent(family_); - updateTraitsIfNeccessary(); -} - -void ShadowNode::replaceChild( - const ShadowNode& oldChild, - const std::shared_ptr& newChild, - size_t suggestedIndex) { - ensureUnsealed(); - - cloneChildrenIfShared(); - newChild->family_->setParent(family_); - - auto& children = - const_cast>&>(*children_); - auto size = children.size(); - - if (suggestedIndex != std::numeric_limits::max() && - suggestedIndex < size) { - // If provided `suggestedIndex` is accurate, - // replacing in place using the index. - if (children.at(suggestedIndex).get() == &oldChild) { - children[suggestedIndex] = newChild; - return; - } - } - - for (size_t index = 0; index < size; index++) { - if (children.at(index).get() == &oldChild) { - children[index] = newChild; - return; - } - } - - react_native_assert(false && "Child to replace was not found."); - updateTraitsIfNeccessary(); -} - -void ShadowNode::cloneChildrenIfShared() { - if (!traits_.check(ShadowNodeTraits::Trait::ChildrenAreShared)) { - return; - } - - traits_.unset(ShadowNodeTraits::Trait::ChildrenAreShared); - children_ = std::make_shared>>( - *children_); -} - -void ShadowNode::updateTraitsIfNeccessary() { - if (ReactNativeFeatureFlags::enableViewCulling()) { - if (traits_.check(ShadowNodeTraits::Trait::Unstable_uncullableView)) { - return; - } - - for (const auto& child : *children_) { - if (child->getTraits().check( - ShadowNodeTraits::Trait::Unstable_uncullableView) || - child->getTraits().check( - ShadowNodeTraits::Trait::Unstable_uncullableTrace)) { - traits_.set(ShadowNodeTraits::Trait::Unstable_uncullableTrace); - return; - } - } - traits_.unset(ShadowNodeTraits::Trait::Unstable_uncullableTrace); - } -} - -void ShadowNode::setMounted(bool mounted) const { - if (mounted) { - family_->setMostRecentState(getState()); - family_->setMounted(); - hasBeenMounted_ = mounted; - } - - family_->eventEmitter_->setEnabled(mounted); -} - -bool ShadowNode::getHasBeenPromoted() const { - return hasBeenMounted_.load(); -} - -void ShadowNode::setRuntimeShadowNodeReference( - const std::shared_ptr& runtimeShadowNodeReference) - const { - runtimeShadowNodeReference_ = runtimeShadowNodeReference; -} - -void ShadowNode::updateRuntimeShadowNodeReference( - const std::shared_ptr& destinationShadowNode) const { - if (auto reference = runtimeShadowNodeReference_.lock()) { - reference->shadowNode = destinationShadowNode; - } -} - -void ShadowNode::transferRuntimeShadowNodeReference( - const std::shared_ptr& destinationShadowNode) const { - destinationShadowNode->runtimeShadowNodeReference_ = - runtimeShadowNodeReference_; - - if (!ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit()) { - updateRuntimeShadowNodeReference(destinationShadowNode); - } -} - -void ShadowNode::transferRuntimeShadowNodeReference( - const std::shared_ptr& destinationShadowNode, - const ShadowNodeFragment& fragment) const { - if ((ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit() || - useRuntimeShadowNodeReferenceUpdateOnThread) && - fragment.runtimeShadowNodeReference) { - transferRuntimeShadowNodeReference(destinationShadowNode); - } -} - -const ShadowNodeFamily& ShadowNode::getFamily() const { - return *family_; -} - -ShadowNodeFamily::Shared ShadowNode::getFamilyShared() const { - return family_; -} - -std::shared_ptr ShadowNode::cloneTree( - const ShadowNodeFamily& shadowNodeFamily, - const std::function( - const ShadowNode& oldShadowNode)>& callback) const { - auto ancestors = shadowNodeFamily.getAncestors(*this); - - if (ancestors.empty()) { - return std::shared_ptr{nullptr}; - } - - auto& parent = ancestors.back(); - auto& oldShadowNode = parent.first.get().getChildren().at(parent.second); - - auto newShadowNode = callback(*oldShadowNode); - - react_native_assert( - newShadowNode && - "`callback` returned `nullptr` which is not allowed value."); - - auto childNode = newShadowNode; - - for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) { - auto& parentNode = it->first.get(); - auto childIndex = it->second; - - auto children = parentNode.getChildren(); - react_native_assert( - ShadowNode::sameFamily(*children.at(childIndex), *childNode)); - children[childIndex] = childNode; - - childNode = parentNode.clone( - {.children = - std::make_shared>>( - children)}); - } - - return std::const_pointer_cast(childNode); -} - -namespace { - -std::shared_ptr cloneMultipleRecursive( - const ShadowNode& shadowNode, - const std::unordered_set& familiesToUpdate, - const std::unordered_map& childrenCount, - const std::function(const ShadowNode&, const ShadowNodeFragment&)>& callback) { - const auto* family = &shadowNode.getFamily(); - auto& children = shadowNode.getChildren(); - std::shared_ptr>> newChildren; - auto count = childrenCount.at(family); - -<<<<<<< Upstream - for (size_t i = 0; count > 0 && i < children.size(); i++) { -======= - // [Windows Remove when issue #15292 is resolved (the fix goes upstream and comes back) - for (size_t i = 0; count > 0 && i < children.size(); i++) { - // Windows] ->>>>>>> Override - const auto childFamily = &children[i]->getFamily(); - if (childrenCount.contains(childFamily)) { - count--; - if (!newChildren) { - newChildren = - std::make_shared>>( - children); - } - (*newChildren)[i] = cloneMultipleRecursive( - *children[i], familiesToUpdate, childrenCount, callback); - } - } - - ShadowNodeFragment fragment{.children = newChildren}; - if (familiesToUpdate.contains(family)) { - return callback(shadowNode, fragment); - } - return shadowNode.clone(fragment); -} - -} // namespace - -std::shared_ptr ShadowNode::cloneMultiple( - const std::unordered_set& familiesToUpdate, - const std::function( - const ShadowNode& oldShadowNode, - const ShadowNodeFragment& fragment)>& callback) const { - std::unordered_map childrenCount; - - for (const auto& family : familiesToUpdate) { - if (childrenCount.contains(family)) { - continue; - } - - childrenCount[family] = 0; - - auto ancestor = family->parent_.lock(); - while ((ancestor != nullptr) && ancestor != family_) { - auto ancestorIt = childrenCount.find(ancestor.get()); - if (ancestorIt != childrenCount.end()) { - ancestorIt->second++; - break; - } - childrenCount[ancestor.get()] = 1; - - ancestor = ancestor->parent_.lock(); - } - - if (ancestor == family_) { - childrenCount[ancestor.get()]++; - } - } - - if (childrenCount.empty()) { - return nullptr; - } - - return cloneMultipleRecursive( - *this, familiesToUpdate, childrenCount, callback); -} - -#pragma mark - DebugStringConvertible - -#if RN_DEBUG_STRING_CONVERTIBLE -std::string ShadowNode::getDebugName() const { - return getComponentName(); -} - -std::string ShadowNode::getDebugValue() const { - return "r" + std::to_string(revision_) + "/sr" + - std::to_string(state_ ? state_->getRevision() : 0) + - (getSealed() ? "/sealed" : "") + - (getProps()->nativeId.empty() ? "" : "/id=" + getProps()->nativeId); -} - -SharedDebugStringConvertibleList ShadowNode::getDebugChildren() const { - auto debugChildren = SharedDebugStringConvertibleList{}; - - for (const auto& child : *children_) { - auto debugChild = - std::dynamic_pointer_cast(child); - if (debugChild) { - debugChildren.push_back(debugChild); - } - } - - return debugChildren; -} - -SharedDebugStringConvertibleList ShadowNode::getDebugProps() const { - return props_->getDebugProps() + - SharedDebugStringConvertibleList{ - debugStringConvertibleItem("tag", std::to_string(getTag()))}; -} -#endif - -// Explicitly define destructors here, as they have to exist in order to act as -// a "key function" for the ShadowNodeWrapper class -- this allows for RTTI to -// work properly across dynamic library boundaries (i.e. dynamic_cast that is -// used by getNativeState method) -ShadowNodeWrapper::~ShadowNodeWrapper() = default; - -} // namespace facebook::react diff --git a/vnext/overrides.json b/vnext/overrides.json index 25505268d4b..0f97cbbb230 100644 --- a/vnext/overrides.json +++ b/vnext/overrides.json @@ -199,20 +199,6 @@ "baseFile": "packages/react-native/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h", "baseHash": "72cc422293c0e70f454225476cdabd3458bbce5e" }, - { - "type": "patch", - "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h", - "baseFile": "packages/react-native/ReactCommon/react/renderer/components/view/conversions.h", - "baseHash": "07075be2e9ae81728bab85d0ddf2d334fee2d43a", - "issue": 14698 - }, - { - "type": "patch", - "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp", - "baseFile": "packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp", - "baseHash": "8078adaeb0c8187fd9ff5bc857f041f2cbfc3b3e", - "issue": 15292 - }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h", From a3e83886e1de89dccddcafe0f628d0a28a33e339 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:48:06 +0530 Subject: [PATCH 03/11] Removing GenerateModuleCpp https://github.com/facebook/react-native/commit/0fd24c75a15d031c51753c986ee8c32e14fa573a --- .../codegen/src/index.ts | 10 +- .../msrnIntegrationTestsJSI-generated.cpp | 112 ------- .../codegen/msrnIntegrationTestsJSI.h | 278 +++++++----------- 3 files changed, 111 insertions(+), 289 deletions(-) delete mode 100644 vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI-generated.cpp diff --git a/packages/@react-native-windows/codegen/src/index.ts b/packages/@react-native-windows/codegen/src/index.ts index 507732b8eac..37890656c54 100644 --- a/packages/@react-native-windows/codegen/src/index.ts +++ b/packages/@react-native-windows/codegen/src/index.ts @@ -254,10 +254,10 @@ export function generate( rncodegenPath, 'lib/generators/modules/GenerateModuleH', )).generate; - const generateJsiModuleCpp = require(path.resolve( - rncodegenPath, - 'lib/generators/modules/GenerateModuleCpp', - )).generate; + // const generateJsiModuleCpp = require(path.resolve( + // rncodegenPath, + // 'lib/generators/modules/GenerateModuleCpp', + // )).generate; const generatorPropsH = require(path.resolve( rncodegenPath, 'lib/generators/components/GeneratePropsH', @@ -303,7 +303,7 @@ export function generate( if (modulesCxx) { moduleGenerators.push(generateJsiModuleH); - moduleGenerators.push(generateJsiModuleCpp); + // moduleGenerators.push(generateJsiModuleCpp); } if (modulesTypeScriptTypes) { diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI-generated.cpp b/vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI-generated.cpp deleted file mode 100644 index f0e68494f24..00000000000 --- a/vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI-generated.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleCpp.js - */ - -#include "msrnIntegrationTestsJSI.h" - -namespace facebook::react { - -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_logAction(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->logAction( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); -} - -NativeMySimpleTurboModuleCxxCxxSpecJSI::NativeMySimpleTurboModuleCxxCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("MySimpleTurboModuleCxx", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getConstants}; - methodMap_["logAction"] = MethodMetadata {2, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_logAction}; - methodMap_["voidFunc"] = MethodMetadata {0, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_voidFunc}; - methodMap_["getBool"] = MethodMetadata {1, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getBool}; - methodMap_["getNumber"] = MethodMetadata {1, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getNumber}; - methodMap_["getString"] = MethodMetadata {1, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getString}; - methodMap_["getArray"] = MethodMetadata {1, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getArray}; - methodMap_["getObject"] = MethodMetadata {1, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getObject}; - methodMap_["getValue"] = MethodMetadata {3, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getValue}; - methodMap_["getValueWithCallback"] = MethodMetadata {1, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getValueWithCallback}; - methodMap_["getValueWithPromise"] = MethodMetadata {1, __hostFunction_NativeMySimpleTurboModuleCxxCxxSpecJSI_getValueWithPromise}; -} -static jsi::Value __hostFunction_NativeMyTrivialTurboModuleCxxSpecJSI_startFromJS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startFromJS( - rt - ); - return jsi::Value::undefined(); -} - -NativeMyTrivialTurboModuleCxxSpecJSI::NativeMyTrivialTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("MyTrivialTurboModule", jsInvoker) { - methodMap_["startFromJS"] = MethodMetadata {0, __hostFunction_NativeMyTrivialTurboModuleCxxSpecJSI_startFromJS}; -} - - -} // namespace facebook::react diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI.h b/vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI.h index 232c213af4a..c162a137e9b 100644 --- a/vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI.h +++ b/vnext/Microsoft.ReactNative.IntegrationTests/codegen/msrnIntegrationTestsJSI.h @@ -15,201 +15,135 @@ namespace facebook::react { - class JSI_EXPORT NativeMySimpleTurboModuleCxxCxxSpecJSI : public TurboModule { -protected: - NativeMySimpleTurboModuleCxxCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void logAction(jsi::Runtime &rt, jsi::String actionName, jsi::Value value) = 0; - virtual void voidFunc(jsi::Runtime &rt) = 0; - virtual bool getBool(jsi::Runtime &rt, bool arg) = 0; - virtual double getNumber(jsi::Runtime &rt, double arg) = 0; - virtual jsi::String getString(jsi::Runtime &rt, jsi::String arg) = 0; - virtual jsi::Array getArray(jsi::Runtime &rt, jsi::Array arg) = 0; - virtual jsi::Object getObject(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual jsi::Object getValue(jsi::Runtime &rt, double x, jsi::String y, jsi::Object z) = 0; - virtual void getValueWithCallback(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual jsi::Value getValueWithPromise(jsi::Runtime &rt, bool error) = 0; - -}; - template class JSI_EXPORT NativeMySimpleTurboModuleCxxCxxSpec : public TurboModule { public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); + static constexpr std::string_view kModuleName = "MySimpleTurboModuleCxx"; + +protected: + NativeMySimpleTurboModuleCxxCxxSpec(std::shared_ptr jsInvoker) : TurboModule(std::string{NativeMySimpleTurboModuleCxxCxxSpec::kModuleName}, jsInvoker) { + methodMap_["getConstants"] = MethodMetadata {.argCount = 0, .invoker = __getConstants}; + methodMap_["logAction"] = MethodMetadata {.argCount = 2, .invoker = __logAction}; + methodMap_["voidFunc"] = MethodMetadata {.argCount = 0, .invoker = __voidFunc}; + methodMap_["getBool"] = MethodMetadata {.argCount = 1, .invoker = __getBool}; + methodMap_["getNumber"] = MethodMetadata {.argCount = 1, .invoker = __getNumber}; + methodMap_["getString"] = MethodMetadata {.argCount = 1, .invoker = __getString}; + methodMap_["getArray"] = MethodMetadata {.argCount = 1, .invoker = __getArray}; + methodMap_["getObject"] = MethodMetadata {.argCount = 1, .invoker = __getObject}; + methodMap_["getValue"] = MethodMetadata {.argCount = 3, .invoker = __getValue}; + methodMap_["getValueWithCallback"] = MethodMetadata {.argCount = 1, .invoker = __getValueWithCallback}; + methodMap_["getValueWithPromise"] = MethodMetadata {.argCount = 1, .invoker = __getValueWithPromise}; + } + +private: + static jsi::Value __getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) { + static_assert( + bridging::getParameterCount(&T::getConstants) == 1, + "Expected getConstants(...) to have 1 parameters"); + return bridging::callFromJs(rt, &T::getConstants, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule)); } - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); + static jsi::Value __logAction(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::logAction) == 3, + "Expected logAction(...) to have 3 parameters"); + bridging::callFromJs(rt, &T::logAction, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), + count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]));return jsi::Value::undefined(); } - static constexpr std::string_view kModuleName = "MySimpleTurboModuleCxx"; + static jsi::Value __voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) { + static_assert( + bridging::getParameterCount(&T::voidFunc) == 1, + "Expected voidFunc(...) to have 1 parameters"); + bridging::callFromJs(rt, &T::voidFunc, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule));return jsi::Value::undefined(); + } -protected: - NativeMySimpleTurboModuleCxxCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeMySimpleTurboModuleCxxCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} + static jsi::Value __getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getBool) == 2, + "Expected getBool(...) to have 2 parameters"); + return bridging::callFromJs(rt, &T::getBool, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()); + } + static jsi::Value __getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getNumber) == 2, + "Expected getNumber(...) to have 2 parameters"); + return bridging::callFromJs(rt, &T::getNumber, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()); + } -private: - class Delegate : public NativeMySimpleTurboModuleCxxCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeMySimpleTurboModuleCxxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void logAction(jsi::Runtime &rt, jsi::String actionName, jsi::Value value) override { - static_assert( - bridging::getParameterCount(&T::logAction) == 3, - "Expected logAction(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::logAction, jsInvoker_, instance_, std::move(actionName), std::move(value)); - } - void voidFunc(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::voidFunc) == 1, - "Expected voidFunc(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::voidFunc, jsInvoker_, instance_); - } - bool getBool(jsi::Runtime &rt, bool arg) override { - static_assert( - bridging::getParameterCount(&T::getBool) == 2, - "Expected getBool(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getBool, jsInvoker_, instance_, std::move(arg)); - } - double getNumber(jsi::Runtime &rt, double arg) override { - static_assert( - bridging::getParameterCount(&T::getNumber) == 2, - "Expected getNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getNumber, jsInvoker_, instance_, std::move(arg)); - } - jsi::String getString(jsi::Runtime &rt, jsi::String arg) override { - static_assert( - bridging::getParameterCount(&T::getString) == 2, - "Expected getString(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getString, jsInvoker_, instance_, std::move(arg)); - } - jsi::Array getArray(jsi::Runtime &rt, jsi::Array arg) override { - static_assert( - bridging::getParameterCount(&T::getArray) == 2, - "Expected getArray(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getArray, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getObject(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getObject) == 2, - "Expected getObject(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getObject, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getValue(jsi::Runtime &rt, double x, jsi::String y, jsi::Object z) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 4, - "Expected getValue(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(x), std::move(y), std::move(z)); - } - void getValueWithCallback(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getValueWithCallback) == 2, - "Expected getValueWithCallback(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getValueWithCallback, jsInvoker_, instance_, std::move(callback)); - } - jsi::Value getValueWithPromise(jsi::Runtime &rt, bool error) override { - static_assert( - bridging::getParameterCount(&T::getValueWithPromise) == 2, - "Expected getValueWithPromise(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getValueWithPromise, jsInvoker_, instance_, std::move(error)); - } - - private: - friend class NativeMySimpleTurboModuleCxxCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; + static jsi::Value __getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getString) == 2, + "Expected getString(...) to have 2 parameters"); + return bridging::callFromJs(rt, &T::getString, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)); + } + static jsi::Value __getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getArray) == 2, + "Expected getArray(...) to have 2 parameters"); + return bridging::callFromJs(rt, &T::getArray, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt)); + } - class JSI_EXPORT NativeMyTrivialTurboModuleCxxSpecJSI : public TurboModule { -protected: - NativeMyTrivialTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker); + static jsi::Value __getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getObject) == 2, + "Expected getObject(...) to have 2 parameters"); + return bridging::callFromJs(rt, &T::getObject, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)); + } -public: - virtual void startFromJS(jsi::Runtime &rt) = 0; + static jsi::Value __getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getValue) == 4, + "Expected getValue(...) to have 4 parameters"); + return bridging::callFromJs(rt, &T::getValue, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), + count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), + count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt)); + } + + static jsi::Value __getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getValueWithCallback) == 2, + "Expected getValueWithCallback(...) to have 2 parameters"); + bridging::callFromJs(rt, &T::getValueWithCallback, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt));return jsi::Value::undefined(); + } + static jsi::Value __getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_assert( + bridging::getParameterCount(&T::getValueWithPromise) == 2, + "Expected getValueWithPromise(...) to have 2 parameters"); + return bridging::callFromJs(rt, &T::getValueWithPromise, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule), + count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()); + } }; + template class JSI_EXPORT NativeMyTrivialTurboModuleCxxSpec : public TurboModule { public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - static constexpr std::string_view kModuleName = "MyTrivialTurboModule"; protected: - NativeMyTrivialTurboModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeMyTrivialTurboModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - + NativeMyTrivialTurboModuleCxxSpec(std::shared_ptr jsInvoker) : TurboModule(std::string{NativeMyTrivialTurboModuleCxxSpec::kModuleName}, jsInvoker) { + methodMap_["startFromJS"] = MethodMetadata {.argCount = 0, .invoker = __startFromJS}; + } + private: - class Delegate : public NativeMyTrivialTurboModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeMyTrivialTurboModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void startFromJS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startFromJS) == 1, - "Expected startFromJS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startFromJS, jsInvoker_, instance_); - } - - private: - friend class NativeMyTrivialTurboModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; + static jsi::Value __startFromJS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) { + static_assert( + bridging::getParameterCount(&T::startFromJS) == 1, + "Expected startFromJS(...) to have 1 parameters"); + bridging::callFromJs(rt, &T::startFromJS, static_cast(&turboModule)->jsInvoker_, static_cast(&turboModule));return jsi::Value::undefined(); + } }; } // namespace facebook::react From cfbf74bf53c42f545b1961e98027d68496745934 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:01:26 +0530 Subject: [PATCH 04/11] validate overrides and yarn lock update --- .../ContentURLAndroid/ContentURLAndroid.js | 2 +- .../js/examples/Filter/FilterExample.js | 5 - .../LinearGradient/LinearGradientExample.js | 12 +- yarn.lock | 208 +++++++----------- 4 files changed, 85 insertions(+), 142 deletions(-) diff --git a/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js b/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js index 81f88a78bf1..69bce4cd022 100644 --- a/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js +++ b/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js @@ -34,7 +34,7 @@ function blobToBase64(blob: Blob) { if (typeof result === 'string') { resolve(result); } else { - reject('error: incompatible types'); + reject(new Error('error: incompatible types')); } }; reader.readAsDataURL(blob); diff --git a/packages/@react-native/tester/js/examples/Filter/FilterExample.js b/packages/@react-native/tester/js/examples/Filter/FilterExample.js index cb50e374338..7a24f30b25e 100644 --- a/packages/@react-native/tester/js/examples/Filter/FilterExample.js +++ b/packages/@react-native/tester/js/examples/Filter/FilterExample.js @@ -135,7 +135,6 @@ exports.examples = [ title: 'Contrast', description: 'contrast(0.5)', name: 'contrast', - platform: 'android', render(): React.Node { return ( @@ -155,7 +154,6 @@ exports.examples = [ title: 'Grayscale', description: 'grayscale(0.5)', name: 'grayscale', - platform: 'android', render(): React.Node { return ( @@ -166,7 +164,6 @@ exports.examples = [ title: 'Saturate', description: 'saturate(4)', name: 'saturate', - platform: 'android', render(): React.Node { return ; }, @@ -175,7 +172,6 @@ exports.examples = [ title: 'Hue Rotate', description: 'hueRotate(-90deg)', name: 'hueRotate', - platform: 'android', render(): React.Node { return ( Linear Gradient @@ -73,7 +73,7 @@ exports.examples = [ return ( diff --git a/yarn.lock b/yarn.lock index 3036b81e0cd..c324895f515 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,7 +16,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.29.0.tgz#00d03e8c0ac24dd9be942c5370990cbe1f17d88d" integrity sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg== -"@babel/core@^7.0.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.13.16", "@babel/core@^7.22.0", "@babel/core@^7.23.9", "@babel/core@^7.25.2": +"@babel/core@^7.0.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.13.16", "@babel/core@^7.22.0", "@babel/core@^7.23.9", "@babel/core@^7.24.4", "@babel/core@^7.25.2": version "7.29.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.29.0.tgz#5286ad785df7f79d656e88ce86e650d16ca5f322" integrity sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA== @@ -249,7 +249,7 @@ "@babel/template" "^7.28.6" "@babel/types" "^7.28.6" -"@babel/parser@^7.1.0", "@babel/parser@^7.13.16", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.0", "@babel/parser@^7.23.9", "@babel/parser@^7.25.3", "@babel/parser@^7.28.5", "@babel/parser@^7.28.6", "@babel/parser@^7.29.0": +"@babel/parser@^7.1.0", "@babel/parser@^7.13.16", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.0", "@babel/parser@^7.23.9", "@babel/parser@^7.24.4", "@babel/parser@^7.25.3", "@babel/parser@^7.28.5", "@babel/parser@^7.28.6", "@babel/parser@^7.29.0": version "7.29.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.0.tgz#669ef345add7d057e92b7ed15f0bac07611831b6" integrity sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww== @@ -2417,11 +2417,6 @@ resolved "https://registry.yarnpkg.com/@react-native-picker/picker/-/picker-2.11.4.tgz#7fb09506ee00a82989125cc03e8495204c8afc01" integrity sha512-Kf8h1AMnBo54b1fdiVylP2P/iFcZqzpMYcglC28EEFB1DEnOjsNr6Ucqc+3R9e91vHxEDnhZFbYDmAe79P2gjA== -"@react-native/assets-registry@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.83.0-nightly-20251012-6f482708b.tgz#ea42aa216f4c28015878ed70461116830253bbbc" - integrity sha512-ToCYjnTV9Wexs+aqPu4Ib+6T92JXzjtDYwYj6CiCtjHrAIFbVCk49MmJQD/CF3aNp5PvfZ3WUc5FTqdaSKA0ZQ== - "@react-native/assets-registry@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.83.0-nightly-20251104-502efe1cc.tgz#8f4d5f45b1d624e8dc373435b6187d00feedfe57" @@ -2432,18 +2427,18 @@ resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e" integrity sha512-KrwSpS1tKI70wuKl68DwJZYEvXktDHdZMG0k2AXD/rJVSlB23/X2CB2cutVR0HwNMJIal9HOUOBB2rVfa6UGtQ== -"@react-native/babel-plugin-codegen@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.83.0-nightly-20251012-6f482708b.tgz#39068736c22a5e8832b14e611d17e5136e608661" - integrity sha512-XEh3WM+cuGcHNLG7HlBBNKuMoMSpPzz7UdENgdbqccMuzxVvcdDgrbjhI6h2mSaomPmwOPjEfTHPhiziwE2mfA== +"@react-native/babel-plugin-codegen@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.83.0-nightly-20251104-502efe1cc.tgz#92f61d8d8f9dd5fee88c5be7d0fba5e3eed43412" + integrity sha512-sUhUtgBrhEDTk5h4FeByQX5RqZFqZqElSTieKiRF9oPBZm2Jjk4K+uf2//XJvsYLup07GlgICQ1Z++X6Mgf8Vg== dependencies: "@babel/traverse" "^7.25.3" - "@react-native/codegen" "0.83.0-nightly-20251012-6f482708b" + "@react-native/codegen" "0.83.0-nightly-20251104-502efe1cc" -"@react-native/babel-preset@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.83.0-nightly-20251012-6f482708b.tgz#15272899652aa2e1212e444d5f3d77abca3b0ab9" - integrity sha512-zfoqwtIMjhB2MlqgazPP18YsyunUHL4RFlIS60uV7rrqzKPxFCz3lVIn52ungjgPABdTE07WTsmRbKWjze3Emw== +"@react-native/babel-preset@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.83.0-nightly-20251104-502efe1cc.tgz#e8b0f1e510eb07a4ea9f3f1a86b8673ed43c419d" + integrity sha512-hBfvEKgXb90+jsQVzlhPluFGr4+Kiy49WvheMVULQ0Tz8budP2Hz/0851VBdcHHBn/p4G8lKhlDCPTeiY1o7ag== dependencies: "@babel/core" "^7.25.2" "@babel/plugin-proposal-export-default-from" "^7.24.7" @@ -2486,24 +2481,11 @@ "@babel/plugin-transform-typescript" "^7.25.2" "@babel/plugin-transform-unicode-regex" "^7.24.7" "@babel/template" "^7.25.0" - "@react-native/babel-plugin-codegen" "0.83.0-nightly-20251012-6f482708b" + "@react-native/babel-plugin-codegen" "0.83.0-nightly-20251104-502efe1cc" babel-plugin-syntax-hermes-parser "0.32.0" babel-plugin-transform-flow-enums "^0.0.2" react-refresh "^0.14.0" -"@react-native/codegen@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.83.0-nightly-20251012-6f482708b.tgz#eb2a6e6430e290443bda403e37cd7744a8866472" - integrity sha512-CkWyKkJ0pnhuc6bWrSST54LbG9Ck3j23bVmztsRl2mGhSjANfLUrMMiTpiUW6Rd+1bX1S1ArlXNtE0Umb+c5tw== - dependencies: - "@babel/core" "^7.25.2" - "@babel/parser" "^7.25.3" - glob "^7.1.1" - hermes-parser "0.32.0" - invariant "^2.2.4" - nullthrows "^1.1.1" - yargs "^17.6.2" - "@react-native/codegen@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.83.0-nightly-20251104-502efe1cc.tgz#effa08722928c682bb6fe4cba8feedb2f9b60ea6" @@ -2517,19 +2499,6 @@ nullthrows "^1.1.1" yargs "^17.6.2" -"@react-native/community-cli-plugin@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.83.0-nightly-20251012-6f482708b.tgz#893b2598412f6dd12be581716ef7bc3da5300dde" - integrity sha512-4ggWsC9Ijxd8m2u91PJPfDwUKcfXBnaW+xbh7lRx1zFDL2V3H+DD+hpWmWyoPTXv8lZqV5s4XEGG5i52gMTLlw== - dependencies: - "@react-native/dev-middleware" "0.83.0-nightly-20251012-6f482708b" - debug "^4.4.0" - invariant "^2.2.4" - metro "^0.83.3" - metro-config "^0.83.3" - metro-core "^0.83.3" - semver "^7.1.3" - "@react-native/community-cli-plugin@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.83.0-nightly-20251104-502efe1cc.tgz#2f4c30c9bbdd8b9b4930a194deef4f1c7ca17e11" @@ -2543,24 +2512,11 @@ metro-core "^0.83.3" semver "^7.1.3" -"@react-native/debugger-frontend@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.83.0-nightly-20251012-6f482708b.tgz#fabc17792c69f2ff9c5a375f27e9e81ff0437e2d" - integrity sha512-iDwRBiEVqqqlOi0xhtzmrttwp53aTRb3U66P/0mBEYqIeGTgxZ37kI2lzxqyyITI5EcCNOUl/47w8stR4asLfw== - "@react-native/debugger-frontend@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.83.0-nightly-20251104-502efe1cc.tgz#0453bf2eb3c40c296b6ade448794ce29e6b1aa60" integrity sha512-YyAC8vJTuxg2bVhQij6zNKH+qcHpn+3S0cK72Fyapgh96BdwG6Lr4upAYqQJnI+8rA8Ram/BUchDqkT2HWEcBA== -"@react-native/debugger-shell@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/debugger-shell/-/debugger-shell-0.83.0-nightly-20251012-6f482708b.tgz#490d9bbf98aebd841fa53019f0d7878c20772d95" - integrity sha512-ptlUK1v/DZopiVKJdqCifBKedGGxJpb0aRnu40kWWClJhqy6znI9YIHcVVFcph1VzTw7Pa70NEHP18CqPr3teQ== - dependencies: - cross-spawn "^7.0.6" - fb-dotslash "0.5.8" - "@react-native/debugger-shell@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/debugger-shell/-/debugger-shell-0.83.0-nightly-20251104-502efe1cc.tgz#980416fba85bfb8ab1eb8fac45336c11e84b0e3c" @@ -2569,24 +2525,6 @@ cross-spawn "^7.0.6" fb-dotslash "0.5.8" -"@react-native/dev-middleware@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.83.0-nightly-20251012-6f482708b.tgz#7c487b42c57928d4a1b824840fd3a126065c4ffe" - integrity sha512-cjr4L62EZu+VselhnF29FEGgzcB65Gx12ObiQu0pWXQ3oJUxJMGAaHBO3/AmWlkU59mUzpmgeyjUrMZBwd6Luw== - dependencies: - "@isaacs/ttlcache" "^1.4.1" - "@react-native/debugger-frontend" "0.83.0-nightly-20251012-6f482708b" - "@react-native/debugger-shell" "0.83.0-nightly-20251012-6f482708b" - chrome-launcher "^0.15.2" - chromium-edge-launcher "^0.2.0" - connect "^3.6.5" - debug "^4.4.0" - invariant "^2.2.4" - nullthrows "^1.1.1" - open "^7.0.3" - serve-static "^1.16.2" - ws "^7.5.10" - "@react-native/dev-middleware@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.83.0-nightly-20251104-502efe1cc.tgz#f46dad915f30c4ff7b355175379ae890101dcead" @@ -2605,14 +2543,14 @@ serve-static "^1.16.2" ws "^7.5.10" -"@react-native/eslint-config@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/eslint-config/-/eslint-config-0.83.0-nightly-20251012-6f482708b.tgz#060e866a40a1c364eaefc5f716789323d536ef38" - integrity sha512-qs2/20PuBN8hiGktT3OInZ2TY9W9+rzVaFyBJARUI/6LL8fya+1vF+rRzPrVBD5vUbtMrm1JONVhBUd7TpOIuw== +"@react-native/eslint-config@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/eslint-config/-/eslint-config-0.83.0-nightly-20251104-502efe1cc.tgz#59bddce6ff9c38084fa2867df097b8f915ad2975" + integrity sha512-F8T8h/B+wPveGFewGT3cmJn9ZxwRfl3ua1S1vBw3ZSFdM2IwdBScrBWQ/ZHistctOcv/WNlKpg6QtF7AVloBXw== dependencies: "@babel/core" "^7.25.2" "@babel/eslint-parser" "^7.25.1" - "@react-native/eslint-plugin" "0.83.0-nightly-20251012-6f482708b" + "@react-native/eslint-plugin" "0.83.0-nightly-20251104-502efe1cc" "@typescript-eslint/eslint-plugin" "^8.36.0" "@typescript-eslint/parser" "^8.36.0" eslint-config-prettier "^8.5.0" @@ -2620,51 +2558,41 @@ eslint-plugin-ft-flow "^2.0.1" eslint-plugin-jest "^29.0.1" eslint-plugin-react "^7.30.1" - eslint-plugin-react-hooks "^5.2.0" + eslint-plugin-react-hooks "^7.0.1" eslint-plugin-react-native "^4.0.0" -"@react-native/eslint-plugin@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/eslint-plugin/-/eslint-plugin-0.83.0-nightly-20251012-6f482708b.tgz#09843e4a5ea492cf915e848f1836dfdfef20bb9f" - integrity sha512-meflGWvM3vjQEiIJMTDzlbdercs/d9vl/RymW2jYFu+YcoBToUt1FXGAcDaLh6rB722mFxmK+71l5IHw8Kjh8A== - -"@react-native/gradle-plugin@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.83.0-nightly-20251012-6f482708b.tgz#1656b7d7943c73b1b5fa86a8ae29721e6a67a096" - integrity sha512-B+thkpA3Kx7ESKyyDEGxLOw/lfQwwqR272DmaM7g3Xp4kY760xr9ky2H/qK3Cy89fZXNOUWGOImgEWrCaY6QKg== +"@react-native/eslint-plugin@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/eslint-plugin/-/eslint-plugin-0.83.0-nightly-20251104-502efe1cc.tgz#2bbe330341b9bc04dc8c9b0fb756ba7361bddd77" + integrity sha512-SGuxfzuJo/PPMO5BUSWs2HuYLWM2dRjC3LvCGiFsLCZddtPhNIfL247mnMXb7k1GEiv+q3OL0kFJd3DWgd35+g== "@react-native/gradle-plugin@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.83.0-nightly-20251104-502efe1cc.tgz#f91846863f98506c7f260eed66ec2bffa10d5082" integrity sha512-B++pfoh0/I+PHS9xCF9jFB2wV1i2PlyQ0fbeUpGg90hiM+DVmFdWbtvVGh3NGQsuelPbeuCxNizjdklYcXawVg== -"@react-native/js-polyfills@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.83.0-nightly-20251012-6f482708b.tgz#c5dfe91a9bb3ebb1974e74d93425aa82ffc564de" - integrity sha512-PbzaH7/PQ8ocpgbdg6uIU0pilXfknhvUs3OxtFSWq3TrTzW+FXm+ultia1Oy1txMKtk1s7kmxjTp3NXUNBUqqA== - "@react-native/js-polyfills@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.83.0-nightly-20251104-502efe1cc.tgz#f388af658bf8586c9d7d48d5d6201ebcbe7bd83f" integrity sha512-O4a0C1H5BU7h30xb72x4+8XLu3vEId07UCkMk5Hfwts3eANarKOajD8tCk9Abo5eN13S4AmYvn00+DZ1in+/Vw== -"@react-native/metro-babel-transformer@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.83.0-nightly-20251012-6f482708b.tgz#e42f81108642f85a219af6542a72088812d66dfa" - integrity sha512-qRCFVANshUaomZB7Vyv05HiZ5VaSeA+GjQc+2cgpW1olvO/v2PHKS7Jk2Pcrxf52zTJcNIqsxCXdBO9iwYWHWQ== +"@react-native/metro-babel-transformer@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.83.0-nightly-20251104-502efe1cc.tgz#1a7a4ac382203add3d56905b2d90f6f6d26baf4d" + integrity sha512-HPuWgera/eK+fasFHOlbLP7/uW7G5JHf7FXjlCOXB57bzaTINC7i2o4QyH+dpQJkDn1E4bElAjJyrXTPe7wDpg== dependencies: "@babel/core" "^7.25.2" - "@react-native/babel-preset" "0.83.0-nightly-20251012-6f482708b" + "@react-native/babel-preset" "0.83.0-nightly-20251104-502efe1cc" hermes-parser "0.32.0" nullthrows "^1.1.1" -"@react-native/metro-config@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/metro-config/-/metro-config-0.83.0-nightly-20251012-6f482708b.tgz#352a082d8a9e1b202648d7a78277483d9dc9663a" - integrity sha512-6D22QoAfvVPCwa5pIxcvFIX6ck5Z2IxTgVIhxWIxlCgQ6cAxUD1yXkds/A8samOPoJupEIR3XJtxDe9+UT+wow== +"@react-native/metro-config@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/metro-config/-/metro-config-0.83.0-nightly-20251104-502efe1cc.tgz#29f6c51c09d3d6abb07a2b17ee33d8e39056d33c" + integrity sha512-bJaohnAlwSTo+2oE9ykErlHeJpZZXQq8YUJPJ8JOU8768DODAXYJsQ7e70y+AGGvYGXe/Hfsvy4MjQ8MZz+gZw== dependencies: - "@react-native/js-polyfills" "0.83.0-nightly-20251012-6f482708b" - "@react-native/metro-babel-transformer" "0.83.0-nightly-20251012-6f482708b" + "@react-native/js-polyfills" "0.83.0-nightly-20251104-502efe1cc" + "@react-native/metro-babel-transformer" "0.83.0-nightly-20251104-502efe1cc" metro-config "^0.83.3" metro-runtime "^0.83.3" @@ -2673,34 +2601,21 @@ resolved "https://registry.yarnpkg.com/@react-native/new-app-screen/-/new-app-screen-0.82.0-nightly-20250821-0ef21bf8a.tgz#f7b64f7bd93945bdea0d597d973b11d079bbceb9" integrity sha512-IcNqFAgsUTEt/GxJDW7PaoOS2Sn3iTQijnPGCIBkmlo/PBlnOzOZOXT6nz58aVdWYbHVh9+WTuItv/dpeKgzMg== -"@react-native/new-app-screen@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/new-app-screen/-/new-app-screen-0.83.0-nightly-20251012-6f482708b.tgz#4e38467bcc76b41449aa0eb1bcb94eaced8b6c8c" - integrity sha512-ktiguCng4McPXdcPhPVxYqiv8a9RkSukwkPLiVPU/sosxkEK5Ozn1THOPwhDYEizrG25k2t40986ksa/axao1g== - -"@react-native/normalize-colors@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.83.0-nightly-20251012-6f482708b.tgz#59979dd490bcce94cc14eb570fc418476d304a84" - integrity sha512-7cXFv5T44g8qEACrpbsewVGpruLYJVCHdCua0Ti2c4L95oyrNSsi51LpUIPXgO7A0Lx66TIfGxmpB4KO3K94fg== +"@react-native/new-app-screen@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/new-app-screen/-/new-app-screen-0.83.0-nightly-20251104-502efe1cc.tgz#595341f37a728ee7cefd75ffa9e27cb0e31329c1" + integrity sha512-ejQGZTEuplwoU+AZ6C+CiThzAbm96+do3AVGRYLht6Dcw47aiVdbtMn77+aqdFtadW+iGWkxCSrmls3grzFUog== "@react-native/normalize-colors@0.83.0-nightly-20251104-502efe1cc": version "0.83.0-nightly-20251104-502efe1cc" resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.83.0-nightly-20251104-502efe1cc.tgz#60be84b59e60cf43d95db29f4793a09952e95828" integrity sha512-LVJuk+/CA5TpzCLkFQP6klKjnSRG0mNv1O5C7pLFSBDfChpkbTuZBow07GcHR0lkha71vFQDsMTaMsDhbCJSDw== -"@react-native/popup-menu-android@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/popup-menu-android/-/popup-menu-android-0.83.0-nightly-20251012-6f482708b.tgz#45c430494c1741f41416db13e03e9a46adeb0226" - integrity sha512-/yAm0wqOWsIp3FsKQZVpNSwZt8cvucl7v6R1p7hHGXHXX8ZNxdeR/3MmjeHH1ecyWe0wnMWyByRTa6tuV2ZMRQ== - dependencies: - nullthrows "^1.1.1" - -"@react-native/virtualized-lists@0.83.0-nightly-20251012-6f482708b": - version "0.83.0-nightly-20251012-6f482708b" - resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.83.0-nightly-20251012-6f482708b.tgz#54e72c5b079d6957c34629a4ca42f95c93c49bd5" - integrity sha512-l4awg00aSdobMmqEvfBimI++GXebH0BV8CtZ84l5RTAI8dvjDPVqKHS4HX4XGKniIBT2RqCgEH4FtNxUnzGiNw== +"@react-native/popup-menu-android@0.83.0-nightly-20251104-502efe1cc": + version "0.83.0-nightly-20251104-502efe1cc" + resolved "https://registry.yarnpkg.com/@react-native/popup-menu-android/-/popup-menu-android-0.83.0-nightly-20251104-502efe1cc.tgz#e213f8a1d27caa46dce3620a56642a4c26ee8762" + integrity sha512-jExeIni0ZZta4UYuGlpCtzIJ8gyVM2UumwH9Po4pCiFnPPWr29/mg0K2ooTKJO+HQYE2o/qs+565F4zfhGv6NA== dependencies: - invariant "^2.2.4" nullthrows "^1.1.1" "@react-native/virtualized-lists@0.83.0-nightly-20251104-502efe1cc": @@ -6138,10 +6053,16 @@ eslint-plugin-node@11.1.0: resolve "^1.10.1" semver "^6.1.0" -eslint-plugin-react-hooks@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz#1be0080901e6ac31ce7971beed3d3ec0a423d9e3" - integrity sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg== +eslint-plugin-react-hooks@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz#66e258db58ece50723ef20cc159f8aa908219169" + integrity sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA== + dependencies: + "@babel/core" "^7.24.4" + "@babel/parser" "^7.24.4" + hermes-parser "^0.25.1" + zod "^3.25.0 || ^4.0.0" + zod-validation-error "^3.5.0 || ^4.0.0" eslint-plugin-react-native-globals@^0.1.1: version "0.1.2" @@ -6744,6 +6665,11 @@ flow-bin@^0.287.0: resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.287.0.tgz#b4a5714cb38e603986a07c62e4d8a4c61c35708c" integrity sha512-GYASmje2SOjhSm6Xr7itYbeiAmPm+lNzF/vAHsFE8aj7lCCPnLE6YePj6mVZEZKqqtRmP5SbPA5+mOxog/o/RA== +flow-bin@^0.289.0: + version "0.289.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.289.0.tgz#f6b64db7fc7e77ee3ec2f994339d41d22934fdd5" + integrity sha512-xNmTDLq6TkHa3LvNWHF9lcnKmtBlxZstEWXo7p0KXRzrtHNAAWJGDFyidz7E0IEw95VxxjNZhgiTYGDOIAWPPw== + flow-enums-runtime@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz#5bb0cd1b0a3e471330f4d109039b7eba5cb3e787" @@ -7325,6 +7251,11 @@ hermes-estree@0.23.1: resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.23.1.tgz#d0bac369a030188120ee7024926aabe5a9f84fdb" integrity sha512-eT5MU3f5aVhTqsfIReZ6n41X5sYn4IdQL0nvz6yO+MMlPxw49aSARHLg/MSehQftyjnrE8X6bYregzSumqc6cg== +hermes-estree@0.25.1: + version "0.25.1" + resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.25.1.tgz#6aeec17d1983b4eabf69721f3aa3eb705b17f480" + integrity sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw== + hermes-estree@0.32.0: version "0.32.0" resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.32.0.tgz#bb7da6613ab8e67e334a1854ea1e209f487d307b" @@ -7351,6 +7282,13 @@ hermes-parser@0.32.0: dependencies: hermes-estree "0.32.0" +hermes-parser@^0.25.1: + version "0.25.1" + resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.25.1.tgz#5be0e487b2090886c62bd8a11724cd766d5f54d1" + integrity sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA== + dependencies: + hermes-estree "0.25.1" + hermes-transform@0.32.0: version "0.32.0" resolved "https://registry.yarnpkg.com/hermes-transform/-/hermes-transform-0.32.0.tgz#c484df51282a3677352dfae84bee413973ddb637" @@ -13370,7 +13308,17 @@ zip-stream@^4.1.0: compress-commons "^4.1.2" readable-stream "^3.6.0" +"zod-validation-error@^3.5.0 || ^4.0.0": + version "4.0.2" + resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-4.0.2.tgz#bc605eba49ce0fcd598c127fee1c236be3f22918" + integrity sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ== + zod@^3.24.1: version "3.25.76" resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34" integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ== + +"zod@^3.25.0 || ^4.0.0": + version "4.3.6" + resolved "https://registry.yarnpkg.com/zod/-/zod-4.3.6.tgz#89c56e0aa7d2b05107d894412227087885ab112a" + integrity sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg== From ba59c56e350dd3ff35900b159c90055f444f7070 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:01:58 +0530 Subject: [PATCH 05/11] Change files --- ...-native-win32-a9ce0fd5-6486-458a-842d-ea0c9043bcfc.json | 7 +++++++ ...ation-channel-326f050b-a2ad-4d13-8b6c-cf9d51a4c379.json | 7 +++++++ ...ndows-codegen-85405c44-bfd9-4d12-aca6-ef64ffb73d42.json | 7 +++++++ ...ative-windows-406791d1-5175-4d3b-8671-0c26e71487cd.json | 7 +++++++ 4 files changed, 28 insertions(+) create mode 100644 change/@office-iss-react-native-win32-a9ce0fd5-6486-458a-842d-ea0c9043bcfc.json create mode 100644 change/@react-native-windows-automation-channel-326f050b-a2ad-4d13-8b6c-cf9d51a4c379.json create mode 100644 change/@react-native-windows-codegen-85405c44-bfd9-4d12-aca6-ef64ffb73d42.json create mode 100644 change/react-native-windows-406791d1-5175-4d3b-8671-0c26e71487cd.json diff --git a/change/@office-iss-react-native-win32-a9ce0fd5-6486-458a-842d-ea0c9043bcfc.json b/change/@office-iss-react-native-win32-a9ce0fd5-6486-458a-842d-ea0c9043bcfc.json new file mode 100644 index 00000000000..ef3b9418f70 --- /dev/null +++ b/change/@office-iss-react-native-win32-a9ce0fd5-6486-458a-842d-ea0c9043bcfc.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate 0.83.0-nightly-20251104-502efe1cc", + "packageName": "@office-iss/react-native-win32", + "email": "66076509+vineethkuttan@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-automation-channel-326f050b-a2ad-4d13-8b6c-cf9d51a4c379.json b/change/@react-native-windows-automation-channel-326f050b-a2ad-4d13-8b6c-cf9d51a4c379.json new file mode 100644 index 00000000000..da9ab5891c2 --- /dev/null +++ b/change/@react-native-windows-automation-channel-326f050b-a2ad-4d13-8b6c-cf9d51a4c379.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate 0.83.0-nightly-20251104-502efe1cc", + "packageName": "@react-native-windows/automation-channel", + "email": "66076509+vineethkuttan@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-codegen-85405c44-bfd9-4d12-aca6-ef64ffb73d42.json b/change/@react-native-windows-codegen-85405c44-bfd9-4d12-aca6-ef64ffb73d42.json new file mode 100644 index 00000000000..bdc694ed4f9 --- /dev/null +++ b/change/@react-native-windows-codegen-85405c44-bfd9-4d12-aca6-ef64ffb73d42.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate 0.83.0-nightly-20251104-502efe1cc", + "packageName": "@react-native-windows/codegen", + "email": "66076509+vineethkuttan@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-406791d1-5175-4d3b-8671-0c26e71487cd.json b/change/react-native-windows-406791d1-5175-4d3b-8671-0c26e71487cd.json new file mode 100644 index 00000000000..d5ad67668fa --- /dev/null +++ b/change/react-native-windows-406791d1-5175-4d3b-8671-0c26e71487cd.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Integrate 0.83.0-nightly-20251104-502efe1cc", + "packageName": "react-native-windows", + "email": "66076509+vineethkuttan@users.noreply.github.com", + "dependentChangeType": "patch" +} From 02d50c401191e391a4089f8d93ada280a5c71394 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:18:25 +0530 Subject: [PATCH 06/11] format files using prettier --- .../src-win/Libraries/Components/View/ViewWin32.d.ts | 3 +-- .../TextInput/WindowsTextInputComponentDescriptor.h | 7 +++---- .../Composition/TextInput/WindowsTextInputShadowNode.h | 3 +-- .../Fabric/Composition/TextInput/WindowsTextInputState.h | 4 +--- .../TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h | 8 ++++---- .../react/renderer/components/image/conversions.h | 3 ++- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts index eaaa6533149..d681d27f128 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts @@ -19,8 +19,7 @@ import {HostInstance} from 'react-native/types/public/ReactNativeTypes'; * whether that is a UIView,
, android.view, etc. */ declare class ViewWin32Component extends React.Component {} -declare const ViewWin32Base: Constructor & - typeof ViewWin32Component; +declare const ViewWin32Base: Constructor & typeof ViewWin32Component; export class ViewWin32 extends ViewWin32Base { /** * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h index c1ec8027982..aaa50fd668b 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h @@ -67,10 +67,9 @@ virtual State::Shared createInitialState( textInputShadowNode.setTextLayoutManager(textLayoutManager_); /* - int surfaceId = textInputShadowNode.getSurfaceId(); - if (surfaceIdToThemePaddingMap_.find(surfaceId) != - surfaceIdToThemePaddingMap_.end()) { - const auto& theme = surfaceIdToThemePaddingMap_[surfaceId]; + int surfaceId = textInputShadowNode.getSurfaceId(); + if (surfaceIdToThemePaddingMap_.find(surfaceId) != surfaceIdToThemePaddingMap_.end()) { + const auto &theme = surfaceIdToThemePaddingMap_[surfaceId]; auto &textInputProps = textInputShadowNode.getConcreteProps(); diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h index 094cc2dea51..95ca1149fd9 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h @@ -30,8 +30,7 @@ class WindowsTextInputShadowNode final : public ConcreteViewShadowNode< public: using ConcreteViewShadowNode::ConcreteViewShadowNode; - static ShadowNodeTraits BaseTraits() - { + static ShadowNodeTraits BaseTraits() { auto traits = ConcreteViewShadowNode::BaseTraits(); traits.set(ShadowNodeTraits::Trait::LeafYogaNode); traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode); diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h index 9a88aebd5ee..a1ff376ddf4 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h @@ -32,9 +32,7 @@ class WindowsTextInputState final { : attributedStringBox(std::move(attributedStringBox)), reactTreeAttributedString(std::move(reactTreeAttributedString)), paragraphAttributes(std::move(paragraphAttributes)), - mostRecentEventCount(mostRecentEventCount) - { - } + mostRecentEventCount(mostRecentEventCount) {} WindowsTextInputState(const WindowsTextInputState &previousState, const folly::dynamic &data) : attributedStringBox(previousState.attributedStringBox), diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h index f03d9fa4b51..99b6e413263 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h @@ -84,10 +84,10 @@ using TraceSectionUnwrapped = TraceSection; struct ConcreteTraceSection { public: template - explicit ConcreteTraceSection( - const char* name, - ConvertsToStringPiece&&... args) - : m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...) {} // [Windows][issue #14819] + explicit ConcreteTraceSection(const char *name, ConvertsToStringPiece &&...args) + : m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...) // [Windows][issue #14819] + { + } private: fbsystrace::FbSystraceSection m_section; diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h index daa9a96fa12..a6edeb9ff73 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h @@ -18,7 +18,8 @@ namespace facebook::react { -inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) { +inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) +{ if (value.hasType()) { result = { /* .type = */ ImageSource::Type::Remote, From 48e7a08931a59be27cc8709a511b7c6aea3d6900 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:39:53 +0530 Subject: [PATCH 07/11] Build fixes --- packages/@office-iss/react-native-win32/package.json | 2 +- .../src-win/Libraries/Components/View/ViewWin32.d.ts | 3 ++- vnext/ReactCommon/ReactCommon.vcxproj | 3 +++ vnext/Shared/Shared.vcxitems | 5 ++++- vnext/Shared/Shared.vcxitems.filters | 4 ++++ vnext/package.json | 2 +- vnext/src-win/Libraries/Components/View/View.windows.js | 1 - yarn.lock | 5 ----- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/@office-iss/react-native-win32/package.json b/packages/@office-iss/react-native-win32/package.json index 83ba6e39918..6e2fdce2449 100644 --- a/packages/@office-iss/react-native-win32/package.json +++ b/packages/@office-iss/react-native-win32/package.json @@ -83,7 +83,7 @@ "@types/prop-types": "15.7.1", "@types/react": "^19.2.0", "eslint": "^8.19.0", - "flow-bin": "^0.287.0", + "flow-bin": "^0.289.0", "jscodeshift": "^0.14.0", "just-scripts": "^1.3.3", "prettier": "2.8.8", diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts index d681d27f128..eaaa6533149 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewWin32.d.ts @@ -19,7 +19,8 @@ import {HostInstance} from 'react-native/types/public/ReactNativeTypes'; * whether that is a UIView,
, android.view, etc. */ declare class ViewWin32Component extends React.Component {} -declare const ViewWin32Base: Constructor & typeof ViewWin32Component; +declare const ViewWin32Base: Constructor & + typeof ViewWin32Component; export class ViewWin32 extends ViewWin32Base { /** * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) diff --git a/vnext/ReactCommon/ReactCommon.vcxproj b/vnext/ReactCommon/ReactCommon.vcxproj index 8d4d8f4472d..dcaa5fa8431 100644 --- a/vnext/ReactCommon/ReactCommon.vcxproj +++ b/vnext/ReactCommon/ReactCommon.vcxproj @@ -136,6 +136,7 @@ + @@ -144,6 +145,7 @@ + @@ -180,6 +182,7 @@ + diff --git a/vnext/Shared/Shared.vcxitems b/vnext/Shared/Shared.vcxitems index aa565c120e0..4a40df5327b 100644 --- a/vnext/Shared/Shared.vcxitems +++ b/vnext/Shared/Shared.vcxitems @@ -20,7 +20,6 @@ $(IntDir)\codegenRnwCoreProps.obj - $(ReactNativeWindowsDir)Microsoft.ReactNative\Composition.Input.idl @@ -404,6 +403,7 @@ + @@ -423,9 +423,11 @@ + + @@ -551,6 +553,7 @@ + diff --git a/vnext/Shared/Shared.vcxitems.filters b/vnext/Shared/Shared.vcxitems.filters index f506fe23da2..8cd5278e642 100644 --- a/vnext/Shared/Shared.vcxitems.filters +++ b/vnext/Shared/Shared.vcxitems.filters @@ -242,8 +242,10 @@ + + @@ -276,6 +278,7 @@ + @@ -289,6 +292,7 @@ + diff --git a/vnext/package.json b/vnext/package.json index ba62df4295f..bf9fbb7d94f 100644 --- a/vnext/package.json +++ b/vnext/package.json @@ -79,7 +79,7 @@ "@types/node": "^22.14.0", "@types/react": "^19.2.0", "eslint": "^8.19.0", - "flow-bin": "^0.287.0", + "flow-bin": "^0.289.0", "jscodeshift": "^0.14.0", "just-scripts": "^1.3.3", "prettier": "2.8.8", diff --git a/vnext/src-win/Libraries/Components/View/View.windows.js b/vnext/src-win/Libraries/Components/View/View.windows.js index 80d0fe8971b..b29b5738341 100644 --- a/vnext/src-win/Libraries/Components/View/View.windows.js +++ b/vnext/src-win/Libraries/Components/View/View.windows.js @@ -66,7 +66,6 @@ component View( ref?: React.RefSetter>, ...props: ViewProps ) { - // eslint-disable-next-line react-hooks/rules-of-hooks const hasTextAncestor = use(TextAncestorContext); let actualView; diff --git a/yarn.lock b/yarn.lock index c324895f515..1303fa54ce6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6660,11 +6660,6 @@ flow-api-translator@0.32.0: hermes-transform "0.32.0" typescript "5.3.2" -flow-bin@^0.287.0: - version "0.287.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.287.0.tgz#b4a5714cb38e603986a07c62e4d8a4c61c35708c" - integrity sha512-GYASmje2SOjhSm6Xr7itYbeiAmPm+lNzF/vAHsFE8aj7lCCPnLE6YePj6mVZEZKqqtRmP5SbPA5+mOxog/o/RA== - flow-bin@^0.289.0: version "0.289.0" resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.289.0.tgz#f6b64db7fc7e77ee3ec2f994339d41d22934fdd5" From 61392d901dd036b3abe456de1f5ace8571954811 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:47:55 +0530 Subject: [PATCH 08/11] build fixes --- vnext/ReactCommon/ReactCommon.vcxproj | 5 +++++ vnext/Shared/Shared.vcxitems | 1 - vnext/Shared/Shared.vcxitems.filters | 2 -- vnext/stubs/double-conversion/double-conversion.h | 5 +++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/vnext/ReactCommon/ReactCommon.vcxproj b/vnext/ReactCommon/ReactCommon.vcxproj index dcaa5fa8431..bc40fad1969 100644 --- a/vnext/ReactCommon/ReactCommon.vcxproj +++ b/vnext/ReactCommon/ReactCommon.vcxproj @@ -91,6 +91,7 @@ + @@ -176,6 +177,10 @@ + + + + diff --git a/vnext/Shared/Shared.vcxitems b/vnext/Shared/Shared.vcxitems index 4a40df5327b..76ce3ab6f74 100644 --- a/vnext/Shared/Shared.vcxitems +++ b/vnext/Shared/Shared.vcxitems @@ -553,7 +553,6 @@ - diff --git a/vnext/Shared/Shared.vcxitems.filters b/vnext/Shared/Shared.vcxitems.filters index 8cd5278e642..d06e5f75107 100644 --- a/vnext/Shared/Shared.vcxitems.filters +++ b/vnext/Shared/Shared.vcxitems.filters @@ -242,7 +242,6 @@ - @@ -289,7 +288,6 @@ - diff --git a/vnext/stubs/double-conversion/double-conversion.h b/vnext/stubs/double-conversion/double-conversion.h index df66e9160d2..9e60ecf8776 100644 --- a/vnext/stubs/double-conversion/double-conversion.h +++ b/vnext/stubs/double-conversion/double-conversion.h @@ -32,6 +32,11 @@ class StringBuilder { return m_buffer; // Returns char* that will convert to std::string } + void AddCharacter(char c) { + DCHECK(c != '\0'); + m_ss.put(c); + } + char *m_buffer; std::stringstream m_ss; }; From cdc87076203395b19d33dc3df828c63c0c843e1c Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:50:29 +0530 Subject: [PATCH 09/11] update snapshot --- .../test/__snapshots__/HomeUIADump.test.ts.snap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap b/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap index 970c9776541..522da9921d5 100644 --- a/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap +++ b/packages/e2e-test-app-fabric/test/__snapshots__/HomeUIADump.test.ts.snap @@ -4839,7 +4839,7 @@ exports[`Home UIA Tree Dump RTLExample 1`] = ` }, "Comment": "RTLExample", "Offset": "0, 0, 0", - "Size": "966, 78", + "Size": "966, 77", "Visual Type": "SpriteVisual", "__Children": [ { @@ -5354,7 +5354,7 @@ exports[`Home UIA Tree Dump Share 1`] = ` }, "Comment": "Share", "Offset": "0, 0, 0", - "Size": "966, 77", + "Size": "966, 78", "Visual Type": "SpriteVisual", "__Children": [ { @@ -6331,12 +6331,12 @@ exports[`Home UIA Tree Dump URL 1`] = ` "__Children": [ { "Offset": "16, 16, 0", - "Size": "32, 25", + "Size": "32, 24", "Visual Type": "SpriteVisual", "__Children": [ { "Offset": "0, 0, 0", - "Size": "32, 25", + "Size": "32, 24", "Visual Type": "SpriteVisual", }, ], @@ -6493,12 +6493,12 @@ exports[`Home UIA Tree Dump WebSocket 1`] = ` "__Children": [ { "Offset": "16, 16, 0", - "Size": "89, 24", + "Size": "89, 25", "Visual Type": "SpriteVisual", "__Children": [ { "Offset": "0, 0, 0", - "Size": "89, 24", + "Size": "89, 25", "Visual Type": "SpriteVisual", }, ], From 6c5a8f8e41de64343050af638b208b1b13383f23 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Wed, 25 Feb 2026 15:47:23 +0530 Subject: [PATCH 10/11] universal build fix --- .../JsiSimpleTurboModuleTests.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/JsiSimpleTurboModuleTests.cpp b/vnext/Microsoft.ReactNative.IntegrationTests/JsiSimpleTurboModuleTests.cpp index 2ff960803ef..7943ee88dab 100644 --- a/vnext/Microsoft.ReactNative.IntegrationTests/JsiSimpleTurboModuleTests.cpp +++ b/vnext/Microsoft.ReactNative.IntegrationTests/JsiSimpleTurboModuleTests.cpp @@ -13,7 +13,6 @@ #pragma pack(push) #pragma warning(disable : 4100 4127 4324) -#include "codegen/msrnIntegrationTestsJSI-generated.cpp" #include "codegen/msrnIntegrationTestsJSI.h" #pragma pack(pop) From 730704e6d7b7f35d9e682342dee3bac8d6031881 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Thu, 26 Feb 2026 15:37:39 +0530 Subject: [PATCH 11/11] test cli --- .ado/templates/prepare-js-env.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/templates/prepare-js-env.yml b/.ado/templates/prepare-js-env.yml index 89c8724575f..d7a2e3648e3 100644 --- a/.ado/templates/prepare-js-env.yml +++ b/.ado/templates/prepare-js-env.yml @@ -21,5 +21,5 @@ steps: parameters: agentImage: ${{ parameters.agentImage }} - - script: yarn build + - script: yarn build --reset-cache displayName: yarn build