diff --git a/change/@office-iss-react-native-win32-9651a155-49de-4025-9742-bd9fc8aadae6.json b/change/@office-iss-react-native-win32-9651a155-49de-4025-9742-bd9fc8aadae6.json new file mode 100644 index 00000000000..9a63c4468b7 --- /dev/null +++ b/change/@office-iss-react-native-win32-9651a155-49de-4025-9742-bd9fc8aadae6.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Update tester files", + "packageName": "@office-iss/react-native-win32", + "email": "hmalothu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-automation-channel-2b6bd733-4c76-4b2b-b9db-fb2210035f93.json b/change/@react-native-windows-automation-channel-2b6bd733-4c76-4b2b-b9db-fb2210035f93.json new file mode 100644 index 00000000000..4a40a9711a9 --- /dev/null +++ b/change/@react-native-windows-automation-channel-2b6bd733-4c76-4b2b-b9db-fb2210035f93.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Update tester files", + "packageName": "@react-native-windows/automation-channel", + "email": "hmalothu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@rnw-scripts-integrate-rn-094dd0ae-4648-41bc-a07e-e4f77733b6aa.json b/change/@rnw-scripts-integrate-rn-094dd0ae-4648-41bc-a07e-e4f77733b6aa.json new file mode 100644 index 00000000000..8378b0e5f17 --- /dev/null +++ b/change/@rnw-scripts-integrate-rn-094dd0ae-4648-41bc-a07e-e4f77733b6aa.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Update communitycli template version", + "packageName": "@rnw-scripts/integrate-rn", + "email": "hmalothu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@rnw-scripts-just-task-45ddd392-4803-4110-b0ea-3af83cb2fbc5.json b/change/@rnw-scripts-just-task-45ddd392-4803-4110-b0ea-3af83cb2fbc5.json new file mode 100644 index 00000000000..66560d6b4db --- /dev/null +++ b/change/@rnw-scripts-just-task-45ddd392-4803-4110-b0ea-3af83cb2fbc5.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Update downloadFlowTypes with newly missing flow types", + "packageName": "@rnw-scripts/just-task", + "email": "hmalothu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-cbc424a4-549d-45f4-a672-4c89c7a597c8.json b/change/react-native-windows-cbc424a4-549d-45f4-a672-4c89c7a597c8.json new file mode 100644 index 00000000000..11861b72868 --- /dev/null +++ b/change/react-native-windows-cbc424a4-549d-45f4-a672-4c89c7a597c8.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Update tester files", + "packageName": "react-native-windows", + "email": "hmalothu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/@office-iss/react-native-win32-tester/js/utils/JSEventLoopWatchdog.js b/packages/@office-iss/react-native-win32-tester/js/utils/JSEventLoopWatchdog.js new file mode 100644 index 00000000000..898a246d666 --- /dev/null +++ b/packages/@office-iss/react-native-win32-tester/js/utils/JSEventLoopWatchdog.js @@ -0,0 +1,86 @@ +/** + * 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. + * + * @flow + * @format + */ + +'use strict'; + +type Handler = { + onIterate?: () => void, + onStall: (params: {lastInterval: number, busyTime: number, ...}) => ?string, + ... +}; + +/** + * A utility for tracking stalls in the JS event loop that prevent timers and + * other events from being processed in a timely manner. + * + * The "stall" time is defined as the amount of time in access of the acceptable + * threshold, which is typically around 100-200ms. So if the threshold is set to + * 100 and a timer fires 150 ms later than it was scheduled because the event + * loop was tied up, that would be considered a 50ms stall. + * + * By default, logs stall events to the console when installed. Can also be + * queried with `getStats`. + */ +const JSEventLoopWatchdog = { + getStats: function (): Object { + return {stallCount, totalStallTime, longestStall, acceptableBusyTime}; + }, + reset: function () { + console.log('JSEventLoopWatchdog: reset'); + totalStallTime = 0; + stallCount = 0; + longestStall = 0; + lastInterval = global.performance.now(); + }, + addHandler: function (handler: Handler) { + handlers.push(handler); + }, + install: function ({thresholdMS}: {thresholdMS: number, ...}) { + acceptableBusyTime = thresholdMS; + if (installed) { + return; + } + installed = true; + lastInterval = global.performance.now(); + function iteration() { + const now = global.performance.now(); + const busyTime = now - lastInterval; + if (busyTime >= thresholdMS) { + const stallTime = busyTime - thresholdMS; + stallCount++; + totalStallTime += stallTime; + longestStall = Math.max(longestStall, stallTime); + let msg = + `JSEventLoopWatchdog: JS thread busy for ${busyTime}ms. ` + + `${totalStallTime}ms in ${stallCount} stalls so far. `; + handlers.forEach(handler => { + msg += handler.onStall({lastInterval, busyTime}) || ''; + }); + console.log(msg); + } + handlers.forEach(handler => { + handler.onIterate && handler.onIterate(); + }); + lastInterval = now; + setTimeout(iteration, thresholdMS / 5); + } + iteration(); + }, +}; + +let acceptableBusyTime = 0; +let installed = false; +let totalStallTime = 0; +let stallCount = 0; +let longestStall = 0; +let lastInterval = 0; +const handlers: Array = []; + +export default JSEventLoopWatchdog; 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..bc40989a838 100644 --- a/packages/@office-iss/react-native-win32-tester/package.json +++ b/packages/@office-iss/react-native-win32-tester/package.json @@ -19,7 +19,7 @@ "peerDependencies": { "@office-iss/react-native-win32": "^0.0.0-canary.297", "react": "19.1.0", - "react-native": "0.81.0-nightly-20250521-3cb70bb6a" + "react-native": "0.81.0-nightly-20250604-1a6d466f1" }, "devDependencies": { "@office-iss/react-native-win32": "^0.0.0-canary.297", @@ -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..01702eb4ef7 100644 --- a/packages/@office-iss/react-native-win32/.flowconfig +++ b/packages/@office-iss/react-native-win32/.flowconfig @@ -110,7 +110,7 @@ [libs] interface.js -flow/ +../../../node_modules/.flow/flow/ ../../../node_modules/.flow/flow-typed/ ../../../node_modules/react-native/src/types src/types/ @@ -143,6 +143,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 +178,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..3bc33752a66 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 }, { @@ -89,10 +89,10 @@ "issue": 6240 }, { - "type": "patch", + "type": "copy", "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 }, { @@ -398,10 +398,10 @@ "issue": 0 }, { - "type": "derived", + "type": "copy", "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..a0593fa53cc 100644 --- a/packages/@office-iss/react-native-win32/package.json +++ b/packages/@office-iss/react-native-win32/package.json @@ -30,13 +30,13 @@ "@react-native-community/cli-platform-android": "17.0.0", "@react-native-community/cli-platform-ios": "17.0.0", "@react-native/assets": "1.0.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", @@ -72,7 +72,7 @@ "devDependencies": { "@babel/core": "^7.25.2", "@babel/eslint-parser": "^7.25.1", - "@react-native/metro-config": "0.81.0-nightly-20250521-3cb70bb6a", + "@react-native/metro-config": "0.81.0-nightly-20250604-1a6d466f1", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.37", "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.41", @@ -83,19 +83,19 @@ "@types/prop-types": "15.7.1", "@types/react": "^19.0.0", "eslint": "^8.19.0", - "flow-bin": "^0.271.0", + "flow-bin": "^0.272.0", "jscodeshift": "^0.14.0", "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" }, "peerDependencies": { "@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" }, "beachball": { "defaultNpmTag": "canary", 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..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,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow + * @flow strict-local * @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..9806e8d2a76 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 @@ -13,11 +13,13 @@ import {GestureResponderHandlers} from 'react-native/types/public/ReactNativeRen import {StyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; import {ViewStyle} from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; import { + BlurEvent, + FocusEvent, LayoutChangeEvent, + PointerEvents, MouseEvent, // Win32 NativeSyntheticEvent, // Win32 - PointerEvents, -} from 'react-native/Libraries/Types/CoreEventTypes'; +} from '../../Types/CoreEventTypes'; import {Touchable} from 'react-native/Libraries/Components/Touchable/Touchable'; import {AccessibilityProps} from './ViewAccessibility'; @@ -81,6 +83,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..f44d6b44587 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,11 +4,13 @@ * 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 - * @flow */ // flowlint unsafe-getters-setters:off +// flowlint unclear-type:off +// flowlint untyped-import:off 'use strict'; 'use client'; 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 5287a436423..0a956b3be68 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.996", "typescript": "5.0.4" }, diff --git a/packages/@react-native-windows/tester/js/utils/JSEventLoopWatchdog.js b/packages/@react-native-windows/tester/js/utils/JSEventLoopWatchdog.js new file mode 100644 index 00000000000..898a246d666 --- /dev/null +++ b/packages/@react-native-windows/tester/js/utils/JSEventLoopWatchdog.js @@ -0,0 +1,86 @@ +/** + * 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. + * + * @flow + * @format + */ + +'use strict'; + +type Handler = { + onIterate?: () => void, + onStall: (params: {lastInterval: number, busyTime: number, ...}) => ?string, + ... +}; + +/** + * A utility for tracking stalls in the JS event loop that prevent timers and + * other events from being processed in a timely manner. + * + * The "stall" time is defined as the amount of time in access of the acceptable + * threshold, which is typically around 100-200ms. So if the threshold is set to + * 100 and a timer fires 150 ms later than it was scheduled because the event + * loop was tied up, that would be considered a 50ms stall. + * + * By default, logs stall events to the console when installed. Can also be + * queried with `getStats`. + */ +const JSEventLoopWatchdog = { + getStats: function (): Object { + return {stallCount, totalStallTime, longestStall, acceptableBusyTime}; + }, + reset: function () { + console.log('JSEventLoopWatchdog: reset'); + totalStallTime = 0; + stallCount = 0; + longestStall = 0; + lastInterval = global.performance.now(); + }, + addHandler: function (handler: Handler) { + handlers.push(handler); + }, + install: function ({thresholdMS}: {thresholdMS: number, ...}) { + acceptableBusyTime = thresholdMS; + if (installed) { + return; + } + installed = true; + lastInterval = global.performance.now(); + function iteration() { + const now = global.performance.now(); + const busyTime = now - lastInterval; + if (busyTime >= thresholdMS) { + const stallTime = busyTime - thresholdMS; + stallCount++; + totalStallTime += stallTime; + longestStall = Math.max(longestStall, stallTime); + let msg = + `JSEventLoopWatchdog: JS thread busy for ${busyTime}ms. ` + + `${totalStallTime}ms in ${stallCount} stalls so far. `; + handlers.forEach(handler => { + msg += handler.onStall({lastInterval, busyTime}) || ''; + }); + console.log(msg); + } + handlers.forEach(handler => { + handler.onIterate && handler.onIterate(); + }); + lastInterval = now; + setTimeout(iteration, thresholdMS / 5); + } + iteration(); + }, +}; + +let acceptableBusyTime = 0; +let installed = false; +let totalStallTime = 0; +let stallCount = 0; +let longestStall = 0; +let lastInterval = 0; +const handlers: Array = []; + +export default JSEventLoopWatchdog; 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 e06297e4b80..e044aff576f 100644 --- a/packages/@react-native-windows/tester/package.json +++ b/packages/@react-native-windows/tester/package.json @@ -19,13 +19,13 @@ "peerDependencies": { "@react-native-picker/picker": "2.11.0", "react": "19.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.996", "react-native-xaml": "^0.0.80" }, "devDependencies": { "@react-native/tester": "0.80.0-main", - "@react-native/new-app-screen": "0.81.0-nightly-20250521-3cb70bb6a", + "@react-native/new-app-screen": "0.81.0-nightly-20250604-1a6d466f1", "@rnw-scripts/babel-react-native-config": "0.0.0", "@rnw-scripts/eslint-config": "1.2.37", "@rnw-scripts/just-task": "2.3.55", @@ -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.996", "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..2f79643bbdc 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'; @@ -732,7 +732,7 @@ const ImageFunctionsExample = () => { ); }; -function CacheControlAndroidExample(): React.Node { +function CacheControlExample(): React.Node { const [reload, setReload] = useState(0); const onReload = () => { @@ -1305,46 +1305,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-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..ccc71639e8b 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 :'} @@ -1154,13 +1159,19 @@ function TextBaseLineLayoutExample(props: {}): React.Node { ) : ( - {'Nested s:'} + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} + + {'Interleaving and :'} + {marker} {texts} {marker} + {/* $FlowFixMe[incompatible-type] Natural Inference rollout. See + * https://fburl.com/workplace/6291gfvu */} {'Array of s in :'} @@ -1657,9 +1668,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..fbc10d31a07 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,57 @@ function EmptyTextExample(): React.Node { ); } +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 ( + + + + + + + ); +} + const examples = [ { title: 'Empty Text', name: 'emptyText', render: EmptyTextExample, }, + { + title: 'numberOfLines with onTextLayout', + name: 'numberOfLinesLayout', + description: + 'Shows the behavior of numberOfLines and ellipsizeMode in conjunction with the onTextLayout event', + scrollable: true, + render: NumberOfLinesTextLayoutExample, + }, // Windows: Only include TextInlineViewsExample in Fabric mode (bridgeless) // Paper mode doesn't support Views nested in Text ...(global.RN$Bridgeless === true 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..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 @@ -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,11 @@ export default ({ name: 'box-sizing', render: BoxSizingExample, }, + { + title: 'Focus/Blur', + name: 'focus-blur', + render: FocusBlurExample, + }, // [Windows { title: 'NativeID', 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..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,8 +1,11 @@ /** - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * @format + * 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. + * * @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..9c91095ef6f 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,8 @@ "@babel/preset-env": "^7.25.3", "@babel/preset-flow": "^7.24.7", "@jest/create-cache-key-function": "^29.7.0", - "@react-native/metro-babel-transformer": "0.81.0-nightly-20250521-3cb70bb6a", - "@react-native/metro-config": "0.81.0-nightly-20250521-3cb70bb6a", + "@react-native/metro-babel-transformer": "0.81.0-nightly-20250604-1a6d466f1", + "@react-native/metro-config": "0.81.0-nightly-20250604-1a6d466f1", "@tsconfig/node18": "1.0.1", "@types/react": "^19.0.0", "@typescript-eslint/parser": "^7.1.1", @@ -75,7 +75,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 +87,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 +101,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 +109,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/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...'} - /> -