From 9d3b052b377fd465e6cdc57f7cb84b35b2f22cfc Mon Sep 17 00:00:00 2001 From: Harini Malothu Date: Mon, 22 Sep 2025 14:54:17 +0530 Subject: [PATCH 01/34] changes before resolving merge conflicts --- .../react-native-win32-tester/overrides.json | 10 +- .../react-native-win32-tester/package.json | 2 +- .../src/js/RNTesterApp.win32.js | 2 +- .../js/components/ListExampleShared.win32.js | 2 +- .../components/RNTesterExampleFilter.win32.js | 2 +- .../src/js/utils/RNTesterList.win32.js | 2 +- .../react-native-win32/.flowconfig | 10 +- .../react-native-win32/overrides.json | 52 +-- .../react-native-win32/package.json | 2 +- .../src-win/Libraries/Alert/Alert.win32.js | 2 +- .../legacySendAccessibilityEvent.win32.js | 2 +- .../Libraries/Components/Button.win32.js | 2 +- .../DrawerAndroid/DrawerLayoutAndroid.js | 2 +- .../ProgressBarAndroid/ProgressBarAndroid.js | 4 + .../TextInput/TextInput.flow.win32.js | 20 +- .../Components/TextInput/TextInput.win32.js | 24 +- .../TextInput/TextInputState.win32.js | 2 +- .../ToastAndroid/ToastAndroid.win32.js | 2 +- .../Components/Touchable/Touchable.win32.js | 10 + .../Libraries/Components/View/View.win32.js | 2 +- .../View/ViewAccessibility.win32.js | 2 +- .../Components/View/ViewPropTypes.d.ts | 28 ++ .../Components/View/ViewPropTypes.win32.js | 2 +- .../NativeComponent/BaseViewConfig.win32.js | 8 +- .../Libraries/Network/RCTNetworking.win32.js | 2 +- .../Pressability/Pressability.win32.js | 2 +- .../src-win/Libraries/Text/Text.win32.js | 2 +- .../Text/TextNativeComponent.win32.js | 4 + .../Libraries/Utilities/Dimensions.win32.js | 2 +- .../Libraries/Utilities/Platform.win32.js | 2 +- .../react-native-win32/src-win/index.win32.js | 5 + .../animated/NativeAnimatedHelper.win32.js | 2 + .../automation-channel/package.json | 2 +- .../tester/overrides.json | 40 +- .../@react-native-windows/tester/package.json | 2 +- .../tester/src/js/RNTesterApp.windows.js | 2 +- .../js/components/TextInlineView.windows.js | 2 +- .../Button/ButtonExample.windows.js | 2 +- .../Switch/SwitchExample.windows.js | 2 +- .../ActivityIndicatorExample.windows.js | 2 +- .../FlatList/FlatList-basic.windows.js | 5 +- .../FlatList/FlatList-multiColumn.windows.js | 58 +-- .../FlatList/FlatList-nested.windows.js | 2 +- .../js/examples/Image/ImageExample.windows.js | 16 +- .../Modal/ModalPresentation.windows.js | 6 +- .../Pressable/PressableExample.windows.js | 12 +- .../js/examples/Text/TextExample.windows.js | 70 ++- .../Text/TextSharedExamples.windows.js | 65 ++- .../TextInput/TextInputExample.windows.js | 32 +- .../Touchable/TouchableExample.windows.js | 2 +- .../SampleTurboModuleExample.windows.js | 2 +- .../js/examples/View/ViewExample.windows.js | 79 +++- .../src/js/utils/RNTesterList.windows.js | 9 + .../@react-native/monorepo/overrides.json | 4 +- packages/@react-native/monorepo/package.json | 19 +- .../tester/js/RNTesterApp.android.js | 2 +- .../tester/js/RNTesterApp.ios.js | 2 +- .../tester/js/RNTesterAppShared.js | 2 +- .../TextInput/TextInputExample.android.js | 32 +- .../TextInput/TextInputExample.ios.js | 19 +- .../TextInput/TextInputExample.js.flow | 2 +- .../js/examples/TextInput/TextInputKeyProp.js | 2 +- .../TextInput/TextInputSharedExamples.js | 8 +- .../tester/js/examples/Urls/UrlExample.js | 2 +- .../tester/js/utils/RNTesterList.android.js | 2 +- .../tester/js/utils/RNTesterList.ios.js | 2 +- .../tester/js/utils/RNTesterList.js.flow | 2 +- .../js/utils/RNTesterNavigationReducer.js | 2 +- .../tester/js/utils/testerStateUtils.js | 4 +- .../tester/js/utils/useJsStalls.js | 5 +- packages/@react-native/tester/overrides.json | 162 +++---- packages/e2e-test-app-fabric/package.json | 2 +- packages/e2e-test-app/package.json | 2 +- packages/integration-test-app/package.json | 2 +- packages/playground/package.json | 2 +- packages/sample-app-fabric/package.json | 2 +- packages/sample-apps/package.json | 2 +- packages/sample-custom-component/package.json | 2 +- vnext/.flowconfig | 10 +- .../react/nativemodule/dom/NativeDOM.cpp | 91 ++-- .../react/nativemodule/dom/NativeDOM.h | 38 +- .../components/text/ParagraphShadowNode.cpp | 25 +- .../sliceChildShadowNodeViewPairs.cpp | 191 ++++++++ .../NativeIntersectionObserverSpec.g.h | 2 - vnext/codegen/NativeMutationObserverSpec.g.h | 20 +- .../NativeReactNativeFeatureFlagsSpec.g.h | 200 ++++---- .../react/components/rnwcore/Props.cpp | 441 +++++++++++++++++- .../codegen/react/components/rnwcore/Props.h | 52 +++ vnext/codegen/rnwcoreJSI-generated.cpp | 39 +- vnext/codegen/rnwcoreJSI.h | 77 ++- vnext/overrides.json | 66 +-- vnext/package.json | 2 +- .../src-win/Libraries/Alert/Alert.windows.js | 8 + .../legacySendAccessibilityEvent.windows.js | 2 +- .../Libraries/Components/Button.windows.js | 2 +- .../RefreshControl/RefreshControl.windows.js | 2 +- .../ScrollView/ScrollView.windows.js | 6 +- .../TextInput/TextInput.flow.windows.js | 20 +- .../Components/TextInput/TextInput.windows.js | 27 +- .../TextInput/TextInputState.windows.js | 2 +- .../WindowsTextInputNativeComponent.js | 12 - .../Components/Touchable/Touchable.windows.js | 10 + .../TouchableWithoutFeedback.windows.js | 4 + .../Libraries/Components/View/View.windows.js | 2 +- .../View/ViewAccessibility.windows.js | 2 +- .../Components/View/ViewPropTypes.d.ts | 22 + .../Components/View/ViewPropTypes.windows.js | 2 +- .../Image/resolveAssetSource.windows.js | 2 +- .../src-win/Libraries/Modal/Modal.windows.js | 6 +- .../NativeComponent/BaseViewConfig.windows.js | 8 +- .../Network/RCTNetworking.windows.js | 2 +- .../Pressability/Pressability.windows.js | 2 +- vnext/src-win/Libraries/Text/Text.windows.js | 2 +- .../Libraries/Utilities/Platform.windows.js | 2 +- vnext/src-win/index.windows.js | 5 + vnext/src-win/jest/setup.js | 74 ++- .../ReactNativeFeatureFlagsBase.js | 2 + .../RCTModalHostViewNativeComponent.js | 2 +- yarn.lock | 111 ++++- 119 files changed, 1846 insertions(+), 665 deletions(-) diff --git a/packages/@office-iss/react-native-win32-tester/overrides.json b/packages/@office-iss/react-native-win32-tester/overrides.json index 112fa8c4495..e022eb46213 100644 --- a/packages/@office-iss/react-native-win32-tester/overrides.json +++ b/packages/@office-iss/react-native-win32-tester/overrides.json @@ -5,19 +5,19 @@ "excludePatterns": [ "src/js/examples-win32/**" ], - "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", + "baseVersion": "0.81.0-nightly-20250604-1a6d466f1", "overrides": [ { "type": "patch", "file": "src/js/components/ListExampleShared.win32.js", "baseFile": "packages/rn-tester/js/components/ListExampleShared.js", - "baseHash": "eb604f3c06468e8aaa2671985a772b26f666e5de" + "baseHash": "885ca16a7587f79d6404679ee1b1309d3844afe9" }, { "type": "patch", "file": "src/js/components/RNTesterExampleFilter.win32.js", "baseFile": "packages/rn-tester/js/components/RNTesterExampleFilter.js", - "baseHash": "2b12495e7371031510b53ebcccdad627363c36ad" + "baseHash": "142194524dd3dfc8d28f2b77fb26cd819ce0236c" }, { "type": "platform", @@ -35,14 +35,14 @@ "type": "copy", "file": "src/js/RNTesterApp.win32.js", "baseFile": "packages/rn-tester/js/RNTesterApp.android.js", - "baseHash": "5e73edb50a1156756f2d1bec70d95a92f701ec22", + "baseHash": "987893a4df686425670b7897881b61e485960191", "issue": 4586 }, { "type": "derived", "file": "src/js/utils/RNTesterList.win32.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.android.js", - "baseHash": "aded9dd37f3ac325aa1cc095f6d217114c45a8b9" + "baseHash": "faa6a65524adb312817e96d511649edd81e38262" } ] } \ 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 e7d038d8aed..de497428853 100644 --- a/packages/@office-iss/react-native-win32-tester/package.json +++ b/packages/@office-iss/react-native-win32-tester/package.json @@ -30,7 +30,7 @@ "@types/node": "^22.14.0", "eslint": "^8.19.0", "just-scripts": "^1.3.3", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-platform-override": "^1.9.58", "typescript": "5.0.4" }, diff --git a/packages/@office-iss/react-native-win32-tester/src/js/RNTesterApp.win32.js b/packages/@office-iss/react-native-win32-tester/src/js/RNTesterApp.win32.js index 5974d28a8a9..0062ee3a3d0 100644 --- a/packages/@office-iss/react-native-win32-tester/src/js/RNTesterApp.win32.js +++ b/packages/@office-iss/react-native-win32-tester/src/js/RNTesterApp.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import RNTesterApp from './RNTesterAppShared'; diff --git a/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js b/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js index ca1d28b09e0..bc4c81c3e0f 100644 --- a/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js +++ b/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js b/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js index ee8c32a4980..11116df5f15 100644 --- a/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js +++ b/packages/@office-iss/react-native-win32-tester/src/js/components/RNTesterExampleFilter.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {SectionData} from '../types/RNTesterTypes'; 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 76ed50c15b0..651b95ab4ff 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 @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@office-iss/react-native-win32/.flowconfig b/packages/@office-iss/react-native-win32/.flowconfig index b5a4c82aa0a..028621552db 100644 --- a/packages/@office-iss/react-native-win32/.flowconfig +++ b/packages/@office-iss/react-native-win32/.flowconfig @@ -109,11 +109,17 @@ ../../../node_modules/ [libs] +<<<<<<< Upstream +flow-typed/ +packages/react-native/interface.js +packages/react-native/flow/ +======= interface.js flow/ ../../../node_modules/.flow/flow-typed/ ../../../node_modules/react-native/src/types src/types/ +>>>>>>> Override [options] enums=true @@ -143,6 +149,8 @@ module.name_mapper='^@office-iss/react-native-win32/\(.*\)$' -> '\ module.name_mapper='^@react-native/dev-middleware$' -> '/\1' module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '/Libraries/Image/RelativeImageStub' +module.system.haste.module_ref_prefix=m# + react.runtime=automatic suppress_type=$FlowIssue @@ -176,4 +184,4 @@ untyped-import untyped-type-import [version] -^0.271.0 +^0.272.2 diff --git a/packages/@office-iss/react-native-win32/overrides.json b/packages/@office-iss/react-native-win32/overrides.json index 6432566ea84..d6b0313b167 100644 --- a/packages/@office-iss/react-native-win32/overrides.json +++ b/packages/@office-iss/react-native-win32/overrides.json @@ -7,19 +7,19 @@ "**/__snapshots__/**", "src-win/rntypes/**" ], - "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", + "baseVersion": "0.81.0-nightly-20250604-1a6d466f1", "overrides": [ { "type": "derived", "file": ".flowconfig", "baseFile": ".flowconfig", - "baseHash": "dbea35126905a8314fa0a64ed2912896bc6d307b" + "baseHash": "a9dfa56b1428e49ea4474e0fee395c0dba67625b" }, { "type": "derived", "file": "src-win/index.win32.js", "baseFile": "packages/react-native/index.js", - "baseHash": "b447e699186ab3e95da9dc4520b9c2517776e723" + "baseHash": "79fa02963edb0e0f580fad3c401187956b393e2e" }, { "type": "platform", @@ -29,7 +29,7 @@ "type": "patch", "file": "src-win/Libraries/Alert/Alert.win32.js", "baseFile": "packages/react-native/Libraries/Alert/Alert.js", - "baseHash": "bd8f474e454f2b703ca7fb55cb022f24046bc0f8" + "baseHash": "980f439d79b614424de82f8a3380dea74ab6824b" }, { "type": "derived", @@ -47,7 +47,7 @@ "type": "copy", "file": "src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js", "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js", - "baseHash": "706e7b9a66fbddcb4b19c6d1d9b9838db9d15d52", + "baseHash": "28b564593dd7886279f3f4becee3a1da5144be1d", "issue": 4578 }, { @@ -60,7 +60,7 @@ "type": "derived", "file": "src-win/Libraries/Components/Button.win32.js", "baseFile": "packages/react-native/Libraries/Components/Button.js", - "baseHash": "6063d726e6255d1c55e07587f9ce09f1b7284301" + "baseHash": "ff56172f38be109b069589c40b6be80751c3527c" }, { "type": "platform", @@ -74,7 +74,7 @@ "type": "copy", "file": "src-win/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js", "baseFile": "packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js", - "baseHash": "fe92a96a2bfd0e92b99b2803ce133c7a3cf2b022", + "baseHash": "f161b547f80baf5bf21919478499fe868a031d96", "issue": 14290 }, { @@ -92,7 +92,7 @@ "type": "patch", "file": "src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", "baseFile": "packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", - "baseHash": "d1cc663442d184b62799b748c475a5a2c5c558c7" + "baseHash": "85efdbe556a087175fb9328f8d6e8d1f2cf29447" }, { "type": "copy", @@ -108,19 +108,19 @@ "type": "derived", "file": "src-win/Libraries/Components/TextInput/TextInput.flow.win32.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.flow.js", - "baseHash": "b611f4e98e9c7818dfac087e4f14384d3cc16b6a" + "baseHash": "217606b7527281d62335913ee8349506fcb9192b" }, { "type": "derived", "file": "src-win/Libraries/Components/TextInput/TextInput.win32.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js", - "baseHash": "2a5835c5cbdb36bd110e26f9be737aaaeb1fd97c" + "baseHash": "6bdac6e2d8569b25480db63f81d7f6dfc130f5f7" }, { "type": "patch", "file": "src-win/Libraries/Components/TextInput/TextInputState.win32.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInputState.js", - "baseHash": "400af173e846317c705487f51f3cb165e7378a4f" + "baseHash": "6ed06ca68066b0cdbaa28a2e5f1fe1b6d9d62f63" }, { "type": "platform", @@ -130,7 +130,7 @@ "type": "copy", "file": "src-win/Libraries/Components/ToastAndroid/ToastAndroid.win32.js", "baseFile": "packages/react-native/Libraries/Components/ToastAndroid/ToastAndroid.js", - "baseHash": "a623c5a09b665a36e84e7fc943bd619c8ca3cc14", + "baseHash": "825760336cab22ae77b7c382ac77d1500623a2d3", "issue": 4378 }, { @@ -141,7 +141,7 @@ "type": "patch", "file": "src-win/Libraries/Components/Touchable/Touchable.win32.js", "baseFile": "packages/react-native/Libraries/Components/Touchable/Touchable.js", - "baseHash": "2f7db68acd47af643bc0625d31d199332d519871" + "baseHash": "399b4d18cb04aae8d565484d3e228eccd88abad6" }, { "type": "derived", @@ -177,7 +177,7 @@ "type": "patch", "file": "src-win/Libraries/Components/View/View.win32.js", "baseFile": "packages/react-native/Libraries/Components/View/View.js", - "baseHash": "121c2126d26c94c8e508e3fb19ffe33f7be814b1" + "baseHash": "a3a08960f0c78d97f9144e32ed8388f02ff2a641" }, { "type": "derived", @@ -189,19 +189,19 @@ "type": "derived", "file": "src-win/Libraries/Components/View/ViewAccessibility.win32.js", "baseFile": "packages/react-native/Libraries/Components/View/ViewAccessibility.js", - "baseHash": "04981261b2ed61b31bfbb396478bb6b103d99253" + "baseHash": "26f3cbc5eeb46241a6e25cf051d5fa872c8c936c" }, { "type": "derived", "file": "src-win/Libraries/Components/View/ViewPropTypes.d.ts", "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts", - "baseHash": "ef39871442f6fd69ff316e824fcace95bda6f95b" + "baseHash": "10b609db23ea9243b34d787d42a148f5cb9b33f2" }, { "type": "patch", "file": "src-win/Libraries/Components/View/ViewPropTypes.win32.js", "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.js", - "baseHash": "ec1ffd005b6631e6af027731b087a7620fbf5cf5", + "baseHash": "8ade41e42a14e3d39428e7e135120feedbdb2f6c", "issue": 6240 }, { @@ -329,13 +329,13 @@ "type": "derived", "file": "src-win/Libraries/NativeComponent/BaseViewConfig.win32.js", "baseFile": "packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js", - "baseHash": "b520e2bdb2be31bdb6ad7e3769dbe69168870c8c" + "baseHash": "2afdb9c2f278c6008944e31eea4c20078529e561" }, { "type": "copy", "file": "src-win/Libraries/Network/RCTNetworking.win32.js", "baseFile": "packages/react-native/Libraries/Network/RCTNetworking.ios.js", - "baseHash": "4b96609d7e8d0596d2960aacfda35af73cec1085", + "baseHash": "975cb78ed40d162be73144bafcaee9bcd057bd44", "issue": 4318 }, { @@ -365,7 +365,7 @@ "type": "patch", "file": "src-win/Libraries/Pressability/Pressability.win32.js", "baseFile": "packages/react-native/Libraries/Pressability/Pressability.js", - "baseHash": "b52df7d819237b8acdd08f84631e3c257a9cb390", + "baseHash": "54f2a508c9378c1d9240ff27a460a8815e2b8ebd", "issue": 6240 }, { @@ -401,7 +401,7 @@ "type": "derived", "file": "src-win/Libraries/Settings/Settings.win32.js", "baseFile": "packages/react-native/Libraries/Settings/Settings.js", - "baseHash": "84da45c9a1bf8cec6d5044433f3c10e7298381d7" + "baseHash": "e1d244ee581a1456d00af638fb9331d90c48c91e" }, { "type": "platform", @@ -425,13 +425,13 @@ "type": "derived", "file": "src-win/Libraries/Text/Text.win32.js", "baseFile": "packages/react-native/Libraries/Text/Text.js", - "baseHash": "108e59816ed3b3c8183d0687a66088755580c00d" + "baseHash": "a24c9881da46b612c461a304b3ba9c640adbb5cb" }, { "type": "derived", "file": "src-win/Libraries/Text/TextNativeComponent.win32.js", "baseFile": "packages/react-native/Libraries/Text/TextNativeComponent.js", - "baseHash": "19efb0b15014c3e11be035a67c9e46b8e25f3090", + "baseHash": "4af82705ca22b281344c1e7f0c7b06b6fc3264c5", "issue": 7074 }, { @@ -458,7 +458,7 @@ "type": "derived", "file": "src-win/Libraries/Utilities/Dimensions.win32.js", "baseFile": "packages/react-native/Libraries/Utilities/Dimensions.js", - "baseHash": "07b59b2dd822c45eb9bccba8da0ce361eeb67bc1" + "baseHash": "58a45ebaadbfa79e4e1463738ff85d6dcf8348ea" }, { "type": "platform", @@ -478,7 +478,7 @@ "type": "derived", "file": "src-win/Libraries/Utilities/Platform.win32.js", "baseFile": "packages/react-native/Libraries/Utilities/Platform.android.js", - "baseHash": "8c3daf7b75af0445441def55571374bebed83726" + "baseHash": "58c8663867cc2cfdf9bd62425386dd1f44a592e8" }, { "type": "patch", @@ -497,7 +497,7 @@ "type": "patch", "file": "src-win/src/private/animated/NativeAnimatedHelper.win32.js", "baseFile": "packages/react-native/src/private/animated/NativeAnimatedHelper.js", - "baseHash": "e897f1bd33ed982044b97a01d9f606b9ebcd4505", + "baseHash": "8ed20ecc1b2a1967539fee0d53a47f25432746f4", "issue": 11041 }, { diff --git a/packages/@office-iss/react-native-win32/package.json b/packages/@office-iss/react-native-win32/package.json index 9ffad318ad0..706e99de185 100644 --- a/packages/@office-iss/react-native-win32/package.json +++ b/packages/@office-iss/react-native-win32/package.json @@ -88,7 +88,7 @@ "just-scripts": "^1.3.3", "prettier": "2.8.8", "react": "19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-platform-override": "^1.9.58", "typescript": "5.0.4" }, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Alert/Alert.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Alert/Alert.win32.js index 460004dddfc..0fee3290b56 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Alert/Alert.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Alert/Alert.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ // [Windows diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js index cc75d54fafd..b47617745ff 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import UIManager from '../../ReactNative/UIManager'; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js index b37a06faf2b..fbdfef30f1a 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js index 64693f6c144..5776fd4f500 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ // NOTE: This file supports backwards compatibility of subpath (deep) imports diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js index 707b4ee7965..ffee73d3a5b 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js @@ -4,7 +4,11 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * +<<<<<<< Upstream + * @flow strict-local +======= * @flow +>>>>>>> Override * @format */ diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js index ca1a29b6053..e6e9ae10dc2 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js @@ -10,6 +10,8 @@ import type {HostInstance} from '../../../src/private/types/HostInstance'; import type { + BlurEvent, + FocusEvent, GestureResponderEvent, NativeSyntheticEvent, ScrollEvent, @@ -58,22 +60,22 @@ type TextInputContentSizeChangeEventData = $ReadOnly<{ export type TextInputContentSizeChangeEvent = NativeSyntheticEvent; -type TargetEvent = $ReadOnly<{ - target: number, - ... -}>; - -type TextInputFocusEventData = TargetEvent; - /** * @see TextInputProps.onBlur + * @deprecated Use `BlurEvent` instead. */ -export type TextInputBlurEvent = NativeSyntheticEvent; +export type TextInputBlurEvent = BlurEvent; /** * @see TextInputProps.onFocus + * @deprecated Use `FocusEvent` instead. */ -export type TextInputFocusEvent = NativeSyntheticEvent; +export type TextInputFocusEvent = FocusEvent; + +type TargetEvent = $ReadOnly<{ + target: number, + ... +}>; export type Selection = $ReadOnly<{ start: number, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js index 1defdd0c159..33ad4175fe8 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js @@ -11,6 +11,8 @@ import type {HostInstance} from '../../../src/private/types/HostInstance'; import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes'; import type { + BlurEvent, + FocusEvent, GestureResponderEvent, ScrollEvent, } from '../../Types/CoreEventTypes'; @@ -98,10 +100,12 @@ else if (Platform.OS === 'win32') { export type { AutoCapitalize, + BlurEvent, EnterKeyHintType, EnterKeyHintTypeAndroid, EnterKeyHintTypeIOS, EnterKeyHintTypeOptions, + FocusEvent, InputModeOptions, KeyboardType, KeyboardTypeAndroid, @@ -541,14 +545,14 @@ function InternalTextInput(props: TextInputProps): React.Node { }); }; - const _onFocus = (event: TextInputFocusEvent) => { + const _onFocus = (event: FocusEvent) => { TextInputState.focusInput(inputRef.current); if (props.onFocus) { props.onFocus(event); } }; - const _onBlur = (event: TextInputBlurEvent) => { + const _onBlur = (event: BlurEvent) => { TextInputState.blurInput(inputRef.current); if (props.onBlur) { props.onBlur(event); @@ -895,7 +899,7 @@ const enterKeyHintToReturnTypeMap = { previous: 'previous', search: 'search', send: 'send', -}; +} as const; const inputModeToKeyboardTypeMap = { none: 'default', @@ -903,10 +907,11 @@ const inputModeToKeyboardTypeMap = { decimal: 'decimal-pad', numeric: 'number-pad', tel: 'phone-pad', - search: Platform.OS === 'ios' ? 'web-search' : 'default', + search: + Platform.OS === 'ios' ? ('web-search' as const) : ('default' as const), email: 'email-address', url: 'url', -}; +} as const; // Map HTML autocomplete values to Android autoComplete values const autoCompleteWebToAutoCompleteAndroidMap = { @@ -940,7 +945,7 @@ const autoCompleteWebToAutoCompleteAndroidMap = { 'tel-country-code': 'tel-country-code', 'tel-national': 'tel-national', username: 'username', -}; +} as const; // Map HTML autocomplete values to iOS textContentType values const autoCompleteWebToTextContentTypeMap = { @@ -980,7 +985,7 @@ const autoCompleteWebToTextContentTypeMap = { tel: 'telephoneNumber', url: 'URL', username: 'username', -}; +} as const; const TextInput: component( ref?: React.RefSetter, @@ -1032,8 +1037,7 @@ const TextInput: component( : Platform.OS === 'ios' && autoComplete && autoComplete in autoCompleteWebToTextContentTypeMap - ? // $FlowFixMe[invalid-computed-prop] - // $FlowFixMe[prop-missing] + ? // $FlowFixMe[prop-missing] autoCompleteWebToTextContentTypeMap[autoComplete] : textContentType } @@ -1072,7 +1076,7 @@ const verticalAlignToTextAlignVerticalMap = { top: 'top', bottom: 'bottom', middle: 'center', -}; +} as const; // $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe. export default TextInput as any as TextInputType; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInputState.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInputState.win32.js index c586a38a1d4..1967ad2cf06 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInputState.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInputState.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ // This class is responsible for coordinating the "focused" state for diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ToastAndroid/ToastAndroid.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ToastAndroid/ToastAndroid.win32.js index eeca1b3aea3..7985b65882f 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ToastAndroid/ToastAndroid.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ // NOTE: This file supports backwards compatibility of subpath (deep) imports diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js index fe5329e829c..7cdebf72e14 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/Touchable.win32.js @@ -874,11 +874,15 @@ const TouchableMixinImpl = { curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN; + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ const isActiveTransition = !IsActive[curState] && IsActive[nextState]; if (isInitialTransition || isActiveTransition) { this._remeasureMetricsOnActivation(); } + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { this.touchableHandleLongPress && this.touchableHandleLongPress(e); } @@ -889,13 +893,19 @@ const TouchableMixinImpl = { this._endHighlight(e); } + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { const hasLongPressHandler = !!this.props.onLongPress; const pressIsLongButStillCallOnPress = + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ IsLongPressingIn[curState] && // We *are* long pressing.. // But either has no long handler (!hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it. const shouldInvokePress = + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; if (shouldInvokePress && this.touchableHandlePress) { if (!newIsHighlight && !curIsHighlight) { diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/View.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/View.win32.js index 8b410b2238a..b204cf2459c 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/View.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/View.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {ViewProps} from './ViewPropTypes'; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js index 07b8a6d02ea..4a122d4b0ba 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewAccessibility.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts index 47d5c30e07a..4a82526342e 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts @@ -8,6 +8,19 @@ */ import type * as React from 'react'; +<<<<<<< Upstream +import {Insets} from '../../../types/public/Insets'; +import {GestureResponderHandlers} from '../../../types/public/ReactNativeRenderer'; +import {StyleProp} from '../../StyleSheet/StyleSheet'; +import {ViewStyle} from '../../StyleSheet/StyleSheetTypes'; +import { + BlurEvent, + FocusEvent, + LayoutChangeEvent, + PointerEvents, +} from '../../Types/CoreEventTypes'; +import {Touchable} from '../Touchable/Touchable'; +======= import {Insets} from 'react-native/types/public/Insets'; import {GestureResponderHandlers} from 'react-native/types/public/ReactNativeRenderer'; import {StyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; @@ -19,6 +32,7 @@ import { PointerEvents, } from 'react-native/Libraries/Types/CoreEventTypes'; import {Touchable} from 'react-native/Libraries/Components/Touchable/Touchable'; +>>>>>>> Override import {AccessibilityProps} from './ViewAccessibility'; export interface TVViewPropsIOS { @@ -81,6 +95,20 @@ export interface ViewPropsIOS extends TVViewPropsIOS { } export interface ViewPropsAndroid { + /** + * Callback that is called when the view is blurred. + * + * Note: This will only be called if the view is focusable. + */ + onBlur?: ((e: BlurEvent) => void) | null | undefined; + + /** + * Callback that is called when the view is focused. + * + * Note: This will only be called if the view is focusable. + */ + onFocus?: ((e: FocusEvent) => void) | null | undefined; + /** * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. * diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.win32.js index e844fa056d2..e738ff984eb 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/NativeComponent/BaseViewConfig.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/NativeComponent/BaseViewConfig.win32.js index 26f0fe64a34..aed11345b45 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/NativeComponent/BaseViewConfig.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/NativeComponent/BaseViewConfig.win32.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {PartialViewConfigWithoutName} from './PlatformBaseViewConfig'; @@ -228,14 +228,14 @@ const validAttributesForNonEventProps = { experimental_filter: NativeReactNativeFeatureFlags != null && ReactNativeFeatureFlags.enableNativeCSSParsing() - ? true + ? (true as const) : { process: require('../StyleSheet/processFilter').default, }, boxShadow: NativeReactNativeFeatureFlags != null && ReactNativeFeatureFlags.enableNativeCSSParsing() - ? true + ? (true as const) : { process: require('../StyleSheet/processBoxShadow').default, }, @@ -359,7 +359,7 @@ const validAttributesForNonEventProps = { direction: true, style: ReactNativeStyleAttributes, -}; +} as const; // Props for bubbling and direct events const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({ diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js index 40035ff1f6a..dcabadec9fd 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Network/RCTNetworking.win32.js @@ -29,7 +29,7 @@ const RCTNetworking = { sendRequest( method: string, - trackingName: ?string, + trackingName: string | void, url: string, headers: {...}, data: RequestBody, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Pressability/Pressability.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Pressability/Pressability.win32.js index 84a522b540c..395cd18d6fb 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Pressability/Pressability.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Pressability/Pressability.win32.js @@ -267,7 +267,7 @@ const Transitions = Object.freeze({ LEAVE_PRESS_RECT: 'NOT_RESPONDER', LONG_PRESS_DETECTED: 'NOT_RESPONDER', }, -}); +} as const); const isActiveSignal = (signal: TouchState) => signal === 'RESPONDER_ACTIVE_PRESS_IN' || diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js index 4311277c706..1ec2f8efa89 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js @@ -583,6 +583,6 @@ const verticalAlignToTextAlignVerticalMap = { top: 'top', bottom: 'bottom', middle: 'center', -}; +} as const; export default TextImpl; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextNativeComponent.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextNativeComponent.win32.js index bd7cbf43717..505195a25ef 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextNativeComponent.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextNativeComponent.win32.js @@ -101,6 +101,8 @@ const virtualTextViewConfig = { export const NativeText: HostComponent = (createReactNativeComponentClass('RCTText', () => + /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ createViewConfig(textViewConfig), ): any); @@ -109,5 +111,7 @@ export const NativeVirtualText: HostComponent = UIManager.getViewManagerConfig('RCTVirtualText') == null ? NativeText : (createReactNativeComponentClass('RCTVirtualText', () => + /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ createViewConfig(virtualTextViewConfig), ): any); diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Dimensions.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Dimensions.win32.js index 88aac51f3af..d89936b596a 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Dimensions.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Dimensions.win32.js @@ -2,8 +2,8 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * - * @format * @flow + * @format */ import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter'; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Platform.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Platform.win32.js index 039162b3796..2722b982fdd 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Platform.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/Platform.win32.js @@ -2,8 +2,8 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * - * @format * @flow strict + * @format */ import type { diff --git a/packages/@office-iss/react-native-win32/src-win/index.win32.js b/packages/@office-iss/react-native-win32/src-win/index.win32.js index 28b78b435ea..c03a0050686 100644 --- a/packages/@office-iss/react-native-win32/src-win/index.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/index.win32.js @@ -4,8 +4,13 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * +<<<<<<< Upstream + * @flow strict-local + * @format +======= * @format * @flow +>>>>>>> Override */ // flowlint unsafe-getters-setters:off diff --git a/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js b/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js index 7b06ecdee2a..ba3a213b948 100644 --- a/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js @@ -107,6 +107,8 @@ function createNativeOperations(): $NonMaybeType { for (let ii = 0, length = methodNames.length; ii < length; ii++) { const methodName = methodNames[ii]; nativeOperations[methodName] = (...args) => { + /* $FlowFixMe[prop-missing] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ const method = nullthrows(NativeAnimatedModule)[methodName]; // If queueing is explicitly on, *or* the queue has not yet // been flushed, use the queue. This is to prevent operations diff --git a/packages/@react-native-windows/automation-channel/package.json b/packages/@react-native-windows/automation-channel/package.json index e8cda29b55c..e83598e44d1 100644 --- a/packages/@react-native-windows/automation-channel/package.json +++ b/packages/@react-native-windows/automation-channel/package.json @@ -32,7 +32,7 @@ "just-scripts": "^1.3.2", "prettier": "2.8.8", "react": "19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993", "typescript": "5.0.4" }, diff --git a/packages/@react-native-windows/tester/overrides.json b/packages/@react-native-windows/tester/overrides.json index fee59f514c0..a24ade1b1b8 100644 --- a/packages/@react-native-windows/tester/overrides.json +++ b/packages/@react-native-windows/tester/overrides.json @@ -5,38 +5,38 @@ "excludePatterns": [ "src/js/examples-win/**" ], - "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", + "baseVersion": "0.81.0-nightly-20250604-1a6d466f1", "overrides": [ { "type": "copy", "file": "js/examples/ContentURLAndroid/ContentURLAndroid.js", "baseFile": "packages/rn-tester/js/examples/ContentURLAndroid/ContentURLAndroid.js", - "baseHash": "8c8ae861aa6984218efc0f127bf6aba4b7960040", + "baseHash": "5219751d36d3f2581e075d835424aa2f20c9809f", "issue": 14844 }, { "type": "derived", "file": "src/js/components/TextInlineView.windows.js", "baseFile": "packages/rn-tester/js/components/TextInlineView.js", - "baseHash": "74a0b8d26ba5e62ea6e39e17a9fc9bc2d5c235fa" + "baseHash": "c3ef9781d473fa5fd4d0a93842ee875536b19eb2" }, { "type": "derived", "file": "src/js/examples-win/Button/ButtonExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Button/ButtonExample.js", - "baseHash": "e03b21d229ecb631c12e4ac04ddf73fbe6059da7" + "baseHash": "c44c83e48760fddc1129751debbf3a3ba1ec3fac" }, { "type": "derived", "file": "src/js/examples-win/Switch/SwitchExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Switch/SwitchExample.js", - "baseHash": "314dacf1e200ddc9dc414bd9be1a21ee77ae097a" + "baseHash": "a5314bc9384402a96a8bb5190e5513a785925f90" }, { "type": "patch", "file": "src/js/examples/ActivityIndicator/ActivityIndicatorExample.windows.js", "baseFile": "packages/rn-tester/js/examples/ActivityIndicator/ActivityIndicatorExample.js", - "baseHash": "4dbb1a7e0f970ab6987d83899b4c87b6408c7e2c", + "baseHash": "f8ef473352cc6bc67ef28df8eb1889d394d8e481", "issue": 12869 }, { @@ -50,21 +50,21 @@ "type": "patch", "file": "src/js/examples/FlatList/FlatList-basic.windows.js", "baseFile": "packages/rn-tester/js/examples/FlatList/FlatList-basic.js", - "baseHash": "a10d3f1b947f00cd11f33644e374d04bf5417a04", + "baseHash": "c523e6ea68a0ec0e754f4bea57f598200112a3c1", "issue": 12869 }, { "type": "copy", "file": "src/js/examples/FlatList/FlatList-multiColumn.windows.js", "baseFile": "packages/rn-tester/js/examples/FlatList/FlatList-multiColumn.js", - "baseHash": "5b2487a526ee0e4dd0e01f87f334fef99822d682", + "baseHash": "d65899720b46246b721e583b9a9920d7601b5221", "issue": 12869 }, { "type": "patch", "file": "src/js/examples/FlatList/FlatList-nested.windows.js", "baseFile": "packages/rn-tester/js/examples/FlatList/FlatList-nested.js", - "baseHash": "c5f4c76741ff490c10c4c18db45bacfecd1b8a12", + "baseHash": "58f95a964352c4ee884af4b027010fb54e4c1e39", "issue": 12869 }, { @@ -85,7 +85,7 @@ "type": "patch", "file": "src/js/examples/Image/ImageExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Image/ImageExample.js", - "baseHash": "a3931ef84647705af55804b29eadb845d5185e87", + "baseHash": "9381aa0a0b1d084fda30e13c3b35eac653b28625", "issue": 12869 }, { @@ -98,65 +98,65 @@ "type": "patch", "file": "src/js/examples/Modal/ModalPresentation.windows.js", "baseFile": "packages/rn-tester/js/examples/Modal/ModalPresentation.js", - "baseHash": "93c88f75903188f1b5671a288fbf6eb333ea8acb" + "baseHash": "66214506a9f3b7755fe6596380455c63b04091b7" }, { "type": "patch", "file": "src/js/examples/Pressable/PressableExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Pressable/PressableExample.js", - "baseHash": "63fce542a05c17e8115c03ab81b3d633083ff08c", + "baseHash": "c6dd35fb59d439ee655844b2baa16f1711b70619", "issue": 6240 }, { "type": "derived", "file": "src/js/examples/Text/TextExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Text/TextExample.android.js", - "baseHash": "b821fd7ae82ed4470ea3f06baafb87ac99c953f1" + "baseHash": "55b0983ac2f69f38284e5014d77533eb0e2e9ff6" }, { "type": "patch", "file": "src/js/examples/Text/TextSharedExamples.windows.js", "baseFile": "packages/rn-tester/js/examples/Text/TextSharedExamples.js", - "baseHash": "083863d1623d7df3205850e0fd760054bcd771ad", + "baseHash": "af0e1fb5bf6deebad7fc0de41242a27652bafdac", "issue": 15125 }, { "type": "patch", "file": "src/js/examples/TextInput/TextInputExample.windows.js", "baseFile": "packages/rn-tester/js/examples/TextInput/TextInputExample.android.js", - "baseHash": "ed91ff793aa3c1305d75f795be74adcffe540edb", + "baseHash": "e2ec4b71e3cd614682d9be1551b3a2994ea51823", "issue": 5688 }, { "type": "derived", "file": "src/js/examples/Touchable/TouchableExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Touchable/TouchableExample.js", - "baseHash": "e65c182f60ca77bbba3e7d42318850dc936efb2c" + "baseHash": "838aa97d99b1a4deb26cd92b7dbd3824e5818cb5" }, { "type": "patch", "file": "src/js/examples/TurboModule/SampleTurboModuleExample.windows.js", "baseFile": "packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js", - "baseHash": "a005538f6ea294fb44d0f6265c1bc75bd893ab56" + "baseHash": "3e16d172b5b5cac74c4733662d83bc2b2107bc4f" }, { "type": "patch", "file": "src/js/examples/View/ViewExample.windows.js", "baseFile": "packages/rn-tester/js/examples/View/ViewExample.js", - "baseHash": "728c93153aa91aa7091345a17631fa0fe4e37b0c" + "baseHash": "8f02aec2ad43cf4a32db1604e3b60e1b41aed919" }, { "type": "copy", "file": "src/js/RNTesterApp.windows.js", "baseFile": "packages/rn-tester/js/RNTesterApp.android.js", - "baseHash": "5e73edb50a1156756f2d1bec70d95a92f701ec22", + "baseHash": "987893a4df686425670b7897881b61e485960191", "issue": 4586 }, { "type": "derived", "file": "src/js/utils/RNTesterList.windows.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.android.js", - "baseHash": "aded9dd37f3ac325aa1cc095f6d217114c45a8b9" + "baseHash": "faa6a65524adb312817e96d511649edd81e38262" } ] } \ 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 602521af3c1..d9d9086bde7 100644 --- a/packages/@react-native-windows/tester/package.json +++ b/packages/@react-native-windows/tester/package.json @@ -33,7 +33,7 @@ "@types/node": "^22.14.0", "eslint": "^8.19.0", "just-scripts": "^1.3.3", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-platform-override": "^1.9.58", "react-native-windows": "^0.0.0-canary.993", "typescript": "5.0.4" diff --git a/packages/@react-native-windows/tester/src/js/RNTesterApp.windows.js b/packages/@react-native-windows/tester/src/js/RNTesterApp.windows.js index 5974d28a8a9..0062ee3a3d0 100644 --- a/packages/@react-native-windows/tester/src/js/RNTesterApp.windows.js +++ b/packages/@react-native-windows/tester/src/js/RNTesterApp.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import RNTesterApp from './RNTesterAppShared'; diff --git a/packages/@react-native-windows/tester/src/js/components/TextInlineView.windows.js b/packages/@react-native-windows/tester/src/js/components/TextInlineView.windows.js index af6e9470b1b..03d0907583d 100644 --- a/packages/@react-native-windows/tester/src/js/components/TextInlineView.windows.js +++ b/packages/@react-native-windows/tester/src/js/components/TextInlineView.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native-windows/tester/src/js/examples-win/Button/ButtonExample.windows.js b/packages/@react-native-windows/tester/src/js/examples-win/Button/ButtonExample.windows.js index 4f68c37fc08..069de0e10db 100644 --- a/packages/@react-native-windows/tester/src/js/examples-win/Button/ButtonExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples-win/Button/ButtonExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native-windows/tester/src/js/examples-win/Switch/SwitchExample.windows.js b/packages/@react-native-windows/tester/src/js/examples-win/Switch/SwitchExample.windows.js index c090a305b30..9a8009c75c0 100644 --- a/packages/@react-native-windows/tester/src/js/examples-win/Switch/SwitchExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples-win/Switch/SwitchExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native-windows/tester/src/js/examples/ActivityIndicator/ActivityIndicatorExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/ActivityIndicator/ActivityIndicatorExample.windows.js index 4cacc34696e..0ea26ffb58a 100644 --- a/packages/@react-native-windows/tester/src/js/examples/ActivityIndicator/ActivityIndicatorExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/ActivityIndicator/ActivityIndicatorExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; diff --git a/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-basic.windows.js b/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-basic.windows.js index 68499ad54f0..f4d6321ebb6 100644 --- a/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-basic.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-basic.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; @@ -43,7 +43,6 @@ import { TextInput, View, } from 'react-native'; -import infoLog from 'react-native/Libraries/Utilities/infoLog'; const PAGE_SIZE = 100; const NUM_PAGES = 10; @@ -402,7 +401,7 @@ class FlatListExample extends React.PureComponent { }) => { // Impressions can be logged here if (this.state.logViewable) { - infoLog( + console.log( 'onViewableItemsChanged: ', info.changed.map(v => ({...v, item: '...'})), ); diff --git a/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-multiColumn.windows.js b/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-multiColumn.windows.js index 92079c3a00d..a6b6c8921de 100644 --- a/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-multiColumn.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-multiColumn.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; @@ -28,9 +28,8 @@ import { import RNTesterPage from '../../components/RNTesterPage'; import RNTesterText from '../../components/RNTesterText'; import * as React from 'react'; -import {useState} from 'react'; +import {useCallback, useState} from 'react'; import {Alert, FlatList, StyleSheet, View} from 'react-native'; -import infoLog from 'react-native/Libraries/Utilities/infoLog'; function MultiColumnExample(): React.Node { const [data, setData] = useState(genNewerItems(1000)); @@ -67,20 +66,33 @@ function MultiColumnExample(): React.Node { return {length, offset: length * index, index}; }; - // eslint-disable-next-line react/no-unstable-nested-components - const _renderItemComponent = ({ - item, - }: ListRenderItemInfo): $FlowFixMe => { - return ( - - - - ); - }; + const _pressItem = useCallback( + (key: string) => { + const index = Number(key); + const itemState = pressItem(data[index]); + setData(state => [ + ...state.slice(0, index), + itemState, + ...state.slice(index + 1), + ]); + }, + [data], + ); + + const _renderItemComponent = useCallback( + ({item}: ListRenderItemInfo): $FlowFixMe => { + return ( + + + + ); + }, + [_pressItem, fixedHeight], + ); // This is called when items change viewability by scrolling into or out of the viewable area. const _onViewableItemsChanged = (info: { @@ -96,23 +108,13 @@ function MultiColumnExample(): React.Node { }) => { // Impressions can be logged here if (logViewable) { - infoLog( + console.log( 'onViewableItemsChanged: ', info.changed.map(v => ({...v, item: '...'})), ); } }; - const _pressItem = (key: string) => { - const index = Number(key); - const itemState = pressItem(data[index]); - setData(state => [ - ...state.slice(0, index), - itemState, - ...state.slice(index + 1), - ]); - }; - const filterRegex = new RegExp(String(filterText), 'i'); const filter = (item: any | Item) => filterRegex.test(item.text) || filterRegex.test(item.title); diff --git a/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-nested.windows.js b/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-nested.windows.js index 66b06ea0721..2e1b31d2513 100644 --- a/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-nested.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/FlatList/FlatList-nested.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js index d151b043d0c..c639f7bb00a 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; @@ -631,6 +631,9 @@ const VectorDrawableExample = () => { ); }; +<<<<<<< Upstream +function CacheControlExample(): React.Node { +======= const AccessibilityActions = () => { const [accessibilityLabel, setAccessibilityLabel] = React.useState('Initial Label'); @@ -733,6 +736,7 @@ const ImageFunctionsExample = () => { }; function CacheControlAndroidExample(): React.Node { +>>>>>>> Override const [reload, setReload] = useState(0); const onReload = () => { @@ -1307,6 +1311,8 @@ exports.examples = [ }, { title: 'Cache Policy', +<<<<<<< Upstream +======= description: ('First image has never been loaded before and is instructed not to load unless in cache.' + 'Placeholder image from above will stay. Second image is the same but forced to load regardless of' + @@ -1337,14 +1343,14 @@ exports.examples = [ }, { title: 'Cache Policy', +>>>>>>> Override description: `- First image will be loaded and cached. - Second image is the same but will be reloaded if re-rendered as the cache policy is set to reload. -- Third image will never be loaded as the cache policy is set to only-if-cached and the image has not been loaded before. - `, +- Third image will try to load from the cache first and only use the network if the cached version is unavailable. +- Fourth image will never be loaded as the cache policy is set to only-if-cached and the image has not been loaded before.`, render: function (): React.Node { - return ; + return ; }, - platform: 'android', }, { title: 'Borders', diff --git a/packages/@react-native-windows/tester/src/js/examples/Modal/ModalPresentation.windows.js b/packages/@react-native-windows/tester/src/js/examples/Modal/ModalPresentation.windows.js index f5569c20f53..da7229fa508 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Modal/ModalPresentation.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Modal/ModalPresentation.windows.js @@ -21,20 +21,20 @@ import * as React from 'react'; import {useCallback, useContext, useState} from 'react'; import {Modal, Platform, StyleSheet, Switch, Text, View} from 'react-native'; -const animationTypes = ['slide', 'none', 'fade']; +const animationTypes = ['slide', 'none', 'fade'] as const; const presentationStyles = [ 'fullScreen', 'pageSheet', 'formSheet', 'overFullScreen', -]; +] as const; const supportedOrientations = [ 'portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right', -]; +] as const; const backdropColors = ['red', 'blue', undefined]; diff --git a/packages/@react-native-windows/tester/src/js/examples/Pressable/PressableExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Pressable/PressableExample.windows.js index c8656469675..2ac094c01fe 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Pressable/PressableExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Pressable/PressableExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModule} from '../../types/RNTesterTypes'; @@ -636,6 +636,8 @@ const examples = [ + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. + * See https://fburl.com/workplace/6291gfvu */} radius 30 @@ -644,6 +646,8 @@ const examples = [ + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. + * See https://fburl.com/workplace/6291gfvu */} radius 150 @@ -652,6 +656,8 @@ const examples = [ + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. + * See https://fburl.com/workplace/6291gfvu */} radius 70, with border @@ -661,6 +667,8 @@ const examples = [ + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} with border, default color and radius @@ -1116,5 +1124,7 @@ module.exports = ({ category: 'UI', description: 'Component for making views pressable.', displayName: 'Pressable', + /* $FlowFixMe[incompatible-cast] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ examples, }: RNTesterModule); diff --git a/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js index afba2142050..28794c5c654 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ // This is a port of TextExample.android.js @@ -63,7 +63,7 @@ class AttributeToggler extends React.Component<{...}, $FlowFixMeState> { fontSize: this.state.fontSize, }; return ( - + Tap the controls below to change attributes. @@ -76,11 +76,12 @@ class AttributeToggler extends React.Component<{...}, $FlowFixMeState> { - Toggle Weight - {' (with highlight onPress)'} + + Toggle Weight + - - Increase Size (suppressHighlighting true) + + Increase Size ); @@ -1136,6 +1137,8 @@ function TextBaseLineLayoutExample(props: {}): React.Node { // [Windows - Paper doesn't support Views in Text while Fabric does return global.RN$Bridgeless !== true ? ( + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} {'Nested s:'} {marker} @@ -1143,6 +1146,8 @@ function TextBaseLineLayoutExample(props: {}): React.Node { {marker} + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} {'Array of s in :'} @@ -1151,16 +1156,27 @@ function TextBaseLineLayoutExample(props: {}): React.Node { {texts} {marker} +<<<<<<< Upstream + + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} + + {'Interleaving and :'} + +======= ) : ( {'Nested s:'} +>>>>>>> Override {marker} {texts} {marker} + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} {'Array of s in :'} @@ -1169,6 +1185,20 @@ function TextBaseLineLayoutExample(props: {}): React.Node { {texts} {marker} +<<<<<<< Upstream + + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} + + {'Multi-line alignment'} + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. +======= {'Interleaving and :'} @@ -1187,6 +1217,7 @@ function TextBaseLineLayoutExample(props: {}): React.Node { Text inside View. {marker} +>>>>>>> Override {marker} @@ -1208,6 +1239,28 @@ function TextBaseLineLayoutExample(props: {}): React.Node { +<<<<<<< Upstream + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} + {':'} + + {marker} + {texts} + {marker} + + + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} + + {':'} + + + {marker} + + {texts} + + {marker} +======= {'Multi-line alignment'} @@ -1244,6 +1297,7 @@ function TextBaseLineLayoutExample(props: {}): React.Node { {marker} +>>>>>>> Override ); @@ -1657,9 +1711,7 @@ const examples = [ { title: 'Toggling Attributes', name: 'togglingAttributes', - render(): React.Node { - return ; - }, + render: AttributeToggler, }, { title: 'backgroundColor attribute', diff --git a/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js b/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js index d4ae83bc68e..2d5215b18bc 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js @@ -4,14 +4,16 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; +import type {TextLayoutLine} from 'react-native/Libraries/Types/CoreEventTypes'; import RNTesterText from '../../components/RNTesterText'; import {useTheme} from '../../components/RNTesterTheme'; +import {useState} from 'react'; import {View} from 'react-native'; function InlineView(props: { @@ -71,12 +73,72 @@ function EmptyTextExample(): React.Node { ); } +<<<<<<< Upstream +function TextAndLayoutLinesJSON({ + testID, + ellipsizeMode, +}: $ReadOnly<{ + testID: string, + ellipsizeMode: 'head' | 'tail' | 'middle' | 'clip', +}>): React.Node { + const [lines, setLines] = useState(); + + return ( + + {ellipsizeMode} + setLines(ev.nativeEvent.lines)}> + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin volutpat + molestie nunc non tristique. + + + {JSON.stringify(lines, null, 2)} + + + ); +} + +function NumberOfLinesTextLayoutExample(): React.Node { + return ( + + + + + + + ); +} + +export default [ +======= const examples = [ +>>>>>>> Override { title: 'Empty Text', name: 'emptyText', render: EmptyTextExample, }, +<<<<<<< Upstream + { + title: 'TextInlineViewsExample', + name: 'inlineViews', + description: + 'Shows how inline views are rendered when text is subject to alignment.', + expect: 'The red box should align correctly with the rest of the text.', + render: TextInlineViewsExample, + }, + { + title: 'numberOfLines with onTextLayout', + name: 'numberOfLinesLayout', + description: + 'Shows the behavior of numberOfLines and ellipsizeMode in conjunction with the onTextLayout event', + scrollable: true, + render: NumberOfLinesTextLayoutExample, + }, +] as $ReadOnlyArray; +======= // Windows: Only include TextInlineViewsExample in Fabric mode (bridgeless) // Paper mode doesn't support Views nested in Text ...(global.RN$Bridgeless === true @@ -95,3 +157,4 @@ const examples = [ ]; export default examples; +>>>>>>> Override diff --git a/packages/@react-native-windows/tester/src/js/examples/TextInput/TextInputExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/TextInput/TextInputExample.windows.js index 9d80e0e8380..701e2a2ac59 100644 --- a/packages/@react-native-windows/tester/src/js/examples/TextInput/TextInputExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/TextInput/TextInputExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; @@ -327,19 +327,21 @@ const examples: Array = [ style={[styles.singleLine]} testID="textinput-weight-default" /> - {[ - 'normal', - 'bold', - '900', - 800, - '700', - '600', - '500', - '400', - '300', - '200', - '100', - ].map(fontWeight => ( + {( + [ + 'normal', + 'bold', + '900', + 800, + '700', + '600', + '500', + '400', + '300', + '200', + '100', + ] as const + ).map(fontWeight => ( = [ 'done', 'previous', 'next', - ]; + ] as const; const returnKeyLabels = ['Compile', 'React Native']; const returnKeyExamples = returnKeyTypes.map(type => { return ( diff --git a/packages/@react-native-windows/tester/src/js/examples/Touchable/TouchableExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Touchable/TouchableExample.windows.js index 37ba2e3e21d..057e7b208cd 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Touchable/TouchableExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Touchable/TouchableExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; diff --git a/packages/@react-native-windows/tester/src/js/examples/TurboModule/SampleTurboModuleExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/TurboModule/SampleTurboModuleExample.windows.js index b27e83cebbf..082c39d36b8 100644 --- a/packages/@react-native-windows/tester/src/js/examples/TurboModule/SampleTurboModuleExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/TurboModule/SampleTurboModuleExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {EventSubscription, RootTag} from 'react-native'; diff --git a/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js index d9117c9f404..12cae68fc78 100644 --- a/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; @@ -14,6 +14,7 @@ import type {RNTesterModule} from '../../types/RNTesterTypes'; import RNTesterText from '../../components/RNTesterText'; import * as React from 'react'; +import {useState} from 'react'; import { Platform, PlatformColor, @@ -671,6 +672,74 @@ function BoxSizingExample(): React.Node { ); } +function FocusableInnerRow({focusable}: {focusable: boolean}) { + const styles = StyleSheet.create({ + focused: { + borderColor: 'blue', + borderWidth: 2, + }, + innerBox: { + backgroundColor: 'red', + width: '100%', + height: 50, + borderColor: 'transparent', + borderWidth: 2, + }, + innerBoxTextColor: { + color: 'white', + }, + }); + const [focused, setFocused] = useState(false); + return ( + setFocused(false)} + onFocus={() => setFocused(true)} + style={[styles.innerBox, focused && styles.focused]}> + + Focusable: {focusable ? 'true' : 'false'} + + + Focused: {focused ? 'true' : 'false'} + + + ); +} + +function FocusBlurExample(): React.Node { + const styles = StyleSheet.create({ + focused: { + borderColor: 'blue', + borderWidth: 2, + }, + outerBox: { + backgroundColor: 'green', + borderColor: 'transparent', + borderWidth: 2, + padding: 10, + }, + outerBoxTextColor: { + color: 'white', + }, + }); + const [outerFocused, setOuterFocused] = useState(false); + return ( + setOuterFocused(false)} + onFocus={() => setOuterFocused(true)} + style={[styles.outerBox, outerFocused && styles.focused]}> + + Focused: {outerFocused ? 'true' : 'false'} + + + + + + + ); +} + export default ({ title: 'View', documentationURL: 'https://reactnative.dev/docs/view', @@ -1357,6 +1426,13 @@ export default ({ name: 'box-sizing', render: BoxSizingExample, }, +<<<<<<< Upstream + { + title: 'Focus/Blur', + name: 'focus-blur', + render: FocusBlurExample, + }, +======= // [Windows { title: 'NativeID', @@ -1431,5 +1507,6 @@ export default ({ }, }, // ]TODO(macOS ISS#2323203) // Windows] +>>>>>>> Override ], }: RNTesterModule); 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 18b1c2a14b4..065a8ef5737 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 @@ -1,8 +1,17 @@ /** +<<<<<<< Upstream + * 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. + * +======= * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * @format +>>>>>>> Override * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/monorepo/overrides.json b/packages/@react-native/monorepo/overrides.json index fa62e24df55..f457581f89c 100644 --- a/packages/@react-native/monorepo/overrides.json +++ b/packages/@react-native/monorepo/overrides.json @@ -1,11 +1,11 @@ { - "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", + "baseVersion": "0.81.0-nightly-20250604-1a6d466f1", "overrides": [ { "type": "patch", "file": "package.json", "baseFile": "package.json", - "baseHash": "709467c84f3132be8a835d22cb8586194cd1e333" + "baseHash": "838c08059138d826960d4a7d516b92bb1732a701" } ] } \ No newline at end of file diff --git a/packages/@react-native/monorepo/package.json b/packages/@react-native/monorepo/package.json index 82ae6c46be9..85b5bf527ed 100644 --- a/packages/@react-native/monorepo/package.json +++ b/packages/@react-native/monorepo/package.json @@ -26,7 +26,7 @@ "test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js", "test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js", "test-ios": "./scripts/objc-test.sh test", - "test-typescript": "tsc -p packages/react-native/types/tsconfig.test.json", + "test-typescript": "tsc -p packages/react-native/types/tsconfig.json", "test": "jest", "fantom": "JS_DIR='..' yarn jest --config packages/react-native-fantom/config/jest.config.js", "trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js", @@ -46,8 +46,14 @@ "@babel/preset-env": "^7.25.3", "@babel/preset-flow": "^7.24.7", "@jest/create-cache-key-function": "^29.7.0", +<<<<<<< Upstream + "@microsoft/api-extractor": "^7.52.2", + "@react-native/metro-babel-transformer": "0.80.0-main", + "@react-native/metro-config": "0.80.0-main", +======= "@react-native/metro-babel-transformer": "0.81.0-nightly-20250521-3cb70bb6a", "@react-native/metro-config": "0.81.0-nightly-20250521-3cb70bb6a", +>>>>>>> Override "@tsconfig/node18": "1.0.1", "@types/react": "^19.0.0", "@typescript-eslint/parser": "^7.1.1", @@ -75,7 +81,7 @@ "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", "flow-api-translator": "0.28.1", - "flow-bin": "^0.271.0", + "flow-bin": "^0.272.2", "glob": "^7.1.1", "hermes-eslint": "0.28.1", "hermes-transform": "0.28.1", @@ -87,9 +93,9 @@ "jest-snapshot": "^29.7.0", "markdownlint-cli2": "^0.17.2", "markdownlint-rule-relative-links": "^3.0.0", - "metro-babel-register": "^0.82.3", - "metro-memory-fs": "^0.82.3", - "metro-transform-plugins": "^0.82.3", + "metro-babel-register": "^0.82.4", + "metro-memory-fs": "^0.82.4", + "metro-transform-plugins": "^0.82.4", "micromatch": "^4.0.4", "node-fetch": "^2.2.0", "nullthrows": "^1.1.1", @@ -101,6 +107,7 @@ "shelljs": "^0.8.5", "signedsource": "^1.0.0", "supports-color": "^7.1.0", + "temp-dir": "^2.0.0", "tinybench": "^3.1.0", "typescript": "5.0.4", "ws": "^6.2.2" @@ -108,4 +115,4 @@ "resolutions": { "react-is": "19.1.0" } -} \ No newline at end of file +} diff --git a/packages/@react-native/tester/js/RNTesterApp.android.js b/packages/@react-native/tester/js/RNTesterApp.android.js index 5974d28a8a9..0062ee3a3d0 100644 --- a/packages/@react-native/tester/js/RNTesterApp.android.js +++ b/packages/@react-native/tester/js/RNTesterApp.android.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import RNTesterApp from './RNTesterAppShared'; diff --git a/packages/@react-native/tester/js/RNTesterApp.ios.js b/packages/@react-native/tester/js/RNTesterApp.ios.js index 281ee25afd7..6c7155dc2e4 100644 --- a/packages/@react-native/tester/js/RNTesterApp.ios.js +++ b/packages/@react-native/tester/js/RNTesterApp.ios.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {RNTesterModuleInfo} from './types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/RNTesterAppShared.js b/packages/@react-native/tester/js/RNTesterAppShared.js index b0a268ba9d9..6cb54f1ed15 100644 --- a/packages/@react-native/tester/js/RNTesterAppShared.js +++ b/packages/@react-native/tester/js/RNTesterAppShared.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {RNTesterModuleInfo, ScreenTypes} from './types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/examples/TextInput/TextInputExample.android.js b/packages/@react-native/tester/js/examples/TextInput/TextInputExample.android.js index 025215a1df8..930b241647b 100644 --- a/packages/@react-native/tester/js/examples/TextInput/TextInputExample.android.js +++ b/packages/@react-native/tester/js/examples/TextInput/TextInputExample.android.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; @@ -119,19 +119,21 @@ const examples: Array = [ defaultValue="Font Weight (default)" style={[styles.singleLine]} /> - {[ - 'normal', - 'bold', - '900', - 800, - '700', - '600', - '500', - '400', - '300', - '200', - '100', - ].map(fontWeight => ( + {( + [ + 'normal', + 'bold', + '900', + 800, + '700', + '600', + '500', + '400', + '300', + '200', + '100', + ] as const + ).map(fontWeight => ( = [ 'done', 'previous', 'next', - ]; + ] as const; const returnKeyLabels = ['Compile', 'React Native']; const returnKeyExamples = returnKeyTypes.map(type => { return ( diff --git a/packages/@react-native/tester/js/examples/TextInput/TextInputExample.ios.js b/packages/@react-native/tester/js/examples/TextInput/TextInputExample.ios.js index eadeccba109..62f9607de9e 100644 --- a/packages/@react-native/tester/js/examples/TextInput/TextInputExample.ios.js +++ b/packages/@react-native/tester/js/examples/TextInput/TextInputExample.ios.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; @@ -373,7 +373,7 @@ const textInputExamples: Array = [ 'phone-pad', 'decimal-pad', 'ascii-capable-number-pad', - ]; + ] as const; const examples = keyboardTypesWithDoneButton.map(type => { return ( @@ -434,7 +434,7 @@ const textInputExamples: Array = [ { title: 'Keyboard appearance', render: function (): React.Node { - const keyboardAppearance = ['default', 'light', 'dark']; + const keyboardAppearance = ['default', 'light', 'dark'] as const; const examples = keyboardAppearance.map(type => { return ( @@ -460,7 +460,7 @@ const textInputExamples: Array = [ 'yahoo', 'done', 'emergency-call', - ]; + ] as const; const examples = returnKeyTypes.map(type => { return ( @@ -525,7 +525,7 @@ const textInputExamples: Array = [ 'while-editing', 'unless-editing', 'always', - ]; + ] as const; const examples = clearButtonModes.map(mode => { return ( @@ -918,7 +918,12 @@ const textInputExamples: Array = [ { title: 'Line Break Strategy', render: function (): React.Node { - const lineBreakStrategy = ['none', 'standard', 'hangul-word', 'push-out']; + const lineBreakStrategy = [ + 'none', + 'standard', + 'hangul-word', + 'push-out', + ] as const; const textByCode = { en: 'lineBreakStrategy lineBreakStrategy lineBreakStrategy lineBreakStrategy', ko: '한글개행한글개행 한글개행한글개행 한글개행한글개행 한글개행한글개행 한글개행한글개행 한글개행한글개행', @@ -996,7 +1001,7 @@ const textInputExamples: Array = [ 'head', 'middle', 'tail', - ]; + ] as const; const textByCode = { en: 'verylongtext-dummydummydummydummydummydummydummydummydummydummydummydummy', ko: '한글개행한글개행-한글개행한글개행한글개행한글개행한글개행한글개행한글개행한글개행한글개행한글개행', diff --git a/packages/@react-native/tester/js/examples/TextInput/TextInputExample.js.flow b/packages/@react-native/tester/js/examples/TextInput/TextInputExample.js.flow index 08e4217a5ac..ae0b79c1a6d 100644 --- a/packages/@react-native/tester/js/examples/TextInput/TextInputExample.js.flow +++ b/packages/@react-native/tester/js/examples/TextInput/TextInputExample.js.flow @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/TextInput/TextInputKeyProp.js b/packages/@react-native/tester/js/examples/TextInput/TextInputKeyProp.js index 22502df5f20..5d2330c3b57 100644 --- a/packages/@react-native/tester/js/examples/TextInput/TextInputKeyProp.js +++ b/packages/@react-native/tester/js/examples/TextInput/TextInputKeyProp.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/TextInput/TextInputSharedExamples.js b/packages/@react-native/tester/js/examples/TextInput/TextInputSharedExamples.js index 092852d4eda..288b90c1432 100644 --- a/packages/@react-native/tester/js/examples/TextInput/TextInputSharedExamples.js +++ b/packages/@react-native/tester/js/examples/TextInput/TextInputSharedExamples.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; @@ -1011,7 +1011,7 @@ module.exports = ([ 'web-search', 'ascii-capable-number-pad', 'numeric', - ]; + ] as const; const examples = keyboardTypes.map(type => { return ( @@ -1035,7 +1035,7 @@ module.exports = ([ 'search', 'email', 'url', - ]; + ] as const; const examples = inputMode.map(mode => { return ( @@ -1064,7 +1064,7 @@ module.exports = ([ 'previous', 'search', 'send', - ]; + ] as const; const examples = enterKeyHintTypesHints.map(hint => { return ( diff --git a/packages/@react-native/tester/js/examples/Urls/UrlExample.js b/packages/@react-native/tester/js/examples/Urls/UrlExample.js index a54c87837db..df6953718f7 100644 --- a/packages/@react-native/tester/js/examples/Urls/UrlExample.js +++ b/packages/@react-native/tester/js/examples/Urls/UrlExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/utils/RNTesterList.android.js b/packages/@react-native/tester/js/utils/RNTesterList.android.js index 833546281c1..ad4396d7e31 100644 --- a/packages/@react-native/tester/js/utils/RNTesterList.android.js +++ b/packages/@react-native/tester/js/utils/RNTesterList.android.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/utils/RNTesterList.ios.js b/packages/@react-native/tester/js/utils/RNTesterList.ios.js index 3ffb079f547..802a1d2e19d 100644 --- a/packages/@react-native/tester/js/utils/RNTesterList.ios.js +++ b/packages/@react-native/tester/js/utils/RNTesterList.ios.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/utils/RNTesterList.js.flow b/packages/@react-native/tester/js/utils/RNTesterList.js.flow index 2d74a8ea50c..dda33398312 100644 --- a/packages/@react-native/tester/js/utils/RNTesterList.js.flow +++ b/packages/@react-native/tester/js/utils/RNTesterList.js.flow @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/utils/RNTesterNavigationReducer.js b/packages/@react-native/tester/js/utils/RNTesterNavigationReducer.js index 7cb495cb8b9..3a3fd36dd31 100644 --- a/packages/@react-native/tester/js/utils/RNTesterNavigationReducer.js +++ b/packages/@react-native/tester/js/utils/RNTesterNavigationReducer.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type { diff --git a/packages/@react-native/tester/js/utils/testerStateUtils.js b/packages/@react-native/tester/js/utils/testerStateUtils.js index df8137bc58e..3897338e3ee 100644 --- a/packages/@react-native/tester/js/utils/testerStateUtils.js +++ b/packages/@react-native/tester/js/utils/testerStateUtils.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type { @@ -22,7 +22,7 @@ export const Screens = { COMPONENTS: 'components', APIS: 'apis', PLAYGROUNDS: 'playgrounds', -}; +} as const; export const initialNavigationState: RNTesterNavigationState = { activeModuleKey: null, diff --git a/packages/@react-native/tester/js/utils/useJsStalls.js b/packages/@react-native/tester/js/utils/useJsStalls.js index 7f602ac5c63..e56a7e9f480 100644 --- a/packages/@react-native/tester/js/utils/useJsStalls.js +++ b/packages/@react-native/tester/js/utils/useJsStalls.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterJsStallsState} from '../types/RNTesterTypes'; @@ -56,8 +56,7 @@ const useJsStalls = (): ({ }, []); const onEnableJsStallsTracking = useCallback(() => { - const JSEventLoopWatchdog = - require('react-native/Libraries/Interaction/JSEventLoopWatchdog').default; + const JSEventLoopWatchdog = require('./JSEventLoopWatchdog').default; JSEventLoopWatchdog.install({thresholdMS: 25}); diff --git a/packages/@react-native/tester/overrides.json b/packages/@react-native/tester/overrides.json index 4a0c220fbbf..a7404b81c3a 100644 --- a/packages/@react-native/tester/overrides.json +++ b/packages/@react-native/tester/overrides.json @@ -1,5 +1,5 @@ { - "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", + "baseVersion": "0.81.0-nightly-20250604-1a6d466f1", "overrides": [ { "type": "copy", @@ -12,70 +12,70 @@ "type": "copy", "directory": "js/components", "baseDirectory": "packages/rn-tester/js/components", - "baseHash": "c736a4825f4e72864c05d2df0d5b4077075ec3c4", + "baseHash": "437ee67999759eaccdef7b1620d52cee7dc93ef3", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Accessibility", "baseDirectory": "packages/rn-tester/js/examples/Accessibility", - "baseHash": "f1095a492e55ecf9a950171076c3ebd09627bd04", + "baseHash": "8de410be934fa2b0463b557ae39467b1e8bd5660", "issue": 4054 }, { "type": "copy", "directory": "js/examples/ActionSheetIOS", "baseDirectory": "packages/rn-tester/js/examples/ActionSheetIOS", - "baseHash": "284ffb9aef4f7ac10cdb3606124af1f0a8dad231", + "baseHash": "5ea321e609eca938c5b2b6e6588ffec9dc9bc140", "issue": 4054 }, { "type": "copy", "directory": "js/examples/ActivityIndicator", "baseDirectory": "packages/rn-tester/js/examples/ActivityIndicator", - "baseHash": "5f3c5a36cc83e2520900548999d4282ec62648c1", + "baseHash": "cbfe5e59a4e1f879756d2dfb7d740daf83b0bc6f", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Alert", "baseDirectory": "packages/rn-tester/js/examples/Alert", - "baseHash": "e6b2ca8b22895574e7b13e0f2b68e628689992fd", + "baseHash": "f86c10d593d7df2d39f2c84999d17b8779ce850d", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Animated", "baseDirectory": "packages/rn-tester/js/examples/Animated", - "baseHash": "887588a46283f20f5af16aae88ff8dfabc782408", + "baseHash": "2360c15266880dd810d87ecdaadb8d3118949122", "issue": 4054 }, { "type": "copy", "directory": "js/examples/AnimatedGratuitousApp", "baseDirectory": "packages/rn-tester/js/examples/AnimatedGratuitousApp", - "baseHash": "27c1dbb8fe73acc6c4397789f7b6b01e6288fac3", + "baseHash": "919725c39b25ca35d8c9ae97f738efcac5d4619c", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Appearance", "baseDirectory": "packages/rn-tester/js/examples/Appearance", - "baseHash": "bdb5d6a9c497a3a1098b6e5c0c19f4e5d0aa650c", + "baseHash": "a0ace4d095aed6fcadb33b1036a0dce2faa84935", "issue": 4054 }, { "type": "copy", "directory": "js/examples/AppState", "baseDirectory": "packages/rn-tester/js/examples/AppState", - "baseHash": "38fdf6aadfc305752480b482b9dc252a09ee0cf3", + "baseHash": "e207d452ff10e06bdd47b18767ce0f1dcdad5c48", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Border", "baseDirectory": "packages/rn-tester/js/examples/Border", - "baseHash": "d4d79d08b9d427dcb847985494b7844e8b1cf613", + "baseHash": "6c59e59ca987d4783d4369661cd766cc876ec3de", "issue": 4054 }, { @@ -89,21 +89,21 @@ "type": "copy", "directory": "js/examples/Button", "baseDirectory": "packages/rn-tester/js/examples/Button", - "baseHash": "45af2a172c406ff014f4ec5cb2e25db71eae039f", + "baseHash": "b55e8f45a52219192b60c93a74327fea5f12f248", "issue": 4054 }, { "type": "copy", "directory": "js/examples/ContentURLAndroid", "baseDirectory": "packages/rn-tester/js/examples/ContentURLAndroid", - "baseHash": "63d75106646d06fcc186a2e7f2b454f22ab6d282", + "baseHash": "84432fe42f13d88cf5a683f6352c5448bdab5ff8", "issue": 14844 }, { "type": "copy", "directory": "js/examples/Crash", "baseDirectory": "packages/rn-tester/js/examples/Crash", - "baseHash": "c975dc965aa783c2608b9619aca55a7415c15ff4", + "baseHash": "8f253227dc9153838c06e3acefedb19ad71afcf4", "issue": 4054 }, { @@ -117,105 +117,105 @@ "type": "copy", "directory": "js/examples/DevSettings", "baseDirectory": "packages/rn-tester/js/examples/DevSettings", - "baseHash": "0c68ef88151b1a330bc558f91fbe5835251ac63e", + "baseHash": "1dfcc11095ad5623f55c70a9583423fef063d020", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Dimensions", "baseDirectory": "packages/rn-tester/js/examples/Dimensions", - "baseHash": "cb6775e81ca7618bd7b3ecd2d6378c9d9d7140a2", + "baseHash": "17355cfdfc1226357f64195b897685681b3d0d06", "issue": 4054 }, { "type": "copy", "directory": "js/examples/DisplayContents", "baseDirectory": "packages/rn-tester/js/examples/DisplayContents", - "baseHash": "c23c101587a77d4e96fca087eef9760792e23f4b", + "baseHash": "14cc40ae27fc9f0dab86f5eca4534c7d0d247d4c", "issue": 4054 }, { "type": "copy", "directory": "js/examples/DrawerLayoutAndroid", "baseDirectory": "packages/rn-tester/js/examples/DrawerLayoutAndroid", - "baseHash": "fca543d89350c3f00c081d9b42447c683fd5430a", + "baseHash": "e39c4ae1b1ab170ff0aa9bbdd6dc10ee9572e581", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Experimental", "baseDirectory": "packages/rn-tester/js/examples/Experimental", - "baseHash": "bcaf7e221089ff42936eae1f96913e83f9b03d06", + "baseHash": "d50fafa9eb6e87e67bd8ae1b0830927210efc8dd", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Filter", "baseDirectory": "packages/rn-tester/js/examples/Filter", - "baseHash": "4e894d7113a0f6a789741f93ed2d5a7c1885d525", + "baseHash": "e0e677e9e81362e663857e0a3c3216d45035f0b1", "issue": 4054 }, { "type": "copy", "directory": "js/examples/FlatList", "baseDirectory": "packages/rn-tester/js/examples/FlatList", - "baseHash": "0a7cd01bacf7616e1f5abf7f80ade2bb5834b73f", + "baseHash": "8482cbc242b6e720fa5c1ee6cbee09463a46e55a", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Image", "baseDirectory": "packages/rn-tester/js/examples/Image", - "baseHash": "7a12041bc339370fd9ecaf2d99682a08d47fb536", + "baseHash": "8938292ca461f0222f16795cb8725ad9a177153d", "issue": 4054 }, { "type": "copy", "directory": "js/examples/InputAccessoryView", "baseDirectory": "packages/rn-tester/js/examples/InputAccessoryView", - "baseHash": "3786b55aa9476b0460b6f8f7ba4ca281945bc399", + "baseHash": "0e08c62585bf84585a5c5e4750ac60810cfc4abd", "issue": 4054 }, { "type": "copy", "directory": "js/examples/InvalidProps", "baseDirectory": "packages/rn-tester/js/examples/InvalidProps", - "baseHash": "080d765db9f0ffd5e683abb15c6b2416aa015d26", + "baseHash": "156aa86db7cd0d18359a36639e33f7c1cd2b8a6a", "issue": 4054 }, { "type": "copy", "directory": "js/examples/JSResponderHandlerExample", "baseDirectory": "packages/rn-tester/js/examples/JSResponderHandlerExample", - "baseHash": "5c2aaf75e825889d49dd8d8fc144ea3ea56c235b", + "baseHash": "56167eac4a956eda6aaefa320ace8aa232bebe7b", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Keyboard", "baseDirectory": "packages/rn-tester/js/examples/Keyboard", - "baseHash": "c97b0047f8799cdeb0429d4557786b654552944c", + "baseHash": "836505d306708c7d0835b744be96b21b599f0658", "issue": 4054 }, { "type": "copy", "directory": "js/examples/KeyboardAvoidingView", "baseDirectory": "packages/rn-tester/js/examples/KeyboardAvoidingView", - "baseHash": "71675ed83ad24fe7a4a2368a48d92e20177df877", + "baseHash": "a62950d3245e6a55daada929fc54faf862c6c449", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Layout", "baseDirectory": "packages/rn-tester/js/examples/Layout", - "baseHash": "886c6e5c3907152e9000eba4f095f32fd0a8f743", + "baseHash": "2c057a259bc8ab4468b210ba0a1c93f14e592afc", "issue": 4054 }, { "type": "copy", "directory": "js/examples/LinearGradient", "baseDirectory": "packages/rn-tester/js/examples/LinearGradient/", - "baseHash": "020606242879035f322127682d0adc88e932a0f1", + "baseHash": "c8320fc108340a8eb70336ce2dc96ed593efe7d1", "issue": 4054 }, { @@ -229,118 +229,118 @@ "type": "copy", "directory": "js/examples/MixBlendMode", "baseDirectory": "packages/rn-tester/js/examples/MixBlendMode", - "baseHash": "c1b37073287e3ba9e21e299160b61258a833b3c7", + "baseHash": "68c9b90a61a76a63d2fe8f79df7fefd7d2320e37", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Modal", "baseDirectory": "packages/rn-tester/js/examples/Modal", - "baseHash": "3f9ebfeb7e1389eefe51b0ed22465a36484fcd0e", + "baseHash": "25cab1a7072f85668993d41f742a0e736c7ce2b3", "issue": 4054 }, { "type": "copy", "directory": "js/examples/NativeAnimation", "baseDirectory": "packages/rn-tester/js/examples/NativeAnimation", - "baseHash": "511912caab1a4ca976b70e23d31508dd3c060cd9", + "baseHash": "e6e46a8314710ca508b1235eaaf15454e112100f", "issue": 4054 }, { "type": "copy", "directory": "js/examples/NewAppScreen", "baseDirectory": "packages/rn-tester/js/examples/NewAppScreen", - "baseHash": "8f10b84d4ebfeab9bd76d2fd9ef06af1bb78bfa7", + "baseHash": "69596f54e45e0b9ed384052e7e0d96ed44dc0c6e", "issue": 0 }, { "type": "copy", "directory": "js/examples/NewArchitecture", "baseDirectory": "packages/rn-tester/js/examples/NewArchitecture", - "baseHash": "007b6fe5678c4c2330957575d3b8c31d2d7041de", + "baseHash": "f2f212445c5a1310b393a64634014a50c38dd03c", "issue": 4054 }, { "type": "copy", "directory": "js/examples/OrientationChange", "baseDirectory": "packages/rn-tester/js/examples/OrientationChange", - "baseHash": "9342e3741a9dad9a5a9efd6a1436deebfb14b17e", + "baseHash": "58840892e1b928b2290bafad76efebbf0e7770cb", "issue": 4054 }, { "type": "copy", "directory": "js/examples/OSSLibraryExample", "baseDirectory": "packages/rn-tester/js/examples/OSSLibraryExample", - "baseHash": "e6c27b0e9f85bd7ffaff296b3b1d36f7e442758a", + "baseHash": "5e81207c1955cdd2c2e3c307785d614f74ff858f", "issue": 4054 }, { "type": "copy", "directory": "js/examples/PanResponder", "baseDirectory": "packages/rn-tester/js/examples/PanResponder", - "baseHash": "70e9ae1244f50e113cb5911d2b3d6f4f4ab7756e", + "baseHash": "6859f5e7f35424e6ddc4aa9c39a76ecb946c7bb3", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Performance", "baseDirectory": "packages/rn-tester/js/examples/Performance", - "baseHash": "16d0d12a559979ef4126c7e913bcf4d115d391ba" + "baseHash": "408ae7ff893047dc3a187b878fd8ac9c61883547" }, { "type": "copy", "directory": "js/examples/PermissionsAndroid", "baseDirectory": "packages/rn-tester/js/examples/PermissionsAndroid", - "baseHash": "3245c9968c8e4efec115ee3a4c514d7c3af079c1", + "baseHash": "6f4d4d32f7cfa7d1c6b7d7f85aacc86a00fd51cf", "issue": 4054 }, { "type": "copy", "directory": "js/examples/PixelRatio", "baseDirectory": "packages/rn-tester/js/examples/PixelRatio", - "baseHash": "8309ac200bdd9bd2d301af8a970407652bf2eb2c", + "baseHash": "e724d72c0010fce144a936d606ff2f120ab9bf3e", "issue": 4054 }, { "type": "copy", "directory": "js/examples/PlatformColor", "baseDirectory": "packages/rn-tester/js/examples/PlatformColor", - "baseHash": "9b3ccfdda59115536f062cae09f58a6955f9aecc", + "baseHash": "4522c76cf0d9338ad5e8ba1f076290d8c03b47b4", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Playground", "baseDirectory": "packages/rn-tester/js/examples/Playground", - "baseHash": "6765fcbeceefd44838d1ae3584dcf919b6834160", + "baseHash": "ff9da49530b63c580c532e403dbdd7ff8050ea4c", "issue": 4054 }, { "type": "copy", "directory": "js/examples/PointerEvents", "baseDirectory": "packages/rn-tester/js/examples/PointerEvents", - "baseHash": "439ad0ce20342e79754ab0b4397e6bc3386b7067", + "baseHash": "41cb4045529577e57964802fdb23c429e2bce46b", "issue": 4054 }, { "type": "copy", "directory": "js/examples/PopupMenuAndroid", "baseDirectory": "packages/rn-tester/js/examples/PopupMenuAndroid", - "baseHash": "8963a594b5b945b00044e92c2a789438c56ca5a5", + "baseHash": "0025a91c9757a0674f324c044ed3694f59741867", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Pressable", "baseDirectory": "packages/rn-tester/js/examples/Pressable", - "baseHash": "c169408a423b490b64980439e67d70ecf60acde0", + "baseHash": "c5d2c7e009eaece6ca49b0687c9b855e82426546", "issue": 4054 }, { "type": "copy", "directory": "js/examples/RCTRootView", "baseDirectory": "packages/rn-tester/js/examples/RCTRootView", - "baseHash": "8401aedea0a1646f8f70f2a902449e2d205676fe", + "baseHash": "77a2dcd006f9548de27a0ff12d7b7fffd41ec74e", "issue": 4054 }, { @@ -354,14 +354,14 @@ "type": "copy", "directory": "js/examples/RootViewSizeFlexibilityExample", "baseDirectory": "packages/rn-tester/js/examples/RootViewSizeFlexibilityExample", - "baseHash": "1bc67bf082594c8d80f061a272d7369369bd4d67", + "baseHash": "b06060756edec18185db013530252a5050295cc8", "issue": 4054 }, { "type": "copy", "directory": "js/examples/RTL", "baseDirectory": "packages/rn-tester/js/examples/RTL", - "baseHash": "113d8ee424b9676575de92dacd740926f911a13a", + "baseHash": "f71c89d778f6df90fd7fe08067749daea5893da5", "issue": 4054 }, { @@ -375,42 +375,42 @@ "type": "copy", "directory": "js/examples/ScrollView", "baseDirectory": "packages/rn-tester/js/examples/ScrollView", - "baseHash": "1611d03fd3ffe4c07b29464cbaf557afb78e6309", + "baseHash": "859f85f9a9837792091f4adb9245e3cc2d275efb", "issue": 4054 }, { "type": "copy", "directory": "js/examples/SectionList", "baseDirectory": "packages/rn-tester/js/examples/SectionList", - "baseHash": "5203607e8d11ac017e1fd8f6d4161d638285ad63", + "baseHash": "8bc8ac6cea1513369d65328fb589a78f3f914a00", "issue": 4054 }, { "type": "copy", "directory": "js/examples/SetPropertiesExample", "baseDirectory": "packages/rn-tester/js/examples/SetPropertiesExample", - "baseHash": "a36362b80f1745cd1ba20d0606aea5dbbb6d3e11", + "baseHash": "6600716b175dc5efefac41ad6667191755a34965", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Share", "baseDirectory": "packages/rn-tester/js/examples/Share", - "baseHash": "af46b3e117209e278c8ee7b1f5587d861f80f9ee", + "baseHash": "3b16ebdae95ba484745d10f5713f930c349aef4c", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Snapshot", "baseDirectory": "packages/rn-tester/js/examples/Snapshot", - "baseHash": "f98f7b2b775c517c0c4e3365453628e36babcd90", + "baseHash": "bb61e1f0132201716149c17820d27da7bccf777b", "issue": 4054 }, { "type": "copy", "directory": "js/examples/StatusBar", "baseDirectory": "packages/rn-tester/js/examples/StatusBar", - "baseHash": "2a1fe43315bd83b2d05987aafc02f6b324175fa5", + "baseHash": "f221f26adda37c9fa5b0049b231111a6f98bfc0d", "issue": 4054 }, { @@ -424,14 +424,14 @@ "type": "copy", "directory": "js/examples/Switch", "baseDirectory": "packages/rn-tester/js/examples/Switch", - "baseHash": "95e37e042fb493552002e6e3b01f759d825f4af6", + "baseHash": "80f86685990261b19208331b623277a9fe6fa906", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Text", "baseDirectory": "packages/rn-tester/js/examples/Text", - "baseHash": "f49a475fb5f55882b02e98df7357a0dbcea25cdf", + "baseHash": "8a3a60f413a0d2aa9deb6349ef42fad60488c111", "issue": 4054 }, { @@ -445,97 +445,97 @@ "type": "copy", "file": "js/examples/TextInput/TextInputExample.android.js", "baseFile": "packages/rn-tester/js/examples/TextInput/TextInputExample.android.js", - "baseHash": "ed91ff793aa3c1305d75f795be74adcffe540edb", + "baseHash": "e2ec4b71e3cd614682d9be1551b3a2994ea51823", "issue": 14292 }, { "type": "copy", "file": "js/examples/TextInput/TextInputExample.ios.js", "baseFile": "packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js", - "baseHash": "be6ad2afc1d45d2ccfcfd6e8092e473497100439", + "baseHash": "3ee8cf92c26fd3b2bdf49cd45f91bd4039889176", "issue": 14292 }, { "type": "copy", "file": "js/examples/TextInput/TextInputExample.js.flow", "baseFile": "packages/rn-tester/js/examples/TextInput/TextInputExample.js.flow", - "baseHash": "3b2283c808b5cfdb81e76d66280915c70c8bcae0", + "baseHash": "72e5056869d31f19a5752b49edad4b2152339bdf", "issue": 14292 }, { "type": "copy", "file": "js/examples/TextInput/TextInputKeyProp.js", "baseFile": "packages/rn-tester/js/examples/TextInput/TextInputKeyProp.js", - "baseHash": "4b20afdadfeba3e1a039525860f14c31161c3382", + "baseHash": "8ef6a993c1754a016afb1d4826b33b9bffd64c4f", "issue": 14292 }, { "type": "patch", "file": "js/examples/TextInput/TextInputSharedExamples.js", "baseFile": "packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js", - "baseHash": "0fb3edd66da2973878dbb6d04358b656dccb21f3", + "baseHash": "46b59227ca8473ab25f558b2c27d5eab8c6009e4", "issue": 14291 }, { "type": "copy", "directory": "js/examples/Timer", "baseDirectory": "packages/rn-tester/js/examples/Timer", - "baseHash": "0a8230263e436de9ddb70be4df231460b7f00168", + "baseHash": "e34b237e56a1909d86a6f17162f3c11ece405d89", "issue": 4054 }, { "type": "copy", "directory": "js/examples/ToastAndroid", "baseDirectory": "packages/rn-tester/js/examples/ToastAndroid", - "baseHash": "51bfe4f15fe6e86121a4599a03e0a2c41bee39ec", + "baseHash": "82e349fa291f3187dbdac9b74eb15b85405fa064", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Touchable", "baseDirectory": "packages/rn-tester/js/examples/Touchable", - "baseHash": "b9a82318edc3eee1c039cee7281f44c73a05adfc", + "baseHash": "c7e77472680734c2bb7ae31018978d019cf2c3a5", "issue": 4054 }, { "type": "copy", "directory": "js/examples/Transform", "baseDirectory": "packages/rn-tester/js/examples/Transform", - "baseHash": "9c5bc36e3173eb09deea87baac7b669823f47919", + "baseHash": "e9341b7f41df3f22b843a9d74638d8e14c4d1be0", "issue": 4054 }, { "type": "copy", "directory": "js/examples/TransparentHitTest", "baseDirectory": "packages/rn-tester/js/examples/TransparentHitTest", - "baseHash": "1e55a5054bcb7e36ec49d310d122ec134864a035", + "baseHash": "3b28f506de014aae36bb4682a6d02d886b0ef382", "issue": 4054 }, { "type": "copy", "directory": "js/examples/TurboModule", "baseDirectory": "packages/rn-tester/js/examples/TurboModule", - "baseHash": "6b267098024fd237b4fafba827871decbf6e2f86", + "baseHash": "ee71ec149a82c221404ecb97507ae901773c079d", "issue": 4054 }, { "type": "copy", "file": "js/examples/Urls/UrlExample.js", "baseFile": "packages/rn-tester/js/examples/Urls/UrlExample.js", - "baseHash": "06a5d2e5d3ccf291f33c6733cc3faee5a468f655" + "baseHash": "da210c7b8e59587c58acde5c9f68181ad51bdb1e" }, { "type": "copy", "directory": "js/examples/Vibration", "baseDirectory": "packages/rn-tester/js/examples/Vibration", - "baseHash": "5c89e2a3bd6ea56a5220e26aa2bf8e8efc70af69", + "baseHash": "0cfa593f9c7fc6a80bca9f25930297cdaedc0ddf", "issue": 4054 }, { "type": "copy", "directory": "js/examples/View", "baseDirectory": "packages/rn-tester/js/examples/View", - "baseHash": "780c2954afdbc7b99f02b6f1ad462ce0dc9564c1", + "baseHash": "118363a9b248b450f1782c91d35a0102dd758ec3", "issue": 4054 }, { @@ -549,56 +549,56 @@ "type": "copy", "directory": "js/examples/XHR", "baseDirectory": "packages/rn-tester/js/examples/XHR", - "baseHash": "bd25a7f1e3e8f2e5ca6bd395fb77f8df90340051", + "baseHash": "7e0371f96a68b509a7b2f948db55199a7e4bb341", "issue": 4054 }, { "type": "copy", "file": "js/RNTesterApp.android.js", "baseFile": "packages/rn-tester/js/RNTesterApp.android.js", - "baseHash": "5e73edb50a1156756f2d1bec70d95a92f701ec22", + "baseHash": "987893a4df686425670b7897881b61e485960191", "issue": 4054 }, { "type": "copy", "file": "js/RNTesterApp.ios.js", "baseFile": "packages/rn-tester/js/RNTesterApp.ios.js", - "baseHash": "45c4e448f7cc5bafa3f331860ff8747f252f8ace", + "baseHash": "cde4e2f48f0e8d12f42f75bf56ae09265e17a984", "issue": 4054 }, { "type": "copy", "file": "js/RNTesterAppShared.js", "baseFile": "packages/rn-tester/js/RNTesterAppShared.js", - "baseHash": "68a13d2fb7a8f2a9e729bbfe490c9654f9b2bec4", + "baseHash": "60fa5f78a5eae5e51678d59456d22bd7d4b73374", "issue": 4054 }, { "type": "copy", "directory": "js/types", "baseDirectory": "packages/rn-tester/js/types", - "baseHash": "e61749e70d51ffe95b383c32d4956a2beddb72df", + "baseHash": "40139bdab68c7a7d023f91961ce3e8513c275af9", "issue": 4054 }, { "type": "patch", "file": "js/utils/RNTesterList.android.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.android.js", - "baseHash": "aded9dd37f3ac325aa1cc095f6d217114c45a8b9", + "baseHash": "faa6a65524adb312817e96d511649edd81e38262", "issue": 13228 }, { "type": "patch", "file": "js/utils/RNTesterList.ios.js", "baseFile": "packages/rn-tester/js/utils/RNTesterList.ios.js", - "baseHash": "789dae4f7e58c8db55f121907fa923294ca69ac1", + "baseHash": "bccd9d08994e58aaa3262eeeeb60bacac5f68204", "issue": 13228 }, { "type": "copy", "file": "js/utils/RNTesterList.js.flow", "baseFile": "packages/rn-tester/js/utils/RNTesterList.js.flow", - "baseHash": "8059d3cfd7ce42a8283ff6bbfd5c6a133e30b7a2", + "baseHash": "92c62c7c48ad1de937ef02a1687d4ba71cbff307", "issue": 4054 }, { @@ -612,21 +612,21 @@ "type": "copy", "file": "js/utils/RNTesterNavigationReducer.js", "baseFile": "packages/rn-tester/js/utils/RNTesterNavigationReducer.js", - "baseHash": "b82ce86909eab06480318a5312231d4b7d50e4d2", + "baseHash": "20a837b3cd30a61623215b3681e5cd35070789c8", "issue": 4054 }, { "type": "copy", "file": "js/utils/testerStateUtils.js", "baseFile": "packages/rn-tester/js/utils/testerStateUtils.js", - "baseHash": "7fa1afc9bd4225b55aa36135193a86138c6269a6", + "baseHash": "e2c7af3c0bbca1ff69e6a22769f8d050b4f9b124", "issue": 4054 }, { "type": "copy", "file": "js/utils/useJsStalls.js", "baseFile": "packages/rn-tester/js/utils/useJsStalls.js", - "baseHash": "bbe8c5e4a0cb5f27a967a43c7953efada69927d9", + "baseHash": "b6993b7f0c4c179de0cc1276212669627e7a21bb", "issue": 4054 }, { diff --git a/packages/e2e-test-app-fabric/package.json b/packages/e2e-test-app-fabric/package.json index b58aa0df382..421ac0c9290 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.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993" }, "devDependencies": { diff --git a/packages/e2e-test-app/package.json b/packages/e2e-test-app/package.json index 254d60cf1cc..90e5a83e741 100644 --- a/packages/e2e-test-app/package.json +++ b/packages/e2e-test-app/package.json @@ -20,7 +20,7 @@ "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "react": "^19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993", "react-native-xaml": "^0.0.80" }, diff --git a/packages/integration-test-app/package.json b/packages/integration-test-app/package.json index f1c69f917a1..bc63a554aec 100644 --- a/packages/integration-test-app/package.json +++ b/packages/integration-test-app/package.json @@ -17,7 +17,7 @@ "@typescript-eslint/parser": "^7.1.1", "chai": "^4.2.0", "react": "^19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993" }, "devDependencies": { diff --git a/packages/playground/package.json b/packages/playground/package.json index 256dd915110..9ea7290c6c0 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -15,7 +15,7 @@ "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "react": "^19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993" }, "devDependencies": { diff --git a/packages/sample-app-fabric/package.json b/packages/sample-app-fabric/package.json index 10ffd05ee02..e549f7f36a0 100644 --- a/packages/sample-app-fabric/package.json +++ b/packages/sample-app-fabric/package.json @@ -17,7 +17,7 @@ "@typescript-eslint/parser": "^7.1.1", "@react-native/new-app-screen": "0.81.0-nightly-20250521-3cb70bb6a", "react": "^19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993" }, "devDependencies": { diff --git a/packages/sample-apps/package.json b/packages/sample-apps/package.json index c58b93f22de..0d1de034f62 100644 --- a/packages/sample-apps/package.json +++ b/packages/sample-apps/package.json @@ -16,7 +16,7 @@ "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "react": "^19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993" }, "devDependencies": { diff --git a/packages/sample-custom-component/package.json b/packages/sample-custom-component/package.json index d08477d2bfc..e39036bb249 100644 --- a/packages/sample-custom-component/package.json +++ b/packages/sample-custom-component/package.json @@ -22,7 +22,7 @@ "dependencies": { "@types/react": "^19.1.0", "react": "^19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-windows": "^0.0.0-canary.993" }, "devDependencies": { diff --git a/vnext/.flowconfig b/vnext/.flowconfig index 7b412f3a780..510d5e67b30 100644 --- a/vnext/.flowconfig +++ b/vnext/.flowconfig @@ -105,11 +105,17 @@ ../node_modules/ [libs] +<<<<<<< Upstream +flow-typed/ +packages/react-native/interface.js +packages/react-native/flow/ +======= interface.js flow/ ../node_modules/.flow/flow-typed/ ../node_modules/react-native/src/types src/types/ +>>>>>>> Override [options] enums=true @@ -139,6 +145,8 @@ module.name_mapper='^react-native-windows/\(.*\)$' -> '/\1' module.name_mapper='^@react-native/dev-middleware$' -> '/\1' module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '/Libraries/Image/RelativeImageStub' +module.system.haste.module_ref_prefix=m# + react.runtime=automatic suppress_type=$FlowIssue @@ -171,4 +179,4 @@ untyped-import untyped-type-import [version] -^0.271.0 +^0.272.2 diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp index 41f8377a68a..a00d78a4caf 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp @@ -6,11 +6,11 @@ */ #include "NativeDOM.h" +#include #include #include #include #include -#include #ifdef RN_DISABLE_OSS_PLUGIN_HEADER #include "Plugins.h" @@ -23,6 +23,14 @@ std::shared_ptr NativeDOMModuleProvider( namespace facebook::react { +namespace { +inline ShadowNode::Shared getShadowNode( + facebook::jsi::Runtime& runtime, + jsi::Value& shadowNodeValue) { + return Bridging::fromJs(runtime, shadowNodeValue); +} +} // namespace + #pragma mark - Private helpers static UIManager& getUIManagerFromRuntime(facebook::jsi::Runtime& runtime) { @@ -46,8 +54,7 @@ static RootShadowNode::Shared getCurrentShadowTreeRevision( } return getCurrentShadowTreeRevision( - runtime, - shadowNodeFromValue(runtime, nativeNodeReference)->getSurfaceId()); + runtime, getShadowNode(runtime, nativeNodeReference)->getSurfaceId()); } static facebook::react::PointerEventsProcessor& @@ -107,7 +114,7 @@ double NativeDOM::compareDocumentPosition( // Only the first is a document auto surfaceId = nativeNodeReference.asNumber(); shadowNode = currentRevision; - otherShadowNode = shadowNodeFromValue(rt, otherNativeNodeReference); + otherShadowNode = getShadowNode(rt, otherNativeNodeReference); if (isRootShadowNode(*otherShadowNode)) { // If the other is a root node, we just need to check if it is its @@ -123,8 +130,13 @@ double NativeDOM::compareDocumentPosition( } else { // Only the second is a document auto otherSurfaceId = otherNativeNodeReference.asNumber(); +<<<<<<< Upstream + shadowNode = getShadowNode(rt, nativeNodeReference); + otherShadowNode = getCurrentShadowTreeRevision(rt, otherSurfaceId); +======= shadowNode = shadowNodeFromValue(rt, nativeNodeReference); otherShadowNode = getCurrentShadowTreeRevision(rt, static_cast(otherSurfaceId)); +>>>>>>> Override if (isRootShadowNode(*shadowNode)) { // If this is a root node, we just need to check if the other is its @@ -138,8 +150,8 @@ double NativeDOM::compareDocumentPosition( } } } else { - shadowNode = shadowNodeFromValue(rt, nativeNodeReference); - otherShadowNode = shadowNodeFromValue(rt, otherNativeNodeReference); + shadowNode = getShadowNode(rt, nativeNodeReference); + otherShadowNode = getShadowNode(rt, otherNativeNodeReference); } return dom::compareDocumentPosition( @@ -160,7 +172,7 @@ std::vector NativeDOM::getChildNodes( } auto childNodes = dom::getChildNodes( - currentRevision, *shadowNodeFromValue(rt, nativeNodeReference)); + currentRevision, *getShadowNode(rt, nativeNodeReference)); return getArrayOfInstanceHandlesFromShadowNodes(childNodes, rt); } @@ -172,7 +184,7 @@ jsi::Value NativeDOM::getParentNode( return jsi::Value::undefined(); } - auto shadowNode = shadowNodeFromValue(rt, nativeNodeReference); + auto shadowNode = getShadowNode(rt, nativeNodeReference); if (isRootShadowNode(*shadowNode)) { // The parent of the root node is the document. return jsi::Value{shadowNode->getSurfaceId()}; @@ -203,7 +215,7 @@ bool NativeDOM::isConnected(jsi::Runtime& rt, jsi::Value nativeNodeReference) { return true; } - auto shadowNode = shadowNodeFromValue(rt, nativeNodeReference); + auto shadowNode = getShadowNode(rt, nativeNodeReference); return dom::isConnected(currentRevision, *shadowNode); } @@ -214,8 +226,7 @@ std::tuple< /* rightWidth: */ int, /* bottomWidth: */ int, /* leftWidth: */ int> -NativeDOM::getBorderWidth(jsi::Runtime& rt, jsi::Value nativeElementReference) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); +NativeDOM::getBorderWidth(jsi::Runtime& rt, ShadowNode::Shared shadowNode) { auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -234,9 +245,8 @@ std::tuple< /* height: */ double> NativeDOM::getBoundingClientRect( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, bool includeTransform) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -251,8 +261,7 @@ NativeDOM::getBoundingClientRect( std::tuple NativeDOM::getInnerSize( jsi::Runtime& rt, - jsi::Value nativeElementReference) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); + ShadowNode::Shared shadowNode) { auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -264,10 +273,7 @@ std::tuple NativeDOM::getInnerSize( } std::tuple -NativeDOM::getScrollPosition( - jsi::Runtime& rt, - jsi::Value nativeElementReference) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); +NativeDOM::getScrollPosition(jsi::Runtime& rt, ShadowNode::Shared shadowNode) { auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -279,8 +285,7 @@ NativeDOM::getScrollPosition( } std::tuple -NativeDOM::getScrollSize(jsi::Runtime& rt, jsi::Value nativeElementReference) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); +NativeDOM::getScrollSize(jsi::Runtime& rt, ShadowNode::Shared shadowNode) { auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -293,15 +298,13 @@ NativeDOM::getScrollSize(jsi::Runtime& rt, jsi::Value nativeElementReference) { std::string NativeDOM::getTagName( jsi::Runtime& rt, - jsi::Value nativeElementReference) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); + ShadowNode::Shared shadowNode) { return dom::getTagName(*shadowNode); } std::string NativeDOM::getTextContent( jsi::Runtime& rt, - jsi::Value nativeNodeReference) { - auto shadowNode = shadowNodeFromValue(rt, nativeNodeReference); + ShadowNode::Shared shadowNode) { auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -313,30 +316,27 @@ std::string NativeDOM::getTextContent( bool NativeDOM::hasPointerCapture( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, double pointerId) { bool isCapturing = getPointerEventsProcessorFromRuntime(rt).hasPointerCapture( - static_cast(pointerId), - shadowNodeFromValue(rt, nativeElementReference).get()); + static_cast(pointerId), shadowNode.get()); return isCapturing; } void NativeDOM::releasePointerCapture( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, double pointerId) { getPointerEventsProcessorFromRuntime(rt).releasePointerCapture( - static_cast(pointerId), - shadowNodeFromValue(rt, nativeElementReference).get()); + static_cast(pointerId), shadowNode.get()); } void NativeDOM::setPointerCapture( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, double pointerId) { getPointerEventsProcessorFromRuntime(rt).setPointerCapture( - static_cast(pointerId), - shadowNodeFromValue(rt, nativeElementReference)); + static_cast(pointerId), shadowNode); } #pragma mark - Methods from the HTMLElement interface (for ReactNativeElement). @@ -345,8 +345,7 @@ std::tuple< /* offsetParent: */ jsi::Value, /* top: */ double, /* left: */ double> -NativeDOM::getOffset(jsi::Runtime& rt, jsi::Value nativeElementReference) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); +NativeDOM::getOffset(jsi::Runtime& rt, ShadowNode::Shared shadowNode) { auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -378,16 +377,15 @@ jsi::Value NativeDOM::linkRootNode( std::make_shared(rt, instanceHandle, surfaceId); currentRevision->setInstanceHandle(instanceHandleWrapper); - return valueFromShadowNode(rt, currentRevision); + return Bridging::toJs(rt, currentRevision); } #pragma mark - Legacy layout APIs (for ReactNativeElement). void NativeDOM::measure( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, jsi::Function callback) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -409,9 +407,8 @@ void NativeDOM::measure( void NativeDOM::measureInWindow( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, jsi::Function callback) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -430,13 +427,10 @@ void NativeDOM::measureInWindow( void NativeDOM::measureLayout( jsi::Runtime& rt, - jsi::Value nativeElementReference, - jsi::Value relativeToNativeElementReference, + ShadowNode::Shared shadowNode, + ShadowNode::Shared relativeToShadowNode, jsi::Function onFail, jsi::Function onSuccess) { - auto shadowNode = shadowNodeFromValue(rt, nativeElementReference); - auto relativeToShadowNode = - shadowNodeFromValue(rt, relativeToNativeElementReference); auto currentRevision = getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId()); if (currentRevision == nullptr) { @@ -468,11 +462,10 @@ void NativeDOM::measureLayout( void NativeDOM::setNativeProps( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, jsi::Value updatePayload) { getUIManagerFromRuntime(rt).setNativeProps_DEPRECATED( - shadowNodeFromValue(rt, nativeElementReference), - RawProps(rt, updatePayload)); + shadowNode, RawProps(rt, updatePayload)); } } // 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 d231964d488..994504ec894 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h @@ -11,14 +11,14 @@ #include -#if __has_include("rncoreJSI.h") // Cmake headers on Android -#include "rncoreJSI.h" -#elif __has_include("FBReactNativeSpecJSI.h") // CocoaPod headers on Apple +#if __has_include("FBReactNativeSpecJSI.h") // CocoaPod headers on Apple #include "FBReactNativeSpecJSI.h" #else #include #endif +#include +#include #include namespace facebook::react { @@ -49,7 +49,7 @@ class NativeDOM : public NativeDOMCxxSpec { /* rightWidth: */ int, /* bottomWidth: */ int, /* leftWidth: */ int> - getBorderWidth(jsi::Runtime& rt, jsi::Value nativeElementReference); + getBorderWidth(jsi::Runtime& rt, ShadowNode::Shared shadowNode); std::tuple< /* x: */ double, @@ -58,37 +58,37 @@ class NativeDOM : public NativeDOMCxxSpec { /* height: */ double> getBoundingClientRect( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, bool includeTransform); std::tuple getInnerSize( jsi::Runtime& rt, - jsi::Value nativeElementReference); + ShadowNode::Shared shadowNode); std::tuple - getScrollPosition(jsi::Runtime& rt, jsi::Value nativeElementReference); + getScrollPosition(jsi::Runtime& rt, ShadowNode::Shared shadowNode); std::tuple getScrollSize( jsi::Runtime& rt, - jsi::Value nativeElementReference); + ShadowNode::Shared shadowNode); - std::string getTagName(jsi::Runtime& rt, jsi::Value nativeElementReference); + std::string getTagName(jsi::Runtime& rt, ShadowNode::Shared shadowNode); - std::string getTextContent(jsi::Runtime& rt, jsi::Value nativeNodeReference); + std::string getTextContent(jsi::Runtime& rt, ShadowNode::Shared shadowNode); bool hasPointerCapture( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, double pointerId); void releasePointerCapture( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, double pointerId); void setPointerCapture( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, double pointerId); #pragma mark - Methods from the HTMLElement interface (for ReactNativeElement). @@ -97,7 +97,7 @@ class NativeDOM : public NativeDOMCxxSpec { /* offsetParent: */ jsi::Value, /* top: */ double, /* left: */ double> - getOffset(jsi::Runtime& rt, jsi::Value nativeElementReference); + getOffset(jsi::Runtime& rt, ShadowNode::Shared shadowNode); #pragma mark - Special methods to handle the root node. @@ -110,18 +110,18 @@ class NativeDOM : public NativeDOMCxxSpec { void measure( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, jsi::Function callback); void measureInWindow( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, jsi::Function callback); void measureLayout( jsi::Runtime& rt, - jsi::Value nativeElementReference, - jsi::Value relativeToNativeElementReference, + ShadowNode::Shared shadowNode, + ShadowNode::Shared relativeToShadowNode, jsi::Function onFail, jsi::Function onSuccess); @@ -131,7 +131,7 @@ class NativeDOM : public NativeDOMCxxSpec { void setNativeProps( jsi::Runtime& rt, - jsi::Value nativeElementReference, + ShadowNode::Shared shadowNode, jsi::Value updatePayload); }; 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 e95cc1676f7..c974daf99ad 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp @@ -59,28 +59,15 @@ ParagraphShadowNode::ParagraphShadowNode( const ShadowNode& sourceShadowNode, const ShadowNodeFragment& fragment) : ConcreteViewShadowNode(sourceShadowNode, fragment) { - auto& sourceParagraphShadowNode = - static_cast(sourceShadowNode); - auto& state = getStateData(); - const auto& sourceContent = sourceParagraphShadowNode.content_; - - if (!fragment.children && !fragment.props && - sourceParagraphShadowNode.getIsLayoutClean() && - (!ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout() || - (sourceContent.has_value() && - sourceContent.value() - .attributedString.getBaseTextAttributes() - .fontSizeMultiplier == - state.attributedString.getBaseTextAttributes() - .fontSizeMultiplier))) { - // This ParagraphShadowNode was cloned but did not change - // in a way that affects its layout. Let's mark it clean - // to stop Yoga from traversing it. - cleanLayout(); - } initialize(); } +bool ParagraphShadowNode::shouldNewRevisionDirtyMeasurement( + const ShadowNode& /*sourceShadowNode*/, + const ShadowNodeFragment& fragment) const { + return fragment.props != nullptr; +} + const Content& ParagraphShadowNode::getContent( const LayoutContext& layoutContext) const { if (content_.has_value()) { diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp index af9e3f41765..92f80586a63 100644 --- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp +++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp @@ -5,6 +5,196 @@ * LICENSE file in the root directory of this source tree. */ +<<<<<<< Upstream +#include "sliceChildShadowNodeViewPairs.h" +#include +#include + +#include "ShadowViewNodePair.h" + +namespace facebook::react { + +/* + * Sorting comparator for `reorderInPlaceIfNeeded`. + */ +static bool shouldFirstPairComesBeforeSecondOne( + const ShadowViewNodePair* lhs, + const ShadowViewNodePair* rhs) noexcept { + return lhs->shadowNode->getOrderIndex() < rhs->shadowNode->getOrderIndex(); +} + +/* + * Reorders pairs in-place based on `orderIndex` using a stable sort algorithm. + */ +static void reorderInPlaceIfNeeded( + std::vector& pairs) noexcept { + if (pairs.size() < 2) { + return; + } + + auto isReorderNeeded = false; + for (const auto& pair : pairs) { + if (pair->shadowNode->getOrderIndex() != 0) { + isReorderNeeded = true; + break; + } + } + + if (!isReorderNeeded) { + return; + } + + std::stable_sort( + pairs.begin(), pairs.end(), &shouldFirstPairComesBeforeSecondOne); +} + +static void sliceChildShadowNodeViewPairsRecursively( + std::vector& pairList, + size_t& startOfStaticIndex, + ViewNodePairScope& scope, + Point layoutOffset, + const ShadowNode& shadowNode, + const CullingContext& cullingContext) { + for (const auto& sharedChildShadowNode : shadowNode.getChildren()) { + auto& childShadowNode = *sharedChildShadowNode; +#ifndef ANDROID + // T153547836: Disabled on Android because the mounting infrastructure + // is not fully ready yet. + if (childShadowNode.getTraits().check(ShadowNodeTraits::Trait::Hidden)) { + continue; + } +#endif + auto shadowView = ShadowView(childShadowNode); + + if (ReactNativeFeatureFlags::enableViewCulling()) { + auto isViewCullable = + !shadowView.traits.check( + ShadowNodeTraits::Trait::Unstable_uncullableView) && + !shadowView.traits.check( + ShadowNodeTraits::Trait::Unstable_uncullableTrace); + if (cullingContext.shouldConsiderCulling() && isViewCullable) { + auto overflowInsetFrame = + shadowView.layoutMetrics.getOverflowInsetFrame() * + cullingContext.transform; + if (auto layoutableShadowNode = + dynamic_cast(&childShadowNode)) { + overflowInsetFrame = + overflowInsetFrame * layoutableShadowNode->getTransform(); + } + auto doesIntersect = + Rect::intersect(cullingContext.frame, overflowInsetFrame) != Rect{}; + if (!doesIntersect) { + continue; // Culling. + } + } + } + + auto origin = layoutOffset; + auto cullingContextCopy = cullingContext.adjustCullingContextIfNeeded( + {.shadowView = shadowView, .shadowNode = &childShadowNode}); + + if (shadowView.layoutMetrics != EmptyLayoutMetrics) { + origin += shadowView.layoutMetrics.frame.origin; + shadowView.layoutMetrics.frame.origin += layoutOffset; + } + + // This might not be a FormsView, or a FormsStackingContext. We let the + // differ handle removal of flattened views from the Mounting layer and + // shuffling their children around. + bool childrenFormStackingContexts = shadowNode.getTraits().check( + ShadowNodeTraits::Trait::ChildrenFormStackingContext); + bool isConcreteView = (childShadowNode.getTraits().check( + ShadowNodeTraits::Trait::FormsView) || + childrenFormStackingContexts) && + !childShadowNode.getTraits().check( + ShadowNodeTraits::Trait::ForceFlattenView); + bool areChildrenFlattened = + (!childShadowNode.getTraits().check( + ShadowNodeTraits::Trait::FormsStackingContext) && + !childrenFormStackingContexts) || + childShadowNode.getTraits().check( + ShadowNodeTraits::Trait::ForceFlattenView); + + Point storedOrigin = {}; + if (areChildrenFlattened) { + storedOrigin = origin; + } + scope.push_back( + {shadowView, + &childShadowNode, + areChildrenFlattened, + isConcreteView, + storedOrigin}); + + if (shadowView.layoutMetrics.positionType == PositionType::Static) { + auto it = pairList.begin(); + std::advance(it, startOfStaticIndex); + pairList.insert(it, &scope.back()); + startOfStaticIndex++; + if (areChildrenFlattened) { + sliceChildShadowNodeViewPairsRecursively( + pairList, + startOfStaticIndex, + scope, + origin, + childShadowNode, + cullingContextCopy); + } + } else { + pairList.push_back(&scope.back()); + if (areChildrenFlattened) { + size_t pairListSize = pairList.size(); + sliceChildShadowNodeViewPairsRecursively( + pairList, + pairListSize, + scope, + origin, + childShadowNode, + cullingContextCopy); + } + } + } +} + +std::vector sliceChildShadowNodeViewPairs( + const ShadowViewNodePair& shadowNodePair, + ViewNodePairScope& scope, + bool allowFlattened, + Point layoutOffset, + const CullingContext& cullingContext) { + const auto& shadowNode = *shadowNodePair.shadowNode; + auto pairList = std::vector{}; + + if (shadowNodePair.flattened && shadowNodePair.isConcreteView && + !allowFlattened) { + return pairList; + } + + size_t startOfStaticIndex = 0; + + sliceChildShadowNodeViewPairsRecursively( + pairList, + startOfStaticIndex, + scope, + layoutOffset, + shadowNode, + cullingContext); + + // Sorting pairs based on `orderIndex` if needed. + reorderInPlaceIfNeeded(pairList); + + // Set list and mountIndex for each after reordering + size_t mountIndex = 0; + for (auto child : pairList) { + child->mountIndex = + (child->isConcreteView ? mountIndex++ : static_cast(-1)); + } + + return pairList; +} + +} // namespace facebook::react +======= #include "sliceChildShadowNodeViewPairs.h" #include #include @@ -189,3 +379,4 @@ } } // namespace facebook::react +>>>>>>> Override diff --git a/vnext/codegen/NativeIntersectionObserverSpec.g.h b/vnext/codegen/NativeIntersectionObserverSpec.g.h index d5478418b9c..4dd128882c4 100644 --- a/vnext/codegen/NativeIntersectionObserverSpec.g.h +++ b/vnext/codegen/NativeIntersectionObserverSpec.g.h @@ -26,7 +26,6 @@ struct IntersectionObserverSpec_NativeIntersectionObserverEntry { struct IntersectionObserverSpec_NativeIntersectionObserverObserveOptions { double intersectionObserverId; - std::optional<> rootShadowNode; targetShadowNode; std::vector thresholds; std::optional> rootThresholds; @@ -49,7 +48,6 @@ inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(IntersectionObserve inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(IntersectionObserverSpec_NativeIntersectionObserverObserveOptions*) noexcept { winrt::Microsoft::ReactNative::FieldMap fieldMap { {L"intersectionObserverId", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::intersectionObserverId}, - {L"rootShadowNode", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::rootShadowNode}, {L"targetShadowNode", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::targetShadowNode}, {L"thresholds", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::thresholds}, {L"rootThresholds", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::rootThresholds}, diff --git a/vnext/codegen/NativeMutationObserverSpec.g.h b/vnext/codegen/NativeMutationObserverSpec.g.h index 7847c28e0d6..d37fbeb72a3 100644 --- a/vnext/codegen/NativeMutationObserverSpec.g.h +++ b/vnext/codegen/NativeMutationObserverSpec.g.h @@ -50,11 +50,10 @@ inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(MutationObserverSpe struct MutationObserverSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { static constexpr auto methods = std::tuple{ Method{0, L"observe"}, - Method{1, L"unobserve"}, - Method{2, L"unobserveAll"}, - Method, Callback<>) noexcept>{3, L"connect"}, - Method{4, L"disconnect"}, - SyncMethod() noexcept>{5, L"takeRecords"}, + Method{1, L"unobserveAll"}, + Method, Callback<>) noexcept>{2, L"connect"}, + Method{3, L"disconnect"}, + SyncMethod() noexcept>{4, L"takeRecords"}, }; template @@ -68,26 +67,21 @@ struct MutationObserverSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { " REACT_METHOD(observe) static void observe(MutationObserverSpec_NativeMutationObserverObserveOptions && options) noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( 1, - "unobserve", - " REACT_METHOD(unobserve) void unobserve(double mutationObserverId, targetShadowNode) noexcept { /* implementation */ }\n" - " REACT_METHOD(unobserve) static void unobserve(double mutationObserverId, targetShadowNode) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, "unobserveAll", " REACT_METHOD(unobserveAll) void unobserveAll(double mutationObserverId) noexcept { /* implementation */ }\n" " REACT_METHOD(unobserveAll) static void unobserveAll(double mutationObserverId) noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 3, + 2, "connect", " REACT_METHOD(connect) void connect(std::function const & notifyMutationObservers, std::function const & getPublicInstanceFromInstanceHandle) noexcept { /* implementation */ }\n" " REACT_METHOD(connect) static void connect(std::function const & notifyMutationObservers, std::function const & getPublicInstanceFromInstanceHandle) noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 4, + 3, "disconnect", " REACT_METHOD(disconnect) void disconnect() noexcept { /* implementation */ }\n" " REACT_METHOD(disconnect) static void disconnect() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 5, + 4, "takeRecords", " REACT_SYNC_METHOD(takeRecords) std::vector takeRecords() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(takeRecords) static std::vector takeRecords() noexcept { /* implementation */ }\n"); diff --git a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h b/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h index e83b199e0b3..5815302baa5 100644 --- a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h +++ b/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h @@ -24,49 +24,54 @@ struct ReactNativeFeatureFlagsSpec : winrt::Microsoft::ReactNative::TurboModuleS SyncMethod{4, L"cxxNativeAnimatedEnabled"}, SyncMethod{5, L"disableMainQueueSyncDispatchIOS"}, SyncMethod{6, L"disableMountItemReorderingAndroid"}, - SyncMethod{7, L"enableAccessibilityOrder"}, - SyncMethod{8, L"enableAccumulatedUpdatesInRawPropsAndroid"}, - SyncMethod{9, L"enableBridgelessArchitecture"}, - SyncMethod{10, L"enableCppPropsIteratorSetter"}, - SyncMethod{11, L"enableCustomFocusSearchOnClippedElementsAndroid"}, - SyncMethod{12, L"enableDestroyShadowTreeRevisionAsync"}, - SyncMethod{13, L"enableDoubleMeasurementFixAndroid"}, - SyncMethod{14, L"enableEagerRootViewAttachment"}, - SyncMethod{15, L"enableFabricLogs"}, - SyncMethod{16, L"enableFabricRenderer"}, - SyncMethod{17, L"enableFixForParentTagDuringReparenting"}, - SyncMethod{18, L"enableFontScaleChangesUpdatingLayout"}, - SyncMethod{19, L"enableIOSViewClipToPaddingBox"}, - SyncMethod{20, L"enableIntersectionObserverEventLoopIntegration"}, - SyncMethod{21, L"enableLayoutAnimationsOnAndroid"}, - SyncMethod{22, L"enableLayoutAnimationsOnIOS"}, - SyncMethod{23, L"enableMainQueueModulesOnIOS"}, - SyncMethod{24, L"enableNativeCSSParsing"}, - SyncMethod{25, L"enableNetworkEventReporting"}, - SyncMethod{26, L"enableNewBackgroundAndBorderDrawables"}, - SyncMethod{27, L"enablePreparedTextLayout"}, - SyncMethod{28, L"enablePropsUpdateReconciliationAndroid"}, - SyncMethod{29, L"enableResourceTimingAPI"}, - SyncMethod{30, L"enableSynchronousStateUpdates"}, - SyncMethod{31, L"enableViewCulling"}, - SyncMethod{32, L"enableViewRecycling"}, - SyncMethod{33, L"enableViewRecyclingForText"}, - SyncMethod{34, L"enableViewRecyclingForView"}, - SyncMethod{35, L"fixMappingOfEventPrioritiesBetweenFabricAndReact"}, - SyncMethod{36, L"fuseboxEnabledRelease"}, - SyncMethod{37, L"fuseboxNetworkInspectionEnabled"}, - SyncMethod{38, L"incorporateMaxLinesDuringAndroidLayout"}, - SyncMethod{39, L"traceTurboModulePromiseRejectionsOnAndroid"}, - SyncMethod{40, L"updateRuntimeShadowNodeReferencesOnCommit"}, - SyncMethod{41, L"useAlwaysAvailableJSErrorHandling"}, - SyncMethod{42, L"useAndroidTextLayoutWidthDirectly"}, - SyncMethod{43, L"useFabricInterop"}, - SyncMethod{44, L"useNativeViewConfigsInBridgelessMode"}, - SyncMethod{45, L"useOptimizedEventBatchingOnAndroid"}, - SyncMethod{46, L"useRawPropsJsiValue"}, - SyncMethod{47, L"useShadowNodeStateOnClone"}, - SyncMethod{48, L"useTurboModuleInterop"}, - SyncMethod{49, L"useTurboModules"}, + SyncMethod{7, L"disableTextLayoutManagerCacheAndroid"}, + SyncMethod{8, L"enableAccessibilityOrder"}, + SyncMethod{9, L"enableAccumulatedUpdatesInRawPropsAndroid"}, + SyncMethod{10, L"enableBridgelessArchitecture"}, + SyncMethod{11, L"enableCppPropsIteratorSetter"}, + SyncMethod{12, L"enableCustomFocusSearchOnClippedElementsAndroid"}, + SyncMethod{13, L"enableDestroyShadowTreeRevisionAsync"}, + SyncMethod{14, L"enableDoubleMeasurementFixAndroid"}, + SyncMethod{15, L"enableEagerRootViewAttachment"}, + SyncMethod{16, L"enableFabricLogs"}, + SyncMethod{17, L"enableFabricRenderer"}, + SyncMethod{18, L"enableFixForParentTagDuringReparenting"}, + SyncMethod{19, L"enableFontScaleChangesUpdatingLayout"}, + SyncMethod{20, L"enableIOSTextBaselineOffsetPerLine"}, + SyncMethod{21, L"enableIOSViewClipToPaddingBox"}, + SyncMethod{22, L"enableIntersectionObserverEventLoopIntegration"}, + SyncMethod{23, L"enableLayoutAnimationsOnAndroid"}, + SyncMethod{24, L"enableLayoutAnimationsOnIOS"}, + SyncMethod{25, L"enableMainQueueCoordinatorOnIOS"}, + SyncMethod{26, L"enableMainQueueModulesOnIOS"}, + SyncMethod{27, L"enableModuleArgumentNSNullConversionIOS"}, + SyncMethod{28, L"enableNativeCSSParsing"}, + SyncMethod{29, L"enableNetworkEventReporting"}, + SyncMethod{30, L"enableNewBackgroundAndBorderDrawables"}, + SyncMethod{31, L"enablePreparedTextLayout"}, + SyncMethod{32, L"enablePropsUpdateReconciliationAndroid"}, + SyncMethod{33, L"enableResourceTimingAPI"}, + SyncMethod{34, L"enableSynchronousStateUpdates"}, + SyncMethod{35, L"enableViewCulling"}, + SyncMethod{36, L"enableViewRecycling"}, + SyncMethod{37, L"enableViewRecyclingForText"}, + SyncMethod{38, L"enableViewRecyclingForView"}, + SyncMethod{39, L"fixMappingOfEventPrioritiesBetweenFabricAndReact"}, + SyncMethod{40, L"fuseboxEnabledRelease"}, + SyncMethod{41, L"fuseboxNetworkInspectionEnabled"}, + SyncMethod{42, L"incorporateMaxLinesDuringAndroidLayout"}, + SyncMethod{43, L"traceTurboModulePromiseRejectionsOnAndroid"}, + SyncMethod{44, L"updateRuntimeShadowNodeReferencesOnCommit"}, + SyncMethod{45, L"useAlwaysAvailableJSErrorHandling"}, + SyncMethod{46, L"useAndroidTextLayoutWidthDirectly"}, + SyncMethod{47, L"useFabricInterop"}, + SyncMethod{48, L"useNativeViewConfigsInBridgelessMode"}, + SyncMethod{49, L"useOptimizedEventBatchingOnAndroid"}, + SyncMethod{50, L"useRawPropsJsiValue"}, + SyncMethod{51, L"useShadowNodeStateOnClone"}, + SyncMethod{52, L"useTurboModuleInterop"}, + SyncMethod{53, L"useTurboModules"}, + SyncMethod{54, L"virtualViewPrerenderRatio"}, }; template @@ -110,219 +115,244 @@ struct ReactNativeFeatureFlagsSpec : winrt::Microsoft::ReactNative::TurboModuleS " REACT_SYNC_METHOD(disableMountItemReorderingAndroid) static bool disableMountItemReorderingAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( 7, + "disableTextLayoutManagerCacheAndroid", + " REACT_SYNC_METHOD(disableTextLayoutManagerCacheAndroid) bool disableTextLayoutManagerCacheAndroid() noexcept { /* implementation */ }\n" + " REACT_SYNC_METHOD(disableTextLayoutManagerCacheAndroid) static bool disableTextLayoutManagerCacheAndroid() noexcept { /* implementation */ }\n"); + REACT_SHOW_METHOD_SPEC_ERRORS( + 8, "enableAccessibilityOrder", " REACT_SYNC_METHOD(enableAccessibilityOrder) bool enableAccessibilityOrder() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableAccessibilityOrder) static bool enableAccessibilityOrder() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 8, + 9, "enableAccumulatedUpdatesInRawPropsAndroid", " REACT_SYNC_METHOD(enableAccumulatedUpdatesInRawPropsAndroid) bool enableAccumulatedUpdatesInRawPropsAndroid() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableAccumulatedUpdatesInRawPropsAndroid) static bool enableAccumulatedUpdatesInRawPropsAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 9, + 10, "enableBridgelessArchitecture", " REACT_SYNC_METHOD(enableBridgelessArchitecture) bool enableBridgelessArchitecture() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableBridgelessArchitecture) static bool enableBridgelessArchitecture() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 10, + 11, "enableCppPropsIteratorSetter", " REACT_SYNC_METHOD(enableCppPropsIteratorSetter) bool enableCppPropsIteratorSetter() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableCppPropsIteratorSetter) static bool enableCppPropsIteratorSetter() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 11, + 12, "enableCustomFocusSearchOnClippedElementsAndroid", " REACT_SYNC_METHOD(enableCustomFocusSearchOnClippedElementsAndroid) bool enableCustomFocusSearchOnClippedElementsAndroid() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableCustomFocusSearchOnClippedElementsAndroid) static bool enableCustomFocusSearchOnClippedElementsAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 12, + 13, "enableDestroyShadowTreeRevisionAsync", " REACT_SYNC_METHOD(enableDestroyShadowTreeRevisionAsync) bool enableDestroyShadowTreeRevisionAsync() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableDestroyShadowTreeRevisionAsync) static bool enableDestroyShadowTreeRevisionAsync() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 13, + 14, "enableDoubleMeasurementFixAndroid", " REACT_SYNC_METHOD(enableDoubleMeasurementFixAndroid) bool enableDoubleMeasurementFixAndroid() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableDoubleMeasurementFixAndroid) static bool enableDoubleMeasurementFixAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 14, + 15, "enableEagerRootViewAttachment", " REACT_SYNC_METHOD(enableEagerRootViewAttachment) bool enableEagerRootViewAttachment() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableEagerRootViewAttachment) static bool enableEagerRootViewAttachment() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 15, + 16, "enableFabricLogs", " REACT_SYNC_METHOD(enableFabricLogs) bool enableFabricLogs() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableFabricLogs) static bool enableFabricLogs() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 16, + 17, "enableFabricRenderer", " REACT_SYNC_METHOD(enableFabricRenderer) bool enableFabricRenderer() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableFabricRenderer) static bool enableFabricRenderer() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 17, + 18, "enableFixForParentTagDuringReparenting", " REACT_SYNC_METHOD(enableFixForParentTagDuringReparenting) bool enableFixForParentTagDuringReparenting() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableFixForParentTagDuringReparenting) static bool enableFixForParentTagDuringReparenting() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 18, + 19, "enableFontScaleChangesUpdatingLayout", " REACT_SYNC_METHOD(enableFontScaleChangesUpdatingLayout) bool enableFontScaleChangesUpdatingLayout() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableFontScaleChangesUpdatingLayout) static bool enableFontScaleChangesUpdatingLayout() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 19, + 20, + "enableIOSTextBaselineOffsetPerLine", + " REACT_SYNC_METHOD(enableIOSTextBaselineOffsetPerLine) bool enableIOSTextBaselineOffsetPerLine() noexcept { /* implementation */ }\n" + " REACT_SYNC_METHOD(enableIOSTextBaselineOffsetPerLine) static bool enableIOSTextBaselineOffsetPerLine() noexcept { /* implementation */ }\n"); + REACT_SHOW_METHOD_SPEC_ERRORS( + 21, "enableIOSViewClipToPaddingBox", " REACT_SYNC_METHOD(enableIOSViewClipToPaddingBox) bool enableIOSViewClipToPaddingBox() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableIOSViewClipToPaddingBox) static bool enableIOSViewClipToPaddingBox() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 20, + 22, "enableIntersectionObserverEventLoopIntegration", " REACT_SYNC_METHOD(enableIntersectionObserverEventLoopIntegration) bool enableIntersectionObserverEventLoopIntegration() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableIntersectionObserverEventLoopIntegration) static bool enableIntersectionObserverEventLoopIntegration() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 21, + 23, "enableLayoutAnimationsOnAndroid", " REACT_SYNC_METHOD(enableLayoutAnimationsOnAndroid) bool enableLayoutAnimationsOnAndroid() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableLayoutAnimationsOnAndroid) static bool enableLayoutAnimationsOnAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 22, + 24, "enableLayoutAnimationsOnIOS", " REACT_SYNC_METHOD(enableLayoutAnimationsOnIOS) bool enableLayoutAnimationsOnIOS() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableLayoutAnimationsOnIOS) static bool enableLayoutAnimationsOnIOS() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 23, + 25, + "enableMainQueueCoordinatorOnIOS", + " REACT_SYNC_METHOD(enableMainQueueCoordinatorOnIOS) bool enableMainQueueCoordinatorOnIOS() noexcept { /* implementation */ }\n" + " REACT_SYNC_METHOD(enableMainQueueCoordinatorOnIOS) static bool enableMainQueueCoordinatorOnIOS() noexcept { /* implementation */ }\n"); + REACT_SHOW_METHOD_SPEC_ERRORS( + 26, "enableMainQueueModulesOnIOS", " REACT_SYNC_METHOD(enableMainQueueModulesOnIOS) bool enableMainQueueModulesOnIOS() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableMainQueueModulesOnIOS) static bool enableMainQueueModulesOnIOS() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 24, + 27, + "enableModuleArgumentNSNullConversionIOS", + " REACT_SYNC_METHOD(enableModuleArgumentNSNullConversionIOS) bool enableModuleArgumentNSNullConversionIOS() noexcept { /* implementation */ }\n" + " REACT_SYNC_METHOD(enableModuleArgumentNSNullConversionIOS) static bool enableModuleArgumentNSNullConversionIOS() noexcept { /* implementation */ }\n"); + REACT_SHOW_METHOD_SPEC_ERRORS( + 28, "enableNativeCSSParsing", " REACT_SYNC_METHOD(enableNativeCSSParsing) bool enableNativeCSSParsing() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableNativeCSSParsing) static bool enableNativeCSSParsing() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 25, + 29, "enableNetworkEventReporting", " REACT_SYNC_METHOD(enableNetworkEventReporting) bool enableNetworkEventReporting() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableNetworkEventReporting) static bool enableNetworkEventReporting() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 26, + 30, "enableNewBackgroundAndBorderDrawables", " REACT_SYNC_METHOD(enableNewBackgroundAndBorderDrawables) bool enableNewBackgroundAndBorderDrawables() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableNewBackgroundAndBorderDrawables) static bool enableNewBackgroundAndBorderDrawables() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 27, + 31, "enablePreparedTextLayout", " REACT_SYNC_METHOD(enablePreparedTextLayout) bool enablePreparedTextLayout() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enablePreparedTextLayout) static bool enablePreparedTextLayout() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 28, + 32, "enablePropsUpdateReconciliationAndroid", " REACT_SYNC_METHOD(enablePropsUpdateReconciliationAndroid) bool enablePropsUpdateReconciliationAndroid() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enablePropsUpdateReconciliationAndroid) static bool enablePropsUpdateReconciliationAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 29, + 33, "enableResourceTimingAPI", " REACT_SYNC_METHOD(enableResourceTimingAPI) bool enableResourceTimingAPI() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableResourceTimingAPI) static bool enableResourceTimingAPI() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 30, + 34, "enableSynchronousStateUpdates", " REACT_SYNC_METHOD(enableSynchronousStateUpdates) bool enableSynchronousStateUpdates() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableSynchronousStateUpdates) static bool enableSynchronousStateUpdates() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 31, + 35, "enableViewCulling", " REACT_SYNC_METHOD(enableViewCulling) bool enableViewCulling() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableViewCulling) static bool enableViewCulling() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 32, + 36, "enableViewRecycling", " REACT_SYNC_METHOD(enableViewRecycling) bool enableViewRecycling() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableViewRecycling) static bool enableViewRecycling() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 33, + 37, "enableViewRecyclingForText", " REACT_SYNC_METHOD(enableViewRecyclingForText) bool enableViewRecyclingForText() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableViewRecyclingForText) static bool enableViewRecyclingForText() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 34, + 38, "enableViewRecyclingForView", " REACT_SYNC_METHOD(enableViewRecyclingForView) bool enableViewRecyclingForView() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(enableViewRecyclingForView) static bool enableViewRecyclingForView() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 35, + 39, "fixMappingOfEventPrioritiesBetweenFabricAndReact", " REACT_SYNC_METHOD(fixMappingOfEventPrioritiesBetweenFabricAndReact) bool fixMappingOfEventPrioritiesBetweenFabricAndReact() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(fixMappingOfEventPrioritiesBetweenFabricAndReact) static bool fixMappingOfEventPrioritiesBetweenFabricAndReact() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 36, + 40, "fuseboxEnabledRelease", " REACT_SYNC_METHOD(fuseboxEnabledRelease) bool fuseboxEnabledRelease() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(fuseboxEnabledRelease) static bool fuseboxEnabledRelease() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 37, + 41, "fuseboxNetworkInspectionEnabled", " REACT_SYNC_METHOD(fuseboxNetworkInspectionEnabled) bool fuseboxNetworkInspectionEnabled() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(fuseboxNetworkInspectionEnabled) static bool fuseboxNetworkInspectionEnabled() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 38, + 42, "incorporateMaxLinesDuringAndroidLayout", " REACT_SYNC_METHOD(incorporateMaxLinesDuringAndroidLayout) bool incorporateMaxLinesDuringAndroidLayout() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(incorporateMaxLinesDuringAndroidLayout) static bool incorporateMaxLinesDuringAndroidLayout() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 39, + 43, "traceTurboModulePromiseRejectionsOnAndroid", " REACT_SYNC_METHOD(traceTurboModulePromiseRejectionsOnAndroid) bool traceTurboModulePromiseRejectionsOnAndroid() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(traceTurboModulePromiseRejectionsOnAndroid) static bool traceTurboModulePromiseRejectionsOnAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 40, + 44, "updateRuntimeShadowNodeReferencesOnCommit", " REACT_SYNC_METHOD(updateRuntimeShadowNodeReferencesOnCommit) bool updateRuntimeShadowNodeReferencesOnCommit() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(updateRuntimeShadowNodeReferencesOnCommit) static bool updateRuntimeShadowNodeReferencesOnCommit() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 41, + 45, "useAlwaysAvailableJSErrorHandling", " REACT_SYNC_METHOD(useAlwaysAvailableJSErrorHandling) bool useAlwaysAvailableJSErrorHandling() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useAlwaysAvailableJSErrorHandling) static bool useAlwaysAvailableJSErrorHandling() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 42, + 46, "useAndroidTextLayoutWidthDirectly", " REACT_SYNC_METHOD(useAndroidTextLayoutWidthDirectly) bool useAndroidTextLayoutWidthDirectly() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useAndroidTextLayoutWidthDirectly) static bool useAndroidTextLayoutWidthDirectly() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 43, + 47, "useFabricInterop", " REACT_SYNC_METHOD(useFabricInterop) bool useFabricInterop() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useFabricInterop) static bool useFabricInterop() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 44, + 48, "useNativeViewConfigsInBridgelessMode", " REACT_SYNC_METHOD(useNativeViewConfigsInBridgelessMode) bool useNativeViewConfigsInBridgelessMode() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useNativeViewConfigsInBridgelessMode) static bool useNativeViewConfigsInBridgelessMode() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 45, + 49, "useOptimizedEventBatchingOnAndroid", " REACT_SYNC_METHOD(useOptimizedEventBatchingOnAndroid) bool useOptimizedEventBatchingOnAndroid() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useOptimizedEventBatchingOnAndroid) static bool useOptimizedEventBatchingOnAndroid() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 46, + 50, "useRawPropsJsiValue", " REACT_SYNC_METHOD(useRawPropsJsiValue) bool useRawPropsJsiValue() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useRawPropsJsiValue) static bool useRawPropsJsiValue() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 47, + 51, "useShadowNodeStateOnClone", " REACT_SYNC_METHOD(useShadowNodeStateOnClone) bool useShadowNodeStateOnClone() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useShadowNodeStateOnClone) static bool useShadowNodeStateOnClone() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 48, + 52, "useTurboModuleInterop", " REACT_SYNC_METHOD(useTurboModuleInterop) bool useTurboModuleInterop() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useTurboModuleInterop) static bool useTurboModuleInterop() noexcept { /* implementation */ }\n"); REACT_SHOW_METHOD_SPEC_ERRORS( - 49, + 53, "useTurboModules", " REACT_SYNC_METHOD(useTurboModules) bool useTurboModules() noexcept { /* implementation */ }\n" " REACT_SYNC_METHOD(useTurboModules) static bool useTurboModules() noexcept { /* implementation */ }\n"); + REACT_SHOW_METHOD_SPEC_ERRORS( + 54, + "virtualViewPrerenderRatio", + " REACT_SYNC_METHOD(virtualViewPrerenderRatio) double virtualViewPrerenderRatio() noexcept { /* implementation */ }\n" + " REACT_SYNC_METHOD(virtualViewPrerenderRatio) static double virtualViewPrerenderRatio() noexcept { /* implementation */ }\n"); } }; diff --git a/vnext/codegen/react/components/rnwcore/Props.cpp b/vnext/codegen/react/components/rnwcore/Props.cpp index 3d33bfb0980..ddfb5e91f62 100644 --- a/vnext/codegen/react/components/rnwcore/Props.cpp +++ b/vnext/codegen/react/components/rnwcore/Props.cpp @@ -22,8 +22,35 @@ ActivityIndicatorViewProps::ActivityIndicatorViewProps( hidesWhenStopped(convertRawProp(context, rawProps, "hidesWhenStopped", sourceProps.hidesWhenStopped, {true})), animating(convertRawProp(context, rawProps, "animating", sourceProps.animating, {true})), color(convertRawProp(context, rawProps, "color", sourceProps.color, {})), - size(convertRawProp(context, rawProps, "size", sourceProps.size, {ActivityIndicatorViewSize::Small})) - {} + size(convertRawProp(context, rawProps, "size", sourceProps.size, {ActivityIndicatorViewSize::Small})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic ActivityIndicatorViewProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = ActivityIndicatorViewProps(); + const ActivityIndicatorViewProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (hidesWhenStopped != oldProps->hidesWhenStopped) { + result["hidesWhenStopped"] = hidesWhenStopped; + } + + if (animating != oldProps->animating) { + result["animating"] = animating; + } + + if (color != oldProps->color) { + result["color"] = *color; + } + + return result; +} +#endif AndroidDrawerLayoutProps::AndroidDrawerLayoutProps( const PropsParserContext &context, const AndroidDrawerLayoutProps &sourceProps, @@ -34,15 +61,62 @@ AndroidDrawerLayoutProps::AndroidDrawerLayoutProps( drawerPosition(convertRawProp(context, rawProps, "drawerPosition", sourceProps.drawerPosition, {AndroidDrawerLayoutDrawerPosition::Left})), drawerWidth(convertRawProp(context, rawProps, "drawerWidth", sourceProps.drawerWidth, {})), drawerLockMode(convertRawProp(context, rawProps, "drawerLockMode", sourceProps.drawerLockMode, {AndroidDrawerLayoutDrawerLockMode::Unlocked})), - statusBarBackgroundColor(convertRawProp(context, rawProps, "statusBarBackgroundColor", sourceProps.statusBarBackgroundColor, {})) - {} + statusBarBackgroundColor(convertRawProp(context, rawProps, "statusBarBackgroundColor", sourceProps.statusBarBackgroundColor, {})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic AndroidDrawerLayoutProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = AndroidDrawerLayoutProps(); + const AndroidDrawerLayoutProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + + if (drawerBackgroundColor != oldProps->drawerBackgroundColor) { + result["drawerBackgroundColor"] = *drawerBackgroundColor; + } + + + if ((drawerWidth != oldProps->drawerWidth) && !(std::isnan(drawerWidth) && std::isnan(oldProps->drawerWidth))) { + result["drawerWidth"] = drawerWidth; + } + + + if (statusBarBackgroundColor != oldProps->statusBarBackgroundColor) { + result["statusBarBackgroundColor"] = *statusBarBackgroundColor; + } + return result; +} +#endif AndroidHorizontalScrollContentViewProps::AndroidHorizontalScrollContentViewProps( const PropsParserContext &context, const AndroidHorizontalScrollContentViewProps &sourceProps, const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - removeClippedSubviews(convertRawProp(context, rawProps, "removeClippedSubviews", sourceProps.removeClippedSubviews, {false})) - {} + removeClippedSubviews(convertRawProp(context, rawProps, "removeClippedSubviews", sourceProps.removeClippedSubviews, {false})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic AndroidHorizontalScrollContentViewProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = AndroidHorizontalScrollContentViewProps(); + const AndroidHorizontalScrollContentViewProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (removeClippedSubviews != oldProps->removeClippedSubviews) { + result["removeClippedSubviews"] = removeClippedSubviews; + } + return result; +} +#endif AndroidSwipeRefreshLayoutProps::AndroidSwipeRefreshLayoutProps( const PropsParserContext &context, const AndroidSwipeRefreshLayoutProps &sourceProps, @@ -53,8 +127,40 @@ AndroidSwipeRefreshLayoutProps::AndroidSwipeRefreshLayoutProps( progressBackgroundColor(convertRawProp(context, rawProps, "progressBackgroundColor", sourceProps.progressBackgroundColor, {})), size(convertRawProp(context, rawProps, "size", sourceProps.size, {AndroidSwipeRefreshLayoutSize::Default})), progressViewOffset(convertRawProp(context, rawProps, "progressViewOffset", sourceProps.progressViewOffset, {0.0})), - refreshing(convertRawProp(context, rawProps, "refreshing", sourceProps.refreshing, {false})) - {} + refreshing(convertRawProp(context, rawProps, "refreshing", sourceProps.refreshing, {false})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic AndroidSwipeRefreshLayoutProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = AndroidSwipeRefreshLayoutProps(); + const AndroidSwipeRefreshLayoutProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (enabled != oldProps->enabled) { + result["enabled"] = enabled; + } + + + if (progressBackgroundColor != oldProps->progressBackgroundColor) { + result["progressBackgroundColor"] = *progressBackgroundColor; + } + + + if ((progressViewOffset != oldProps->progressViewOffset) && !(std::isnan(progressViewOffset) && std::isnan(oldProps->progressViewOffset))) { + result["progressViewOffset"] = progressViewOffset; + } + + if (refreshing != oldProps->refreshing) { + result["refreshing"] = refreshing; + } + return result; +} +#endif AndroidSwitchProps::AndroidSwitchProps( const PropsParserContext &context, const AndroidSwitchProps &sourceProps, @@ -68,15 +174,80 @@ AndroidSwitchProps::AndroidSwitchProps( value(convertRawProp(context, rawProps, "value", sourceProps.value, {false})), on(convertRawProp(context, rawProps, "on", sourceProps.on, {false})), thumbTintColor(convertRawProp(context, rawProps, "thumbTintColor", sourceProps.thumbTintColor, {})), - trackTintColor(convertRawProp(context, rawProps, "trackTintColor", sourceProps.trackTintColor, {})) - {} + trackTintColor(convertRawProp(context, rawProps, "trackTintColor", sourceProps.trackTintColor, {})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic AndroidSwitchProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = AndroidSwitchProps(); + const AndroidSwitchProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (disabled != oldProps->disabled) { + result["disabled"] = disabled; + } + + if (enabled != oldProps->enabled) { + result["enabled"] = enabled; + } + + if (thumbColor != oldProps->thumbColor) { + result["thumbColor"] = *thumbColor; + } + + if (trackColorForFalse != oldProps->trackColorForFalse) { + result["trackColorForFalse"] = *trackColorForFalse; + } + + if (trackColorForTrue != oldProps->trackColorForTrue) { + result["trackColorForTrue"] = *trackColorForTrue; + } + + if (value != oldProps->value) { + result["value"] = value; + } + + if (on != oldProps->on) { + result["on"] = on; + } + + if (thumbTintColor != oldProps->thumbTintColor) { + result["thumbTintColor"] = *thumbTintColor; + } + + if (trackTintColor != oldProps->trackTintColor) { + result["trackTintColor"] = *trackTintColor; + } + return result; +} +#endif DebuggingOverlayProps::DebuggingOverlayProps( const PropsParserContext &context, const DebuggingOverlayProps &sourceProps, const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) + {} - {} +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic DebuggingOverlayProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = DebuggingOverlayProps(); + const DebuggingOverlayProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + return result; +} +#endif AndroidProgressBarProps::AndroidProgressBarProps( const PropsParserContext &context, const AndroidProgressBarProps &sourceProps, @@ -88,8 +259,50 @@ AndroidProgressBarProps::AndroidProgressBarProps( progress(convertRawProp(context, rawProps, "progress", sourceProps.progress, {0.0})), animating(convertRawProp(context, rawProps, "animating", sourceProps.animating, {true})), color(convertRawProp(context, rawProps, "color", sourceProps.color, {})), - testID(convertRawProp(context, rawProps, "testID", sourceProps.testID, {""})) - {} + testID(convertRawProp(context, rawProps, "testID", sourceProps.testID, {""})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic AndroidProgressBarProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = AndroidProgressBarProps(); + const AndroidProgressBarProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (styleAttr != oldProps->styleAttr) { + result["styleAttr"] = styleAttr; + } + + if (typeAttr != oldProps->typeAttr) { + result["typeAttr"] = typeAttr; + } + + if (indeterminate != oldProps->indeterminate) { + result["indeterminate"] = indeterminate; + } + + if ((progress != oldProps->progress) && !(std::isnan(progress) && std::isnan(oldProps->progress))) { + result["progress"] = progress; + } + + if (animating != oldProps->animating) { + result["animating"] = animating; + } + + if (color != oldProps->color) { + result["color"] = *color; + } + + if (testID != oldProps->testID) { + result["testID"] = testID; + } + return result; +} +#endif PullToRefreshViewProps::PullToRefreshViewProps( const PropsParserContext &context, const PullToRefreshViewProps &sourceProps, @@ -99,15 +312,67 @@ PullToRefreshViewProps::PullToRefreshViewProps( titleColor(convertRawProp(context, rawProps, "titleColor", sourceProps.titleColor, {})), title(convertRawProp(context, rawProps, "title", sourceProps.title, {})), progressViewOffset(convertRawProp(context, rawProps, "progressViewOffset", sourceProps.progressViewOffset, {0.0})), - refreshing(convertRawProp(context, rawProps, "refreshing", sourceProps.refreshing, {false})) - {} + refreshing(convertRawProp(context, rawProps, "refreshing", sourceProps.refreshing, {false})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic PullToRefreshViewProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = PullToRefreshViewProps(); + const PullToRefreshViewProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (tintColor != oldProps->tintColor) { + result["tintColor"] = *tintColor; + } + + if (titleColor != oldProps->titleColor) { + result["titleColor"] = *titleColor; + } + + if (title != oldProps->title) { + result["title"] = title; + } + + if ((progressViewOffset != oldProps->progressViewOffset) && !(std::isnan(progressViewOffset) && std::isnan(oldProps->progressViewOffset))) { + result["progressViewOffset"] = progressViewOffset; + } + + if (refreshing != oldProps->refreshing) { + result["refreshing"] = refreshing; + } + return result; +} +#endif InputAccessoryProps::InputAccessoryProps( const PropsParserContext &context, const InputAccessoryProps &sourceProps, const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - backgroundColor(convertRawProp(context, rawProps, "backgroundColor", sourceProps.backgroundColor, {})) - {} + backgroundColor(convertRawProp(context, rawProps, "backgroundColor", sourceProps.backgroundColor, {})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic InputAccessoryProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = InputAccessoryProps(); + const InputAccessoryProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (backgroundColor != oldProps->backgroundColor) { + result["backgroundColor"] = *backgroundColor; + } + return result; +} +#endif ModalHostViewProps::ModalHostViewProps( const PropsParserContext &context, const ModalHostViewProps &sourceProps, @@ -123,15 +388,79 @@ ModalHostViewProps::ModalHostViewProps( animated(convertRawProp(context, rawProps, "animated", sourceProps.animated, {false})), supportedOrientations(convertRawProp(context, rawProps, "supportedOrientations", ModalHostViewSupportedOrientationsMaskWrapped{ .value = sourceProps.supportedOrientations }, {static_cast(ModalHostViewSupportedOrientations::Portrait)}).value), identifier(convertRawProp(context, rawProps, "identifier", sourceProps.identifier, {0})), - title(convertRawProp(context, rawProps, "title", sourceProps.title, {})) - {} + title(convertRawProp(context, rawProps, "title", sourceProps.title, {})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic ModalHostViewProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = ModalHostViewProps(); + const ModalHostViewProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + + + if (transparent != oldProps->transparent) { + result["transparent"] = transparent; + } + + if (statusBarTranslucent != oldProps->statusBarTranslucent) { + result["statusBarTranslucent"] = statusBarTranslucent; + } + + if (navigationBarTranslucent != oldProps->navigationBarTranslucent) { + result["navigationBarTranslucent"] = navigationBarTranslucent; + } + + if (hardwareAccelerated != oldProps->hardwareAccelerated) { + result["hardwareAccelerated"] = hardwareAccelerated; + } + + if (visible != oldProps->visible) { + result["visible"] = visible; + } + + if (animated != oldProps->animated) { + result["animated"] = animated; + } + + + if (identifier != oldProps->identifier) { + result["identifier"] = identifier; + } + + if (title != oldProps->title) { + result["title"] = title; + } + return result; +} +#endif SafeAreaViewProps::SafeAreaViewProps( const PropsParserContext &context, const SafeAreaViewProps &sourceProps, const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) + {} - {} +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic SafeAreaViewProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = SafeAreaViewProps(); + const SafeAreaViewProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + return result; +} +#endif SwitchProps::SwitchProps( const PropsParserContext &context, const SwitchProps &sourceProps, @@ -144,14 +473,78 @@ SwitchProps::SwitchProps( thumbTintColor(convertRawProp(context, rawProps, "thumbTintColor", sourceProps.thumbTintColor, {})), thumbColor(convertRawProp(context, rawProps, "thumbColor", sourceProps.thumbColor, {})), trackColorForFalse(convertRawProp(context, rawProps, "trackColorForFalse", sourceProps.trackColorForFalse, {})), - trackColorForTrue(convertRawProp(context, rawProps, "trackColorForTrue", sourceProps.trackColorForTrue, {})) - {} + trackColorForTrue(convertRawProp(context, rawProps, "trackColorForTrue", sourceProps.trackColorForTrue, {})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic SwitchProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = SwitchProps(); + const SwitchProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (disabled != oldProps->disabled) { + result["disabled"] = disabled; + } + + if (value != oldProps->value) { + result["value"] = value; + } + + if (tintColor != oldProps->tintColor) { + result["tintColor"] = *tintColor; + } + + if (onTintColor != oldProps->onTintColor) { + result["onTintColor"] = *onTintColor; + } + + if (thumbTintColor != oldProps->thumbTintColor) { + result["thumbTintColor"] = *thumbTintColor; + } + + if (thumbColor != oldProps->thumbColor) { + result["thumbColor"] = *thumbColor; + } + + if (trackColorForFalse != oldProps->trackColorForFalse) { + result["trackColorForFalse"] = *trackColorForFalse; + } + + if (trackColorForTrue != oldProps->trackColorForTrue) { + result["trackColorForTrue"] = *trackColorForTrue; + } + return result; +} +#endif UnimplementedNativeViewProps::UnimplementedNativeViewProps( const PropsParserContext &context, const UnimplementedNativeViewProps &sourceProps, const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - name(convertRawProp(context, rawProps, "name", sourceProps.name, {""})) - {} + name(convertRawProp(context, rawProps, "name", sourceProps.name, {""})) {} + +#ifdef RN_SERIALIZABLE_STATE +folly::dynamic UnimplementedNativeViewProps::getDiffProps( + const Props* prevProps) const { + static const auto defaultProps = UnimplementedNativeViewProps(); + const UnimplementedNativeViewProps* oldProps = prevProps == nullptr + ? &defaultProps + : static_cast(prevProps); + if (this == oldProps) { + return folly::dynamic::object(); + } + folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); + + if (name != oldProps->name) { + result["name"] = name; + } + return result; +} +#endif } // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/Props.h b/vnext/codegen/react/components/rnwcore/Props.h index 397bc1706cb..e144d2b3f2c 100644 --- a/vnext/codegen/react/components/rnwcore/Props.h +++ b/vnext/codegen/react/components/rnwcore/Props.h @@ -44,6 +44,10 @@ class ActivityIndicatorViewProps final : public ViewProps { bool animating{true}; SharedColor color{}; ActivityIndicatorViewSize size{ActivityIndicatorViewSize::Small}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; enum class AndroidDrawerLayoutKeyboardDismissMode { None, OnDrag }; @@ -107,6 +111,10 @@ class AndroidDrawerLayoutProps final : public ViewProps { Float drawerWidth{}; AndroidDrawerLayoutDrawerLockMode drawerLockMode{AndroidDrawerLayoutDrawerLockMode::Unlocked}; SharedColor statusBarBackgroundColor{}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class AndroidHorizontalScrollContentViewProps final : public ViewProps { @@ -117,6 +125,10 @@ class AndroidHorizontalScrollContentViewProps final : public ViewProps { #pragma mark - Props bool removeClippedSubviews{false}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; enum class AndroidSwipeRefreshLayoutSize { Default, Large }; @@ -148,6 +160,10 @@ class AndroidSwipeRefreshLayoutProps final : public ViewProps { AndroidSwipeRefreshLayoutSize size{AndroidSwipeRefreshLayoutSize::Default}; Float progressViewOffset{0.0}; bool refreshing{false}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class AndroidSwitchProps final : public ViewProps { @@ -166,6 +182,10 @@ class AndroidSwitchProps final : public ViewProps { bool on{false}; SharedColor thumbTintColor{}; SharedColor trackTintColor{}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class DebuggingOverlayProps final : public ViewProps { @@ -176,6 +196,10 @@ class DebuggingOverlayProps final : public ViewProps { #pragma mark - Props + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class AndroidProgressBarProps final : public ViewProps { @@ -192,6 +216,10 @@ class AndroidProgressBarProps final : public ViewProps { bool animating{true}; SharedColor color{}; std::string testID{""}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class PullToRefreshViewProps final : public ViewProps { @@ -206,6 +234,10 @@ class PullToRefreshViewProps final : public ViewProps { std::string title{}; Float progressViewOffset{0.0}; bool refreshing{false}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class InputAccessoryProps final : public ViewProps { @@ -216,6 +248,10 @@ class InputAccessoryProps final : public ViewProps { #pragma mark - Props SharedColor backgroundColor{}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; enum class ModalHostViewAnimationType { None, Slide, Fade }; @@ -356,6 +392,10 @@ class ModalHostViewProps final : public ViewProps { ModalHostViewSupportedOrientationsMask supportedOrientations{static_cast(ModalHostViewSupportedOrientations::Portrait)}; int identifier{0}; std::string title{}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class SafeAreaViewProps final : public ViewProps { @@ -366,6 +406,10 @@ class SafeAreaViewProps final : public ViewProps { #pragma mark - Props + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class SwitchProps final : public ViewProps { @@ -383,6 +427,10 @@ class SwitchProps final : public ViewProps { SharedColor thumbColor{}; SharedColor trackColorForFalse{}; SharedColor trackColorForTrue{}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; class UnimplementedNativeViewProps final : public ViewProps { @@ -393,6 +441,10 @@ class UnimplementedNativeViewProps final : public ViewProps { #pragma mark - Props std::string name{""}; + + #ifdef RN_SERIALIZABLE_STATE + folly::dynamic getDiffProps(const Props* prevProps) const override; + #endif }; } // namespace facebook::react diff --git a/vnext/codegen/rnwcoreJSI-generated.cpp b/vnext/codegen/rnwcoreJSI-generated.cpp index 19c2bcccb5d..6e63f4cfbe9 100644 --- a/vnext/codegen/rnwcoreJSI-generated.cpp +++ b/vnext/codegen/rnwcoreJSI-generated.cpp @@ -46,6 +46,11 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disable rt ); } +static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + return static_cast(&turboModule)->disableTextLayoutManagerCacheAndroid( + rt + ); +} static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccessibilityOrder(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->enableAccessibilityOrder( rt @@ -106,6 +111,11 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableF rt ); } +static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + return static_cast(&turboModule)->enableIOSTextBaselineOffsetPerLine( + rt + ); +} static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSViewClipToPaddingBox(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->enableIOSViewClipToPaddingBox( rt @@ -126,11 +136,21 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableL rt ); } +static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + return static_cast(&turboModule)->enableMainQueueCoordinatorOnIOS( + rt + ); +} static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueModulesOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->enableMainQueueModulesOnIOS( rt ); } +static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + return static_cast(&turboModule)->enableModuleArgumentNSNullConversionIOS( + rt + ); +} static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNativeCSSParsing(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->enableNativeCSSParsing( rt @@ -261,6 +281,11 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurb rt ); } +static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_virtualViewPrerenderRatio(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + return static_cast(&turboModule)->virtualViewPrerenderRatio( + rt + ); +} NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI(std::shared_ptr jsInvoker) : TurboModule("NativeReactNativeFeatureFlagsCxx", jsInvoker) { @@ -271,6 +296,7 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI methodMap_["cxxNativeAnimatedEnabled"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedEnabled}; methodMap_["disableMainQueueSyncDispatchIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMainQueueSyncDispatchIOS}; methodMap_["disableMountItemReorderingAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMountItemReorderingAndroid}; + methodMap_["disableTextLayoutManagerCacheAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableTextLayoutManagerCacheAndroid}; methodMap_["enableAccessibilityOrder"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccessibilityOrder}; methodMap_["enableAccumulatedUpdatesInRawPropsAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccumulatedUpdatesInRawPropsAndroid}; methodMap_["enableBridgelessArchitecture"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableBridgelessArchitecture}; @@ -283,11 +309,14 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI methodMap_["enableFabricRenderer"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricRenderer}; methodMap_["enableFixForParentTagDuringReparenting"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFixForParentTagDuringReparenting}; methodMap_["enableFontScaleChangesUpdatingLayout"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFontScaleChangesUpdatingLayout}; + methodMap_["enableIOSTextBaselineOffsetPerLine"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSTextBaselineOffsetPerLine}; methodMap_["enableIOSViewClipToPaddingBox"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSViewClipToPaddingBox}; methodMap_["enableIntersectionObserverEventLoopIntegration"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIntersectionObserverEventLoopIntegration}; methodMap_["enableLayoutAnimationsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnAndroid}; methodMap_["enableLayoutAnimationsOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnIOS}; + methodMap_["enableMainQueueCoordinatorOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueCoordinatorOnIOS}; methodMap_["enableMainQueueModulesOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueModulesOnIOS}; + methodMap_["enableModuleArgumentNSNullConversionIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableModuleArgumentNSNullConversionIOS}; methodMap_["enableNativeCSSParsing"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNativeCSSParsing}; methodMap_["enableNetworkEventReporting"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNetworkEventReporting}; methodMap_["enableNewBackgroundAndBorderDrawables"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNewBackgroundAndBorderDrawables}; @@ -314,6 +343,7 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI methodMap_["useShadowNodeStateOnClone"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useShadowNodeStateOnClone}; methodMap_["useTurboModuleInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModuleInterop}; methodMap_["useTurboModules"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModules}; + methodMap_["virtualViewPrerenderRatio"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_virtualViewPrerenderRatio}; } static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { static_cast(&turboModule)->isReduceMotionEnabled( @@ -3019,14 +3049,6 @@ static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_observe(jsi::R ); return jsi::Value::undefined(); } -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_unobserve(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserve( - 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") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_unobserveAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { static_cast(&turboModule)->unobserveAll( rt, @@ -3057,7 +3079,6 @@ static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_takeRecords(js NativeMutationObserverCxxSpecJSI::NativeMutationObserverCxxSpecJSI(std::shared_ptr jsInvoker) : TurboModule("NativeMutationObserverCxx", jsInvoker) { methodMap_["observe"] = MethodMetadata {1, __hostFunction_NativeMutationObserverCxxSpecJSI_observe}; - methodMap_["unobserve"] = MethodMetadata {2, __hostFunction_NativeMutationObserverCxxSpecJSI_unobserve}; methodMap_["unobserveAll"] = MethodMetadata {1, __hostFunction_NativeMutationObserverCxxSpecJSI_unobserveAll}; methodMap_["connect"] = MethodMetadata {2, __hostFunction_NativeMutationObserverCxxSpecJSI_connect}; methodMap_["disconnect"] = MethodMetadata {0, __hostFunction_NativeMutationObserverCxxSpecJSI_disconnect}; diff --git a/vnext/codegen/rnwcoreJSI.h b/vnext/codegen/rnwcoreJSI.h index 7c19259ecc7..30bad1df5fe 100644 --- a/vnext/codegen/rnwcoreJSI.h +++ b/vnext/codegen/rnwcoreJSI.h @@ -27,6 +27,7 @@ namespace facebook::react { virtual bool cxxNativeAnimatedEnabled(jsi::Runtime &rt) = 0; virtual bool disableMainQueueSyncDispatchIOS(jsi::Runtime &rt) = 0; virtual bool disableMountItemReorderingAndroid(jsi::Runtime &rt) = 0; + virtual bool disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt) = 0; virtual bool enableAccessibilityOrder(jsi::Runtime &rt) = 0; virtual bool enableAccumulatedUpdatesInRawPropsAndroid(jsi::Runtime &rt) = 0; virtual bool enableBridgelessArchitecture(jsi::Runtime &rt) = 0; @@ -39,11 +40,14 @@ namespace facebook::react { virtual bool enableFabricRenderer(jsi::Runtime &rt) = 0; virtual bool enableFixForParentTagDuringReparenting(jsi::Runtime &rt) = 0; virtual bool enableFontScaleChangesUpdatingLayout(jsi::Runtime &rt) = 0; + virtual bool enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt) = 0; virtual bool enableIOSViewClipToPaddingBox(jsi::Runtime &rt) = 0; virtual bool enableIntersectionObserverEventLoopIntegration(jsi::Runtime &rt) = 0; virtual bool enableLayoutAnimationsOnAndroid(jsi::Runtime &rt) = 0; virtual bool enableLayoutAnimationsOnIOS(jsi::Runtime &rt) = 0; + virtual bool enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt) = 0; virtual bool enableMainQueueModulesOnIOS(jsi::Runtime &rt) = 0; + virtual bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt) = 0; virtual bool enableNativeCSSParsing(jsi::Runtime &rt) = 0; virtual bool enableNetworkEventReporting(jsi::Runtime &rt) = 0; virtual bool enableNewBackgroundAndBorderDrawables(jsi::Runtime &rt) = 0; @@ -70,6 +74,7 @@ namespace facebook::react { virtual bool useShadowNodeStateOnClone(jsi::Runtime &rt) = 0; virtual bool useTurboModuleInterop(jsi::Runtime &rt) = 0; virtual bool useTurboModules(jsi::Runtime &rt) = 0; + virtual double virtualViewPrerenderRatio(jsi::Runtime &rt) = 0; }; @@ -156,6 +161,14 @@ class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule { return bridging::callFromJs( rt, &T::disableMountItemReorderingAndroid, jsInvoker_, instance_); } + bool disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt) override { + static_assert( + bridging::getParameterCount(&T::disableTextLayoutManagerCacheAndroid) == 1, + "Expected disableTextLayoutManagerCacheAndroid(...) to have 1 parameters"); + + return bridging::callFromJs( + rt, &T::disableTextLayoutManagerCacheAndroid, jsInvoker_, instance_); + } bool enableAccessibilityOrder(jsi::Runtime &rt) override { static_assert( bridging::getParameterCount(&T::enableAccessibilityOrder) == 1, @@ -252,6 +265,14 @@ class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule { return bridging::callFromJs( rt, &T::enableFontScaleChangesUpdatingLayout, jsInvoker_, instance_); } + bool enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt) override { + static_assert( + bridging::getParameterCount(&T::enableIOSTextBaselineOffsetPerLine) == 1, + "Expected enableIOSTextBaselineOffsetPerLine(...) to have 1 parameters"); + + return bridging::callFromJs( + rt, &T::enableIOSTextBaselineOffsetPerLine, jsInvoker_, instance_); + } bool enableIOSViewClipToPaddingBox(jsi::Runtime &rt) override { static_assert( bridging::getParameterCount(&T::enableIOSViewClipToPaddingBox) == 1, @@ -284,6 +305,14 @@ class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule { return bridging::callFromJs( rt, &T::enableLayoutAnimationsOnIOS, jsInvoker_, instance_); } + bool enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt) override { + static_assert( + bridging::getParameterCount(&T::enableMainQueueCoordinatorOnIOS) == 1, + "Expected enableMainQueueCoordinatorOnIOS(...) to have 1 parameters"); + + return bridging::callFromJs( + rt, &T::enableMainQueueCoordinatorOnIOS, jsInvoker_, instance_); + } bool enableMainQueueModulesOnIOS(jsi::Runtime &rt) override { static_assert( bridging::getParameterCount(&T::enableMainQueueModulesOnIOS) == 1, @@ -292,6 +321,14 @@ class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule { return bridging::callFromJs( rt, &T::enableMainQueueModulesOnIOS, jsInvoker_, instance_); } + bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt) override { + static_assert( + bridging::getParameterCount(&T::enableModuleArgumentNSNullConversionIOS) == 1, + "Expected enableModuleArgumentNSNullConversionIOS(...) to have 1 parameters"); + + return bridging::callFromJs( + rt, &T::enableModuleArgumentNSNullConversionIOS, jsInvoker_, instance_); + } bool enableNativeCSSParsing(jsi::Runtime &rt) override { static_assert( bridging::getParameterCount(&T::enableNativeCSSParsing) == 1, @@ -500,6 +537,14 @@ class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule { return bridging::callFromJs( rt, &T::useTurboModules, jsInvoker_, instance_); } + double virtualViewPrerenderRatio(jsi::Runtime &rt) override { + static_assert( + bridging::getParameterCount(&T::virtualViewPrerenderRatio) == 1, + "Expected virtualViewPrerenderRatio(...) to have 1 parameters"); + + return bridging::callFromJs( + rt, &T::virtualViewPrerenderRatio, jsInvoker_, instance_); + } private: friend class NativeReactNativeFeatureFlagsCxxSpec; @@ -6261,7 +6306,7 @@ struct Bridging { } else if (value == 42) { return NativeSampleTurboModuleEnumInt::B; } else { - throw jsi::JSError(rt, "No appropriate enum member found for value"); + throw jsi::JSError(rt, "No appropriate enum member found for value in NativeSampleTurboModuleEnumInt"); } } @@ -6271,7 +6316,7 @@ struct Bridging { } else if (value == NativeSampleTurboModuleEnumInt::B) { return bridging::toJs(rt, 42); } else { - throw jsi::JSError(rt, "No appropriate enum member found for enum value"); + throw jsi::JSError(rt, "No appropriate enum member found for enum value in NativeSampleTurboModuleEnumInt"); } } }; @@ -8257,15 +8302,14 @@ struct NativeIntersectionObserverNativeIntersectionObserverEntryBridging { #pragma mark - NativeIntersectionObserverNativeIntersectionObserverObserveOptions -template +template struct NativeIntersectionObserverNativeIntersectionObserverObserveOptions { P0 intersectionObserverId; - P1 rootShadowNode; - P2 targetShadowNode; - P3 thresholds; - P4 rootThresholds; + P1 targetShadowNode; + P2 thresholds; + P3 rootThresholds; bool operator==(const NativeIntersectionObserverNativeIntersectionObserverObserveOptions &other) const { - return intersectionObserverId == other.intersectionObserverId && rootShadowNode == other.rootShadowNode && targetShadowNode == other.targetShadowNode && thresholds == other.thresholds && rootThresholds == other.rootThresholds; + return intersectionObserverId == other.intersectionObserverId && targetShadowNode == other.targetShadowNode && thresholds == other.thresholds && rootThresholds == other.rootThresholds; } }; @@ -8279,7 +8323,6 @@ struct NativeIntersectionObserverNativeIntersectionObserverObserveOptionsBridgin const std::shared_ptr &jsInvoker) { T result{ bridging::fromJs(rt, value.getProperty(rt, "intersectionObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootShadowNode"), jsInvoker), bridging::fromJs(rt, value.getProperty(rt, "targetShadowNode"), jsInvoker), bridging::fromJs(rt, value.getProperty(rt, "thresholds"), jsInvoker), bridging::fromJs(rt, value.getProperty(rt, "rootThresholds"), jsInvoker)}; @@ -8291,10 +8334,6 @@ struct NativeIntersectionObserverNativeIntersectionObserverObserveOptionsBridgin return bridging::toJs(rt, value); } - static std::optional rootShadowNodeToJs(jsi::Runtime &rt, decltype(types.rootShadowNode) value) { - return bridging::toJs(rt, value); - } - static jsi::Value targetShadowNodeToJs(jsi::Runtime &rt, decltype(types.targetShadowNode) value) { return bridging::toJs(rt, value); } @@ -8314,9 +8353,6 @@ struct NativeIntersectionObserverNativeIntersectionObserverObserveOptionsBridgin const std::shared_ptr &jsInvoker) { auto result = facebook::jsi::Object(rt); result.setProperty(rt, "intersectionObserverId", bridging::toJs(rt, value.intersectionObserverId, jsInvoker)); - if (value.rootShadowNode) { - result.setProperty(rt, "rootShadowNode", bridging::toJs(rt, value.rootShadowNode.value(), jsInvoker)); - } result.setProperty(rt, "targetShadowNode", bridging::toJs(rt, value.targetShadowNode, jsInvoker)); result.setProperty(rt, "thresholds", bridging::toJs(rt, value.thresholds, jsInvoker)); if (value.rootThresholds) { @@ -8610,7 +8646,6 @@ class JSI_EXPORT NativeMutationObserverCxxSpecJSI : public TurboModule { public: virtual void observe(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserve(jsi::Runtime &rt, double mutationObserverId, jsi::Value targetShadowNode) = 0; virtual void unobserveAll(jsi::Runtime &rt, double mutationObserverId) = 0; virtual void connect(jsi::Runtime &rt, jsi::Function notifyMutationObservers, jsi::Function getPublicInstanceFromInstanceHandle) = 0; virtual void disconnect(jsi::Runtime &rt) = 0; @@ -8653,14 +8688,6 @@ class JSI_EXPORT NativeMutationObserverCxxSpec : public TurboModule { return bridging::callFromJs( rt, &T::observe, jsInvoker_, instance_, std::move(options)); } - void unobserve(jsi::Runtime &rt, double mutationObserverId, jsi::Value targetShadowNode) override { - static_assert( - bridging::getParameterCount(&T::unobserve) == 3, - "Expected unobserve(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::unobserve, jsInvoker_, instance_, std::move(mutationObserverId), std::move(targetShadowNode)); - } void unobserveAll(jsi::Runtime &rt, double mutationObserverId) override { static_assert( bridging::getParameterCount(&T::unobserveAll) == 2, diff --git a/vnext/overrides.json b/vnext/overrides.json index d22d80ec2e0..3ad5d3a1504 100644 --- a/vnext/overrides.json +++ b/vnext/overrides.json @@ -8,13 +8,13 @@ "**/__snapshots__/**", "src-win/rntypes/**" ], - "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", + "baseVersion": "0.81.0-nightly-20250604-1a6d466f1", "overrides": [ { "type": "derived", "file": ".flowconfig", "baseFile": ".flowconfig", - "baseHash": "dbea35126905a8314fa0a64ed2912896bc6d307b" + "baseHash": "a9dfa56b1428e49ea4474e0fee395c0dba67625b" }, { "type": "derived", @@ -142,14 +142,14 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp", "baseFile": "packages/react-native/ReactCommon/react/nativemodule/dom/NativeDOM.cpp", - "baseHash": "592e8097645b4d75107277c2ae544f8c514bd1fb", + "baseHash": "8dee609f47ed1e6e0d876f5ad75876a07d951d49", "issue": 14257 }, { "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h", "baseFile": "packages/react-native/ReactCommon/react/nativemodule/dom/NativeDOM.h", - "baseHash": "bad5d4e69105e4a67a6436f87ecac1ae557fff61", + "baseHash": "01eff14d2d24d0ff73f2380fadde077953606fd2", "issue": 14654 }, { @@ -163,7 +163,7 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp", "baseFile": "packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp", - "baseHash": "4b4811c43b33fc389a35838aa4a54e29251b2681", + "baseHash": "670620c8ef2c5ed6ac11ff48154c70bee18f50ee", "issue": 15132 }, { @@ -224,7 +224,7 @@ "type": "patch", "file": "ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp", "baseFile": "packages/react-native/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp", - "baseHash": "e03ce8e5db0216f23389ff8b3e9ea450c8a031b7", + "baseHash": "3e2118e9f8acff69371d8f9ad885927452cfb3a1", "issue": 14673 }, { @@ -238,14 +238,14 @@ "type": "copy", "directory": "ReactCopies/IntegrationTests", "baseDirectory": "packages/rn-tester/IntegrationTests", - "baseHash": "a3caedc8e2a223bf80e04801434a32934c3d60d0", + "baseHash": "7111336c1517950c7b0c7acec7ee7a0a3f7c1ae0", "issue": 4054 }, { "type": "derived", "file": "src-win/index.windows.js", "baseFile": "packages/react-native/index.js", - "baseHash": "b447e699186ab3e95da9dc4520b9c2517776e723" + "baseHash": "79fa02963edb0e0f580fad3c401187956b393e2e" }, { "type": "platform", @@ -291,7 +291,7 @@ "type": "patch", "file": "src-win/jest/setup.js", "baseFile": "packages/react-native/jest/setup.js", - "baseHash": "8582f862e5fce906d3feb54b640bc29adc8df9f6", + "baseHash": "34b3b82637073a7ce26503600a71b6d8e6afaf47", "issue": 14929 }, { @@ -302,7 +302,7 @@ "type": "patch", "file": "src-win/Libraries/Alert/Alert.windows.js", "baseFile": "packages/react-native/Libraries/Alert/Alert.js", - "baseHash": "bd8f474e454f2b703ca7fb55cb022f24046bc0f8" + "baseHash": "980f439d79b614424de82f8a3380dea74ab6824b" }, { "type": "platform", @@ -327,7 +327,7 @@ "type": "copy", "file": "src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.windows.js", "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js", - "baseHash": "706e7b9a66fbddcb4b19c6d1d9b9838db9d15d52", + "baseHash": "28b564593dd7886279f3f4becee3a1da5144be1d", "issue": 4578 }, { @@ -341,7 +341,7 @@ "type": "derived", "file": "src-win/Libraries/Components/Button.windows.js", "baseFile": "packages/react-native/Libraries/Components/Button.js", - "baseHash": "6063d726e6255d1c55e07587f9ce09f1b7284301" + "baseHash": "ff56172f38be109b069589c40b6be80751c3527c" }, { "type": "platform", @@ -397,13 +397,13 @@ "type": "patch", "file": "src-win/Libraries/Components/RefreshControl/RefreshControl.windows.js", "baseFile": "packages/react-native/Libraries/Components/RefreshControl/RefreshControl.js", - "baseHash": "42953d82f39f9ad792a7a441e6008f792bb4c13a" + "baseHash": "2d5a412d168f38a8c28582a3eb300495050b1ddc" }, { "type": "derived", "file": "src-win/Libraries/Components/ScrollView/ScrollView.windows.js", "baseFile": "packages/react-native/Libraries/Components/ScrollView/ScrollView.js", - "baseHash": "06b4d1e5824d8c85de6ab74faf5adc33093558af" + "baseHash": "2f5ade3e04889643f0e7af1380e8864869125394" }, { "type": "derived", @@ -421,31 +421,31 @@ "type": "derived", "file": "src-win/Libraries/Components/TextInput/TextInput.flow.windows.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.flow.js", - "baseHash": "b611f4e98e9c7818dfac087e4f14384d3cc16b6a" + "baseHash": "217606b7527281d62335913ee8349506fcb9192b" }, { "type": "patch", "file": "src-win/Libraries/Components/TextInput/TextInput.windows.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js", - "baseHash": "2a5835c5cbdb36bd110e26f9be737aaaeb1fd97c" + "baseHash": "6bdac6e2d8569b25480db63f81d7f6dfc130f5f7" }, { "type": "patch", "file": "src-win/Libraries/Components/TextInput/TextInputState.windows.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInputState.js", - "baseHash": "400af173e846317c705487f51f3cb165e7378a4f" + "baseHash": "6ed06ca68066b0cdbaa28a2e5f1fe1b6d9d62f63" }, { "type": "derived", "file": "src-win/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js", - "baseHash": "dad89638b07112094c027d16046a93728334bb64" + "baseHash": "89e74c58f4a948b921af4bb358a4ac5629d0aca2" }, { "type": "patch", "file": "src-win/Libraries/Components/Touchable/Touchable.windows.js", "baseFile": "packages/react-native/Libraries/Components/Touchable/Touchable.js", - "baseHash": "2f7db68acd47af643bc0625d31d199332d519871" + "baseHash": "399b4d18cb04aae8d565484d3e228eccd88abad6" }, { "type": "derived", @@ -475,7 +475,7 @@ "type": "patch", "file": "src-win/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js", "baseFile": "packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js", - "baseHash": "bda66632ba3157166d9c8ff0ab78f74ed21aaf1d" + "baseHash": "f22cce74573326eaf0fa2f9bc06710d407f92706" }, { "type": "patch", @@ -488,7 +488,7 @@ "type": "patch", "file": "src-win/Libraries/Components/View/View.windows.js", "baseFile": "packages/react-native/Libraries/Components/View/View.js", - "baseHash": "121c2126d26c94c8e508e3fb19ffe33f7be814b1" + "baseHash": "a3a08960f0c78d97f9144e32ed8388f02ff2a641" }, { "type": "derived", @@ -500,19 +500,19 @@ "type": "patch", "file": "src-win/Libraries/Components/View/ViewAccessibility.windows.js", "baseFile": "packages/react-native/Libraries/Components/View/ViewAccessibility.js", - "baseHash": "04981261b2ed61b31bfbb396478bb6b103d99253" + "baseHash": "26f3cbc5eeb46241a6e25cf051d5fa872c8c936c" }, { "type": "derived", "file": "src-win/Libraries/Components/View/ViewPropTypes.d.ts", "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts", - "baseHash": "ef39871442f6fd69ff316e824fcace95bda6f95b" + "baseHash": "10b609db23ea9243b34d787d42a148f5cb9b33f2" }, { "type": "patch", "file": "src-win/Libraries/Components/View/ViewPropTypes.windows.js", "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.js", - "baseHash": "ec1ffd005b6631e6af027731b087a7620fbf5cf5" + "baseHash": "8ade41e42a14e3d39428e7e135120feedbdb2f6c" }, { "type": "patch", @@ -542,7 +542,7 @@ "type": "patch", "file": "src-win/Libraries/Image/resolveAssetSource.windows.js", "baseFile": "packages/react-native/Libraries/Image/resolveAssetSource.js", - "baseHash": "6b011a6e50979371f7a0970baea242e5e5771b30", + "baseHash": "5d34037f3a870c1380b34041cf9b5439ef066bcb", "issue": 10619 }, { @@ -579,13 +579,13 @@ "type": "derived", "file": "src-win/Libraries/Modal/Modal.windows.js", "baseFile": "packages/react-native/Libraries/Modal/Modal.js", - "baseHash": "35fbf7a19cd6e7af8bd9dfce31bc188ebbd7f0b7" + "baseHash": "487ce21a8b85a1961005c4ae66186fe0042040d6" }, { "type": "derived", "file": "src-win/Libraries/NativeComponent/BaseViewConfig.windows.js", "baseFile": "packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js", - "baseHash": "b520e2bdb2be31bdb6ad7e3769dbe69168870c8c" + "baseHash": "2afdb9c2f278c6008944e31eea4c20078529e561" }, { "type": "derived", @@ -597,7 +597,7 @@ "type": "copy", "file": "src-win/Libraries/Network/RCTNetworking.windows.js", "baseFile": "packages/react-native/Libraries/Network/RCTNetworking.ios.js", - "baseHash": "4b96609d7e8d0596d2960aacfda35af73cec1085" + "baseHash": "975cb78ed40d162be73144bafcaee9bcd057bd44" }, { "type": "platform", @@ -614,7 +614,7 @@ "type": "patch", "file": "src-win/Libraries/Pressability/Pressability.windows.js", "baseFile": "packages/react-native/Libraries/Pressability/Pressability.js", - "baseHash": "b52df7d819237b8acdd08f84631e3c257a9cb390", + "baseHash": "54f2a508c9378c1d9240ff27a460a8815e2b8ebd", "issue": 4379 }, { @@ -644,7 +644,7 @@ "type": "derived", "file": "src-win/Libraries/Text/Text.windows.js", "baseFile": "packages/react-native/Libraries/Text/Text.js", - "baseHash": "108e59816ed3b3c8183d0687a66088755580c00d" + "baseHash": "a24c9881da46b612c461a304b3ba9c640adbb5cb" }, { "type": "derived", @@ -675,7 +675,7 @@ "type": "derived", "file": "src-win/Libraries/Utilities/Platform.windows.js", "baseFile": "packages/react-native/Libraries/Utilities/Platform.android.js", - "baseHash": "8c3daf7b75af0445441def55571374bebed83726" + "baseHash": "58c8663867cc2cfdf9bd62425386dd1f44a592e8" }, { "type": "derived", @@ -694,13 +694,13 @@ "type": "patch", "file": "src-win/src/private/featureflags/ReactNativeFeatureFlagsBase.js", "baseFile": "packages/react-native/src/private/featureflags/ReactNativeFeatureFlagsBase.js", - "baseHash": "32823af7188e2935b7fbf1cb368ab9ad94b38d4f" + "baseHash": "ed87cf338bea97b7b4aba393fcc457900e3c73d9" }, { "type": "patch", "file": "src-win/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js", "baseFile": "packages/react-native/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js", - "baseHash": "b68cd3eb3257f988de7a238ebd5e6424769531a7" + "baseHash": "3f0e8a7f4f4bbe46ab71f2b4b62f7071a78bb908" }, { "type": "platform", diff --git a/vnext/package.json b/vnext/package.json index 305ddbd9f59..4d43dfd5a40 100644 --- a/vnext/package.json +++ b/vnext/package.json @@ -84,7 +84,7 @@ "just-scripts": "^1.3.3", "prettier": "2.8.8", "react": "19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a", + "react-native": "0.81.0-nightly-20250604-1a6d466f1", "react-native-platform-override": "^1.9.58", "react-refresh": "^0.14.0", "typescript": "5.0.4" diff --git a/vnext/src-win/Libraries/Alert/Alert.windows.js b/vnext/src-win/Libraries/Alert/Alert.windows.js index e9d0cf7bf12..7d81b8656c8 100644 --- a/vnext/src-win/Libraries/Alert/Alert.windows.js +++ b/vnext/src-win/Libraries/Alert/Alert.windows.js @@ -1,6 +1,14 @@ /** +<<<<<<< Upstream + * 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. + * +======= * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. +>>>>>>> Override * @flow * @format */ diff --git a/vnext/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.windows.js b/vnext/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.windows.js index cc75d54fafd..b47617745ff 100644 --- a/vnext/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.windows.js +++ b/vnext/src-win/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import UIManager from '../../ReactNative/UIManager'; diff --git a/vnext/src-win/Libraries/Components/Button.windows.js b/vnext/src-win/Libraries/Components/Button.windows.js index f660f7a1243..bc4c12181f8 100644 --- a/vnext/src-win/Libraries/Components/Button.windows.js +++ b/vnext/src-win/Libraries/Components/Button.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/vnext/src-win/Libraries/Components/RefreshControl/RefreshControl.windows.js b/vnext/src-win/Libraries/Components/RefreshControl/RefreshControl.windows.js index 2d4806e1729..e5e837dddc4 100644 --- a/vnext/src-win/Libraries/Components/RefreshControl/RefreshControl.windows.js +++ b/vnext/src-win/Libraries/Components/RefreshControl/RefreshControl.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {ColorValue} from '../../StyleSheet/StyleSheet'; diff --git a/vnext/src-win/Libraries/Components/ScrollView/ScrollView.windows.js b/vnext/src-win/Libraries/Components/ScrollView/ScrollView.windows.js index 09d7a25d8c7..2f6cd5ef392 100644 --- a/vnext/src-win/Libraries/Components/ScrollView/ScrollView.windows.js +++ b/vnext/src-win/Libraries/Components/ScrollView/ScrollView.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {HostInstance} from '../../../src/private/types/HostInstance'; @@ -1646,7 +1646,9 @@ class ScrollView extends React.Component { if (__DEV__ && this.props.style !== undefined) { // $FlowFixMe[underconstrained-implicit-instantiation] const style = flattenStyle(this.props.style); - const childLayoutProps = ['alignItems', 'justifyContent'].filter( + const childLayoutProps = ( + ['alignItems', 'justifyContent'] as const + ).filter( // $FlowFixMe[incompatible-use] prop => style && style[prop] !== undefined, ); diff --git a/vnext/src-win/Libraries/Components/TextInput/TextInput.flow.windows.js b/vnext/src-win/Libraries/Components/TextInput/TextInput.flow.windows.js index 54ef637bc3e..7d507c7354b 100644 --- a/vnext/src-win/Libraries/Components/TextInput/TextInput.flow.windows.js +++ b/vnext/src-win/Libraries/Components/TextInput/TextInput.flow.windows.js @@ -10,6 +10,8 @@ import type {HostInstance} from '../../../src/private/types/HostInstance'; import type { + BlurEvent, + FocusEvent, GestureResponderEvent, NativeSyntheticEvent, ScrollEvent, @@ -62,22 +64,22 @@ type TextInputContentSizeChangeEventData = $ReadOnly<{ export type TextInputContentSizeChangeEvent = NativeSyntheticEvent; -type TargetEvent = $ReadOnly<{ - target: number, - ... -}>; - -type TextInputFocusEventData = TargetEvent; - /** * @see TextInputProps.onBlur + * @deprecated Use `BlurEvent` instead. */ -export type TextInputBlurEvent = NativeSyntheticEvent; +export type TextInputBlurEvent = BlurEvent; /** * @see TextInputProps.onFocus + * @deprecated Use `FocusEvent` instead. */ -export type TextInputFocusEvent = NativeSyntheticEvent; +export type TextInputFocusEvent = FocusEvent; + +type TargetEvent = $ReadOnly<{ + target: number, + ... +}>; export type Selection = $ReadOnly<{ start: number, diff --git a/vnext/src-win/Libraries/Components/TextInput/TextInput.windows.js b/vnext/src-win/Libraries/Components/TextInput/TextInput.windows.js index 406df959199..4fda283180a 100644 --- a/vnext/src-win/Libraries/Components/TextInput/TextInput.windows.js +++ b/vnext/src-win/Libraries/Components/TextInput/TextInput.windows.js @@ -11,8 +11,13 @@ import type {HostInstance} from '../../../src/private/types/HostInstance'; import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes'; import type { +<<<<<<< Upstream + BlurEvent, + FocusEvent, +======= KeyEvent, // Windows MouseEvent, // Windows +>>>>>>> Override GestureResponderEvent, ScrollEvent, } from '../../Types/CoreEventTypes'; @@ -100,10 +105,12 @@ else if (Platform.OS === 'windows') { export type { AutoCapitalize, + BlurEvent, EnterKeyHintType, EnterKeyHintTypeAndroid, EnterKeyHintTypeIOS, EnterKeyHintTypeOptions, + FocusEvent, InputModeOptions, KeyboardType, KeyboardTypeAndroid, @@ -550,14 +557,14 @@ function InternalTextInput(props: TextInputProps): React.Node { }); }; - const _onFocus = (event: TextInputFocusEvent) => { + const _onFocus = (event: FocusEvent) => { TextInputState.focusInput(inputRef.current); if (props.onFocus) { props.onFocus(event); } }; - const _onBlur = (event: TextInputBlurEvent) => { + const _onBlur = (event: BlurEvent) => { TextInputState.blurInput(inputRef.current); if (props.onBlur) { props.onBlur(event); @@ -930,7 +937,7 @@ const enterKeyHintToReturnTypeMap = { previous: 'previous', search: 'search', send: 'send', -}; +} as const; const inputModeToKeyboardTypeMap = { none: 'default', @@ -938,10 +945,11 @@ const inputModeToKeyboardTypeMap = { decimal: 'decimal-pad', numeric: 'number-pad', tel: 'phone-pad', - search: Platform.OS === 'ios' ? 'web-search' : 'default', + search: + Platform.OS === 'ios' ? ('web-search' as const) : ('default' as const), email: 'email-address', url: 'url', -}; +} as const; // Map HTML autocomplete values to Android autoComplete values const autoCompleteWebToAutoCompleteAndroidMap = { @@ -975,7 +983,7 @@ const autoCompleteWebToAutoCompleteAndroidMap = { 'tel-country-code': 'tel-country-code', 'tel-national': 'tel-national', username: 'username', -}; +} as const; // Map HTML autocomplete values to iOS textContentType values const autoCompleteWebToTextContentTypeMap = { @@ -1015,7 +1023,7 @@ const autoCompleteWebToTextContentTypeMap = { tel: 'telephoneNumber', url: 'URL', username: 'username', -}; +} as const; const TextInput: component( ref?: React.RefSetter, @@ -1067,8 +1075,7 @@ const TextInput: component( : Platform.OS === 'ios' && autoComplete && autoComplete in autoCompleteWebToTextContentTypeMap - ? // $FlowFixMe[invalid-computed-prop] - // $FlowFixMe[prop-missing] + ? // $FlowFixMe[prop-missing] autoCompleteWebToTextContentTypeMap[autoComplete] : textContentType } @@ -1107,7 +1114,7 @@ const verticalAlignToTextAlignVerticalMap = { top: 'top', bottom: 'bottom', middle: 'center', -}; +} as const; // $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe. export default TextInput as any as TextInputType; diff --git a/vnext/src-win/Libraries/Components/TextInput/TextInputState.windows.js b/vnext/src-win/Libraries/Components/TextInput/TextInputState.windows.js index d5ef4edc9eb..07b69eed862 100644 --- a/vnext/src-win/Libraries/Components/TextInput/TextInputState.windows.js +++ b/vnext/src-win/Libraries/Components/TextInput/TextInputState.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ // This class is responsible for coordinating the "focused" state for diff --git a/vnext/src-win/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js b/vnext/src-win/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js index 4cc9b00ff7f..c3f988bd3c7 100644 --- a/vnext/src-win/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +++ b/vnext/src-win/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js @@ -632,24 +632,12 @@ export const Commands: NativeCommands = codegenNativeCommands({ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = { uiViewClassName: 'WindowsTextInput', bubblingEventTypes: { - topBlur: { - phasedRegistrationNames: { - bubbled: 'onBlur', - captured: 'onBlurCapture', - }, - }, topEndEditing: { phasedRegistrationNames: { bubbled: 'onEndEditing', captured: 'onEndEditingCapture', }, }, - topFocus: { - phasedRegistrationNames: { - bubbled: 'onFocus', - captured: 'onFocusCapture', - }, - }, topKeyPress: { phasedRegistrationNames: { bubbled: 'onKeyPress', diff --git a/vnext/src-win/Libraries/Components/Touchable/Touchable.windows.js b/vnext/src-win/Libraries/Components/Touchable/Touchable.windows.js index 275c30c5dc3..17e51d81b46 100644 --- a/vnext/src-win/Libraries/Components/Touchable/Touchable.windows.js +++ b/vnext/src-win/Libraries/Components/Touchable/Touchable.windows.js @@ -874,11 +874,15 @@ const TouchableMixinImpl = { curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN; + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ const isActiveTransition = !IsActive[curState] && IsActive[nextState]; if (isInitialTransition || isActiveTransition) { this._remeasureMetricsOnActivation(); } + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { this.touchableHandleLongPress && this.touchableHandleLongPress(e); } @@ -889,13 +893,19 @@ const TouchableMixinImpl = { this._endHighlight(e); } + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { const hasLongPressHandler = !!this.props.onLongPress; const pressIsLongButStillCallOnPress = + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ IsLongPressingIn[curState] && // We *are* long pressing.. // But either has no long handler (!hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it. const shouldInvokePress = + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; if (shouldInvokePress && this.touchableHandlePress) { if (!newIsHighlight && !curIsHighlight) { diff --git a/vnext/src-win/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js b/vnext/src-win/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js index 0cfb8eeb2de..84b3aecfc65 100644 --- a/vnext/src-win/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +++ b/vnext/src-win/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js @@ -168,6 +168,9 @@ const PASSTHROUGH_PROPS = [ 'onFocus', 'onLayout', 'testID', +<<<<<<< Upstream +] as const; +======= 'accessibilityPosInSet', // [Windows] 'accessibilitySetSize', // [Windows] 'onAccessibilityTap', // [Windows] @@ -176,6 +179,7 @@ const PASSTHROUGH_PROPS = [ 'tabIndex', // [Windows] 'tooltip', // [Windows] ]; +>>>>>>> Override /** * Do not use unless you have a very good reason. diff --git a/vnext/src-win/Libraries/Components/View/View.windows.js b/vnext/src-win/Libraries/Components/View/View.windows.js index 28f54cc2380..1f8745eaccb 100644 --- a/vnext/src-win/Libraries/Components/View/View.windows.js +++ b/vnext/src-win/Libraries/Components/View/View.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {ViewProps} from './ViewPropTypes'; diff --git a/vnext/src-win/Libraries/Components/View/ViewAccessibility.windows.js b/vnext/src-win/Libraries/Components/View/ViewAccessibility.windows.js index 660daa73028..391047a94f0 100644 --- a/vnext/src-win/Libraries/Components/View/ViewAccessibility.windows.js +++ b/vnext/src-win/Libraries/Components/View/ViewAccessibility.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/vnext/src-win/Libraries/Components/View/ViewPropTypes.d.ts b/vnext/src-win/Libraries/Components/View/ViewPropTypes.d.ts index 5514ec46116..e031b4dea62 100644 --- a/vnext/src-win/Libraries/Components/View/ViewPropTypes.d.ts +++ b/vnext/src-win/Libraries/Components/View/ViewPropTypes.d.ts @@ -13,6 +13,13 @@ import {GestureResponderHandlers} from '../../../types/public/ReactNativeRendere import {StyleProp} from '../../StyleSheet/StyleSheet'; import {ViewStyle} from '../../StyleSheet/StyleSheetTypes'; import { +<<<<<<< Upstream + BlurEvent, + FocusEvent, + LayoutChangeEvent, + PointerEvents, +} from '../../Types/CoreEventTypes'; +======= LayoutChangeEvent, MouseEvent, // Windows NativeSyntheticEvent, // Windows @@ -20,6 +27,7 @@ import { } from 'react-native/Libraries/Types/CoreEventTypes'; import {IKeyboardProps} from '../Keyboard/KeyboardExtProps'; // Windows +>>>>>>> Override import {Touchable} from '../Touchable/Touchable'; import {AccessibilityProps} from './ViewAccessibility'; @@ -83,6 +91,20 @@ export interface ViewPropsIOS extends TVViewPropsIOS { } export interface ViewPropsAndroid { + /** + * Callback that is called when the view is blurred. + * + * Note: This will only be called if the view is focusable. + */ + onBlur?: ((e: BlurEvent) => void) | null | undefined; + + /** + * Callback that is called when the view is focused. + * + * Note: This will only be called if the view is focusable. + */ + onFocus?: ((e: FocusEvent) => void) | null | undefined; + /** * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. * diff --git a/vnext/src-win/Libraries/Components/View/ViewPropTypes.windows.js b/vnext/src-win/Libraries/Components/View/ViewPropTypes.windows.js index c123bc2a1af..60857604ec2 100644 --- a/vnext/src-win/Libraries/Components/View/ViewPropTypes.windows.js +++ b/vnext/src-win/Libraries/Components/View/ViewPropTypes.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/vnext/src-win/Libraries/Image/resolveAssetSource.windows.js b/vnext/src-win/Libraries/Image/resolveAssetSource.windows.js index 604ce790148..070b1398a04 100644 --- a/vnext/src-win/Libraries/Image/resolveAssetSource.windows.js +++ b/vnext/src-win/Libraries/Image/resolveAssetSource.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ // Utilities for resolving an asset into a `source` for e.g. `Image` diff --git a/vnext/src-win/Libraries/Modal/Modal.windows.js b/vnext/src-win/Libraries/Modal/Modal.windows.js index 65fcd7a6eda..11473f4a99f 100644 --- a/vnext/src-win/Libraries/Modal/Modal.windows.js +++ b/vnext/src-win/Libraries/Modal/Modal.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {HostInstance} from '../../src/private/types/HostInstance'; @@ -321,6 +321,8 @@ class Modal extends React.Component { return ( =0.111.0 site=react_native_fb) This * comment suppresses an error found when Flow v0.111 was deployed. To see diff --git a/vnext/src-win/Libraries/NativeComponent/BaseViewConfig.windows.js b/vnext/src-win/Libraries/NativeComponent/BaseViewConfig.windows.js index e84fbcad1d5..24289b26b1c 100644 --- a/vnext/src-win/Libraries/NativeComponent/BaseViewConfig.windows.js +++ b/vnext/src-win/Libraries/NativeComponent/BaseViewConfig.windows.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {PartialViewConfigWithoutName} from './PlatformBaseViewConfig'; @@ -248,14 +248,14 @@ const validAttributesForNonEventProps = { experimental_filter: NativeReactNativeFeatureFlags != null && ReactNativeFeatureFlags.enableNativeCSSParsing() - ? true + ? (true as const) : { process: require('../StyleSheet/processFilter').default, }, boxShadow: NativeReactNativeFeatureFlags != null && ReactNativeFeatureFlags.enableNativeCSSParsing() - ? true + ? (true as const) : { process: require('../StyleSheet/processBoxShadow').default, }, @@ -397,7 +397,7 @@ const validAttributesForNonEventProps = { importantForAccessibility: true, // [Windows] style: ReactNativeStyleAttributes, -}; +} as const; // Props for bubbling and direct events // [Windows diff --git a/vnext/src-win/Libraries/Network/RCTNetworking.windows.js b/vnext/src-win/Libraries/Network/RCTNetworking.windows.js index 40035ff1f6a..dcabadec9fd 100644 --- a/vnext/src-win/Libraries/Network/RCTNetworking.windows.js +++ b/vnext/src-win/Libraries/Network/RCTNetworking.windows.js @@ -29,7 +29,7 @@ const RCTNetworking = { sendRequest( method: string, - trackingName: ?string, + trackingName: string | void, url: string, headers: {...}, data: RequestBody, diff --git a/vnext/src-win/Libraries/Pressability/Pressability.windows.js b/vnext/src-win/Libraries/Pressability/Pressability.windows.js index a02155060f3..c85cc421952 100644 --- a/vnext/src-win/Libraries/Pressability/Pressability.windows.js +++ b/vnext/src-win/Libraries/Pressability/Pressability.windows.js @@ -267,7 +267,7 @@ const Transitions = Object.freeze({ LEAVE_PRESS_RECT: 'NOT_RESPONDER', LONG_PRESS_DETECTED: 'NOT_RESPONDER', }, -}); +} as const); const isActiveSignal = (signal: TouchState) => signal === 'RESPONDER_ACTIVE_PRESS_IN' || diff --git a/vnext/src-win/Libraries/Text/Text.windows.js b/vnext/src-win/Libraries/Text/Text.windows.js index 4bfc068ccbe..401cee9e4e4 100644 --- a/vnext/src-win/Libraries/Text/Text.windows.js +++ b/vnext/src-win/Libraries/Text/Text.windows.js @@ -577,6 +577,6 @@ const verticalAlignToTextAlignVerticalMap = { top: 'top', bottom: 'bottom', middle: 'center', -}; +} as const; export default TextImpl; diff --git a/vnext/src-win/Libraries/Utilities/Platform.windows.js b/vnext/src-win/Libraries/Utilities/Platform.windows.js index 297c44d9449..a44be020ef3 100644 --- a/vnext/src-win/Libraries/Utilities/Platform.windows.js +++ b/vnext/src-win/Libraries/Utilities/Platform.windows.js @@ -2,8 +2,8 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * - * @format * @flow strict + * @format */ import type { diff --git a/vnext/src-win/index.windows.js b/vnext/src-win/index.windows.js index c81a0b7b60a..76445a3e8c7 100644 --- a/vnext/src-win/index.windows.js +++ b/vnext/src-win/index.windows.js @@ -4,8 +4,13 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * +<<<<<<< Upstream + * @flow strict-local + * @format +======= * @format * @flow +>>>>>>> Override */ // flowlint unsafe-getters-setters:off diff --git a/vnext/src-win/jest/setup.js b/vnext/src-win/jest/setup.js index e80e6d19500..6504197036f 100644 --- a/vnext/src-win/jest/setup.js +++ b/vnext/src-win/jest/setup.js @@ -4,21 +4,20 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * + * @flow strict-local * @format */ -'use strict'; - global.IS_REACT_ACT_ENVIRONMENT = true; // Suppress the `react-test-renderer` warnings until New Architecture and legacy // mode are no longer supported by React Native. global.IS_REACT_NATIVE_TEST_ENVIRONMENT = true; -const MockNativeMethods = jest.requireActual('./MockNativeMethods'); -const mockComponent = jest.requireActual('./mockComponent'); +import '@react-native/js-polyfills/error-guard'; -jest.requireActual('@react-native/js-polyfills/error-guard'); +import mock from './mock'; +// $FlowIgnore[cannot-write] Object.defineProperties(global, { __DEV__: { configurable: true, @@ -29,7 +28,9 @@ Object.defineProperties(global, { cancelAnimationFrame: { configurable: true, enumerable: true, - value: id => clearTimeout(id), + value(id: TimeoutID): void { + return clearTimeout(id); + }, writable: true, }, nativeFabricUIManager: { @@ -42,6 +43,7 @@ Object.defineProperties(global, { configurable: true, enumerable: true, value: { + // $FlowIgnore[method-unbinding] now: jest.fn(Date.now), }, writable: true, @@ -49,13 +51,15 @@ Object.defineProperties(global, { regeneratorRuntime: { configurable: true, enumerable: true, - value: jest.requireActual('regenerator-runtime/runtime'), + value: jest.requireActual('regenerator-runtime/runtime'), writable: true, }, requestAnimationFrame: { configurable: true, enumerable: true, - value: callback => setTimeout(() => callback(jest.now()), 0), + value(callback: number => void): TimeoutID { + return setTimeout(() => callback(jest.now()), 0); + }, writable: true, }, window: { @@ -66,6 +70,59 @@ Object.defineProperties(global, { }, }); +<<<<<<< Upstream +// $FlowFixMe[incompatible-call] - `./mocks/AppState` is incomplete. +mock('m#../Libraries/AppState/AppState', 'm#./mocks/AppState'); +mock('m#../Libraries/BatchedBridge/NativeModules', 'm#./mocks/NativeModules'); +mock( + 'm#../Libraries/Components/AccessibilityInfo/AccessibilityInfo', + 'm#./mocks/AccessibilityInfo', +); +mock( + 'm#../Libraries/Components/ActivityIndicator/ActivityIndicator', + 'm#./mocks/ActivityIndicator', +); +mock('m#../Libraries/Components/Clipboard/Clipboard', 'm#./mocks/Clipboard'); +mock( + 'm#../Libraries/Components/RefreshControl/RefreshControl', + // $FlowFixMe[incompatible-call] - `../Libraries/Components/RefreshControl/RefreshControl` should export a component type. + 'm#./mocks/RefreshControl', +); +// $FlowFixMe[incompatible-exact] - `../Libraries/Components/ScrollView/ScrollView` is... I don't even. +// $FlowFixMe[prop-missing] +mock('m#../Libraries/Components/ScrollView/ScrollView', 'm#./mocks/ScrollView'); +mock('m#../Libraries/Components/TextInput/TextInput', 'm#./mocks/TextInput'); +mock('m#../Libraries/Components/View/View', 'm#./mocks/View'); +mock( + 'm#../Libraries/Components/View/ViewNativeComponent', + // $FlowFixMe[incompatible-call] - `./mocks/ViewNativeComponent` is incomplete. + // $FlowFixMe[prop-missing] + 'm#./mocks/ViewNativeComponent', +); +mock('m#../Libraries/Core/InitializeCore', 'm#./mocks/InitializeCore'); +mock('m#../Libraries/Core/NativeExceptionsManager'); +mock('m#../Libraries/Image/Image', 'm#./mocks/Image'); +// $FlowFixMe[incompatible-call] - `./mocks/Linking` is incomplete. +mock('m#../Libraries/Linking/Linking', 'm#./mocks/Linking'); +// $FlowFixMe[incompatible-call] - `../Libraries/Modal/Modal` should export a component type. +mock('m#../Libraries/Modal/Modal', 'm#./mocks/Modal'); +mock( + 'm#../Libraries/NativeComponent/NativeComponentRegistry', + // $FlowFixMe[prop-missing] - `./mocks/NativeComponentRegistry` should export named functions. + 'm#./mocks/NativeComponentRegistry', +); +// $FlowFixMe[prop-missing] - `./mocks/RendererProxy` is incomplete. +mock('m#../Libraries/ReactNative/RendererProxy', 'm#./mocks/RendererProxy'); +mock( + 'm#../Libraries/ReactNative/requireNativeComponent', + 'm#./mocks/requireNativeComponent', +); +// $FlowFixMe[prop-missing] - `./mocks/UIManager` is incomplete. +mock('m#../Libraries/ReactNative/UIManager', 'm#./mocks/UIManager'); +mock('m#../Libraries/Text/Text', 'm#./mocks/Text'); +mock('m#../Libraries/Utilities/useColorScheme', 'm#./mocks/useColorScheme'); +mock('m#../Libraries/Vibration/Vibration', 'm#./mocks/Vibration'); +======= jest .mock('../Libraries/Core/InitializeCore', () => {}) .mock('../Libraries/Core/NativeExceptionsManager') @@ -507,3 +564,4 @@ jest __esModule: true, default: jest.fn().mockReturnValue('light'), })); +>>>>>>> Override diff --git a/vnext/src-win/src/private/featureflags/ReactNativeFeatureFlagsBase.js b/vnext/src-win/src/private/featureflags/ReactNativeFeatureFlagsBase.js index fa942d44b74..ec4dbc8ddad 100644 --- a/vnext/src-win/src/private/featureflags/ReactNativeFeatureFlagsBase.js +++ b/vnext/src-win/src/private/featureflags/ReactNativeFeatureFlagsBase.js @@ -104,6 +104,8 @@ const isFabric = global.nativeFabricUIManager; // [Windows] function maybeLogUnavailableNativeModuleError(configName: string): void { if ( !NativeReactNativeFeatureFlags && + // Don't log in tests. + process.env.NODE_ENV !== 'test' && // Don't log more than once per config !reportedConfigNames.has(configName) && // Don't log in the legacy architecture. diff --git a/vnext/src-win/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js b/vnext/src-win/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js index 84ffa298de1..62be48ed13d 100644 --- a/vnext/src-win/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +++ b/vnext/src-win/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes'; diff --git a/yarn.lock b/yarn.lock index a7e2993c1ca..4111e91332a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2085,6 +2085,11 @@ resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.81.0-nightly-20250521-3cb70bb6a.tgz#8971fbeafa73e9b33eaf5d1d0327de111668d633" integrity sha512-S55a8mtkjMcM1Enm2m0Kaf4fCjK2EkLm2lDbygDnsG1L9Y6Kl4QdHuLQRHeKPsUGhSZN8/mnFzMhD1ga2tMnaQ== +"@react-native/assets-registry@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.81.0-nightly-20250604-1a6d466f1.tgz#eb576c8f2a1637bad4f6b8c38771454d18ebd80f" + integrity sha512-KZkOcNf7GwHcK9JFrOV4wv03W1KOcIa0mKmiyDkkujsHjutFEWrgc/Nt6E5jjmaNTxu5chZX0wiv2+MqDpLMzA== + "@react-native/assets@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e" @@ -2230,6 +2235,17 @@ nullthrows "^1.1.1" yargs "^17.6.2" +"@react-native/codegen@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.81.0-nightly-20250604-1a6d466f1.tgz#e8e01d2168db300ba8b30f07c807b4bbeb6f4215" + integrity sha512-GuQmkseQRmdpLe5Bsh48+f9AE4jTshD6Ns2DHSfEb1Gar3lnFr05dgcq0c2daNZzhF3S5SfPXd96XFgF3zahCQ== + dependencies: + glob "^7.1.1" + hermes-parser "0.28.1" + invariant "^2.2.4" + nullthrows "^1.1.1" + yargs "^17.6.2" + "@react-native/community-cli-plugin@0.81.0-nightly-20250521-3cb70bb6a": version "0.81.0-nightly-20250521-3cb70bb6a" resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.81.0-nightly-20250521-3cb70bb6a.tgz#a72444870bc852079c1edbb02e0390fa9b56c297" @@ -2244,11 +2260,30 @@ metro-core "^0.82.3" semver "^7.1.3" +"@react-native/community-cli-plugin@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.81.0-nightly-20250604-1a6d466f1.tgz#509cc3e1a55f41db76073279a2a155cf98e33eb1" + integrity sha512-nOGKEQLTBJwIRbokKItKhi8vgp75a/2yhZEK3PebdiKp8Ye+PRRrJ5nT4m6j/Ig4Mnm+V20zQi0hNCyY/IO6Lw== + dependencies: + "@react-native/dev-middleware" "0.81.0-nightly-20250604-1a6d466f1" + chalk "^4.0.0" + debug "^4.4.0" + invariant "^2.2.4" + metro "^0.82.4" + metro-config "^0.82.4" + metro-core "^0.82.4" + semver "^7.1.3" + "@react-native/debugger-frontend@0.81.0-nightly-20250521-3cb70bb6a": version "0.81.0-nightly-20250521-3cb70bb6a" resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.81.0-nightly-20250521-3cb70bb6a.tgz#533a8ce39cef45206a2fae984273fb66211d2611" integrity sha512-yhq8Nd3bDOmATJRmef/hGjt6AdZGeBlMY5QwCBDisxLdHig8hCqLb04HGXq90K6cU0mEW1nksrCDkShkCQLRDw== +"@react-native/debugger-frontend@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.81.0-nightly-20250604-1a6d466f1.tgz#63afd6cf2c097639682e027e81d9c150a1a59f00" + integrity sha512-T6Hgpz5UGjRjtsDP4axDvKA8U4aipEQ8JJ6Z5RLs0vbcSmz8TGduJoPZvMQXbnKOcHgvDAagMzakpxZ6kaJcUA== + "@react-native/dev-middleware@0.81.0-nightly-20250521-3cb70bb6a": version "0.81.0-nightly-20250521-3cb70bb6a" resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.81.0-nightly-20250521-3cb70bb6a.tgz#ee68568403743dd3316a242ac131028ea933357e" @@ -2266,6 +2301,23 @@ serve-static "^1.16.2" ws "^6.2.3" +"@react-native/dev-middleware@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.81.0-nightly-20250604-1a6d466f1.tgz#23a80da1d77ec4d9727d8f474580b4b9fe1d4214" + integrity sha512-MmtNJLvuaIfQuc0ev5R/J0602TnjyADv++Hn+OK57I8x/dOzzL+SJEPTaBM3OyPJfaNiPXIfIXTOeERhPrSSnA== + dependencies: + "@isaacs/ttlcache" "^1.4.1" + "@react-native/debugger-frontend" "0.81.0-nightly-20250604-1a6d466f1" + 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 "^6.2.3" + "@react-native/eslint-config@0.79.0-nightly-20250123-d1028885e": version "0.79.0-nightly-20250123-d1028885e" resolved "https://registry.yarnpkg.com/@react-native/eslint-config/-/eslint-config-0.79.0-nightly-20250123-d1028885e.tgz#a4c538e720e9474a7cabdca8d93a266006f53de0" @@ -2294,6 +2346,11 @@ resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.81.0-nightly-20250521-3cb70bb6a.tgz#3dee65c7bf4a11ab028d4c713becd073e877c860" integrity sha512-XtGjMSElb+wiyc9jrCTvpL6sBIuKtjJffBhQMhwHy8zZ6at8phqmhYxGvAFaI67SVNg2xsiDmRAAzBZ6tEpgrw== +"@react-native/gradle-plugin@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.81.0-nightly-20250604-1a6d466f1.tgz#2a19b7752f65010b454e489031084d87abfe2a89" + integrity sha512-6W0tDfhhwOmkq9lTJqQg635gva0zzVOg8OOtCQmfbwoAg3ZXddmriR0o/a1/OZEekbzw3NDOhAWgj1DcOqH2mw== + "@react-native/js-polyfills@0.80.0-nightly-20250506-3ac16dd6a": version "0.80.0-nightly-20250506-3ac16dd6a" resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.80.0-nightly-20250506-3ac16dd6a.tgz#f2c36c596e817f66ad6ff0084f5e0261876252f5" @@ -2304,6 +2361,11 @@ resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.81.0-nightly-20250521-3cb70bb6a.tgz#9123d93b6fc6d8ddfb115aa45fd2b0009719cb69" integrity sha512-eYrIDIAHd8bARZ0dkzRh+8hNUHkURDIk0JCM6EmeTjAPRLrf1QAfiswijd+SBsZEEOvq1f7bUare6rx7CEoevQ== +"@react-native/js-polyfills@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.81.0-nightly-20250604-1a6d466f1.tgz#b8930dc9d6845437bb403cc71b247ae907295f58" + integrity sha512-JAbAgdp2O1N3LhjSefTGxaZ42tVS2jx72i8033uZ8JunY21JEVIWOuI4qaHxHTpOkEdYuwj73Ywb9ArEWSCWDQ== + "@react-native/metro-babel-transformer@0.80.0-nightly-20250506-3ac16dd6a": version "0.80.0-nightly-20250506-3ac16dd6a" resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.80.0-nightly-20250506-3ac16dd6a.tgz#b15eceae51b4e381d7ef81dec90374eeaae8e682" @@ -2354,6 +2416,11 @@ resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.81.0-nightly-20250521-3cb70bb6a.tgz#da5a834b4129ab23ee9e3492964a9fc32c956aa4" integrity sha512-iYbavmbai0pzifH6doQubzRMX5D8WelwrMPd+7VqUcS3E3j1aWhsGImkhhoJJPBYDK6Z9jdYGKibCe/OXcWOHw== +"@react-native/normalize-colors@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.81.0-nightly-20250604-1a6d466f1.tgz#746f47089bd361268ff69ac767ca2325bc3fad04" + integrity sha512-6N770TWeajmWFgAINzEH7jvk79mQJQJ8MIJUg2sTUrBCWKHdJUTzdHpOtScQJDvbHL3uPOZtzfMhSSykK5KI2g== + "@react-native/popup-menu-android@0.81.0-nightly-20250521-3cb70bb6a": version "0.81.0-nightly-20250521-3cb70bb6a" resolved "https://registry.npmjs.org/@react-native/popup-menu-android/-/popup-menu-android-0.81.0-nightly-20250521-3cb70bb6a.tgz#24383208731207871615cb115d6b5eed1e45f663" @@ -2369,6 +2436,14 @@ invariant "^2.2.4" nullthrows "^1.1.1" +"@react-native/virtualized-lists@0.81.0-nightly-20250604-1a6d466f1": + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.81.0-nightly-20250604-1a6d466f1.tgz#586f8cd510aa86d125f44c6a0815f905d6dd959a" + integrity sha512-wB1jd0haB18mQxoe0PclwzA5q58DE1faBoKBiY6k4GP1A5ee7gcluc8R8k4mgTYHB2x7hSq2Eqh9JYHPZEIGSA== + 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" @@ -8636,7 +8711,7 @@ metro-cache@0.82.5: https-proxy-agent "^7.0.5" metro-core "0.82.5" -metro-config@0.82.5, metro-config@^0.82.2, metro-config@^0.82.3: +metro-config@0.82.5, metro-config@^0.82.2, metro-config@^0.82.3, metro-config@^0.82.4: version "0.82.5" resolved "https://registry.yarnpkg.com/metro-config/-/metro-config-0.82.5.tgz#07366f32c3fe6203d630af7df4781900816c7c85" integrity sha512-/r83VqE55l0WsBf8IhNmc/3z71y2zIPe5kRSuqA5tY/SL/ULzlHUJEMd1szztd0G45JozLwjvrhAzhDPJ/Qo/g== @@ -8650,7 +8725,7 @@ metro-config@0.82.5, metro-config@^0.82.2, metro-config@^0.82.3: metro-core "0.82.5" metro-runtime "0.82.5" -metro-core@0.82.5, metro-core@^0.82.3: +metro-core@0.82.5, metro-core@^0.82.3, metro-core@^0.82.4: version "0.82.5" resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.82.5.tgz#fda1b2f7365e3a09055dd72ba1681f8fc1f6f492" integrity sha512-OJL18VbSw2RgtBm1f2P3J5kb892LCVJqMvslXxuxjAPex8OH7Eb8RBfgEo7VZSjgb/LOf4jhC4UFk5l5tAOHHA== @@ -8696,7 +8771,7 @@ metro-resolver@0.82.5: dependencies: flow-enums-runtime "^0.0.6" -metro-runtime@0.82.5, metro-runtime@^0.82.2, metro-runtime@^0.82.3: +metro-runtime@0.82.5, metro-runtime@^0.82.2, metro-runtime@^0.82.3, metro-runtime@^0.82.4: version "0.82.5" resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.82.5.tgz#97840760e4cee49f08948dd918dbeba08dd0d0ec" integrity sha512-rQZDoCUf7k4Broyw3Ixxlq5ieIPiR1ULONdpcYpbJQ6yQ5GGEyYjtkztGD+OhHlw81LCR2SUAoPvtTus2WDK5g== @@ -8704,7 +8779,7 @@ metro-runtime@0.82.5, metro-runtime@^0.82.2, metro-runtime@^0.82.3: "@babel/runtime" "^7.25.0" flow-enums-runtime "^0.0.6" -metro-source-map@0.82.5, metro-source-map@^0.82.2, metro-source-map@^0.82.3: +metro-source-map@0.82.5, metro-source-map@^0.82.2, metro-source-map@^0.82.4: version "0.82.5" resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.82.5.tgz#85e2e9672bff6d6cefb3b65b96fcc69f929c69c6" integrity sha512-wH+awTOQJVkbhn2SKyaw+0cd+RVSCZ3sHVgyqJFQXIee/yLs3dZqKjjeKKhhVeudgjXo7aE/vSu/zVfcQEcUfw== @@ -8763,7 +8838,7 @@ metro-transform-worker@0.82.5: metro-transform-plugins "0.82.5" nullthrows "^1.1.1" -metro@0.82.5, metro@^0.82.3: +metro@0.82.5, metro@^0.82.3, metro@^0.82.4: version "0.82.5" resolved "https://registry.yarnpkg.com/metro/-/metro-0.82.5.tgz#a27fbc08dd283a14ae58496288c10adaae65f461" integrity sha512-8oAXxL7do8QckID/WZEKaIFuQJFUTLzfVcC48ghkHhNK2RGuQq8Xvf4AVd+TUA0SZtX0q8TGNXZ/eba1ckeGCg== @@ -10267,19 +10342,19 @@ react-native-xaml@^0.0.80: dependencies: "@types/react" "^19.0.0" -react-native@0.81.0-nightly-20250521-3cb70bb6a: - version "0.81.0-nightly-20250521-3cb70bb6a" - resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.81.0-nightly-20250521-3cb70bb6a.tgz#b02193af30af1d3baad7b988d69393bf494d4d26" - integrity sha512-KQwpPFobwJ3OwnFYyyxJhSoH0VTPvMYw0+HpWcsVbRKKilM/l5aFJ3tY0OqNWce8fk5kVxFgZe3a9HUPQciPsg== +react-native@0.81.0-nightly-20250604-1a6d466f1: + version "0.81.0-nightly-20250604-1a6d466f1" + resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.81.0-nightly-20250604-1a6d466f1.tgz#d3c081d96e92c0d97c5765ef2efa21d9103b03f0" + integrity sha512-TcLN/j+4dYIRvGNl4iFPVcgpiPGH5D25oxV+4iFCzO0MH2BS1ItDLa7yulASNqjm2fUQtFle8WBzHMzqZ1knBg== dependencies: "@jest/create-cache-key-function" "^29.7.0" - "@react-native/assets-registry" "0.81.0-nightly-20250521-3cb70bb6a" - "@react-native/codegen" "0.81.0-nightly-20250521-3cb70bb6a" - "@react-native/community-cli-plugin" "0.81.0-nightly-20250521-3cb70bb6a" - "@react-native/gradle-plugin" "0.81.0-nightly-20250521-3cb70bb6a" - "@react-native/js-polyfills" "0.81.0-nightly-20250521-3cb70bb6a" - "@react-native/normalize-colors" "0.81.0-nightly-20250521-3cb70bb6a" - "@react-native/virtualized-lists" "0.81.0-nightly-20250521-3cb70bb6a" + "@react-native/assets-registry" "0.81.0-nightly-20250604-1a6d466f1" + "@react-native/codegen" "0.81.0-nightly-20250604-1a6d466f1" + "@react-native/community-cli-plugin" "0.81.0-nightly-20250604-1a6d466f1" + "@react-native/gradle-plugin" "0.81.0-nightly-20250604-1a6d466f1" + "@react-native/js-polyfills" "0.81.0-nightly-20250604-1a6d466f1" + "@react-native/normalize-colors" "0.81.0-nightly-20250604-1a6d466f1" + "@react-native/virtualized-lists" "0.81.0-nightly-20250604-1a6d466f1" abort-controller "^3.0.0" anser "^1.4.9" ansi-regex "^5.0.0" @@ -10293,8 +10368,8 @@ react-native@0.81.0-nightly-20250521-3cb70bb6a: invariant "^2.2.4" jest-environment-node "^29.7.0" memoize-one "^5.0.0" - metro-runtime "^0.82.3" - metro-source-map "^0.82.3" + metro-runtime "^0.82.4" + metro-source-map "^0.82.4" nullthrows "^1.1.1" pretty-format "^29.7.0" promise "^8.3.0" From ff4f7ea3b794f922ddd1364a9080c98474b718f2 Mon Sep 17 00:00:00 2001 From: Harini Malothu Date: Tue, 23 Sep 2025 15:53:28 +0530 Subject: [PATCH 02/34] Update tester files --- .../react-native-win32/.flowconfig | 6 - .../react-native-win32/overrides.json | 4 +- .../ProgressBarAndroid/ProgressBarAndroid.js | 4 - .../Components/View/ViewPropTypes.d.ts | 16 +- .../react-native-win32/src-win/index.win32.js | 5 - .../js/examples/Image/ImageExample.windows.js | 39 +--- .../js/examples/Text/TextExample.windows.js | 45 ----- .../Text/TextSharedExamples.windows.js | 20 +- .../js/examples/View/ViewExample.windows.js | 3 - .../src/js/utils/RNTesterList.windows.js | 6 - packages/@react-native/monorepo/package.json | 6 - .../tester/js/components/ListExampleShared.js | 2 +- .../js/components/RNTConfigurationBlock.js | 2 +- .../tester/js/components/RNTOption.js | 2 +- .../tester/js/components/RNTPressableRow.js | 2 +- .../tester/js/components/RNTTitleBar.js | 2 +- .../tester/js/components/RNTesterBlock.js | 2 +- .../tester/js/components/RNTesterButton.js | 2 +- .../js/components/RNTesterComponentTitle.js | 2 +- .../js/components/RNTesterDocumentationURL.js | 2 +- .../js/components/RNTesterExampleFilter.js | 2 +- .../js/components/RNTesterListFilters.js | 2 +- .../js/components/RNTesterModuleList.js | 2 +- .../tester/js/components/RNTesterNavbar.js | 2 +- .../tester/js/components/RNTesterPage.js | 2 +- .../js/components/RNTesterSettingSwitchRow.js | 2 +- .../tester/js/components/RNTesterTitle.js | 2 +- .../tester/js/components/TextInlineView.js | 2 +- .../tester/js/components/TextLegend.js | 10 +- .../tester/js/components/UseCase.js | 2 +- .../tester/js/components/createExamplePage.js | 2 +- .../AccessibilityAndroidExample.js | 4 +- .../Accessibility/AccessibilityExample.js | 2 +- .../Accessibility/AccessibilityIOSExample.js | 2 +- .../ActionSheetIOS/ActionSheetIOSExample.js | 2 +- .../ActivityIndicatorExample.js | 2 +- .../tester/js/examples/Alert/AlertExample.js | 8 +- .../Animated/RotatingImagesExample.js | 2 +- .../examples/AnimatedGratuitousApp/AnExApp.js | 2 +- .../AnimatedGratuitousApp/AnExBobble.js | 2 +- .../AnimatedGratuitousApp/AnExChained.js | 2 +- .../AnimatedGratuitousApp/AnExScroll.js | 2 +- .../examples/AnimatedGratuitousApp/AnExSet.js | 2 +- .../AnimatedGratuitousApp/AnExTilt.js | 2 +- .../js/examples/AppState/AppStateExample.js | 2 +- .../examples/Appearance/AppearanceExample.js | 2 +- .../js/examples/Border/BorderExample.js | 2 +- .../js/examples/Button/ButtonExample.js | 2 +- .../ContentURLAndroid/ContentURLAndroid.js | 2 +- .../tester/js/examples/Crash/CrashExample.js | 2 +- .../DevSettings/DevSettingsExample.js | 2 +- .../examples/Dimensions/DimensionsExample.js | 2 +- .../DisplayContents/DisplayContentsExample.js | 2 +- .../DrawerLayoutAndroidExample.js | 4 +- .../CompatibilityAnimatedPointerMove.js | 2 +- .../CompatibilityNativeGestureHandling.js | 2 +- .../ManyPointersPropertiesExample.js | 2 +- .../PlatformTest/RNTesterPlatformTest.js | 2 +- .../RNTesterPlatformTestEventRecorder.js | 2 +- .../RNTesterPlatformTestInstructions.js | 2 +- ...RNTesterPlatformTestMinimizedResultView.js | 2 +- .../RNTesterPlatformTestResultView.js | 2 +- .../RNTesterPlatformTestResultsText.js | 2 +- .../PlatformTest/RNTesterPlatformTestTypes.js | 2 +- .../PlatformTest/usePlatformTestHarness.js | 2 +- .../PointerEventAccessibility.js | 6 +- ...PointerEventAttributesHoverablePointers.js | 2 +- .../PointerEventAttributesNoHoverPointers.js | 2 +- .../PointerEventCaptureMouse.js | 2 +- .../PointerEventClickTouch.js | 2 +- .../PointerEventClickTouchHierarchy.js | 6 +- ...erEventClickTouchHierarchyPointerEvents.js | 10 +- ...rEventLayoutChangeShouldFirePointerOver.js | 2 +- .../PointerEventPointerCancelTouch.js | 2 +- .../PointerEventPointerMove.js | 2 +- .../PointerEventPointerMoveAcross.js | 2 +- .../PointerEventPointerMoveBetween.js | 2 +- .../PointerEventPointerMoveEventOrder.js | 2 +- ...terEventPointerMoveOnChordedMouseButton.js | 2 +- .../PointerEventPointerOverOut.js | 2 +- .../PointerEventPrimaryTouchPointer.js | 2 +- .../PointerEventSupport.js | 2 +- .../W3CPointerEventsEventfulView.js | 2 +- .../Experimental/W3CPointerEventsExample.js | 2 +- .../js/examples/Filter/FilterExample.js | 2 +- .../FlatList-BaseOnViewableItemsChanged.js | 2 +- .../js/examples/FlatList/FlatList-basic.js | 5 +- .../FlatList/FlatList-contentInset.js | 2 +- .../examples/FlatList/FlatList-multiColumn.js | 58 +++--- .../js/examples/FlatList/FlatList-nested.js | 2 +- .../FlatList/FlatList-onEndReached.js | 2 +- .../FlatList/FlatList-onStartReached.js | 2 +- ...Changed-horizontal-noWaitForInteraction.js | 2 +- ...ewableItemsChanged-horizontal-offScreen.js | 2 +- ...msChanged-horizontal-waitForInteraction.js | 2 +- ...ewableItemsChanged-noWaitForInteraction.js | 2 +- ...atList-onViewableItemsChanged-offScreen.js | 2 +- ...ViewableItemsChanged-waitForInteraction.js | 2 +- .../FlatList-onViewableItemsChanged.js | 2 +- .../FlatList/FlatList-withSeparators.js | 2 +- .../examples/Image/ImageCapInsetsExample.js | 2 +- .../tester/js/examples/Image/ImageExample.js | 41 +--- .../InputAccessoryViewExample.js | 105 +++++----- .../InvalidProps/InvalidPropsExample.js | 2 +- .../JSResponderHandlerExample.js | 2 +- .../js/examples/Keyboard/KeyboardExample.js | 2 +- .../KeyboardAvoidingViewExample.js | 4 +- .../examples/Layout/LayoutAnimationExample.js | 2 +- .../js/examples/Layout/LayoutEventsExample.js | 2 +- .../js/examples/Layout/LayoutExample.js | 4 +- .../LinearGradient/LinearGradientExample.js | 2 +- .../MixBlendMode/MixBlendModeExample.js | 2 +- .../js/examples/Modal/ModalPresentation.js | 6 +- .../NativeAnimationsExample.js | 2 +- .../NewAppScreen/NewAppScreenExample.js | 2 +- .../NewArchitecture/NewArchitectureExample.js | 2 +- .../OSSLibraryExample/OSSLibraryExample.js | 2 +- .../OrientationChangeExample.js | 2 +- .../PanResponder/PanResponderExample.js | 2 +- .../PerformanceComparisonExample.js | 2 +- .../PermissionsAndroid/PermissionsExample.js | 2 +- .../examples/PixelRatio/PixelRatioExample.js | 2 +- .../PlatformColor/PlatformColorExample.js | 2 +- .../examples/Playground/PlaygroundExample.js | 2 +- .../PointerEvents/PointerEventsExample.js | 2 +- .../PopupMenuAndroidExample.js | 2 +- .../js/examples/Pressable/PressableExample.js | 12 +- .../RCTRootView/RCTRootViewIOSExample.js | 2 +- .../tester/js/examples/RTL/RTLExample.js | 18 ++ .../RootViewSizeFlexibilityExampleApp.js | 2 +- .../ScrollView/ScrollViewAnimatedExample.js | 2 +- .../examples/ScrollView/ScrollViewExample.js | 14 ++ .../ScrollView/ScrollViewSimpleExample.js | 2 +- .../SectionList-BaseOnViewableItemsChanged.js | 2 +- .../SectionList/SectionList-contentInset.js | 2 +- .../SectionList/SectionList-inverted.js | 2 +- .../SectionList/SectionList-onEndReached.js | 2 +- ...Changed-horizontal-noWaitForInteraction.js | 2 +- ...rizontal-offScreen-noWaitForInteraction.js | 2 +- ...msChanged-horizontal-waitForInteraction.js | 2 +- ...ewableItemsChanged-noWaitForInteraction.js | 2 +- ...sChanged-offScreen-noWaitForInteraction.js | 2 +- ...ViewableItemsChanged-waitForInteraction.js | 2 +- .../SectionList-onViewableItemsChanged.js | 2 +- .../SectionList/SectionList-scrollable.js | 5 +- .../SectionList-stickyHeadersEnabled.js | 2 +- .../SectionList/SectionList-withSeparators.js | 2 +- .../examples/SectionList/SectionListIndex.js | 2 +- .../SetPropertiesExampleApp.js | 4 +- .../tester/js/examples/Share/ShareExample.js | 2 +- .../examples/Snapshot/SnapshotViewIOS.ios.js | 2 +- .../js/examples/StatusBar/StatusBarExample.js | 2 +- .../js/examples/Switch/SwitchExample.js | 2 +- .../Text/TextAdjustsDynamicLayoutExample.js | 21 +- .../js/examples/Text/TextExample.android.js | 31 ++- .../js/examples/Text/TextExample.ios.js | 63 +++--- .../js/examples/Text/TextExample.js.flow | 2 +- .../js/examples/Text/TextSharedExamples.js | 49 ++++- .../tester/js/examples/Timer/TimerExample.js | 2 +- .../ToastAndroid/ToastAndroidExample.js | 2 +- .../js/examples/Touchable/TouchableExample.js | 2 +- .../js/examples/Transform/TransformExample.js | 2 +- .../TransparentHitTestExample.js | 2 +- .../TurboModule/LegacyModuleExample.js | 2 +- .../NativeCxxModuleExampleExample.js | 2 +- .../TurboModule/SampleLegacyModuleExample.js | 2 +- .../TurboModule/SampleTurboModuleExample.js | 2 +- .../TurboModule/TurboCxxModuleExample.js | 2 +- .../TurboModule/TurboModuleExample.js | 2 +- .../TurboModule/TurboModuleExampleCommon.js | 2 +- .../js/examples/Vibration/VibrationExample.js | 2 +- .../tester/js/examples/View/ViewExample.js | 76 ++++++- .../tester/js/examples/XHR/XHRExample.js | 2 +- .../examples/XHR/XHRExampleAbortController.js | 2 +- .../js/examples/XHR/XHRExampleBinaryUpload.js | 2 +- .../js/examples/XHR/XHRExampleDownload.js | 2 +- .../tester/js/examples/XHR/XHRExampleFetch.js | 2 +- .../js/examples/XHR/XHRExampleOnTimeOut.js | 2 +- .../tester/js/types/RNTesterTypes.js | 2 +- vnext/.flowconfig | 6 - .../react/nativemodule/dom/NativeDOM.cpp | 5 - .../sliceChildShadowNodeViewPairs.cpp | 191 ------------------ .../AccessibilityManagerTest.js | 2 +- .../IntegrationTests/AppEventsTest.js | 2 +- .../GlobalEvalWithSourceUrlTest.js | 2 +- .../IntegrationTests/ImageCachePolicyTest.js | 4 +- .../IntegrationTests/ImageSnapshotTest.js | 2 +- .../IntegrationTestHarnessTest.js | 2 +- .../IntegrationTests/IntegrationTestsApp.js | 2 +- .../IntegrationTests/LayoutEventsTest.js | 2 +- .../IntegrationTests/PromiseTest.js | 2 +- .../IntegrationTests/SimpleSnapshotTest.js | 2 +- .../IntegrationTests/SyncMethodTest.js | 2 +- .../IntegrationTests/TimersTest.js | 2 +- .../IntegrationTests/WebSocketTest.js | 2 +- .../src-win/Libraries/Alert/Alert.windows.js | 5 - .../Components/TextInput/TextInput.windows.js | 3 - .../TouchableWithoutFeedback.windows.js | 6 +- .../Components/View/ViewPropTypes.d.ts | 6 - vnext/src-win/index.windows.js | 5 - vnext/src-win/jest/setup.js | 54 ----- 201 files changed, 546 insertions(+), 769 deletions(-) diff --git a/packages/@office-iss/react-native-win32/.flowconfig b/packages/@office-iss/react-native-win32/.flowconfig index 028621552db..eaf4edd492a 100644 --- a/packages/@office-iss/react-native-win32/.flowconfig +++ b/packages/@office-iss/react-native-win32/.flowconfig @@ -109,17 +109,11 @@ ../../../node_modules/ [libs] -<<<<<<< Upstream -flow-typed/ -packages/react-native/interface.js -packages/react-native/flow/ -======= interface.js flow/ ../../../node_modules/.flow/flow-typed/ ../../../node_modules/react-native/src/types src/types/ ->>>>>>> Override [options] enums=true diff --git a/packages/@office-iss/react-native-win32/overrides.json b/packages/@office-iss/react-native-win32/overrides.json index d6b0313b167..3bc33752a66 100644 --- a/packages/@office-iss/react-native-win32/overrides.json +++ b/packages/@office-iss/react-native-win32/overrides.json @@ -89,7 +89,7 @@ "issue": 6240 }, { - "type": "patch", + "type": "copy", "file": "src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", "baseFile": "packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", "baseHash": "85efdbe556a087175fb9328f8d6e8d1f2cf29447" @@ -398,7 +398,7 @@ "issue": 0 }, { - "type": "derived", + "type": "copy", "file": "src-win/Libraries/Settings/Settings.win32.js", "baseFile": "packages/react-native/Libraries/Settings/Settings.js", "baseHash": "e1d244ee581a1456d00af638fb9331d90c48c91e" diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js index ffee73d3a5b..7d51999f5e6 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js @@ -4,11 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * -<<<<<<< Upstream * @flow strict-local -======= - * @flow ->>>>>>> Override * @format */ diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts index 4a82526342e..d4a342e0f81 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/View/ViewPropTypes.d.ts @@ -8,7 +8,6 @@ */ import type * as React from 'react'; -<<<<<<< Upstream import {Insets} from '../../../types/public/Insets'; import {GestureResponderHandlers} from '../../../types/public/ReactNativeRenderer'; import {StyleProp} from '../../StyleSheet/StyleSheet'; @@ -18,21 +17,10 @@ import { FocusEvent, LayoutChangeEvent, PointerEvents, -} from '../../Types/CoreEventTypes'; -import {Touchable} from '../Touchable/Touchable'; -======= -import {Insets} from 'react-native/types/public/Insets'; -import {GestureResponderHandlers} from 'react-native/types/public/ReactNativeRenderer'; -import {StyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; -import {ViewStyle} from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; -import { - LayoutChangeEvent, MouseEvent, // Win32 NativeSyntheticEvent, // Win32 - PointerEvents, -} from 'react-native/Libraries/Types/CoreEventTypes'; -import {Touchable} from 'react-native/Libraries/Components/Touchable/Touchable'; ->>>>>>> Override +} from '../../Types/CoreEventTypes'; +import {Touchable} from '../Touchable/Touchable'; import {AccessibilityProps} from './ViewAccessibility'; export interface TVViewPropsIOS { diff --git a/packages/@office-iss/react-native-win32/src-win/index.win32.js b/packages/@office-iss/react-native-win32/src-win/index.win32.js index c03a0050686..1f163bf9ec5 100644 --- a/packages/@office-iss/react-native-win32/src-win/index.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/index.win32.js @@ -4,13 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * -<<<<<<< Upstream * @flow strict-local * @format -======= - * @format - * @flow ->>>>>>> Override */ // flowlint unsafe-getters-setters:off diff --git a/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js index c639f7bb00a..6a19c261d76 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Image/ImageExample.windows.js @@ -631,9 +631,6 @@ const VectorDrawableExample = () => { ); }; -<<<<<<< Upstream -function CacheControlExample(): React.Node { -======= const AccessibilityActions = () => { const [accessibilityLabel, setAccessibilityLabel] = React.useState('Initial Label'); @@ -735,8 +732,7 @@ const ImageFunctionsExample = () => { ); }; -function CacheControlAndroidExample(): React.Node { ->>>>>>> Override + function CacheControlExample(): React.Node { const [reload, setReload] = useState(0); const onReload = () => { @@ -1311,39 +1307,6 @@ exports.examples = [ }, { title: 'Cache Policy', -<<<<<<< Upstream -======= - description: - ('First image has never been loaded before and is instructed not to load unless in cache.' + - 'Placeholder image from above will stay. Second image is the same but forced to load regardless of' + - ' local cache state.': string), - render: function (): React.Node { - return ( - - - - - ); - }, - platform: 'ios', - }, - { - title: 'Cache Policy', ->>>>>>> Override description: `- First image will be loaded and cached. - Second image is the same but will be reloaded if re-rendered as the cache policy is set to reload. - Third image will try to load from the cache first and only use the network if the cached version is unavailable. diff --git a/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js index 28794c5c654..52fc58ab7e9 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Text/TextExample.windows.js @@ -1156,19 +1156,12 @@ function TextBaseLineLayoutExample(props: {}): React.Node { {texts} {marker} -<<<<<<< Upstream {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */} {'Interleaving and :'} -======= - - ) : ( - - {'Nested s:'} ->>>>>>> Override {marker} {texts} @@ -1185,20 +1178,6 @@ function TextBaseLineLayoutExample(props: {}): React.Node { {texts} {marker} -<<<<<<< Upstream - - {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See - * https://fburl.com/workplace/6291gfvu */} - - {'Multi-line alignment'} - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. -======= {'Interleaving and :'} @@ -1217,7 +1196,6 @@ function TextBaseLineLayoutExample(props: {}): React.Node { Text inside View. {marker} ->>>>>>> Override {marker} @@ -1239,28 +1217,6 @@ function TextBaseLineLayoutExample(props: {}): React.Node { -<<<<<<< Upstream - {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See - * https://fburl.com/workplace/6291gfvu */} - {':'} - - {marker} - {texts} - {marker} - - - {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See - * https://fburl.com/workplace/6291gfvu */} - - {':'} - - - {marker} - - {texts} - - {marker} -======= {'Multi-line alignment'} @@ -1297,7 +1253,6 @@ function TextBaseLineLayoutExample(props: {}): React.Node { {marker} ->>>>>>> Override ); diff --git a/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js b/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js index 2d5215b18bc..04d6662f6bb 100644 --- a/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/Text/TextSharedExamples.windows.js @@ -73,7 +73,6 @@ function EmptyTextExample(): React.Node { ); } -<<<<<<< Upstream function TextAndLayoutLinesJSON({ testID, ellipsizeMode, @@ -111,24 +110,12 @@ function NumberOfLinesTextLayoutExample(): React.Node { ); } -export default [ -======= const examples = [ ->>>>>>> Override { title: 'Empty Text', name: 'emptyText', render: EmptyTextExample, }, -<<<<<<< Upstream - { - title: 'TextInlineViewsExample', - name: 'inlineViews', - description: - 'Shows how inline views are rendered when text is subject to alignment.', - expect: 'The red box should align correctly with the rest of the text.', - render: TextInlineViewsExample, - }, { title: 'numberOfLines with onTextLayout', name: 'numberOfLinesLayout', @@ -137,9 +124,7 @@ const examples = [ scrollable: true, render: NumberOfLinesTextLayoutExample, }, -] as $ReadOnlyArray; -======= - // Windows: Only include TextInlineViewsExample in Fabric mode (bridgeless) + // Windows: Only include TextInlineViewsExample in Fabric mode (bridgeless) // Paper mode doesn't support Views nested in Text ...(global.RN$Bridgeless === true ? [ @@ -154,7 +139,6 @@ const examples = [ }, ] : []), -]; +] ; export default examples; ->>>>>>> Override diff --git a/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js index 12cae68fc78..aac71c66546 100644 --- a/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/View/ViewExample.windows.js @@ -1426,13 +1426,11 @@ export default ({ name: 'box-sizing', render: BoxSizingExample, }, -<<<<<<< Upstream { title: 'Focus/Blur', name: 'focus-blur', render: FocusBlurExample, }, -======= // [Windows { title: 'NativeID', @@ -1507,6 +1505,5 @@ export default ({ }, }, // ]TODO(macOS ISS#2323203) // Windows] ->>>>>>> Override ], }: RNTesterModule); 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 065a8ef5737..516f310b8a1 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 @@ -1,15 +1,9 @@ /** -<<<<<<< Upstream * 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. * -======= - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * @format ->>>>>>> Override * @flow * @format */ diff --git a/packages/@react-native/monorepo/package.json b/packages/@react-native/monorepo/package.json index 85b5bf527ed..7fe1987acca 100644 --- a/packages/@react-native/monorepo/package.json +++ b/packages/@react-native/monorepo/package.json @@ -46,14 +46,8 @@ "@babel/preset-env": "^7.25.3", "@babel/preset-flow": "^7.24.7", "@jest/create-cache-key-function": "^29.7.0", -<<<<<<< Upstream - "@microsoft/api-extractor": "^7.52.2", - "@react-native/metro-babel-transformer": "0.80.0-main", - "@react-native/metro-config": "0.80.0-main", -======= "@react-native/metro-babel-transformer": "0.81.0-nightly-20250521-3cb70bb6a", "@react-native/metro-config": "0.81.0-nightly-20250521-3cb70bb6a", ->>>>>>> Override "@tsconfig/node18": "1.0.1", "@types/react": "^19.0.0", "@typescript-eslint/parser": "^7.1.1", diff --git a/packages/@react-native/tester/js/components/ListExampleShared.js b/packages/@react-native/tester/js/components/ListExampleShared.js index 22051f0b983..42bc8694e66 100644 --- a/packages/@react-native/tester/js/components/ListExampleShared.js +++ b/packages/@react-native/tester/js/components/ListExampleShared.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/components/RNTConfigurationBlock.js b/packages/@react-native/tester/js/components/RNTConfigurationBlock.js index e1a9c165690..d78f87abd47 100644 --- a/packages/@react-native/tester/js/components/RNTConfigurationBlock.js +++ b/packages/@react-native/tester/js/components/RNTConfigurationBlock.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/components/RNTOption.js b/packages/@react-native/tester/js/components/RNTOption.js index 6bda6d934b5..ce0da863b35 100644 --- a/packages/@react-native/tester/js/components/RNTOption.js +++ b/packages/@react-native/tester/js/components/RNTOption.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/components/RNTPressableRow.js b/packages/@react-native/tester/js/components/RNTPressableRow.js index 38f6a2afffd..9ae0649389c 100644 --- a/packages/@react-native/tester/js/components/RNTPressableRow.js +++ b/packages/@react-native/tester/js/components/RNTPressableRow.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import RNTesterComponentTitle from './RNTesterComponentTitle'; diff --git a/packages/@react-native/tester/js/components/RNTTitleBar.js b/packages/@react-native/tester/js/components/RNTTitleBar.js index 8f48560e66c..f192f8ed8be 100644 --- a/packages/@react-native/tester/js/components/RNTTitleBar.js +++ b/packages/@react-native/tester/js/components/RNTTitleBar.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import RNTesterDocumentationURL from './RNTesterDocumentationURL'; diff --git a/packages/@react-native/tester/js/components/RNTesterBlock.js b/packages/@react-native/tester/js/components/RNTesterBlock.js index 5deef893caf..98679b192cd 100644 --- a/packages/@react-native/tester/js/components/RNTesterBlock.js +++ b/packages/@react-native/tester/js/components/RNTesterBlock.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import {RNTesterThemeContext} from './RNTesterTheme'; diff --git a/packages/@react-native/tester/js/components/RNTesterButton.js b/packages/@react-native/tester/js/components/RNTesterButton.js index 2ae13b5a8ff..c459bd94c56 100644 --- a/packages/@react-native/tester/js/components/RNTesterButton.js +++ b/packages/@react-native/tester/js/components/RNTesterButton.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/components/RNTesterComponentTitle.js b/packages/@react-native/tester/js/components/RNTesterComponentTitle.js index 38464067ad1..b13e2badfb5 100644 --- a/packages/@react-native/tester/js/components/RNTesterComponentTitle.js +++ b/packages/@react-native/tester/js/components/RNTesterComponentTitle.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import {RNTesterThemeContext} from './RNTesterTheme'; diff --git a/packages/@react-native/tester/js/components/RNTesterDocumentationURL.js b/packages/@react-native/tester/js/components/RNTesterDocumentationURL.js index 07b54df61d7..bbaf1eb2500 100644 --- a/packages/@react-native/tester/js/components/RNTesterDocumentationURL.js +++ b/packages/@react-native/tester/js/components/RNTesterDocumentationURL.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import * as React from 'react'; diff --git a/packages/@react-native/tester/js/components/RNTesterExampleFilter.js b/packages/@react-native/tester/js/components/RNTesterExampleFilter.js index 7f7ac6891fa..b7835692de1 100644 --- a/packages/@react-native/tester/js/components/RNTesterExampleFilter.js +++ b/packages/@react-native/tester/js/components/RNTesterExampleFilter.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {SectionData} from '../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/components/RNTesterListFilters.js b/packages/@react-native/tester/js/components/RNTesterListFilters.js index f1c79729aa1..03d4e5f5131 100644 --- a/packages/@react-native/tester/js/components/RNTesterListFilters.js +++ b/packages/@react-native/tester/js/components/RNTesterListFilters.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/components/RNTesterModuleList.js b/packages/@react-native/tester/js/components/RNTesterModuleList.js index 7d93feb24ec..5a9220e8d6b 100644 --- a/packages/@react-native/tester/js/components/RNTesterModuleList.js +++ b/packages/@react-native/tester/js/components/RNTesterModuleList.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import {RNTesterThemeContext} from './RNTesterTheme'; diff --git a/packages/@react-native/tester/js/components/RNTesterNavbar.js b/packages/@react-native/tester/js/components/RNTesterNavbar.js index 84f5eaa3b74..5e65e1bd8c3 100644 --- a/packages/@react-native/tester/js/components/RNTesterNavbar.js +++ b/packages/@react-native/tester/js/components/RNTesterNavbar.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {ScreenTypes} from '../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/components/RNTesterPage.js b/packages/@react-native/tester/js/components/RNTesterPage.js index 4aad7a19acf..723396f53f5 100644 --- a/packages/@react-native/tester/js/components/RNTesterPage.js +++ b/packages/@react-native/tester/js/components/RNTesterPage.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import {RNTesterThemeContext} from './RNTesterTheme'; diff --git a/packages/@react-native/tester/js/components/RNTesterSettingSwitchRow.js b/packages/@react-native/tester/js/components/RNTesterSettingSwitchRow.js index 9a87aac9f0d..9145ddd2755 100644 --- a/packages/@react-native/tester/js/components/RNTesterSettingSwitchRow.js +++ b/packages/@react-native/tester/js/components/RNTesterSettingSwitchRow.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import RNTesterText from './RNTesterText'; diff --git a/packages/@react-native/tester/js/components/RNTesterTitle.js b/packages/@react-native/tester/js/components/RNTesterTitle.js index d5955fd2b21..88cdcb26788 100644 --- a/packages/@react-native/tester/js/components/RNTesterTitle.js +++ b/packages/@react-native/tester/js/components/RNTesterTitle.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import {RNTesterThemeContext} from './RNTesterTheme'; diff --git a/packages/@react-native/tester/js/components/TextInlineView.js b/packages/@react-native/tester/js/components/TextInlineView.js index c7e884ae225..4164dfad8ca 100644 --- a/packages/@react-native/tester/js/components/TextInlineView.js +++ b/packages/@react-native/tester/js/components/TextInlineView.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/components/TextLegend.js b/packages/@react-native/tester/js/components/TextLegend.js index 3a5c62dc9b4..0feaf9fbfd7 100644 --- a/packages/@react-native/tester/js/components/TextLegend.js +++ b/packages/@react-native/tester/js/components/TextLegend.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import RNTesterText from '../components/RNTesterText'; @@ -204,11 +204,17 @@ export default function TextLegend(): React.Node { onTextLayout={event => { setTextMetrics(event.nativeEvent.lines); }} + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ style={{ fontSize: fontSize, textAlign: alignment, }}> - {PANGRAMS[language]} + { + /* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ + PANGRAMS[language] + } diff --git a/packages/@react-native/tester/js/components/UseCase.js b/packages/@react-native/tester/js/components/UseCase.js index f2d18bf879c..2285b325400 100644 --- a/packages/@react-native/tester/js/components/UseCase.js +++ b/packages/@react-native/tester/js/components/UseCase.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import * as React from 'react'; diff --git a/packages/@react-native/tester/js/components/createExamplePage.js b/packages/@react-native/tester/js/components/createExamplePage.js index 169f3835db8..ff3a4f12d85 100644 --- a/packages/@react-native/tester/js/components/createExamplePage.js +++ b/packages/@react-native/tester/js/components/createExamplePage.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/Accessibility/AccessibilityAndroidExample.js b/packages/@react-native/tester/js/examples/Accessibility/AccessibilityAndroidExample.js index 6b41f435790..df92694a0ea 100644 --- a/packages/@react-native/tester/js/examples/Accessibility/AccessibilityAndroidExample.js +++ b/packages/@react-native/tester/js/examples/Accessibility/AccessibilityAndroidExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; @@ -21,7 +21,7 @@ const importantForAccessibilityValues = [ 'yes', 'no', 'no-hide-descendants', -]; +] as const; type AccessibilityAndroidExampleState = { count: number, diff --git a/packages/@react-native/tester/js/examples/Accessibility/AccessibilityExample.js b/packages/@react-native/tester/js/examples/Accessibility/AccessibilityExample.js index 351abea1e13..560f3d9ef5f 100644 --- a/packages/@react-native/tester/js/examples/Accessibility/AccessibilityExample.js +++ b/packages/@react-native/tester/js/examples/Accessibility/AccessibilityExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/Accessibility/AccessibilityIOSExample.js b/packages/@react-native/tester/js/examples/Accessibility/AccessibilityIOSExample.js index 88b924102e4..9271ad55471 100644 --- a/packages/@react-native/tester/js/examples/Accessibility/AccessibilityIOSExample.js +++ b/packages/@react-native/tester/js/examples/Accessibility/AccessibilityIOSExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js b/packages/@react-native/tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js index ee42a28f7c9..8052c83066f 100644 --- a/packages/@react-native/tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js +++ b/packages/@react-native/tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/ActivityIndicator/ActivityIndicatorExample.js b/packages/@react-native/tester/js/examples/ActivityIndicator/ActivityIndicatorExample.js index 1d9bc24cd9d..793ce3fec6c 100644 --- a/packages/@react-native/tester/js/examples/ActivityIndicator/ActivityIndicatorExample.js +++ b/packages/@react-native/tester/js/examples/ActivityIndicator/ActivityIndicatorExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/examples/Alert/AlertExample.js b/packages/@react-native/tester/js/examples/Alert/AlertExample.js index 027614271aa..3df0a7156ee 100644 --- a/packages/@react-native/tester/js/examples/Alert/AlertExample.js +++ b/packages/@react-native/tester/js/examples/Alert/AlertExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModule} from '../../types/RNTesterTypes'; @@ -261,6 +261,8 @@ const PromptOptions = () => { Alert.prompt('Type a value', null, customButtons)}> prompt with title & custom buttons @@ -306,6 +308,8 @@ const PromptOptions = () => { Alert.prompt( 'Type a value', null, + /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ customButtons, 'login-password', 'admin@site.com', @@ -453,5 +457,7 @@ export default ({ documentationURL: 'https://reactnative.dev/docs/alert', description: 'Alerts display a concise and informative message and prompt the user to make a decision.', + /* $FlowFixMe[incompatible-cast] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ examples, }: RNTesterModule); diff --git a/packages/@react-native/tester/js/examples/Animated/RotatingImagesExample.js b/packages/@react-native/tester/js/examples/Animated/RotatingImagesExample.js index d1a7c24cf03..670ab20dff3 100644 --- a/packages/@react-native/tester/js/examples/Animated/RotatingImagesExample.js +++ b/packages/@react-native/tester/js/examples/Animated/RotatingImagesExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExApp.js b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExApp.js index c8bcda965fd..02def051b95 100644 --- a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExApp.js +++ b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExApp.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExBobble.js b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExBobble.js index 4ffcab2a573..d205aecdec1 100644 --- a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExBobble.js +++ b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExBobble.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExChained.js b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExChained.js index e49026d3d34..ca735fe0ddf 100644 --- a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExChained.js +++ b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExChained.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExScroll.js b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExScroll.js index 6d6a1cf30f8..8cb35f4f8f7 100644 --- a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExScroll.js +++ b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExScroll.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExSet.js b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExSet.js index 37eeca24929..3f4a9f0021e 100644 --- a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExSet.js +++ b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExSet.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExTilt.js b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExTilt.js index 9e35b96fe13..af3130e8d98 100644 --- a/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExTilt.js +++ b/packages/@react-native/tester/js/examples/AnimatedGratuitousApp/AnExTilt.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/AppState/AppStateExample.js b/packages/@react-native/tester/js/examples/AppState/AppStateExample.js index ed1e146e9b2..962df0c64ad 100644 --- a/packages/@react-native/tester/js/examples/AppState/AppStateExample.js +++ b/packages/@react-native/tester/js/examples/AppState/AppStateExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/Appearance/AppearanceExample.js b/packages/@react-native/tester/js/examples/Appearance/AppearanceExample.js index daff14cee3a..23751f76b93 100644 --- a/packages/@react-native/tester/js/examples/Appearance/AppearanceExample.js +++ b/packages/@react-native/tester/js/examples/Appearance/AppearanceExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {ColorSchemeName} from 'react-native'; diff --git a/packages/@react-native/tester/js/examples/Border/BorderExample.js b/packages/@react-native/tester/js/examples/Border/BorderExample.js index 412211c89c7..cc4876ca748 100644 --- a/packages/@react-native/tester/js/examples/Border/BorderExample.js +++ b/packages/@react-native/tester/js/examples/Border/BorderExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/Button/ButtonExample.js b/packages/@react-native/tester/js/examples/Button/ButtonExample.js index 332f9cd6669..d9c30a8b938 100644 --- a/packages/@react-native/tester/js/examples/Button/ButtonExample.js +++ b/packages/@react-native/tester/js/examples/Button/ButtonExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js b/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js index 97b926a5c51..650986c7097 100644 --- a/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js +++ b/packages/@react-native/tester/js/examples/ContentURLAndroid/ContentURLAndroid.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/Crash/CrashExample.js b/packages/@react-native/tester/js/examples/Crash/CrashExample.js index 75376815cae..e85482a1ee2 100644 --- a/packages/@react-native/tester/js/examples/Crash/CrashExample.js +++ b/packages/@react-native/tester/js/examples/Crash/CrashExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {Node} from 'react'; diff --git a/packages/@react-native/tester/js/examples/DevSettings/DevSettingsExample.js b/packages/@react-native/tester/js/examples/DevSettings/DevSettingsExample.js index 7461fcf86d3..2210bfd612a 100644 --- a/packages/@react-native/tester/js/examples/DevSettings/DevSettingsExample.js +++ b/packages/@react-native/tester/js/examples/DevSettings/DevSettingsExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import * as React from 'react'; diff --git a/packages/@react-native/tester/js/examples/Dimensions/DimensionsExample.js b/packages/@react-native/tester/js/examples/Dimensions/DimensionsExample.js index 61843b1d210..8d246d09aa1 100644 --- a/packages/@react-native/tester/js/examples/Dimensions/DimensionsExample.js +++ b/packages/@react-native/tester/js/examples/Dimensions/DimensionsExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import RNTesterText from '../../components/RNTesterText'; diff --git a/packages/@react-native/tester/js/examples/DisplayContents/DisplayContentsExample.js b/packages/@react-native/tester/js/examples/DisplayContents/DisplayContentsExample.js index a326cff2d49..175c71f78b4 100644 --- a/packages/@react-native/tester/js/examples/DisplayContents/DisplayContentsExample.js +++ b/packages/@react-native/tester/js/examples/DisplayContents/DisplayContentsExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/DrawerLayoutAndroid/DrawerLayoutAndroidExample.js b/packages/@react-native/tester/js/examples/DrawerLayoutAndroid/DrawerLayoutAndroidExample.js index c677c8947f7..92a034ae195 100644 --- a/packages/@react-native/tester/js/examples/DrawerLayoutAndroid/DrawerLayoutAndroidExample.js +++ b/packages/@react-native/tester/js/examples/DrawerLayoutAndroid/DrawerLayoutAndroidExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; @@ -51,6 +51,8 @@ const Drawer = () => { ref={drawer} accessibilityRole="drawerlayout" drawerWidth={300} + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */ drawerPosition={drawerPosition} renderNavigationView={navigationView}> diff --git a/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityAnimatedPointerMove.js b/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityAnimatedPointerMove.js index d2bd7a96f17..a05925d42de 100644 --- a/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityAnimatedPointerMove.js +++ b/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityAnimatedPointerMove.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModuleExample} from '../../../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityNativeGestureHandling.js b/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityNativeGestureHandling.js index 6c528c3d57b..c5fc10ad0fa 100644 --- a/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityNativeGestureHandling.js +++ b/packages/@react-native/tester/js/examples/Experimental/Compatibility/CompatibilityNativeGestureHandling.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModuleExample} from '../../../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js b/packages/@react-native/tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js index 538e11239dc..483f6c64f80 100644 --- a/packages/@react-native/tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js +++ b/packages/@react-native/tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModuleExample} from '../../../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js index c0b47dd2f6e..14fda02e7b9 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTest.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {PlatformTestComponentBaseProps} from './RNTesterPlatformTestTypes'; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js index 77d54ecea8b..0418a9376e8 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type {ViewProps} from 'react-native'; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js index 582680b4fa1..d29e688b721 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestInstructions.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestMinimizedResultView.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestMinimizedResultView.js index b8ba890db5b..d9602b4c745 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestMinimizedResultView.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestMinimizedResultView.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js index 091fc0b6484..01988eefa59 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type { diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultsText.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultsText.js index b111803168f..db58b8eee22 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultsText.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultsText.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import * as React from 'react'; diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js index 0af82e098a0..ee20acbb92d 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ type BasePlatformTestAssertionResult = $ReadOnly<{ diff --git a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js index 0d84794e859..619b3b17251 100644 --- a/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js +++ b/packages/@react-native/tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ import type { diff --git a/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAccessibility.js b/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAccessibility.js index b407a5a9122..48a13acb3f2 100644 --- a/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAccessibility.js +++ b/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAccessibility.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {EventOccurrence} from './PointerEventSupport'; @@ -29,12 +29,16 @@ export default function PointerEventAccessibility(props: {}): React.MixedElement diff --git a/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventClickTouchHierarchyPointerEvents.js b/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventClickTouchHierarchyPointerEvents.js index b1433c8fcea..19af463d432 100644 --- a/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventClickTouchHierarchyPointerEvents.js +++ b/packages/@react-native/tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventClickTouchHierarchyPointerEvents.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {PlatformTestComponentBaseProps} from '../PlatformTest/RNTesterPlatformTestTypes'; @@ -97,12 +97,16 @@ function PointerEventClickTouchHierarchyPointerEventsTestCase( { }) => { // Impressions can be logged here if (this.state.logViewable) { - infoLog( + console.log( 'onViewableItemsChanged: ', info.changed.map(v => ({...v, item: '...'})), ); diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-contentInset.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-contentInset.js index 059c685a5ed..a6867911fe3 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-contentInset.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-contentInset.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-multiColumn.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-multiColumn.js index 92079c3a00d..a6b6c8921de 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-multiColumn.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-multiColumn.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; @@ -28,9 +28,8 @@ import { import RNTesterPage from '../../components/RNTesterPage'; import RNTesterText from '../../components/RNTesterText'; import * as React from 'react'; -import {useState} from 'react'; +import {useCallback, useState} from 'react'; import {Alert, FlatList, StyleSheet, View} from 'react-native'; -import infoLog from 'react-native/Libraries/Utilities/infoLog'; function MultiColumnExample(): React.Node { const [data, setData] = useState(genNewerItems(1000)); @@ -67,20 +66,33 @@ function MultiColumnExample(): React.Node { return {length, offset: length * index, index}; }; - // eslint-disable-next-line react/no-unstable-nested-components - const _renderItemComponent = ({ - item, - }: ListRenderItemInfo): $FlowFixMe => { - return ( - - - - ); - }; + const _pressItem = useCallback( + (key: string) => { + const index = Number(key); + const itemState = pressItem(data[index]); + setData(state => [ + ...state.slice(0, index), + itemState, + ...state.slice(index + 1), + ]); + }, + [data], + ); + + const _renderItemComponent = useCallback( + ({item}: ListRenderItemInfo): $FlowFixMe => { + return ( + + + + ); + }, + [_pressItem, fixedHeight], + ); // This is called when items change viewability by scrolling into or out of the viewable area. const _onViewableItemsChanged = (info: { @@ -96,23 +108,13 @@ function MultiColumnExample(): React.Node { }) => { // Impressions can be logged here if (logViewable) { - infoLog( + console.log( 'onViewableItemsChanged: ', info.changed.map(v => ({...v, item: '...'})), ); } }; - const _pressItem = (key: string) => { - const index = Number(key); - const itemState = pressItem(data[index]); - setData(state => [ - ...state.slice(0, index), - itemState, - ...state.slice(index + 1), - ]); - }; - const filterRegex = new RegExp(String(filterText), 'i'); const filter = (item: any | Item) => filterRegex.test(item.text) || filterRegex.test(item.title); diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-nested.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-nested.js index 9d2c018366c..69e7b6978dc 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-nested.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-nested.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onEndReached.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onEndReached.js index 14ac62cdd03..be505226890 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onEndReached.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onEndReached.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onStartReached.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onStartReached.js index 91697fa7a12..00dc412e4fe 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onStartReached.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onStartReached.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-noWaitForInteraction.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-noWaitForInteraction.js index af39b08c33e..d21359ac139 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-noWaitForInteraction.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-noWaitForInteraction.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-offScreen.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-offScreen.js index 86c11e4d7de..94f0ec5c31b 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-offScreen.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-offScreen.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-waitForInteraction.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-waitForInteraction.js index bda07570a82..f0a25e3aff9 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-waitForInteraction.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-horizontal-waitForInteraction.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-noWaitForInteraction.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-noWaitForInteraction.js index 3983da976a4..50dd25f6938 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-noWaitForInteraction.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-noWaitForInteraction.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-offScreen.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-offScreen.js index 9b77418491d..7accf7f4f46 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-offScreen.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-offScreen.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-waitForInteraction.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-waitForInteraction.js index bd47d13c462..d8c203ea7ea 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-waitForInteraction.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged-waitForInteraction.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged.js index 3e88e89f683..60f6ddad19f 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-onViewableItemsChanged.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/FlatList/FlatList-withSeparators.js b/packages/@react-native/tester/js/examples/FlatList/FlatList-withSeparators.js index 2ced8706deb..0a4a58fd660 100644 --- a/packages/@react-native/tester/js/examples/FlatList/FlatList-withSeparators.js +++ b/packages/@react-native/tester/js/examples/FlatList/FlatList-withSeparators.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/Image/ImageCapInsetsExample.js b/packages/@react-native/tester/js/examples/Image/ImageCapInsetsExample.js index 98bfa745ff5..0df78c3b3f3 100644 --- a/packages/@react-native/tester/js/examples/Image/ImageCapInsetsExample.js +++ b/packages/@react-native/tester/js/examples/Image/ImageCapInsetsExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; diff --git a/packages/@react-native/tester/js/examples/Image/ImageExample.js b/packages/@react-native/tester/js/examples/Image/ImageExample.js index be221d94f52..357e714ef8b 100644 --- a/packages/@react-native/tester/js/examples/Image/ImageExample.js +++ b/packages/@react-native/tester/js/examples/Image/ImageExample.js @@ -4,8 +4,8 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format * @flow strict-local + * @format */ 'use strict'; @@ -595,7 +595,7 @@ const VectorDrawableExample = () => { ); }; -function CacheControlAndroidExample(): React.Node { +function CacheControlExample(): React.Node { const [reload, setReload] = useState(0); const onReload = () => { @@ -1052,46 +1052,15 @@ exports.examples = [ }, platform: 'ios', }, - { - title: 'Cache Policy', - description: - ('First image has never been loaded before and is instructed not to load unless in cache.' + - 'Placeholder image from above will stay. Second image is the same but forced to load regardless of' + - ' local cache state.': string), - render: function (): React.Node { - return ( - - - - - ); - }, - platform: 'ios', - }, { title: 'Cache Policy', description: `- First image will be loaded and cached. - Second image is the same but will be reloaded if re-rendered as the cache policy is set to reload. -- Third image will never be loaded as the cache policy is set to only-if-cached and the image has not been loaded before. - `, +- Third image will try to load from the cache first and only use the network if the cached version is unavailable. +- Fourth image will never be loaded as the cache policy is set to only-if-cached and the image has not been loaded before.`, render: function (): React.Node { - return ; + return ; }, - platform: 'android', }, { title: 'Borders', diff --git a/packages/@react-native/tester/js/examples/InputAccessoryView/InputAccessoryViewExample.js b/packages/@react-native/tester/js/examples/InputAccessoryView/InputAccessoryViewExample.js index 798658d1456..532a9ea2837 100644 --- a/packages/@react-native/tester/js/examples/InputAccessoryView/InputAccessoryViewExample.js +++ b/packages/@react-native/tester/js/examples/InputAccessoryView/InputAccessoryViewExample.js @@ -10,8 +10,9 @@ 'use strict'; -const React = require('react'); -const { +import {useTheme} from '../../components/RNTesterTheme'; +import {useState} from 'react'; +import { Alert, Button, InputAccessoryView, @@ -20,67 +21,60 @@ const { Text, TextInput, View, -} = require('react-native'); +} from 'react-native'; -type MessageProps = $ReadOnly<{}>; -class Message extends React.PureComponent { - render(): React.Node { - return ( - - Text Message - - ); - } +function Message(): React.Node { + return ( + + Text Message + + ); } -type TextInputProps = $ReadOnly<{}>; -type TextInputState = {text: string}; -class TextInputBar extends React.PureComponent { - state: TextInputState = {text: ''}; +function TextInputBar(): React.Node { + const {PlaceholderTextColor, LabelColor, SeparatorColor} = useTheme(); + const [text, setText] = useState(''); - render(): React.Node { - return ( - - { - this.setState({text}); - }} - value={this.state.text} - placeholder={'Type a message...'} - /> -