From 7506f83aa3d602606e426d7daff2dbd2eec8d2d1 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 10:23:22 -0700 Subject: [PATCH 01/10] chore: switch Yarn nodeLinker to pnpm Switch the monorepo to Yarn's pnpm linker (strict, non-hoisted node_modules). Pin the standalone docsite to nodeLinker: node-modules so this setting does not leak into its Docusaurus build, which relies on hoisted resolution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .yarnrc.yml | 2 +- docsite/.yarnrc.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docsite/.yarnrc.yml diff --git a/.yarnrc.yml b/.yarnrc.yml index 2d4e1303d05c..955458e8f266 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,6 +1,6 @@ enableScripts: false -nodeLinker: node-modules +nodeLinker: pnpm npmMinimalAgeGate: 7d diff --git a/docsite/.yarnrc.yml b/docsite/.yarnrc.yml new file mode 100644 index 000000000000..74e5fab651d6 --- /dev/null +++ b/docsite/.yarnrc.yml @@ -0,0 +1,5 @@ +# The docsite is a standalone project (not part of the monorepo workspaces). +# Yarn merges .yarnrc.yml files hierarchically, so without this the docsite would +# inherit the monorepo root's `nodeLinker: pnpm`. Docusaurus relies on hoisted +# (non-strict) resolution, so keep the docsite on the node-modules linker. +nodeLinker: node-modules From 595f10d34e196783703865f7cff01eb98aaf0a13 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 10:24:00 -0700 Subject: [PATCH 02/10] fix(metro): resolve deps and self-reference so RNTester bundles under pnpm Under the pnpm linker's strict layout, previously-hoisted dependencies must be declared explicitly: - rn-tester metro config imports mergeConfig from @react-native/metro-config instead of requiring metro-config directly, and maps the react-native-macos self-reference to the workspace via extraNodeModules (the react-native -> react-native-macos redirect is not self-resolvable under pnpm). - Declare @react-native/babel-preset and @babel/runtime at the monorepo root. - Declare @babel/parser in @react-native/codegen, which its built lib requires. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- package.json | 2 ++ packages/react-native-codegen/package.json | 1 + packages/rn-tester/metro.config.js | 8 ++++++-- yarn.lock | 12 +++++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 52efcc047118..aac99a3f39da 100644 --- a/package.json +++ b/package.json @@ -57,10 +57,12 @@ "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/preset-env": "^7.25.3", "@babel/preset-flow": "^7.24.7", + "@babel/runtime": "^7.25.2", "@changesets/cli": "^2.28.1", "@electron/packager": "^18.3.6", "@jest/create-cache-key-function": "^29.7.0", "@microsoft/api-extractor": "^7.52.2", + "@react-native/babel-preset": "workspace:*", "@react-native/metro-babel-transformer": "workspace:*", "@react-native/metro-config": "workspace:*", "@tsconfig/node22": "22.0.2", diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 455f1a0b5d50..4ec918a50b45 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -30,6 +30,7 @@ "lib" ], "dependencies": { + "@babel/parser": "^7.25.2", "glob": "^7.1.1", "hermes-parser": "0.29.1", "invariant": "^2.2.4", diff --git a/packages/rn-tester/metro.config.js b/packages/rn-tester/metro.config.js index 445adfde474a..e2979d5bbb05 100644 --- a/packages/rn-tester/metro.config.js +++ b/packages/rn-tester/metro.config.js @@ -10,8 +10,7 @@ 'use strict'; -const {getDefaultConfig} = require('@react-native/metro-config'); -const {mergeConfig} = require('metro-config'); +const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); const path = require('path'); /** @@ -39,6 +38,11 @@ const config = { blockList: [/..\/react-native\/sdks\/hermes/], extraNodeModules: { 'react-native': path.resolve(__dirname, '../react-native'), + // [macOS] Under Yarn's pnpm linker, files inside the react-native-macos + // package self-reference via `react-native`, which Metro redirects to the + // real package name `react-native-macos`. That name isn't self-resolvable + // in pnpm's strict layout, so map it to the workspace explicitly. + 'react-native-macos': path.resolve(__dirname, '../react-native'), }, platforms: ['ios', 'macos', 'android'], // [macOS] }, diff --git a/yarn.lock b/yarn.lock index 305e0c9812e4..da035495c3e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -387,7 +387,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.29.7": +"@babel/parser@npm:^7.25.2, @babel/parser@npm:^7.29.7": version: 7.29.7 resolution: "@babel/parser@npm:7.29.7" dependencies: @@ -1543,6 +1543,13 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.25.2": + version: 7.29.7 + resolution: "@babel/runtime@npm:7.29.7" + checksum: 10c0/ca11572f7146b21e0bde6a9ed4bb6a89eafbee5f0944c7eb54d0d8a2dac962c33638a1d611e14faa71dfbb92b4b5f9236232208568a6b7d5c6f3f39ddb91771e + languageName: node + linkType: hard + "@babel/template@npm:^7.25.0, @babel/template@npm:^7.25.9, @babel/template@npm:^7.27.2, @babel/template@npm:^7.3.3": version: 7.27.2 resolution: "@babel/template@npm:7.27.2" @@ -3079,10 +3086,12 @@ __metadata: "@babel/plugin-transform-regenerator": "npm:^7.24.7" "@babel/preset-env": "npm:^7.25.3" "@babel/preset-flow": "npm:^7.24.7" + "@babel/runtime": "npm:^7.25.2" "@changesets/cli": "npm:^2.28.1" "@electron/packager": "npm:^18.3.6" "@jest/create-cache-key-function": "npm:^29.7.0" "@microsoft/api-extractor": "npm:^7.52.2" + "@react-native/babel-preset": "workspace:*" "@react-native/metro-babel-transformer": "workspace:*" "@react-native/metro-config": "workspace:*" "@tsconfig/node22": "npm:22.0.2" @@ -3270,6 +3279,7 @@ __metadata: resolution: "@react-native/codegen@workspace:packages/react-native-codegen" dependencies: "@babel/core": "npm:^7.25.2" + "@babel/parser": "npm:^7.25.2" "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" "@babel/plugin-transform-class-properties": "npm:^7.25.4" "@babel/plugin-transform-flow-strip-types": "npm:^7.25.2" From 35306aaf45818e562e7a9b2b2120f867591187d0 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 10:24:30 -0700 Subject: [PATCH 03/10] fix(lint,flow): declare eslint/flow/prettier phantom deps for pnpm The pnpm linker's strict layout requires declaring dependencies that the JS toolchain previously resolved through a hoisted node_modules. ESLint: - Declare @react-native/eslint-config and the plugins @react-native/eslint-plugin, @react-native/eslint-plugin-monorepo, @react-native/eslint-plugin-specs, plus @typescript-eslint/eslint-plugin, eslint-plugin-react-hooks and the jsonc-eslint-parser referenced by the root .eslintrc. - Declare hermes-estree in @react-native/eslint-plugin-monorepo, which its rules require. Prettier: - List prettier-plugin-hermes-parser explicitly in .prettierrc plugins; Prettier 2.x auto-loaded it from a hoisted node_modules, which pnpm does not provide. Flow: - Declare @babel/parser, @babel/traverse, @babel/types, hermes-estree, yargs, metro and metro-config at the root (used by scripts/build-types and helloworld). - Declare the direct dependencies each package imports: @babel/plugin-syntax-flow (babel-plugin-codegen), metro (core-cli-utils), metro-babel-transformer (metro-babel-transformer), invariant (compatibility-check), and metro/ metro-config/jest-docblock/jest-message-util/source-map (fantom). - Add Flow module.name_mapper entries so @react-native/fantom and @react-native/core-cli-utils (including self-references) resolve under pnpm. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .flowconfig | 6 ++ .prettierrc | 1 + package.json | 14 ++++ packages/babel-plugin-codegen/package.json | 3 +- packages/core-cli-utils/package.json | 5 +- .../package.json | 3 + .../package.json | 3 +- private/eslint-plugin-monorepo/package.json | 1 + private/react-native-fantom/package.json | 7 ++ yarn.lock | 82 ++++++++++++++----- 10 files changed, 103 insertions(+), 22 deletions(-) diff --git a/.flowconfig b/.flowconfig index 1faa6debeb19..12e5bfc2931e 100644 --- a/.flowconfig +++ b/.flowconfig @@ -69,6 +69,12 @@ munge_underscores=true module.name_mapper='^react-native$' -> '/packages/react-native/index.js' module.name_mapper='^react-native/\(.*\)$' -> '/packages/react-native/\1' module.name_mapper='^@react-native/dev-middleware$' -> '/packages/dev-middleware' +; [macOS] Resolve workspace packages that are referenced by name (including +; self-references) so Flow can resolve them under Yarn's pnpm linker, which does +; not hoist them into a shared node_modules. +module.name_mapper='^@react-native/fantom$' -> '/private/react-native-fantom/src/index.js' +module.name_mapper='^@react-native/fantom/\(.*\)$' -> '/private/react-native-fantom/\1' +module.name_mapper='^@react-native/core-cli-utils$' -> '/packages/core-cli-utils/src/index.flow.js' 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\)$' -> '/packages/react-native/Libraries/Image/RelativeImageStub' module.system.haste.module_ref_prefix=m# diff --git a/.prettierrc b/.prettierrc index a3f4c89ec6a2..91d36cb6e41e 100644 --- a/.prettierrc +++ b/.prettierrc @@ -6,6 +6,7 @@ "singleQuote": true, "trailingComma": "all", "endOfLine": "lf", + "plugins": ["prettier-plugin-hermes-parser"], "overrides": [ { "files": ["*.code-workspace"], diff --git a/package.json b/package.json index aac99a3f39da..81e9d164210e 100644 --- a/package.json +++ b/package.json @@ -53,20 +53,28 @@ "@babel/core": "^7.25.2", "@babel/eslint-parser": "^7.25.1", "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.2", "@babel/plugin-syntax-typescript": "^7.25.4", "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/preset-env": "^7.25.3", "@babel/preset-flow": "^7.24.7", "@babel/runtime": "^7.25.2", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", "@changesets/cli": "^2.28.1", "@electron/packager": "^18.3.6", "@jest/create-cache-key-function": "^29.7.0", "@microsoft/api-extractor": "^7.52.2", "@react-native/babel-preset": "workspace:*", + "@react-native/eslint-config": "workspace:*", + "@react-native/eslint-plugin": "workspace:*", + "@react-native/eslint-plugin-monorepo": "workspace:*", + "@react-native/eslint-plugin-specs": "workspace:*", "@react-native/metro-babel-transformer": "workspace:*", "@react-native/metro-config": "workspace:*", "@tsconfig/node22": "22.0.2", "@types/react": "^19.1.0", + "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "@yarnpkg/types": "^4.0.1", "ansi-styles": "^4.2.1", @@ -86,6 +94,7 @@ "eslint-plugin-jest": "^27.9.0", "eslint-plugin-jsx-a11y": "^6.6.0", "eslint-plugin-react": "^7.30.1", + "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", @@ -93,6 +102,7 @@ "flow-bin": "^0.275.0", "glob": "^7.1.1", "hermes-eslint": "0.29.1", + "hermes-estree": "0.29.1", "hermes-transform": "0.29.1", "inquirer": "^7.1.0", "jest": "^29.7.0", @@ -100,9 +110,12 @@ "jest-diff": "^29.7.0", "jest-junit": "^10.0.0", "jest-snapshot": "^29.7.0", + "jsonc-eslint-parser": "^2.3.0", "markdownlint-cli2": "^0.22.0", "markdownlint-rule-relative-links": "^3.0.0", + "metro": "^0.82.5", "metro-babel-register": "^0.82.5", + "metro-config": "^0.82.5", "metro-memory-fs": "^0.82.5", "metro-transform-plugins": "^0.82.5", "micromatch": "^4.0.4", @@ -120,6 +133,7 @@ "tinybench": "^3.1.0", "typescript": "5.8.3", "ws": "^6.2.3", + "yargs": "^17.6.2", "zx": "^8.2.4" }, "resolutions": { diff --git a/packages/babel-plugin-codegen/package.json b/packages/babel-plugin-codegen/package.json index 95e6c9606e3c..7d3e46169133 100644 --- a/packages/babel-plugin-codegen/package.json +++ b/packages/babel-plugin-codegen/package.json @@ -30,6 +30,7 @@ "@react-native/codegen": "workspace:*" }, "devDependencies": { - "@babel/core": "^7.25.2" + "@babel/core": "^7.25.2", + "@babel/plugin-syntax-flow": "^7.25.0" } } diff --git a/packages/core-cli-utils/package.json b/packages/core-cli-utils/package.json index 8cd19ed06fcf..e64ea09b3a64 100644 --- a/packages/core-cli-utils/package.json +++ b/packages/core-cli-utils/package.json @@ -26,5 +26,8 @@ }, "files": [ "dist" - ] + ], + "devDependencies": { + "metro": "^0.82.5" + } } diff --git a/packages/react-native-babel-transformer/package.json b/packages/react-native-babel-transformer/package.json index 57b7835b0ec2..3f451ceb7c73 100644 --- a/packages/react-native-babel-transformer/package.json +++ b/packages/react-native-babel-transformer/package.json @@ -34,5 +34,8 @@ }, "peerDependencies": { "@babel/core": "*" + }, + "devDependencies": { + "metro-babel-transformer": "^0.82.5" } } diff --git a/packages/react-native-compatibility-check/package.json b/packages/react-native-compatibility-check/package.json index bb8f2095d966..f8cd7125c40d 100644 --- a/packages/react-native-compatibility-check/package.json +++ b/packages/react-native-compatibility-check/package.json @@ -30,7 +30,8 @@ "dist" ], "dependencies": { - "@react-native/codegen": "workspace:*" + "@react-native/codegen": "workspace:*", + "invariant": "^2.2.4" }, "devDependencies": { "flow-remove-types": "^2.237.2", diff --git a/private/eslint-plugin-monorepo/package.json b/private/eslint-plugin-monorepo/package.json index ed92f37d19ca..31ba2b4411b0 100644 --- a/private/eslint-plugin-monorepo/package.json +++ b/private/eslint-plugin-monorepo/package.json @@ -4,6 +4,7 @@ "version": "0.0.0", "main": "index.js", "dependencies": { + "hermes-estree": "0.29.1", "jsonc-eslint-parser": "^2.3.0" } } diff --git a/private/react-native-fantom/package.json b/private/react-native-fantom/package.json index 6ac990e644a4..e6cb0fc0e2a0 100644 --- a/private/react-native-fantom/package.json +++ b/private/react-native-fantom/package.json @@ -10,5 +10,12 @@ "peerDependencies": { "jest": "^29.7.0", "jest-snapshot": "^29.7.0" + }, + "dependencies": { + "jest-docblock": "^29.7.0", + "jest-message-util": "^29.7.0", + "metro": "^0.82.5", + "metro-config": "^0.82.5", + "source-map": "^0.7.4" } } diff --git a/yarn.lock b/yarn.lock index da035495c3e4..f14eaa69adab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -566,6 +566,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-flow@npm:^7.25.0": + version: 7.29.7 + resolution: "@babel/plugin-syntax-flow@npm:7.29.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.29.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/b2e330dd0dc535c7364937ce2b29a06065e60b1d523db75f36ab4fb89e4ba664e2230cbb1937b35712c9a0ebafc3358f323d6e6b22247d5ebad12fdd3e1f6e98 + languageName: node + linkType: hard + "@babel/plugin-syntax-import-assertions@npm:^7.26.0": version: 7.26.0 resolution: "@babel/plugin-syntax-import-assertions@npm:7.26.0" @@ -1587,6 +1598,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.2, @babel/traverse@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/traverse@npm:7.29.7" + dependencies: + "@babel/code-frame": "npm:^7.29.7" + "@babel/generator": "npm:^7.29.7" + "@babel/helper-globals": "npm:^7.29.7" + "@babel/parser": "npm:^7.29.7" + "@babel/template": "npm:^7.29.7" + "@babel/types": "npm:^7.29.7" + debug: "npm:^4.3.1" + checksum: 10c0/e256a1fbdb956555b76f3c285b1e453f6bedec8b3afb61751d99d933efd11c7d79caf5ddf2493570058a9f7deaa1b48324380d7c1aa1443fd9508becbf56331a + languageName: node + linkType: hard + "@babel/traverse@npm:^7.25.3, @babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.27.1, @babel/traverse@npm:^7.28.3, @babel/traverse@npm:^7.28.4": version: 7.28.4 resolution: "@babel/traverse@npm:7.28.4" @@ -1602,21 +1628,6 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/traverse@npm:7.29.7" - dependencies: - "@babel/code-frame": "npm:^7.29.7" - "@babel/generator": "npm:^7.29.7" - "@babel/helper-globals": "npm:^7.29.7" - "@babel/parser": "npm:^7.29.7" - "@babel/template": "npm:^7.29.7" - "@babel/types": "npm:^7.29.7" - debug: "npm:^4.3.1" - checksum: 10c0/e256a1fbdb956555b76f3c285b1e453f6bedec8b3afb61751d99d933efd11c7d79caf5ddf2493570058a9f7deaa1b48324380d7c1aa1443fd9508becbf56331a - languageName: node - linkType: hard - "@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.7, @babel/types@npm:^7.27.1, @babel/types@npm:^7.27.3, @babel/types@npm:^7.28.2, @babel/types@npm:^7.28.4, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4": version: 7.28.4 resolution: "@babel/types@npm:7.28.4" @@ -3082,20 +3093,28 @@ __metadata: "@babel/core": "npm:^7.25.2" "@babel/eslint-parser": "npm:^7.25.1" "@babel/generator": "npm:^7.25.0" + "@babel/parser": "npm:^7.25.2" "@babel/plugin-syntax-typescript": "npm:^7.25.4" "@babel/plugin-transform-regenerator": "npm:^7.24.7" "@babel/preset-env": "npm:^7.25.3" "@babel/preset-flow": "npm:^7.24.7" "@babel/runtime": "npm:^7.25.2" + "@babel/traverse": "npm:^7.25.2" + "@babel/types": "npm:^7.25.2" "@changesets/cli": "npm:^2.28.1" "@electron/packager": "npm:^18.3.6" "@jest/create-cache-key-function": "npm:^29.7.0" "@microsoft/api-extractor": "npm:^7.52.2" "@react-native/babel-preset": "workspace:*" + "@react-native/eslint-config": "workspace:*" + "@react-native/eslint-plugin": "workspace:*" + "@react-native/eslint-plugin-monorepo": "workspace:*" + "@react-native/eslint-plugin-specs": "workspace:*" "@react-native/metro-babel-transformer": "workspace:*" "@react-native/metro-config": "workspace:*" "@tsconfig/node22": "npm:22.0.2" "@types/react": "npm:^19.1.0" + "@typescript-eslint/eslint-plugin": "npm:^7.1.1" "@typescript-eslint/parser": "npm:^7.1.1" "@yarnpkg/types": "npm:^4.0.1" ansi-styles: "npm:^4.2.1" @@ -3115,6 +3134,7 @@ __metadata: eslint-plugin-jest: "npm:^27.9.0" eslint-plugin-jsx-a11y: "npm:^6.6.0" eslint-plugin-react: "npm:^7.30.1" + eslint-plugin-react-hooks: "npm:^5.2.0" eslint-plugin-react-native: "npm:^4.0.0" eslint-plugin-redundant-undefined: "npm:^0.4.0" eslint-plugin-relay: "npm:^1.8.3" @@ -3122,6 +3142,7 @@ __metadata: flow-bin: "npm:^0.275.0" glob: "npm:^7.1.1" hermes-eslint: "npm:0.29.1" + hermes-estree: "npm:0.29.1" hermes-transform: "npm:0.29.1" inquirer: "npm:^7.1.0" jest: "npm:^29.7.0" @@ -3129,9 +3150,12 @@ __metadata: jest-diff: "npm:^29.7.0" jest-junit: "npm:^10.0.0" jest-snapshot: "npm:^29.7.0" + jsonc-eslint-parser: "npm:^2.3.0" markdownlint-cli2: "npm:^0.22.0" markdownlint-rule-relative-links: "npm:^3.0.0" + metro: "npm:^0.82.5" metro-babel-register: "npm:^0.82.5" + metro-config: "npm:^0.82.5" metro-memory-fs: "npm:^0.82.5" metro-transform-plugins: "npm:^0.82.5" micromatch: "npm:^4.0.4" @@ -3149,6 +3173,7 @@ __metadata: tinybench: "npm:^3.1.0" typescript: "npm:5.8.3" ws: "npm:^6.2.3" + yargs: "npm:^17.6.2" zx: "npm:^8.2.4" languageName: unknown linkType: soft @@ -3181,6 +3206,7 @@ __metadata: resolution: "@react-native/babel-plugin-codegen@workspace:packages/babel-plugin-codegen" dependencies: "@babel/core": "npm:^7.25.2" + "@babel/plugin-syntax-flow": "npm:^7.25.0" "@babel/traverse": "npm:^7.25.3" "@react-native/codegen": "workspace:*" languageName: unknown @@ -3328,6 +3354,7 @@ __metadata: dependencies: "@react-native/codegen": "workspace:*" flow-remove-types: "npm:^2.237.2" + invariant: "npm:^2.2.4" rimraf: "npm:^3.0.2" languageName: unknown linkType: soft @@ -3335,6 +3362,8 @@ __metadata: "@react-native/core-cli-utils@workspace:packages/core-cli-utils": version: 0.0.0-use.local resolution: "@react-native/core-cli-utils@workspace:packages/core-cli-utils" + dependencies: + metro: "npm:^0.82.5" languageName: unknown linkType: soft @@ -3384,7 +3413,7 @@ __metadata: languageName: unknown linkType: soft -"@react-native/eslint-config@workspace:packages/eslint-config-react-native": +"@react-native/eslint-config@workspace:*, @react-native/eslint-config@workspace:packages/eslint-config-react-native": version: 0.0.0-use.local resolution: "@react-native/eslint-config@workspace:packages/eslint-config-react-native" dependencies: @@ -3408,15 +3437,16 @@ __metadata: languageName: unknown linkType: soft -"@react-native/eslint-plugin-monorepo@workspace:private/eslint-plugin-monorepo": +"@react-native/eslint-plugin-monorepo@workspace:*, @react-native/eslint-plugin-monorepo@workspace:private/eslint-plugin-monorepo": version: 0.0.0-use.local resolution: "@react-native/eslint-plugin-monorepo@workspace:private/eslint-plugin-monorepo" dependencies: + hermes-estree: "npm:0.29.1" jsonc-eslint-parser: "npm:^2.3.0" languageName: unknown linkType: soft -"@react-native/eslint-plugin-specs@workspace:packages/eslint-plugin-specs": +"@react-native/eslint-plugin-specs@workspace:*, @react-native/eslint-plugin-specs@workspace:packages/eslint-plugin-specs": version: 0.0.0-use.local resolution: "@react-native/eslint-plugin-specs@workspace:packages/eslint-plugin-specs" dependencies: @@ -3443,6 +3473,12 @@ __metadata: "@react-native/fantom@workspace:private/react-native-fantom": version: 0.0.0-use.local resolution: "@react-native/fantom@workspace:private/react-native-fantom" + dependencies: + jest-docblock: "npm:^29.7.0" + jest-message-util: "npm:^29.7.0" + metro: "npm:^0.82.5" + metro-config: "npm:^0.82.5" + source-map: "npm:^0.7.4" peerDependencies: jest: ^29.7.0 jest-snapshot: ^29.7.0 @@ -3468,6 +3504,7 @@ __metadata: "@babel/core": "npm:^7.25.2" "@react-native/babel-preset": "workspace:*" hermes-parser: "npm:0.29.1" + metro-babel-transformer: "npm:^0.82.5" nullthrows: "npm:^1.1.1" peerDependencies: "@babel/core": "*" @@ -10074,7 +10111,7 @@ __metadata: languageName: node linkType: hard -"metro-babel-transformer@npm:0.82.5": +"metro-babel-transformer@npm:0.82.5, metro-babel-transformer@npm:^0.82.5": version: 0.82.5 resolution: "metro-babel-transformer@npm:0.82.5" dependencies: @@ -12813,6 +12850,13 @@ __metadata: languageName: node linkType: hard +"source-map@npm:^0.7.4": + version: 0.7.6 + resolution: "source-map@npm:0.7.6" + checksum: 10c0/59f6f05538539b274ba771d2e9e32f6c65451982510564438e048bc1352f019c6efcdc6dd07909b1968144941c14015c2c7d4369fb7c4d7d53ae769716dcc16c + languageName: node + linkType: hard + "spawndamnit@npm:^3.0.1": version: 3.0.1 resolution: "spawndamnit@npm:3.0.1" From aa0bcc9f5a8b4ca6acb4d60ee05bdd2a9827c8c3 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 10:24:44 -0700 Subject: [PATCH 04/10] fix(build-types): normalize resolved import paths and refresh API snapshot Under the pnpm linker, API Extractor emitted module specifiers via their on-disk (symlinked) path, e.g. .../node_modules/@react-native-macos/virtualized-lists. Normalize these back to a bare package name in the generated snapshot so it is deterministic regardless of linker, and regenerate the (previously stale) ReactNativeApi.d.ts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-native/ReactNativeApi.d.ts | 888 +++++++++------------- scripts/build-types/BuildApiSnapshot.js | 5 + 2 files changed, 371 insertions(+), 522 deletions(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 999c3f8916a2..c960440d801f 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -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. * - * @generated SignedSource<> + * @generated SignedSource<<901ac341043bc76e96f9be80fa82a76a>> * * This file was generated by scripts/build-types/index.js. */ @@ -21,7 +21,16 @@ /* eslint-disable redundant-undefined/redundant-undefined */ +import { ListRenderItem } from "@react-native-macos/virtualized-lists" +import { ListRenderItemInfo } from "@react-native-macos/virtualized-lists" import * as React from "react" +import { ScrollToLocationParamsType } from "@react-native-macos/virtualized-lists" +import { SectionBase } from "@react-native-macos/virtualized-lists" +import type { SectionData as SectionListData } from "@react-native-macos/virtualized-lists" +import { Separators } from "@react-native-macos/virtualized-lists" +import { VirtualizedListProps } from "@react-native-macos/virtualized-lists" +import VirtualizedLists from "@react-native-macos/virtualized-lists" +import { VirtualizedSectionListProps } from "@react-native-macos/virtualized-lists" declare const $$AndroidSwitchNativeComponent: NativeType declare const $$AnimatedFlatList: ( props: Omit>, "ref"> & { @@ -78,14 +87,6 @@ declare const $$AnimatedView: AnimatedComponentType< > declare const $$flattenStyle: typeof flattenStyle_default declare const $$ImageViewNativeComponent: typeof ImageViewNativeComponent_default -declare const $$index: { - keyExtractor: typeof keyExtractor - get FillRateHelper(): FillRateHelperT - get ViewabilityHelper(): ViewabilityHelperT - get VirtualizedList(): VirtualizedListT - get VirtualizedListContextResetter(): VirtualizedListContextResetterT - get VirtualizedSectionList(): AnyVirtualizedSectionList -} declare const $$NativeDeviceInfo: typeof NativeDeviceInfo_default declare const $$NativeDialogManagerAndroid: null | Spec | undefined declare const $$ProgressBarAndroidNativeComponent: HostComponent @@ -104,6 +105,7 @@ declare const absoluteFillObject: { } declare const AccessibilityInfo: typeof AccessibilityInfo_default declare const AccessibilityInfo_default: { + isHighContrastEnabled: () => Promise addEventListener( eventName: K, handler: (...$$REST$$: AccessibilityEventDefinitions[K]) => void, @@ -179,6 +181,10 @@ declare const Clipboard: { } declare const codegenNativeCommands: typeof codegenNativeCommands_default declare const codegenNativeComponent: typeof codegenNativeComponent_default +declare const ColorWithSystemEffectMacOS: ( + color: ColorValue, + effect: SystemEffectMacOS, +) => ColorValue declare const compose: typeof composeStyles_default declare const create: ( obj: S & ____Styles_Internal, @@ -217,6 +223,7 @@ declare const divideImpl: ( ) => AnimatedDivision_default declare const DrawerLayoutAndroid: typeof DrawerLayoutAndroid_default declare const DynamicColorIOS: (tuple: DynamicColorIOSTuple) => ColorValue +declare const DynamicColorMacOS: (tuple: DynamicColorMacOSTuple) => ColorValue declare const Easing: typeof EasingStatic_default declare const EasingStatic_default: { back(s?: number): EasingFunction @@ -562,23 +569,8 @@ declare const Vibration_default: { declare const ViewNativeComponent_default: HostComponent declare const VirtualizedList: typeof VirtualizedListComponent_default declare const VirtualizedListComponent_default: VirtualizedListType -declare const VirtualizedListContext: React.Context declare const VirtualizedSectionList: typeof VirtualizedSectionList_default declare const VirtualizedSectionList_default: VirtualizedSectionListType -declare const VirtualizedSectionListComponent_default: < - ItemT, - SectionT extends SectionBase< - ItemT, - DefaultVirtualizedSectionT - > = DefaultVirtualizedSectionT, ->( - props: Omit, "ref"> & { - ref: React.Ref<{ - getListRef(): undefined | VirtualizedList_default - scrollToLocation(params: ScrollToLocationParamsType): void - }> - }, -) => React.ReactNode declare type ____BlendMode_Internal = | "color-burn" | "color-dodge" @@ -836,6 +828,7 @@ declare type ____TextStyle_Internal = Readonly< > declare type ____TextStyle_InternalBase = { readonly color?: ____ColorValue_Internal + readonly cursor?: CursorValue readonly fontFamily?: string readonly fontSize?: number readonly fontStyle?: "italic" | "normal" @@ -1007,7 +1000,6 @@ declare type $$AnimatedText = typeof $$AnimatedText declare type $$AnimatedView = typeof $$AnimatedView declare type $$flattenStyle = typeof $$flattenStyle declare type $$ImageViewNativeComponent = typeof $$ImageViewNativeComponent -declare type $$index = typeof $$index declare type $$NativeDeviceInfo = typeof $$NativeDeviceInfo declare type $$NativeDialogManagerAndroid = typeof $$NativeDialogManagerAndroid declare type $$ProgressBarAndroidNativeComponent = @@ -1049,7 +1041,8 @@ declare type AccessibilityActionName = | "magicTap" declare type AccessibilityEventDefinitions = AccessibilityEventDefinitionsAndroid & - AccessibilityEventDefinitionsIOS & { + AccessibilityEventDefinitionsIOS & + AccessibilityEventDefinitionsMacOS & { change: [boolean] reduceMotionChanged: [boolean] screenReaderChanged: [boolean] @@ -1071,6 +1064,9 @@ declare type AccessibilityEventDefinitionsIOS = { invertColorsChanged: [boolean] reduceTransparencyChanged: [boolean] } +declare type AccessibilityEventDefinitionsMacOS = { + highContrastChanged: [boolean] +} declare type AccessibilityEventTypes = "click" | "focus" | "viewHoverEnter" declare type AccessibilityInfo = typeof AccessibilityInfo declare type AccessibilityProps = Readonly< @@ -1140,6 +1136,7 @@ declare type AccessibilityRole = | "list" | "menu" | "menubar" + | "menubutton" | "menuitem" | "none" | "pager" @@ -1231,6 +1228,17 @@ declare class Alert { keyboardType?: string, options?: AlertOptions, ): void + static promptMacOS( + title: null | string | undefined, + message?: null | string | undefined, + callbackOrButtons?: + | (((text: string) => void) | null | undefined) + | AlertButtons, + type?: AlertType | null | undefined, + defaultInputs?: DefaultInputsArray, + modal?: boolean | null | undefined, + critical?: boolean | null | undefined, + ): void } declare type AlertButton = { isPreferred?: boolean @@ -1242,6 +1250,8 @@ declare type AlertButtons = Array declare type AlertButtonStyle = "cancel" | "default" | "destructive" declare type AlertOptions = { cancelable?: boolean + critical?: boolean + modal?: boolean onDismiss?: () => void userInterfaceStyle?: "dark" | "light" | "unspecified" } @@ -1603,8 +1613,6 @@ declare type AnimationConfig = { readonly useNativeDriver: boolean } declare type AnyAttributeType = AttributeType -declare type AnyVirtualizedSectionList = - typeof VirtualizedSectionListComponent_default declare type AppConfig = { appKey: string component?: ComponentProvider @@ -1755,6 +1763,7 @@ declare type ButtonProps = { readonly accessibilityHint?: string readonly accessibilityLabel?: string readonly accessibilityLanguage?: string + readonly accessibilityRole?: AccessibilityRole readonly accessibilityState?: AccessibilityState readonly accessible?: boolean readonly "aria-busy"?: boolean @@ -1777,48 +1786,18 @@ declare type ButtonProps = { readonly nextFocusRight?: number readonly nextFocusUp?: number readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown + readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown + readonly onBlur?: (e: BlurEvent) => void + readonly onFocus?: (e: FocusEvent) => void readonly testID?: string readonly title: string + readonly tooltip?: string readonly touchSoundDisabled?: boolean readonly onPress?: (event?: GestureResponderEvent) => unknown } declare type ButtonRef = React.ComponentRef declare function cancelHeadlessTask(taskId: number, taskKey: string): void declare type Category = string -declare type CellMetricProps = { - data: VirtualizedListProps["data"] - getItem: VirtualizedListProps["getItem"] - getItemCount: VirtualizedListProps["getItemCount"] - getItemLayout?: VirtualizedListProps["getItemLayout"] - keyExtractor?: VirtualizedListProps["keyExtractor"] -} -declare type CellMetrics = { - index: number - isMounted: boolean - length: number - offset: number -} -declare type CellRegion = { - first: number - isSpacer: boolean - last: number -} -declare type CellRendererProps = { - readonly cellKey: string - readonly children: React.ReactNode - readonly index: number - readonly item: ItemT - readonly style: StyleProp - readonly onFocusCapture?: (event: FocusEvent) => void - readonly onLayout?: (event: LayoutChangeEvent) => void -} -declare class CellRenderMask { - addCells(cells: { first: number; last: number }): void - constructor(numCells: number) - enumerateRegions(): ReadonlyArray - equals(other: CellRenderMask): boolean - numCells(): number -} declare type Clipboard = typeof Clipboard declare type CodeFrame = { readonly collapse?: boolean @@ -1857,6 +1836,7 @@ declare namespace CodegenTypes { declare type ColorListenerCallback = (value: ColorValue) => unknown declare type ColorSchemeName = "dark" | "light" | "unspecified" declare type ColorValue = ____ColorValue_Internal +declare type ColorWithSystemEffectMacOS = typeof ColorWithSystemEffectMacOS declare type ComponentProvider = () => React.ComponentType declare type ComponentProviderInstrumentationHook = ( component_: ComponentProvider, @@ -1881,28 +1861,6 @@ declare function configureNext( onAnimationDidFail?: OnAnimationDidFailCallback, ): void declare type ContentAvailable = 1 | null | void -declare type Context = { - readonly cellKey: string | undefined - readonly horizontal: boolean | undefined - readonly getOutermostParentListRef: () => React.ComponentRef - readonly getScrollMetrics: () => { - contentLength: number - dOffset: number - dt: number - offset: number - timestamp: number - velocity: number - visibleLength: number - zoomScale: number - } - readonly registerAsNestedChild: ($$PARAM_0$$: { - cellKey: string - ref: React.ComponentRef - }) => void - readonly unregisterAsNestedChild: ($$PARAM_0$$: { - ref: React.ComponentRef - }) => void -} declare function counterEvent(eventName: EventName, value: number): void declare type create = typeof create declare type createAnimatedComponent = typeof createAnimatedComponent @@ -1924,18 +1882,81 @@ declare function createPublicTextInstance( ownerDocument: ReactNativeDocument_default, ): ReadOnlyText_default declare type createPublicTextInstanceT = typeof createPublicTextInstance -declare type CursorValue = "auto" | "pointer" +declare type CursorValue = + | "alias" + | "all-scroll" + | "auto" + | "cell" + | "col-resize" + | "context-menu" + | "copy" + | "crosshair" + | "default" + | "e-resize" + | "ew-resize" + | "grab" + | "grabbing" + | "help" + | "move" + | "n-resize" + | "ne-resize" + | "nesw-resize" + | "no-drop" + | "none" + | "not-allowed" + | "ns-resize" + | "nw-resize" + | "nwse-resize" + | "pointer" + | "progress" + | "row-resize" + | "s-resize" + | "se-resize" + | "sw-resize" + | "text" + | "url" + | "vertical-text" + | "w-resize" + | "wait" + | "zoom-in" + | "zoom-out" declare type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal declare type DataDetectorTypesType = | "address" | "all" | "calendarEvent" + | "correction" + | "dash" | "flightNumber" + | "grammar" | "link" | "lookupSuggestion" | "none" + | "ortography" | "phoneNumber" + | "quote" + | "regularExpression" + | "replacement" + | "spelling" | "trackingNumber" + | "transitInformation" +declare type DataTransfer = { + readonly files: ReadonlyArray + readonly items: ReadonlyArray + readonly types: ReadonlyArray +} +declare type DataTransferFile = { + readonly height?: number + readonly name: string + readonly size?: number + readonly type: string | undefined + readonly uri: string + readonly width?: number +} +declare type DataTransferItem = { + readonly kind: string + readonly type: string | undefined +} declare type decay = typeof decay declare type DecayAnimationConfig = Readonly< AnimationConfig & { @@ -1949,14 +1970,15 @@ declare type DecayAnimationConfig = Readonly< } > declare type DecelerationRateType = "fast" | "normal" | number +declare type DefaultInputsArray = Array<{ + default?: string + placeholder?: string + style?: AlertButtonStyle +}> declare type DefaultSectionT = { [key: string]: any } declare type DefaultTypes = boolean | number | ReadonlyArray | string -declare type DefaultVirtualizedSectionT = { - [key: string]: any - data: any -} declare type delay = typeof delay declare interface DEPRECATED_RCTExport { readonly getConstants?: () => {} @@ -2009,8 +2031,10 @@ declare type DirectEventProps = { readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown readonly onAccessibilityEscape?: () => unknown readonly onAccessibilityTap?: () => unknown + readonly onInvertedDidChange?: () => unknown readonly onLayout?: (event: LayoutChangeEvent) => unknown readonly onMagicTap?: () => unknown + readonly onPreferredScrollerStyleDidChange?: (event: ScrollEvent) => unknown } declare type DisplayMetrics = { fontScale: number @@ -2076,6 +2100,16 @@ declare class DOMRectReadOnly_default { get y(): number } declare type Double = number +declare type DragEvent = NativeSyntheticEvent<{ + readonly clientX: number + readonly clientY: number + readonly dataTransfer?: DataTransfer + readonly pageX: number + readonly pageY: number + readonly timestamp: number +}> +declare type DraggedType = "fileUrl" | "image" | "string" +declare type DraggedTypesType = DraggedType | ReadonlyArray declare type DrawerLayoutAndroid = typeof DrawerLayoutAndroid declare class DrawerLayoutAndroid_default extends React.Component @@ -2144,6 +2178,13 @@ declare type DynamicColorIOSTuple = { highContrastLight?: ColorValue light: ColorValue } +declare type DynamicColorMacOS = typeof DynamicColorMacOS +declare type DynamicColorMacOSTuple = { + dark: ColorValue + highContrastDark?: ColorValue + highContrastLight?: ColorValue + light: ColorValue +} declare type Easing = typeof Easing declare type EasingFunction = (t: number) => number declare type EdgeInsetsOrSizeProp = RectOrSize @@ -2218,6 +2259,8 @@ declare type EventHandlers = { readonly onBlur: (event: BlurEvent) => void readonly onClick: (event: GestureResponderEvent) => void readonly onFocus: (event: FocusEvent) => void + readonly onKeyDown?: (event: KeyEvent) => void + readonly onKeyUp?: (event: KeyEvent) => void readonly onMouseEnter?: (event: MouseEvent) => void readonly onMouseLeave?: (event: MouseEvent) => void readonly onPointerEnter?: (event: PointerEvent) => void @@ -2256,34 +2299,6 @@ declare type FetchResult = { NoData: "UIBackgroundFetchResultNoData" ResultFailed: "UIBackgroundFetchResultFailed" } -declare class FillRateHelper_default { - activate(): void - static addListener(callback: ($$PARAM_0$$: FillRateInfo) => void): { - remove: () => void - } - computeBlankness( - props: CellMetricProps & { - initialNumToRender?: number - }, - cellsAroundViewport: { - first: number - last: number - }, - scrollMetrics: { - dOffset: number - offset: number - velocity: number - visibleLength: number - }, - ): number - constructor(listMetrics: ListMetricsAggregator_default) - deactivateAndFlush(): void - enabled(): boolean - static setMinSampleCount(minSampleCount: number): void - static setSampleRate(sampleRate: number): void -} -declare type FillRateHelperT = typeof FillRateHelper_default -declare type FillRateInfo = Info declare type FilterFunction = | { blur: number | string @@ -2355,18 +2370,38 @@ declare class FlatList extends React.PureComponent< viewPosition?: number }): void scrollToOffset(params: { animated?: boolean; offset: number }): void + selectRowAtIndex(index: number): void setNativeProps(props: { [$$Key$$: string]: unknown }): void } declare type FlatListBaseProps = RequiredFlatListProps & OptionalFlatListProps declare type FlatListProps = Omit< - VirtualizedListProps, + Omit< + VirtualizedListProps, + | "data" + | "getItem" + | "getItemCount" + | "getItemLayout" + | "keyExtractor" + | "renderItem" + >, + | "columnWrapperStyle" | "data" - | "getItem" - | "getItemCount" + | "enableSelectionOnKeyPress" + | "extraData" + | "fadingEdgeLength" | "getItemLayout" + | "horizontal" + | "initialNumToRender" + | "initialScrollIndex" + | "initialSelectedIndex" + | "inverted" | "keyExtractor" + | "numColumns" + | "removeClippedSubviews" | "renderItem" + | "strictMode" + | never > & FlatListBaseProps declare type flatten = typeof flatten @@ -2463,6 +2498,13 @@ declare function getSectionKeys(): ReadonlyArray declare function getSections(): Runnables declare type hairlineWidth = typeof hairlineWidth declare type Handle = number +declare type HandledKeyEvent = { + readonly altKey?: boolean + readonly ctrlKey?: boolean + readonly key: string + readonly metaKey?: boolean + readonly shiftKey?: boolean +} declare type Headers = { [name: string]: string } @@ -2638,6 +2680,7 @@ declare type ImagePropsBase = Readonly< | "children" | "onLayout" | "testID" + | "tooltip" > & { accessibilityLabel?: string accessible?: boolean @@ -2670,6 +2713,7 @@ declare type ImagePropsBase = Readonly< srcSet?: string testID?: string tintColor?: ColorValue + tooltip?: string width?: number } > @@ -2725,18 +2769,6 @@ declare type IndeterminateProgressBarAndroidStyleAttrProp = { | "SmallInverse" } declare type IndicatorSize = "large" | "small" | number -declare class Info { - any_blank_count: number - any_blank_ms: number - any_blank_speed_sum: number - mostly_blank_count: number - mostly_blank_ms: number - pixels_blank: number - pixels_sampled: number - pixels_scrolled: number - sample_count: number - total_time_spent: number -} declare type InnerViewInstance = React.ComponentRef declare type InputAccessoryView = typeof InputAccessoryView declare type InputAccessoryViewProps = { @@ -2854,7 +2886,6 @@ declare interface IPerformanceLogger { stopTimespan(key: string, timestamp?: number, extras?: Extras): void } declare function isEnabled(): boolean -declare type Item = any declare type Keyboard = typeof Keyboard declare class KeyboardAvoidingView extends React.Component< KeyboardAvoidingViewProps, @@ -2899,6 +2930,12 @@ declare type KeyboardEventEasing = | "keyboard" | "linear" declare type KeyboardEventName = keyof KeyboardEventDefinitions +declare type KeyboardEventProps = { + readonly keyDownEvents?: Array + readonly keyUpEvents?: Array + readonly onKeyDown?: (event: KeyEvent) => void + readonly onKeyUp?: (event: KeyEvent) => void +} declare class KeyboardImpl { addListener( eventType: K, @@ -2940,7 +2977,21 @@ declare type KeyboardTypeOptions = | KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS -declare function keyExtractor(item: any, index: number): string +declare type KeyEvent = NativeSyntheticEvent<{ + readonly altKey: boolean + readonly ArrowDown: boolean + readonly ArrowLeft: boolean + readonly ArrowRight: boolean + readonly ArrowUp: boolean + readonly capsLockKey: boolean + readonly ctrlKey: boolean + readonly functionKey: boolean + readonly helpKey: boolean + readonly key: string + readonly metaKey: boolean + readonly numericPadKey: boolean + readonly shiftKey: boolean +}> declare type KeysOfUnion = T extends any ? keyof T : never declare type LayoutAnimation = typeof LayoutAnimation declare type LayoutAnimationAnim = { @@ -3026,49 +3077,6 @@ declare class LinkingImpl extends NativeEventEmitter { }>, ): Promise } -declare class ListMetricsAggregator_default { - cartesianOffset(flowRelativeOffset: number): number - flowRelativeOffset( - layout: LayoutRectangle, - referenceContentLength?: null | number | undefined, - ): number - getAverageCellLength(): number - getCellMetrics( - index: number, - props: CellMetricProps, - ): CellMetrics | null | undefined - getCellMetricsApprox(index: number, props: CellMetricProps): CellMetrics - getCellOffsetApprox(index: number, props: CellMetricProps): number - getContentLength(): number - getHighestMeasuredCellIndex(): number - hasContentLength(): boolean - notifyCellLayout($$PARAM_0$$: { - cellIndex: number - cellKey: string - layout: LayoutRectangle - orientation: ListOrientation - }): boolean - notifyCellUnmounted(cellKey: string): void - notifyListContentLayout($$PARAM_0$$: { - layout: { - readonly height: number - readonly width: number - } - orientation: ListOrientation - }): void -} -declare type ListOrientation = { - horizontal: boolean - rtl: boolean -} -declare type ListRenderItem = ( - info: ListRenderItemInfo, -) => React.ReactNode -declare type ListRenderItemInfo = { - index: number - item: ItemT - separators: Separators -} declare type LogBox = typeof LogBox declare type LogData = { readonly category: Category @@ -3104,6 +3112,18 @@ declare type MacOSPlatform = { get isVision(): boolean get Version(): string } +declare type MacOSViewProps = { + readonly acceptsFirstMouse?: boolean + readonly allowsVibrancy?: boolean + readonly draggedTypes?: DraggedTypesType + readonly enableFocusRing?: boolean + readonly inverted?: boolean + readonly mouseDownCanMoveWindow?: boolean + readonly tooltip?: string + readonly onDragEnter?: (event: DragEvent) => void + readonly onDragLeave?: (event: DragEvent) => void + readonly onDrop?: (event: DragEvent) => void +} declare type Mapping = | AnimatedValue_default | AnimatedValueXY_default @@ -3197,6 +3217,7 @@ declare type MouseEvent = NativeSyntheticEvent<{ readonly timestamp: number }> declare type MouseEventProps = { + readonly onDoubleClick?: (event: MouseEvent) => void readonly onMouseEnter?: (event: MouseEvent) => void readonly onMouseLeave?: (event: MouseEvent) => void } @@ -3317,6 +3338,7 @@ declare type NativeScrollEvent = { readonly contentOffset: NativeScrollPoint readonly contentSize: NativeScrollSize readonly layoutMeasurement: NativeScrollSize + readonly preferredScrollerStyle?: string readonly responderIgnoreScroll?: boolean readonly targetContentOffset?: NativeScrollPoint readonly velocity?: NativeScrollVelocity @@ -3374,13 +3396,18 @@ declare type NativeTextProps = Readonly< } > declare type NativeTouchEvent = { + readonly altKey?: boolean + readonly button?: number readonly changedTouches: ReadonlyArray + readonly ctrlKey?: boolean readonly force?: number readonly identifier: number readonly locationX: number readonly locationY: number + readonly metaKey?: boolean readonly pageX: number readonly pageY: number + readonly shiftKey?: boolean readonly target: number | undefined readonly timestamp: number readonly touches: ReadonlyArray @@ -3424,6 +3451,7 @@ declare type OnAnimationDidFailCallback = () => void declare type OpaqueColorValue = NativeColorValue declare type OptionalFlatListProps = { columnWrapperStyle?: ViewStyleProp + enableSelectionOnKeyPress?: boolean extraData?: any fadingEdgeLength?: | (number | undefined) @@ -3434,6 +3462,7 @@ declare type OptionalFlatListProps = { horizontal?: boolean initialNumToRender?: number initialScrollIndex?: number + initialSelectedIndex?: number inverted?: boolean keyExtractor?: (item: ItemT, index: number) => string numColumns?: number @@ -3459,78 +3488,6 @@ declare type OptionalSectionListProps = { removeClippedSubviews?: boolean renderItem?: SectionListRenderItem } -declare type OptionalVirtualizedListProps = { - CellRendererComponent?: React.ComponentType> - debug?: boolean - disableVirtualization?: boolean - extraData?: any - horizontal?: boolean - initialNumToRender?: number - initialScrollIndex?: number - inverted?: boolean - ItemSeparatorComponent?: React.ComponentType - keyExtractor?: (item: Item, index: number) => string - ListEmptyComponent?: React.ComponentType | React.JSX.Element - ListFooterComponent?: React.ComponentType | React.JSX.Element - ListFooterComponentStyle?: StyleProp - ListHeaderComponent?: React.ComponentType | React.JSX.Element - ListHeaderComponentStyle?: StyleProp - ListItemComponent?: React.ComponentType | React.JSX.Element - maxToRenderPerBatch?: number - onEndReached?: (info: { distanceFromEnd: number }) => void - onEndReachedThreshold?: number - onRefresh?: () => void - onScrollToIndexFailed?: (info: { - averageItemLength: number - highestMeasuredFrameIndex: number - index: number - }) => void - onStartReached?: (info: { distanceFromStart: number }) => void - onStartReachedThreshold?: number - onViewableItemsChanged?: (info: { - changed: Array - viewableItems: Array - }) => void - persistentScrollbar?: boolean - progressViewOffset?: number - refreshControl?: React.JSX.Element - refreshing?: boolean - removeClippedSubviews?: boolean - renderItem?: ListRenderItem - updateCellsBatchingPeriod?: number - viewabilityConfig?: ViewabilityConfig - viewabilityConfigCallbackPairs?: Array - windowSize?: number - getItemLayout?: ( - data: any, - index: number, - ) => { - index: number - length: number - offset: number - } - renderScrollComponent?: (props: ScrollViewProps) => React.JSX.Element -} -declare type OptionalVirtualizedSectionListProps< - ItemT, - SectionT = DefaultVirtualizedSectionT, -> = { - onEndReached?: ($$PARAM_0$$: { distanceFromEnd: number }) => void - renderSectionFooter?: (info: { section: SectionT }) => null | React.ReactNode - renderSectionHeader?: (info: { section: SectionT }) => null | React.ReactNode - SectionSeparatorComponent?: React.ComponentType - stickySectionHeadersEnabled?: boolean - renderItem?: (info: { - index: number - item: ItemT - section: SectionT - separators: { - highlight: () => void - unhighlight: () => void - updateProps: (select: "leading" | "trailing", newProps: Object) => void - } - }) => null | React.ReactNode -} declare type OrientationChangeEvent = { readonly orientation: "landscape" | "portrait" } @@ -3577,6 +3534,11 @@ declare type PassThroughProps = { readonly passthroughAnimatedPropExplicitValues?: null | ViewProps } declare type PasswordRules = string +declare type PastedTypesType = PasteType | ReadonlyArray +declare type PasteEvent = NativeSyntheticEvent<{ + readonly dataTransfer: DataTransfer +}> +declare type PasteType = "fileUrl" | "image" | "string" declare type Permission = PermissionsType[keyof PermissionsType] declare type PermissionsAndroid = typeof PermissionsAndroid declare class PermissionsAndroidImpl { @@ -3739,10 +3701,12 @@ declare type PressabilityConfig = { readonly disabled?: boolean readonly hitSlop?: RectOrSize readonly minPressDuration?: number - readonly onBlur?: (event: BlurEvent) => unknown - readonly onFocus?: (event: FocusEvent) => unknown + readonly onBlur?: (event: BlurEvent) => void + readonly onFocus?: (event: FocusEvent) => void readonly onHoverIn?: (event: MouseEvent) => unknown readonly onHoverOut?: (event: MouseEvent) => unknown + readonly onKeyDown?: (event: KeyEvent) => void + readonly onKeyUp?: (event: KeyEvent) => void readonly onLongPress?: (event: GestureResponderEvent) => unknown readonly onPress?: (event: GestureResponderEvent) => unknown readonly onPressIn?: (event: GestureResponderEvent) => unknown @@ -3758,6 +3722,8 @@ declare type PressableAndroidRippleConfig = { radius?: number } declare type PressableBaseProps = { + readonly acceptsFirstMouse?: boolean + readonly allowsVibrancy?: boolean readonly android_disableSound?: boolean readonly android_ripple?: PressableAndroidRippleConfig readonly cancelable?: boolean @@ -3768,9 +3734,18 @@ declare type PressableBaseProps = { readonly delayHoverOut?: number readonly delayLongPress?: number readonly disabled?: boolean + readonly draggedTypes?: DraggedTypesType + readonly enableFocusRing?: boolean readonly hitSlop?: RectOrSize + readonly keyDownEvents?: Array + readonly keyUpEvents?: Array + readonly mouseDownCanMoveWindow?: boolean + readonly onBlur?: (event: BlurEvent) => void + readonly onFocus?: (event: FocusEvent) => void readonly onHoverIn?: (event: MouseEvent) => unknown readonly onHoverOut?: (event: MouseEvent) => unknown + readonly onKeyDown?: (event: KeyEvent) => void + readonly onKeyUp?: (event: KeyEvent) => void readonly onLayout?: (event: LayoutChangeEvent) => unknown readonly onLongPress?: (event: GestureResponderEvent) => unknown readonly onPress?: (event: GestureResponderEvent) => unknown @@ -3783,6 +3758,10 @@ declare type PressableBaseProps = { | ViewStyleProp readonly testID?: string readonly testOnly_pressed?: boolean + readonly tooltip?: string + readonly onDragEnter?: (event: DragEvent) => void + readonly onDragLeave?: (event: DragEvent) => void + readonly onDrop?: (event: DragEvent) => void } declare type PressableProps = Readonly< Omit & PressableBaseProps @@ -4156,17 +4135,6 @@ declare type RequiredFlatListProps = { declare type RequiredSectionListProps = { sections: ReadonlyArray> } -declare type RequiredVirtualizedListProps = { - data?: any - getItem: (data: any, index: number) => Item | undefined - getItemCount: (data: any) => number -} -declare type RequiredVirtualizedSectionListProps< - ItemT, - SectionT = DefaultVirtualizedSectionT, -> = { - sections: ReadonlyArray> -} declare type requireNativeComponent = typeof requireNativeComponent declare type ResolvedAssetSource = { readonly height: number | undefined @@ -4311,13 +4279,6 @@ declare type ScheduleLocalNotificationDetails = } declare type ScrollEvent = NativeSyntheticEvent declare type ScrollResponderType = ScrollViewImperativeMethods -declare type ScrollToLocationParamsType = { - animated?: boolean - itemIndex: number - sectionIndex: number - viewOffset?: number - viewPosition?: number -} declare type ScrollView = typeof ScrollView declare type ScrollViewBaseProps = { readonly children?: React.ReactNode @@ -4325,8 +4286,10 @@ declare type ScrollViewBaseProps = { readonly contentOffset?: PointProp readonly decelerationRate?: DecelerationRateType readonly disableIntervalMomentum?: boolean + readonly hasOverlayStyleIndicator?: boolean readonly horizontal?: boolean readonly innerViewRef?: React.Ref + readonly inverted?: boolean readonly invertStickyHeaders?: boolean readonly keyboardDismissMode?: "interactive" | "none" | "on-drag" readonly keyboardShouldPersistTaps?: @@ -4529,28 +4492,6 @@ declare type ScrollViewStickyHeaderProps = { readonly scrollViewHeight: number | undefined readonly onLayout: (event: LayoutChangeEvent) => void } -declare type SectionBase< - SectionItemT, - SectionT = DefaultVirtualizedSectionT, -> = { - data: ReadonlyArray - ItemSeparatorComponent?: React.ComponentType - key?: string - renderItem?: (info: { - index: number - item: SectionItemT - section: SectionListData - separators: { - highlight: () => void - unhighlight: () => void - updateProps: (select: "leading" | "trailing", newProps: Object) => void - } - }) => null | React.JSX.Element - keyExtractor?: ( - item: SectionItemT | undefined, - index?: number | undefined, - ) => string -} declare class SectionList< ItemT = any, SectionT = DefaultSectionT, @@ -4564,13 +4505,6 @@ declare class SectionList< scrollToLocation(params: ScrollToLocationParamsType): void setNativeProps(props: Object): void } -declare type SectionListData< - SectionItemT, - SectionT = DefaultVirtualizedSectionT, -> = - | (Readonly> & SectionT) - | (SectionBase & SectionT) - | SectionT declare type SectionListProps = Omit< Omit< VirtualizedSectionListProps, @@ -4594,18 +4528,13 @@ declare type SectionListRenderItem = ( declare type SectionListRenderItemInfo< ItemT, SectionT = DefaultSectionT, -> = ListRenderItemInfo & { +> = Omit, "section"> & { section: SectionListData } declare type Selection = { readonly end: number readonly start: number } -declare type Separators = { - highlight: () => void - unhighlight: () => void - updateProps: (select: "leading" | "trailing", newProps: Object) => void -} declare type sequence = typeof sequence declare function setColorScheme( colorScheme: ColorSchemeName | null | undefined, @@ -4623,6 +4552,11 @@ declare function setSurfaceProps( appParameters: Object, displayMode?: number, ): void +declare type SettingChangeEvent = NativeSyntheticEvent<{ + readonly autoCorrectEnabled: boolean + readonly grammarCheckEnabled: boolean + readonly spellCheckEnabled: boolean +}> declare type Settings = typeof Settings declare function setWrapperComponentProvider( provider: WrapperComponentProvider, @@ -4859,34 +4793,6 @@ declare function startHeadlessTask( taskKey: string, data: any, ): void -declare type State = { - cellsAroundViewport: { - first: number - last: number - } - firstVisibleItemKey: string | undefined - pendingScrollUpdateCount: number - renderMask: CellRenderMask -} -declare class StateSafePureComponent_default< - Props, - State extends {}, -> extends React.PureComponent { - constructor(props: Props) - setState( - partialState: - | ( - | (( - $$PARAM_0$$: State, - $$PARAM_1$$: Props, - ) => null | Pick | undefined) - | Pick - ) - | null - | undefined, - callback?: () => unknown, - ): void -} declare class StatusBar extends React.Component { static currentHeight: null | number | undefined componentDidMount(): void @@ -4924,9 +4830,9 @@ declare type StatusBarPropsIOS = { readonly showHideTransition?: "fade" | "none" | "slide" } declare type StatusBarStyle = keyof { - "dark-content": string + "dark-content": ColorValue default: string - "light-content": string + "light-content": ColorValue } declare type StickyHeaderComponentType = ( props: ScrollViewStickyHeaderProps & { @@ -4954,6 +4860,14 @@ declare namespace StyleSheet { } } declare type SubmitBehavior = "blurAndSubmit" | "newline" | "submit" +declare type SubmitKeyEvent = { + readonly altKey?: boolean + readonly ctrlKey?: boolean + readonly functionKey?: boolean + readonly key: string + readonly metaKey?: boolean + readonly shiftKey?: boolean +} declare type subtract = typeof subtract declare type Switch = typeof Switch declare type SwitchChangeEvent = NativeSyntheticEvent @@ -4997,6 +4911,12 @@ declare type SwitchPropsIOS = { declare type SwitchRef = React.ComponentRef< typeof $$AndroidSwitchNativeComponent | typeof $$SwitchNativeComponent > +declare type SystemEffectMacOS = + | "deepPressed" + | "disabled" + | "none" + | "pressed" + | "rollover" declare namespace Systrace { export { isEnabled, @@ -5211,7 +5131,7 @@ declare type TextInputBaseProps = { readonly onChangeText?: (text: string) => unknown readonly onContentSizeChange?: (e: TextInputContentSizeChangeEvent) => unknown readonly onEndEditing?: (e: TextInputEndEditingEvent) => unknown - readonly onFocus?: (e: TextInputFocusEvent) => unknown + readonly onFocus?: (e: TextInputFocusEvent) => void readonly onKeyPress?: (e: TextInputKeyPressEvent) => unknown readonly onPress?: (event: GestureResponderEvent) => unknown readonly onPressIn?: (event: GestureResponderEvent) => unknown @@ -5249,6 +5169,8 @@ declare type TextInputComponentStatics = { readonly currentlyFocusedField: () => number | undefined readonly currentlyFocusedInput: () => HostInstance | undefined readonly focusTextInput: (textField: HostInstance | undefined) => void + readonly onTextInputBlur: (textField: HostInstance | undefined) => void + readonly onTextInputFocus: (textField: HostInstance | undefined) => void } } declare type TextInputContentSizeChangeEvent = @@ -5273,6 +5195,7 @@ declare interface TextInputInstance extends HostInstance { readonly clear: () => void readonly getNativeRef: () => HostInstance | undefined readonly isFocused: () => boolean + readonly setGhostText: (ghostText: string | undefined) => void readonly setSelection: (start: number, end: number) => void } declare type TextInputIOSProps = { @@ -5318,11 +5241,28 @@ declare type TextInputKeyPressEventData = Readonly< target?: number } > +declare type TextInputMacOSProps = { + readonly clearTextOnSubmit?: boolean + readonly grammarCheck?: boolean + readonly hideVerticalScrollIndicator?: boolean + readonly keyDownEvents?: ReadonlyArray + readonly keyUpEvents?: ReadonlyArray + readonly onAutoCorrectChange?: (e: SettingChangeEvent) => unknown + readonly onGrammarCheckChange?: (e: SettingChangeEvent) => unknown + readonly onKeyDown?: (e: KeyEvent) => unknown + readonly onKeyUp?: (e: KeyEvent) => unknown + readonly onSpellCheckChange?: (e: SettingChangeEvent) => unknown + readonly pastedTypes?: PastedTypesType + readonly submitKeyEvents?: ReadonlyArray + readonly tooltip?: string + readonly onPaste?: (event: PasteEvent) => void +} declare type TextInputProps = Readonly< Omit & TextInputIOSProps & TextInputAndroidProps & - TextInputBaseProps + TextInputBaseProps & + TextInputMacOSProps > declare type TextInputSelectionChangeEvent = NativeSyntheticEvent @@ -5362,6 +5302,7 @@ declare type TextProps = Readonly< TextPointerEventProps & TextPropsIOS & TextPropsAndroid & + TextPropsMacOS & TextBaseProps & AccessibilityProps > @@ -5390,6 +5331,11 @@ declare type TextPropsIOS = { lineBreakStrategyIOS?: "hangul-word" | "none" | "push-out" | "standard" suppressHighlighting?: boolean } +declare type TextPropsMacOS = { + enableFocusRing?: boolean + focusable?: boolean + tooltip?: string +} declare type TextStyle = ____TextStyle_Internal declare type TextStyleProp = ____TextStyleProp_Internal declare type Timespan = { @@ -5549,8 +5495,8 @@ declare type TouchableWithoutFeedbackProps = Readonly< importantForAccessibility?: "auto" | "no-hide-descendants" | "no" | "yes" nativeID?: string onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown - onBlur?: (event: BlurEvent) => unknown - onFocus?: (event: FocusEvent) => unknown + onBlur?: (event: BlurEvent) => void + onFocus?: (event: FocusEvent) => void onLayout?: (event: LayoutChangeEvent) => unknown onLongPress?: (event: GestureResponderEvent) => unknown onPress?: (event: GestureResponderEvent) => unknown @@ -5565,7 +5511,17 @@ declare type TouchableWithoutFeedbackProps = Readonly< declare type TouchableWithoutFeedbackPropsAndroid = { touchSoundDisabled?: boolean } -declare type TouchableWithoutFeedbackPropsIOS = {} +declare type TouchableWithoutFeedbackPropsIOS = { + acceptsFirstMouse?: boolean + draggedTypes?: DraggedTypesType + enableFocusRing?: boolean + tooltip?: string + onDragEnter?: (event: DragEvent) => void + onDragLeave?: (event: DragEvent) => void + onDrop?: (event: DragEvent) => void + onMouseEnter?: (event: MouseEvent) => void + onMouseLeave?: (event: MouseEvent) => void +} declare type TouchEventProps = { readonly onTouchCancel?: (e: GestureResponderEvent) => void readonly onTouchCancelCapture?: (e: GestureResponderEvent) => void @@ -5629,55 +5585,6 @@ declare function View( ref?: React.Ref> }, ): React.ReactNode -declare type ViewabilityConfig = { - readonly itemVisiblePercentThreshold?: number - readonly minimumViewTime?: number - readonly viewAreaCoveragePercentThreshold?: number - readonly waitForInteraction?: boolean -} -declare type ViewabilityConfigCallbackPair = { - viewabilityConfig: ViewabilityConfig - onViewableItemsChanged: (info: { - changed: Array - viewableItems: Array - }) => void -} -declare class ViewabilityHelper_default { - computeViewableItems( - props: CellMetricProps, - scrollOffset: number, - viewportHeight: number, - listMetrics: ListMetricsAggregator_default, - renderRange?: { - first: number - last: number - }, - ): Array - constructor(config?: ViewabilityConfig) - dispose(): void - onUpdate( - props: CellMetricProps, - scrollOffset: number, - viewportHeight: number, - listMetrics: ListMetricsAggregator_default, - createViewToken: ( - index: number, - isViewable: boolean, - props: CellMetricProps, - ) => ViewToken, - onViewableItemsChanged: ($$PARAM_0$$: { - changed: Array - viewableItems: Array - }) => void, - renderRange?: { - first: number - last: number - }, - ): void - recordInteraction(): void - resetViewableIndices(): void -} -declare type ViewabilityHelperT = typeof ViewabilityHelper_default declare type ViewBaseProps = { readonly children?: React.ReactNode readonly collapsable?: boolean @@ -5728,8 +5635,10 @@ declare type ViewProps = Readonly< PointerEventProps & FocusEventProps & TouchEventProps & + KeyboardEventProps & ViewPropsAndroid & ViewPropsIOS & + MacOSViewProps & AccessibilityProps & ViewBaseProps > @@ -5752,79 +5661,11 @@ declare type ViewPropsIOS = { } declare type ViewStyle = ____ViewStyle_Internal declare type ViewStyleProp = ____ViewStyleProp_Internal -declare type ViewToken = { - index: number | undefined - isViewable: boolean - item: any - key: string - section?: any -} declare type VirtualizedList = typeof VirtualizedList -declare class VirtualizedList_default extends StateSafePureComponent_default< - VirtualizedListProps, - State -> { - static contextType: typeof VirtualizedListContext - state: State - componentDidMount(): void - componentDidUpdate(prevProps: VirtualizedListProps): void - componentWillUnmount(): void - constructor(props: VirtualizedListProps) - flashScrollIndicators(): void - static getDerivedStateFromProps( - newProps: VirtualizedListProps, - prevState: State, - ): State - getScrollableNode(): null | number | undefined - getScrollRef(): null | React.ComponentRef | undefined - getScrollResponder(): null | ScrollResponderType | undefined - hasMore(): boolean - measureLayoutRelativeToContainingList(): void - recordInteraction(): void - render(): React.ReactNode - scrollToEnd( - params?: - | null - | undefined - | { - animated?: boolean - }, - ): void - scrollToIndex(params: { - animated?: boolean - index: number - viewOffset?: number - viewPosition?: number - }): any - scrollToItem(params: { - animated?: boolean - item: Item - viewOffset?: number - viewPosition?: number - }): void - scrollToOffset(params: { animated?: boolean; offset: number }): void - setNativeProps(props: Object): void -} -declare type VirtualizedListContext = typeof VirtualizedListContext -declare function VirtualizedListContextResetter($$PARAM_0$$: { - children: React.ReactNode -}): React.ReactNode -declare type VirtualizedListContextResetterT = - typeof VirtualizedListContextResetter -declare type VirtualizedListProps = ScrollViewProps & - RequiredVirtualizedListProps & - OptionalVirtualizedListProps -declare type VirtualizedListT = typeof VirtualizedList_default -declare type VirtualizedListT_2 = typeof VirtualizedList_default -declare type VirtualizedListType = typeof $$index.VirtualizedList +declare type VirtualizedListType = typeof VirtualizedLists.VirtualizedList declare type VirtualizedSectionList = typeof VirtualizedSectionList -declare type VirtualizedSectionListProps< - ItemT, - SectionT = DefaultVirtualizedSectionT, -> = RequiredVirtualizedSectionListProps & - OptionalVirtualizedSectionListProps & - Omit -declare type VirtualizedSectionListType = typeof $$index.VirtualizedSectionList +declare type VirtualizedSectionListType = + typeof VirtualizedLists.VirtualizedSectionList declare enum VirtualViewMode { Hidden = 2, Prerender = 1, @@ -5912,23 +5753,23 @@ declare type WrapperComponentProvider = ( export { AccessibilityActionEvent, // 9247c3f0 AccessibilityInfo, // 70604904 - AccessibilityProps, // 5a2836fc - AccessibilityRole, // f2f2e066 + AccessibilityProps, // d961eb5c + AccessibilityRole, // 3cf8c6c5 AccessibilityState, // b0c2b3f7 AccessibilityValue, // cf8bcb74 ActionSheetIOS, // 88e6bfb0 ActionSheetIOSOptions, // 1756eb5a ActivityIndicator, // 8d041a45 - ActivityIndicatorProps, // 0edeb628 - Alert, // 5bf12165 + ActivityIndicatorProps, // 097c4116 + Alert, // 24958ab5 AlertButton, // bf1a3b60 AlertButtonStyle, // ec9fb242 - AlertOptions, // a0cdac0f + AlertOptions, // 39b16cfa AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // b3949f33 + Animated, // 72e7bf88 AppConfig, // ebddad4b - AppRegistry, // 6cdee1d6 + AppRegistry, // eb54df94 AppState, // f7097b1b AppStateEvent, // 80f034c3 AppStateStatus, // 447e5ef2 @@ -5939,14 +5780,15 @@ export { BlurEvent, // ab745200 BoxShadowValue, // b679703f Button, // dd130b61 - ButtonProps, // 99495f51 + ButtonProps, // 48492067 Clipboard, // 9b8c878e CodegenTypes, // 1b38ac82 ColorSchemeName, // 31a4350e ColorValue, // 98989a8f + ColorWithSystemEffectMacOS, // df1263b4 ComponentProvider, // b5c60ddd ComponentProviderInstrumentationHook, // 9f640048 - CursorValue, // 26522595 + CursorValue, // 2c77888f DevMenu, // 99e9fcd6 DevSettings, // 1a2f3a5f DeviceEventEmitter, // 31dc96e7 @@ -5958,11 +5800,13 @@ export { DisplayMetrics, // 1dc35cef DisplayMetricsAndroid, // 872e62eb DrawerLayoutAndroid, // 14121b61 - DrawerLayoutAndroidProps, // 11c0dfe2 + DrawerLayoutAndroidProps, // 1e182ba5 DrawerSlideEvent, // ad024574 DropShadowValue, // e9df2606 DynamicColorIOS, // 1f9b3410 DynamicColorIOSTuple, // 023ce58e + DynamicColorMacOS, // f47c1c7d + DynamicColorMacOSTuple, // 692ec192 Easing, // b624f91d EasingFunction, // 14aee4c0 EdgeInsetsValue, // bd44afe6 @@ -5972,12 +5816,12 @@ export { EventSubscription, // b8d084aa ExtendedExceptionData, // 5a6ccf5a FilterFunction, // bf24c0e3 - FlatList, // 0b12ef25 - FlatListProps, // d185db31 + FlatList, // 2d0f495e + FlatListProps, // ec6dc7bf FocusEvent, // 1dc2b592 FontVariant, // 7c7558bb - GestureResponderEvent, // 9c9a1b0d - GestureResponderHandlers, // 2c0e77cb + GestureResponderEvent, // 98a7d008 + GestureResponderHandlers, // 28a84dba Handle, // 2d65285d HostComponent, // b6281cf9 HostInstance, // b159a964 @@ -5985,30 +5829,30 @@ export { IOSKeyboardEvent, // e67bfe3a IgnorePattern, // ec6f6ece Image, // 04474205 - ImageBackground, // b588909c - ImageBackgroundProps, // f9de269c + ImageBackground, // d81f0f5b + ImageBackgroundProps, // c0a5d733 ImageErrorEvent, // 66044485 ImageLoadEvent, // 62e6be9b ImageProgressEventIOS, // 3d6ffb7a - ImageProps, // d77401e6 + ImageProps, // ffb1a3ed ImagePropsAndroid, // 9fd9bcbb - ImagePropsBase, // efd768f1 + ImagePropsBase, // ee772e03 ImagePropsIOS, // c788030b ImageRequireSource, // 681d683b ImageResolvedAssetSource, // f3060931 ImageSize, // 1c47cf88 ImageSource, // 48c7f316 ImageSourcePropType, // bfb5e5c6 - ImageStyle, // 8b22ac76 + ImageStyle, // 6d9dfbb6 ImageURISource, // 016eb083 InputAccessoryView, // 591855d8 - InputAccessoryViewProps, // 4b6f5450 + InputAccessoryViewProps, // fc574890 InputModeOptions, // 4e8581b9 Insets, // e7fe432a InteractionManager, // 301bfa63 Keyboard, // 87311c77 - KeyboardAvoidingView, // ab2d7999 - KeyboardAvoidingViewProps, // 8e348419 + KeyboardAvoidingView, // ce2a914e + KeyboardAvoidingViewProps, // 811bf314 KeyboardEvent, // c3f895d4 KeyboardEventEasing, // af4091c8 KeyboardEventName, // 59299ad6 @@ -6025,8 +5869,8 @@ export { LayoutConformanceProps, // 055f03b8 LayoutRectangle, // 6601b294 Linking, // 292de0a0 - ListRenderItem, // b5353fd8 - ListRenderItemInfo, // e8595b03 + ListRenderItem, + ListRenderItemInfo, LogBox, // b58880c6 LogData, // 89af6d4c MeasureInWindowOnSuccessCallback, // a285f598 @@ -6034,7 +5878,7 @@ export { MeasureOnSuccessCallback, // 82824e59 Modal, // 78e8a79d ModalBaseProps, // 574f2b2d - ModalProps, // 3fb62261 + ModalProps, // e09479a5 ModalPropsAndroid, // 515fb173 ModalPropsIOS, // 6053cb61 ModeChangeEvent, // 0dc5e81f @@ -6049,14 +5893,14 @@ export { NativeModules, // 1cf72876 NativeMouseEvent, // 2d5b5c9f NativePointerEvent, // 5f27ae9c - NativeScrollEvent, // caad7f53 + NativeScrollEvent, // 431aad2d NativeSyntheticEvent, // 29455160 - NativeTouchEvent, // 59b676df + NativeTouchEvent, // e9fce623 NativeUIEvent, // 44ac26ac Networking, // b674447b OpaqueColorValue, // 25f3fa5b PanResponder, // 98a9b6fc - PanResponderCallbacks, // 0567f479 + PanResponderCallbacks, // 49ff5e35 PanResponderGestureState, // 54baf558 PanResponderInstance, // c8b0d00c Permission, // 06473f4f @@ -6071,11 +5915,11 @@ export { PointerEvent, // 3c454015 Pressable, // 3c6e4eb9 PressableAndroidRippleConfig, // 42bc9727 - PressableProps, // 4d37b376 + PressableProps, // b5931c41 PressableStateCallbackType, // 9af36561 ProcessedColorValue, // 33f74304 ProgressBarAndroid, // 03e66cf5 - ProgressBarAndroidProps, // 9302458b + ProgressBarAndroidProps, // 570a1f9e PromiseTask, // 5102c862 PublicRootInstance, // 8040afd7 PublicTextInstance, // 7d73f802 @@ -6083,8 +5927,8 @@ export { PushNotificationIOS, // b4d1fe78 PushNotificationPermissions, // c2e7ae4f Rationale, // 5df1b1c1 - RefreshControl, // effd2a00 - RefreshControlProps, // fca5a05f + RefreshControl, // e4d31e08 + RefreshControlProps, // 91da4678 RefreshControlPropsAndroid, // 99f64c97 RefreshControlPropsIOS, // 72a36381 Registry, // e1ed403e @@ -6093,27 +5937,27 @@ export { Role, // af7b889d RootTag, // 3cd10504 RootTagContext, // 15b60335 - RootViewStyleProvider, // cc8d50e9 + RootViewStyleProvider, // 267bc77f Runnable, // 2cb32c54 Runnables, // d3749ae1 SafeAreaView, // 4364c7bb ScaledSize, // 07e417c7 - ScrollEvent, // 865efb2e + ScrollEvent, // 87a8bd23 ScrollResponderType, // 525b353d - ScrollToLocationParamsType, // d7ecdad1 + ScrollToLocationParamsType, ScrollView, // 7fb7c469 ScrollViewImperativeMethods, // 97a0b5ac - ScrollViewProps, // b276b839 + ScrollViewProps, // af322be8 ScrollViewPropsAndroid, // 84e2134b - ScrollViewPropsIOS, // a2902f33 + ScrollViewPropsIOS, // fd8eda6d ScrollViewScrollToOptions, // 3313411e - SectionBase, // 0ccaedac - SectionList, // ba8c31d9 - SectionListData, // 1c80bb2e - SectionListProps, // 177096d2 - SectionListRenderItem, // cffebb53 - SectionListRenderItemInfo, // 946c2128 - Separators, // 6a45f7e3 + SectionBase, + SectionList, // 1b65b322 + SectionListData, + SectionListProps, // d2fcd6f4 + SectionListRenderItem, // c118edfb + SectionListRenderItemInfo, // bd038703 + Separators, Settings, // 4282b0da Share, // e4591b32 ShareAction, // ead1004a @@ -6122,16 +5966,16 @@ export { ShareContent, // 7c627896 ShareOptions, // 800c3a4e SimpleTask, // 0e619d11 - StatusBar, // 5e08d563 + StatusBar, // e7cd8aa8 StatusBarAnimation, // 7fd047e6 StatusBarProps, // 06c98add - StatusBarStyle, // 986b2051 + StatusBarStyle, // 49e3b6de StyleProp, // fa0e9b4a StyleSheet, // 02b98c20 SubmitBehavior, // c4ddf490 Switch, // aebc9941 SwitchChangeEvent, // 056868be - SwitchProps, // 57b2101f + SwitchProps, // 9fe56453 Systrace, // b5aa21fc TVViewPropsIOS, // 330ce7b5 TargetedEvent, // 16e98910 @@ -6144,40 +5988,40 @@ export { TextInputContentSizeChangeEvent, // f6f7ecae TextInputEndEditingEvent, // 254671ea TextInputFocusEvent, // 29cebb63 - TextInputIOSProps, // 0d05a855 + TextInputIOSProps, // e8905f3e TextInputKeyPressEvent, // 8047f716 - TextInputProps, // 5cda62e0 + TextInputProps, // a1863973 TextInputSelectionChangeEvent, // 3a657f0b TextInputSubmitEditingEvent, // b350617f TextLayoutEvent, // e289bd3c - TextProps, // 0f0be34d - TextStyle, // f3404e2b + TextProps, // 90a80d06 + TextStyle, // 88ac4ff3 ToastAndroid, // b4875e35 Touchable, // 93eb6c63 TouchableHighlight, // b4304a98 - TouchableHighlightProps, // 7212b9cf - TouchableNativeFeedback, // 1562b2eb - TouchableNativeFeedbackProps, // 8a4eed44 + TouchableHighlightProps, // d1f0537e + TouchableNativeFeedback, // 4e736ea9 + TouchableNativeFeedbackProps, // ccfc56b6 TouchableOpacity, // 7e33acfd - TouchableOpacityProps, // 189c11df - TouchableWithoutFeedback, // d5fb023d - TouchableWithoutFeedbackProps, // 26d3cf4e + TouchableOpacityProps, // e1e0f0ae + TouchableWithoutFeedback, // 165173e0 + TouchableWithoutFeedbackProps, // 3e0cac05 TransformsStyle, // 65e70f18 TurboModule, // dfe29706 TurboModuleRegistry, // badfcca2 UIManager, // 8d2c8281 UTFSequence, // baacd11b Vibration, // 315e131d - View, // 75d9e33b - ViewProps, // 0ab8ceda - ViewPropsAndroid, // f3d007c3 + View, // 7ded047f + ViewProps, // f4470407 + ViewPropsAndroid, // ffa079f9 ViewPropsIOS, // 58ee19bf - ViewStyle, // c2db0e6e + ViewStyle, // c0170ec0 VirtualViewMode, // 85a69ef6 VirtualizedList, // 4d513939 - VirtualizedListProps, // 8526b87a + VirtualizedListProps, VirtualizedSectionList, // 446ba0df - VirtualizedSectionListProps, // de510cb4 + VirtualizedSectionListProps, WrapperComponentProvider, // 9cf3844c codegenNativeCommands, // e16d62f7 codegenNativeComponent, // ed4c8103 diff --git a/scripts/build-types/BuildApiSnapshot.js b/scripts/build-types/BuildApiSnapshot.js index 815f251b125f..48676652bba4 100644 --- a/scripts/build-types/BuildApiSnapshot.js +++ b/scripts/build-types/BuildApiSnapshot.js @@ -254,6 +254,11 @@ async function getProcessedSnapshotResult( const cleanedRollup = sourceRollup .replace(/\/\*[\s\S]*?\*\//gm, '') // Remove block comments .replace(/\\\\.*$/gm, '') // Remove inline comments + // Normalize module specifiers that resolved through node_modules back to a + // bare package name. Under Yarn's pnpm linker, API Extractor emits imports + // via the on-disk (symlinked) path, e.g. + // "../../react-native/node_modules/@react-native-macos/virtualized-lists". + .replace(/(from\s+["'])[^"']*\/node_modules\/([^"']+)(["'])/gm, '$1$2$3') .replace(/^\s+$/gm, '') // Clear whitespace-only lines .replace(/\n+/gm, '\n'); // Collapse empty lines From 1487d1d0afd5178c817883d919ebc6f254a1f5cc Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 10:24:44 -0700 Subject: [PATCH 05/10] ci: make yarn-install and code-analysis-bot pnpm-compatible - yarn-install action uses 'yarn install --immutable' instead of the deprecated '--non-interactive --frozen-lockfile'. The --non-interactive flag silently exits 1 under the pnpm linker; --immutable is Yarn's recommended replacement and works with both linkers. - code-analysis-bot filters blank lines so stray output under the pnpm linker does not shift its converter/JSON stream pairing and break parsing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/actions/yarn-install/action.yml | 2 +- private/react-native-bots/code-analysis-bot.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index cdb4a85c899e..efec6dbfbbec 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -9,7 +9,7 @@ runs: ATTEMPT=0 WAIT_TIME=20 while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - yarn install --non-interactive --frozen-lockfile && break + yarn install --immutable && break echo "yarn install failed. Retrying in $WAIT_TIME seconds..." sleep $WAIT_TIME ATTEMPT=$((ATTEMPT + 1)) diff --git a/private/react-native-bots/code-analysis-bot.js b/private/react-native-bots/code-analysis-bot.js index 258e68798245..e429fb05abd1 100644 --- a/private/react-native-bots/code-analysis-bot.js +++ b/private/react-native-bots/code-analysis-bot.js @@ -299,7 +299,13 @@ process.stdin.on('end', function () { // // cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; flow --json) | node code-analysis-bot.js - const lines = content.trim().split('\n'); + // Each linter contributes a `converter-name` line followed by a line of JSON. + // Filter out blank lines so stray output (e.g. an extra newline emitted under + // Yarn's pnpm linker) doesn't shift the pairing and break parsing. + const lines = content + .trim() + .split('\n') + .filter(line => line.trim() !== ''); for (let i = 0; i < Math.ceil(lines.length / 2); ++i) { const converter = converters[lines[i * 2]]; if (!converter) { From 2a41152245454e3f34d5d4123c33a489374e7e3d Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 14:26:51 -0700 Subject: [PATCH 06/10] refactor(deps): centralize per-package pnpm shims in packageExtensions Move the per-package phantom-dependency declarations out of individual package.json manifests and into a single packageExtensions block in .yarnrc.yml. This reverts seven upstream-tracked manifests to pristine, confining the pnpm-compat shims to the fork-only .yarnrc.yml so upstream merges stay clean. Only third-party deps are moved. The fork's yarn.config.cjs constraints inspect manifest deps and do not see packageExtensions entries; on release branches they pin @react-native/* deps to the release version, so any @react-native/* dep must remain in a manifest to stay governed. None of the moved deps are @react-native/*. Moved: - @react-native/codegen -> @babel/parser - @react-native/babel-plugin-codegen -> @babel/plugin-syntax-flow - @react-native/core-cli-utils -> metro - @react-native/metro-babel-transformer -> metro-babel-transformer - @react-native/compatibility-check -> invariant - @react-native/eslint-plugin-monorepo -> hermes-estree - @react-native/fantom -> jest-docblock, jest-message-util, metro, metro-config, source-map Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .yarnrc.yml | 35 +++++++++++++++++++ packages/babel-plugin-codegen/package.json | 3 +- packages/core-cli-utils/package.json | 5 +-- .../package.json | 3 -- packages/react-native-codegen/package.json | 1 - .../package.json | 3 +- private/eslint-plugin-monorepo/package.json | 1 - private/react-native-fantom/package.json | 7 ---- yarn.lock | 13 ------- 9 files changed, 38 insertions(+), 33 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index 955458e8f266..cd5c999309dd 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -5,3 +5,38 @@ nodeLinker: pnpm npmMinimalAgeGate: 7d yarnPath: .yarn/releases/yarn-4.12.0.cjs + +# [macOS] Declare direct dependencies that upstream package manifests omit and +# that were previously resolved only via a hoisted node_modules. The pnpm linker +# uses a strict, non-hoisted layout, so these must be declared. Centralizing them +# here (rather than editing each package.json) keeps the upstream-tracked +# manifests pristine and confines the pnpm-compat shims to this fork-only file. +# Third-party only: yarn.config.cjs constraints do not govern packageExtensions +# deps, so no @react-native/* workspace deps belong here (they must stay in a +# manifest to remain under release-branch version-pinning). +packageExtensions: + "@react-native/codegen@*": + dependencies: + "@babel/parser": "^7.25.2" + "@react-native/babel-plugin-codegen@*": + dependencies: + "@babel/plugin-syntax-flow": "^7.25.0" + "@react-native/core-cli-utils@*": + dependencies: + "metro": "^0.82.5" + "@react-native/metro-babel-transformer@*": + dependencies: + "metro-babel-transformer": "^0.82.5" + "@react-native/compatibility-check@*": + dependencies: + "invariant": "^2.2.4" + "@react-native/eslint-plugin-monorepo@*": + dependencies: + "hermes-estree": "0.29.1" + "@react-native/fantom@*": + dependencies: + "jest-docblock": "^29.7.0" + "jest-message-util": "^29.7.0" + "metro": "^0.82.5" + "metro-config": "^0.82.5" + "source-map": "^0.7.4" diff --git a/packages/babel-plugin-codegen/package.json b/packages/babel-plugin-codegen/package.json index 7d3e46169133..95e6c9606e3c 100644 --- a/packages/babel-plugin-codegen/package.json +++ b/packages/babel-plugin-codegen/package.json @@ -30,7 +30,6 @@ "@react-native/codegen": "workspace:*" }, "devDependencies": { - "@babel/core": "^7.25.2", - "@babel/plugin-syntax-flow": "^7.25.0" + "@babel/core": "^7.25.2" } } diff --git a/packages/core-cli-utils/package.json b/packages/core-cli-utils/package.json index e64ea09b3a64..8cd19ed06fcf 100644 --- a/packages/core-cli-utils/package.json +++ b/packages/core-cli-utils/package.json @@ -26,8 +26,5 @@ }, "files": [ "dist" - ], - "devDependencies": { - "metro": "^0.82.5" - } + ] } diff --git a/packages/react-native-babel-transformer/package.json b/packages/react-native-babel-transformer/package.json index 3f451ceb7c73..57b7835b0ec2 100644 --- a/packages/react-native-babel-transformer/package.json +++ b/packages/react-native-babel-transformer/package.json @@ -34,8 +34,5 @@ }, "peerDependencies": { "@babel/core": "*" - }, - "devDependencies": { - "metro-babel-transformer": "^0.82.5" } } diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 4ec918a50b45..455f1a0b5d50 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -30,7 +30,6 @@ "lib" ], "dependencies": { - "@babel/parser": "^7.25.2", "glob": "^7.1.1", "hermes-parser": "0.29.1", "invariant": "^2.2.4", diff --git a/packages/react-native-compatibility-check/package.json b/packages/react-native-compatibility-check/package.json index f8cd7125c40d..bb8f2095d966 100644 --- a/packages/react-native-compatibility-check/package.json +++ b/packages/react-native-compatibility-check/package.json @@ -30,8 +30,7 @@ "dist" ], "dependencies": { - "@react-native/codegen": "workspace:*", - "invariant": "^2.2.4" + "@react-native/codegen": "workspace:*" }, "devDependencies": { "flow-remove-types": "^2.237.2", diff --git a/private/eslint-plugin-monorepo/package.json b/private/eslint-plugin-monorepo/package.json index 31ba2b4411b0..ed92f37d19ca 100644 --- a/private/eslint-plugin-monorepo/package.json +++ b/private/eslint-plugin-monorepo/package.json @@ -4,7 +4,6 @@ "version": "0.0.0", "main": "index.js", "dependencies": { - "hermes-estree": "0.29.1", "jsonc-eslint-parser": "^2.3.0" } } diff --git a/private/react-native-fantom/package.json b/private/react-native-fantom/package.json index e6cb0fc0e2a0..6ac990e644a4 100644 --- a/private/react-native-fantom/package.json +++ b/private/react-native-fantom/package.json @@ -10,12 +10,5 @@ "peerDependencies": { "jest": "^29.7.0", "jest-snapshot": "^29.7.0" - }, - "dependencies": { - "jest-docblock": "^29.7.0", - "jest-message-util": "^29.7.0", - "metro": "^0.82.5", - "metro-config": "^0.82.5", - "source-map": "^0.7.4" } } diff --git a/yarn.lock b/yarn.lock index f14eaa69adab..6fa11991373f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3206,7 +3206,6 @@ __metadata: resolution: "@react-native/babel-plugin-codegen@workspace:packages/babel-plugin-codegen" dependencies: "@babel/core": "npm:^7.25.2" - "@babel/plugin-syntax-flow": "npm:^7.25.0" "@babel/traverse": "npm:^7.25.3" "@react-native/codegen": "workspace:*" languageName: unknown @@ -3305,7 +3304,6 @@ __metadata: resolution: "@react-native/codegen@workspace:packages/react-native-codegen" dependencies: "@babel/core": "npm:^7.25.2" - "@babel/parser": "npm:^7.25.2" "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" "@babel/plugin-transform-class-properties": "npm:^7.25.4" "@babel/plugin-transform-flow-strip-types": "npm:^7.25.2" @@ -3354,7 +3352,6 @@ __metadata: dependencies: "@react-native/codegen": "workspace:*" flow-remove-types: "npm:^2.237.2" - invariant: "npm:^2.2.4" rimraf: "npm:^3.0.2" languageName: unknown linkType: soft @@ -3362,8 +3359,6 @@ __metadata: "@react-native/core-cli-utils@workspace:packages/core-cli-utils": version: 0.0.0-use.local resolution: "@react-native/core-cli-utils@workspace:packages/core-cli-utils" - dependencies: - metro: "npm:^0.82.5" languageName: unknown linkType: soft @@ -3441,7 +3436,6 @@ __metadata: version: 0.0.0-use.local resolution: "@react-native/eslint-plugin-monorepo@workspace:private/eslint-plugin-monorepo" dependencies: - hermes-estree: "npm:0.29.1" jsonc-eslint-parser: "npm:^2.3.0" languageName: unknown linkType: soft @@ -3473,12 +3467,6 @@ __metadata: "@react-native/fantom@workspace:private/react-native-fantom": version: 0.0.0-use.local resolution: "@react-native/fantom@workspace:private/react-native-fantom" - dependencies: - jest-docblock: "npm:^29.7.0" - jest-message-util: "npm:^29.7.0" - metro: "npm:^0.82.5" - metro-config: "npm:^0.82.5" - source-map: "npm:^0.7.4" peerDependencies: jest: ^29.7.0 jest-snapshot: ^29.7.0 @@ -3504,7 +3492,6 @@ __metadata: "@babel/core": "npm:^7.25.2" "@react-native/babel-preset": "workspace:*" hermes-parser: "npm:0.29.1" - metro-babel-transformer: "npm:^0.82.5" nullthrows: "npm:^1.1.1" peerDependencies: "@babel/core": "*" From 3435cb5def517bd39e66520c97c3ca4ed1dd1ae9 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 15:00:16 -0700 Subject: [PATCH 07/10] chore: address review feedback on pnpm PR - Revert the upstream-inherited yarn-install action and code-analysis-bot changes. Those files only serve the upstream Test All workflow, which the fork does not use for gating; the fork's PR workflow installs with 'yarn install --immutable' and runs yarn lint/flow-check/format-check directly, so no changes to the upstream CI flow are needed. - Trim the verbose docsite/.yarnrc.yml comment to a single line. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/actions/yarn-install/action.yml | 2 +- docsite/.yarnrc.yml | 5 +---- private/react-native-bots/code-analysis-bot.js | 8 +------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index efec6dbfbbec..cdb4a85c899e 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -9,7 +9,7 @@ runs: ATTEMPT=0 WAIT_TIME=20 while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - yarn install --immutable && break + yarn install --non-interactive --frozen-lockfile && break echo "yarn install failed. Retrying in $WAIT_TIME seconds..." sleep $WAIT_TIME ATTEMPT=$((ATTEMPT + 1)) diff --git a/docsite/.yarnrc.yml b/docsite/.yarnrc.yml index 74e5fab651d6..536b1ca84086 100644 --- a/docsite/.yarnrc.yml +++ b/docsite/.yarnrc.yml @@ -1,5 +1,2 @@ -# The docsite is a standalone project (not part of the monorepo workspaces). -# Yarn merges .yarnrc.yml files hierarchically, so without this the docsite would -# inherit the monorepo root's `nodeLinker: pnpm`. Docusaurus relies on hoisted -# (non-strict) resolution, so keep the docsite on the node-modules linker. +# [macOS] Keep the standalone docsite on node-modules; Docusaurus needs hoisted deps. nodeLinker: node-modules diff --git a/private/react-native-bots/code-analysis-bot.js b/private/react-native-bots/code-analysis-bot.js index e429fb05abd1..258e68798245 100644 --- a/private/react-native-bots/code-analysis-bot.js +++ b/private/react-native-bots/code-analysis-bot.js @@ -299,13 +299,7 @@ process.stdin.on('end', function () { // // cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; flow --json) | node code-analysis-bot.js - // Each linter contributes a `converter-name` line followed by a line of JSON. - // Filter out blank lines so stray output (e.g. an extra newline emitted under - // Yarn's pnpm linker) doesn't shift the pairing and break parsing. - const lines = content - .trim() - .split('\n') - .filter(line => line.trim() !== ''); + const lines = content.trim().split('\n'); for (let i = 0; i < Math.ceil(lines.length / 2); ++i) { const converter = converters[lines[i * 2]]; if (!converter) { From 48ada008bad9c26ca4656b5430b0c76ab12003bd Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 15:17:06 -0700 Subject: [PATCH 08/10] chore: minimize fork diff and tag [macOS] carve-outs Audit of the pnpm branch to reduce divergence from upstream: - Drop the ReactNativeApi.d.ts regeneration and the BuildApiSnapshot.js import- path normalization. The API snapshot is only validated by the upstream Test All workflow, which the fork does not use; its PR workflow never runs build-types --validate. Reverting them returns two files to pristine (-893). - Shrink packages/rn-tester/metro.config.js to a single [macOS]-tagged line: keep upstream's 'metro-config' require and instead declare metro-config for @react-native/tester via packageExtensions, dropping the mergeConfig import rewrite. - Tag the fork-only nodeLinker line with [macOS]. - Drop the [macOS] tag from the docsite .yarnrc.yml comment (config-only file). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .yarnrc.yml | 5 +- docsite/.yarnrc.yml | 2 +- packages/react-native/ReactNativeApi.d.ts | 888 +++++++++++++--------- packages/rn-tester/metro.config.js | 9 +- scripts/build-types/BuildApiSnapshot.js | 5 - 5 files changed, 530 insertions(+), 379 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index cd5c999309dd..5808bc2ff139 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,6 +1,6 @@ enableScripts: false -nodeLinker: pnpm +nodeLinker: pnpm # [macOS] npmMinimalAgeGate: 7d @@ -30,6 +30,9 @@ packageExtensions: "@react-native/compatibility-check@*": dependencies: "invariant": "^2.2.4" + "@react-native/tester@*": + dependencies: + "metro-config": "^0.82.5" "@react-native/eslint-plugin-monorepo@*": dependencies: "hermes-estree": "0.29.1" diff --git a/docsite/.yarnrc.yml b/docsite/.yarnrc.yml index 536b1ca84086..dc4cc3e1cf71 100644 --- a/docsite/.yarnrc.yml +++ b/docsite/.yarnrc.yml @@ -1,2 +1,2 @@ -# [macOS] Keep the standalone docsite on node-modules; Docusaurus needs hoisted deps. +# Keep the standalone docsite on node-modules; Docusaurus needs hoisted deps. nodeLinker: node-modules diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index c960440d801f..999c3f8916a2 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -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. * - * @generated SignedSource<<901ac341043bc76e96f9be80fa82a76a>> + * @generated SignedSource<> * * This file was generated by scripts/build-types/index.js. */ @@ -21,16 +21,7 @@ /* eslint-disable redundant-undefined/redundant-undefined */ -import { ListRenderItem } from "@react-native-macos/virtualized-lists" -import { ListRenderItemInfo } from "@react-native-macos/virtualized-lists" import * as React from "react" -import { ScrollToLocationParamsType } from "@react-native-macos/virtualized-lists" -import { SectionBase } from "@react-native-macos/virtualized-lists" -import type { SectionData as SectionListData } from "@react-native-macos/virtualized-lists" -import { Separators } from "@react-native-macos/virtualized-lists" -import { VirtualizedListProps } from "@react-native-macos/virtualized-lists" -import VirtualizedLists from "@react-native-macos/virtualized-lists" -import { VirtualizedSectionListProps } from "@react-native-macos/virtualized-lists" declare const $$AndroidSwitchNativeComponent: NativeType declare const $$AnimatedFlatList: ( props: Omit>, "ref"> & { @@ -87,6 +78,14 @@ declare const $$AnimatedView: AnimatedComponentType< > declare const $$flattenStyle: typeof flattenStyle_default declare const $$ImageViewNativeComponent: typeof ImageViewNativeComponent_default +declare const $$index: { + keyExtractor: typeof keyExtractor + get FillRateHelper(): FillRateHelperT + get ViewabilityHelper(): ViewabilityHelperT + get VirtualizedList(): VirtualizedListT + get VirtualizedListContextResetter(): VirtualizedListContextResetterT + get VirtualizedSectionList(): AnyVirtualizedSectionList +} declare const $$NativeDeviceInfo: typeof NativeDeviceInfo_default declare const $$NativeDialogManagerAndroid: null | Spec | undefined declare const $$ProgressBarAndroidNativeComponent: HostComponent @@ -105,7 +104,6 @@ declare const absoluteFillObject: { } declare const AccessibilityInfo: typeof AccessibilityInfo_default declare const AccessibilityInfo_default: { - isHighContrastEnabled: () => Promise addEventListener( eventName: K, handler: (...$$REST$$: AccessibilityEventDefinitions[K]) => void, @@ -181,10 +179,6 @@ declare const Clipboard: { } declare const codegenNativeCommands: typeof codegenNativeCommands_default declare const codegenNativeComponent: typeof codegenNativeComponent_default -declare const ColorWithSystemEffectMacOS: ( - color: ColorValue, - effect: SystemEffectMacOS, -) => ColorValue declare const compose: typeof composeStyles_default declare const create: ( obj: S & ____Styles_Internal, @@ -223,7 +217,6 @@ declare const divideImpl: ( ) => AnimatedDivision_default declare const DrawerLayoutAndroid: typeof DrawerLayoutAndroid_default declare const DynamicColorIOS: (tuple: DynamicColorIOSTuple) => ColorValue -declare const DynamicColorMacOS: (tuple: DynamicColorMacOSTuple) => ColorValue declare const Easing: typeof EasingStatic_default declare const EasingStatic_default: { back(s?: number): EasingFunction @@ -569,8 +562,23 @@ declare const Vibration_default: { declare const ViewNativeComponent_default: HostComponent declare const VirtualizedList: typeof VirtualizedListComponent_default declare const VirtualizedListComponent_default: VirtualizedListType +declare const VirtualizedListContext: React.Context declare const VirtualizedSectionList: typeof VirtualizedSectionList_default declare const VirtualizedSectionList_default: VirtualizedSectionListType +declare const VirtualizedSectionListComponent_default: < + ItemT, + SectionT extends SectionBase< + ItemT, + DefaultVirtualizedSectionT + > = DefaultVirtualizedSectionT, +>( + props: Omit, "ref"> & { + ref: React.Ref<{ + getListRef(): undefined | VirtualizedList_default + scrollToLocation(params: ScrollToLocationParamsType): void + }> + }, +) => React.ReactNode declare type ____BlendMode_Internal = | "color-burn" | "color-dodge" @@ -828,7 +836,6 @@ declare type ____TextStyle_Internal = Readonly< > declare type ____TextStyle_InternalBase = { readonly color?: ____ColorValue_Internal - readonly cursor?: CursorValue readonly fontFamily?: string readonly fontSize?: number readonly fontStyle?: "italic" | "normal" @@ -1000,6 +1007,7 @@ declare type $$AnimatedText = typeof $$AnimatedText declare type $$AnimatedView = typeof $$AnimatedView declare type $$flattenStyle = typeof $$flattenStyle declare type $$ImageViewNativeComponent = typeof $$ImageViewNativeComponent +declare type $$index = typeof $$index declare type $$NativeDeviceInfo = typeof $$NativeDeviceInfo declare type $$NativeDialogManagerAndroid = typeof $$NativeDialogManagerAndroid declare type $$ProgressBarAndroidNativeComponent = @@ -1041,8 +1049,7 @@ declare type AccessibilityActionName = | "magicTap" declare type AccessibilityEventDefinitions = AccessibilityEventDefinitionsAndroid & - AccessibilityEventDefinitionsIOS & - AccessibilityEventDefinitionsMacOS & { + AccessibilityEventDefinitionsIOS & { change: [boolean] reduceMotionChanged: [boolean] screenReaderChanged: [boolean] @@ -1064,9 +1071,6 @@ declare type AccessibilityEventDefinitionsIOS = { invertColorsChanged: [boolean] reduceTransparencyChanged: [boolean] } -declare type AccessibilityEventDefinitionsMacOS = { - highContrastChanged: [boolean] -} declare type AccessibilityEventTypes = "click" | "focus" | "viewHoverEnter" declare type AccessibilityInfo = typeof AccessibilityInfo declare type AccessibilityProps = Readonly< @@ -1136,7 +1140,6 @@ declare type AccessibilityRole = | "list" | "menu" | "menubar" - | "menubutton" | "menuitem" | "none" | "pager" @@ -1228,17 +1231,6 @@ declare class Alert { keyboardType?: string, options?: AlertOptions, ): void - static promptMacOS( - title: null | string | undefined, - message?: null | string | undefined, - callbackOrButtons?: - | (((text: string) => void) | null | undefined) - | AlertButtons, - type?: AlertType | null | undefined, - defaultInputs?: DefaultInputsArray, - modal?: boolean | null | undefined, - critical?: boolean | null | undefined, - ): void } declare type AlertButton = { isPreferred?: boolean @@ -1250,8 +1242,6 @@ declare type AlertButtons = Array declare type AlertButtonStyle = "cancel" | "default" | "destructive" declare type AlertOptions = { cancelable?: boolean - critical?: boolean - modal?: boolean onDismiss?: () => void userInterfaceStyle?: "dark" | "light" | "unspecified" } @@ -1613,6 +1603,8 @@ declare type AnimationConfig = { readonly useNativeDriver: boolean } declare type AnyAttributeType = AttributeType +declare type AnyVirtualizedSectionList = + typeof VirtualizedSectionListComponent_default declare type AppConfig = { appKey: string component?: ComponentProvider @@ -1763,7 +1755,6 @@ declare type ButtonProps = { readonly accessibilityHint?: string readonly accessibilityLabel?: string readonly accessibilityLanguage?: string - readonly accessibilityRole?: AccessibilityRole readonly accessibilityState?: AccessibilityState readonly accessible?: boolean readonly "aria-busy"?: boolean @@ -1786,18 +1777,48 @@ declare type ButtonProps = { readonly nextFocusRight?: number readonly nextFocusUp?: number readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown - readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown - readonly onBlur?: (e: BlurEvent) => void - readonly onFocus?: (e: FocusEvent) => void readonly testID?: string readonly title: string - readonly tooltip?: string readonly touchSoundDisabled?: boolean readonly onPress?: (event?: GestureResponderEvent) => unknown } declare type ButtonRef = React.ComponentRef declare function cancelHeadlessTask(taskId: number, taskKey: string): void declare type Category = string +declare type CellMetricProps = { + data: VirtualizedListProps["data"] + getItem: VirtualizedListProps["getItem"] + getItemCount: VirtualizedListProps["getItemCount"] + getItemLayout?: VirtualizedListProps["getItemLayout"] + keyExtractor?: VirtualizedListProps["keyExtractor"] +} +declare type CellMetrics = { + index: number + isMounted: boolean + length: number + offset: number +} +declare type CellRegion = { + first: number + isSpacer: boolean + last: number +} +declare type CellRendererProps = { + readonly cellKey: string + readonly children: React.ReactNode + readonly index: number + readonly item: ItemT + readonly style: StyleProp + readonly onFocusCapture?: (event: FocusEvent) => void + readonly onLayout?: (event: LayoutChangeEvent) => void +} +declare class CellRenderMask { + addCells(cells: { first: number; last: number }): void + constructor(numCells: number) + enumerateRegions(): ReadonlyArray + equals(other: CellRenderMask): boolean + numCells(): number +} declare type Clipboard = typeof Clipboard declare type CodeFrame = { readonly collapse?: boolean @@ -1836,7 +1857,6 @@ declare namespace CodegenTypes { declare type ColorListenerCallback = (value: ColorValue) => unknown declare type ColorSchemeName = "dark" | "light" | "unspecified" declare type ColorValue = ____ColorValue_Internal -declare type ColorWithSystemEffectMacOS = typeof ColorWithSystemEffectMacOS declare type ComponentProvider = () => React.ComponentType declare type ComponentProviderInstrumentationHook = ( component_: ComponentProvider, @@ -1861,6 +1881,28 @@ declare function configureNext( onAnimationDidFail?: OnAnimationDidFailCallback, ): void declare type ContentAvailable = 1 | null | void +declare type Context = { + readonly cellKey: string | undefined + readonly horizontal: boolean | undefined + readonly getOutermostParentListRef: () => React.ComponentRef + readonly getScrollMetrics: () => { + contentLength: number + dOffset: number + dt: number + offset: number + timestamp: number + velocity: number + visibleLength: number + zoomScale: number + } + readonly registerAsNestedChild: ($$PARAM_0$$: { + cellKey: string + ref: React.ComponentRef + }) => void + readonly unregisterAsNestedChild: ($$PARAM_0$$: { + ref: React.ComponentRef + }) => void +} declare function counterEvent(eventName: EventName, value: number): void declare type create = typeof create declare type createAnimatedComponent = typeof createAnimatedComponent @@ -1882,81 +1924,18 @@ declare function createPublicTextInstance( ownerDocument: ReactNativeDocument_default, ): ReadOnlyText_default declare type createPublicTextInstanceT = typeof createPublicTextInstance -declare type CursorValue = - | "alias" - | "all-scroll" - | "auto" - | "cell" - | "col-resize" - | "context-menu" - | "copy" - | "crosshair" - | "default" - | "e-resize" - | "ew-resize" - | "grab" - | "grabbing" - | "help" - | "move" - | "n-resize" - | "ne-resize" - | "nesw-resize" - | "no-drop" - | "none" - | "not-allowed" - | "ns-resize" - | "nw-resize" - | "nwse-resize" - | "pointer" - | "progress" - | "row-resize" - | "s-resize" - | "se-resize" - | "sw-resize" - | "text" - | "url" - | "vertical-text" - | "w-resize" - | "wait" - | "zoom-in" - | "zoom-out" +declare type CursorValue = "auto" | "pointer" declare type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal declare type DataDetectorTypesType = | "address" | "all" | "calendarEvent" - | "correction" - | "dash" | "flightNumber" - | "grammar" | "link" | "lookupSuggestion" | "none" - | "ortography" | "phoneNumber" - | "quote" - | "regularExpression" - | "replacement" - | "spelling" | "trackingNumber" - | "transitInformation" -declare type DataTransfer = { - readonly files: ReadonlyArray - readonly items: ReadonlyArray - readonly types: ReadonlyArray -} -declare type DataTransferFile = { - readonly height?: number - readonly name: string - readonly size?: number - readonly type: string | undefined - readonly uri: string - readonly width?: number -} -declare type DataTransferItem = { - readonly kind: string - readonly type: string | undefined -} declare type decay = typeof decay declare type DecayAnimationConfig = Readonly< AnimationConfig & { @@ -1970,15 +1949,14 @@ declare type DecayAnimationConfig = Readonly< } > declare type DecelerationRateType = "fast" | "normal" | number -declare type DefaultInputsArray = Array<{ - default?: string - placeholder?: string - style?: AlertButtonStyle -}> declare type DefaultSectionT = { [key: string]: any } declare type DefaultTypes = boolean | number | ReadonlyArray | string +declare type DefaultVirtualizedSectionT = { + [key: string]: any + data: any +} declare type delay = typeof delay declare interface DEPRECATED_RCTExport { readonly getConstants?: () => {} @@ -2031,10 +2009,8 @@ declare type DirectEventProps = { readonly onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown readonly onAccessibilityEscape?: () => unknown readonly onAccessibilityTap?: () => unknown - readonly onInvertedDidChange?: () => unknown readonly onLayout?: (event: LayoutChangeEvent) => unknown readonly onMagicTap?: () => unknown - readonly onPreferredScrollerStyleDidChange?: (event: ScrollEvent) => unknown } declare type DisplayMetrics = { fontScale: number @@ -2100,16 +2076,6 @@ declare class DOMRectReadOnly_default { get y(): number } declare type Double = number -declare type DragEvent = NativeSyntheticEvent<{ - readonly clientX: number - readonly clientY: number - readonly dataTransfer?: DataTransfer - readonly pageX: number - readonly pageY: number - readonly timestamp: number -}> -declare type DraggedType = "fileUrl" | "image" | "string" -declare type DraggedTypesType = DraggedType | ReadonlyArray declare type DrawerLayoutAndroid = typeof DrawerLayoutAndroid declare class DrawerLayoutAndroid_default extends React.Component @@ -2178,13 +2144,6 @@ declare type DynamicColorIOSTuple = { highContrastLight?: ColorValue light: ColorValue } -declare type DynamicColorMacOS = typeof DynamicColorMacOS -declare type DynamicColorMacOSTuple = { - dark: ColorValue - highContrastDark?: ColorValue - highContrastLight?: ColorValue - light: ColorValue -} declare type Easing = typeof Easing declare type EasingFunction = (t: number) => number declare type EdgeInsetsOrSizeProp = RectOrSize @@ -2259,8 +2218,6 @@ declare type EventHandlers = { readonly onBlur: (event: BlurEvent) => void readonly onClick: (event: GestureResponderEvent) => void readonly onFocus: (event: FocusEvent) => void - readonly onKeyDown?: (event: KeyEvent) => void - readonly onKeyUp?: (event: KeyEvent) => void readonly onMouseEnter?: (event: MouseEvent) => void readonly onMouseLeave?: (event: MouseEvent) => void readonly onPointerEnter?: (event: PointerEvent) => void @@ -2299,6 +2256,34 @@ declare type FetchResult = { NoData: "UIBackgroundFetchResultNoData" ResultFailed: "UIBackgroundFetchResultFailed" } +declare class FillRateHelper_default { + activate(): void + static addListener(callback: ($$PARAM_0$$: FillRateInfo) => void): { + remove: () => void + } + computeBlankness( + props: CellMetricProps & { + initialNumToRender?: number + }, + cellsAroundViewport: { + first: number + last: number + }, + scrollMetrics: { + dOffset: number + offset: number + velocity: number + visibleLength: number + }, + ): number + constructor(listMetrics: ListMetricsAggregator_default) + deactivateAndFlush(): void + enabled(): boolean + static setMinSampleCount(minSampleCount: number): void + static setSampleRate(sampleRate: number): void +} +declare type FillRateHelperT = typeof FillRateHelper_default +declare type FillRateInfo = Info declare type FilterFunction = | { blur: number | string @@ -2370,38 +2355,18 @@ declare class FlatList extends React.PureComponent< viewPosition?: number }): void scrollToOffset(params: { animated?: boolean; offset: number }): void - selectRowAtIndex(index: number): void setNativeProps(props: { [$$Key$$: string]: unknown }): void } declare type FlatListBaseProps = RequiredFlatListProps & OptionalFlatListProps declare type FlatListProps = Omit< - Omit< - VirtualizedListProps, - | "data" - | "getItem" - | "getItemCount" - | "getItemLayout" - | "keyExtractor" - | "renderItem" - >, - | "columnWrapperStyle" + VirtualizedListProps, | "data" - | "enableSelectionOnKeyPress" - | "extraData" - | "fadingEdgeLength" + | "getItem" + | "getItemCount" | "getItemLayout" - | "horizontal" - | "initialNumToRender" - | "initialScrollIndex" - | "initialSelectedIndex" - | "inverted" | "keyExtractor" - | "numColumns" - | "removeClippedSubviews" | "renderItem" - | "strictMode" - | never > & FlatListBaseProps declare type flatten = typeof flatten @@ -2498,13 +2463,6 @@ declare function getSectionKeys(): ReadonlyArray declare function getSections(): Runnables declare type hairlineWidth = typeof hairlineWidth declare type Handle = number -declare type HandledKeyEvent = { - readonly altKey?: boolean - readonly ctrlKey?: boolean - readonly key: string - readonly metaKey?: boolean - readonly shiftKey?: boolean -} declare type Headers = { [name: string]: string } @@ -2680,7 +2638,6 @@ declare type ImagePropsBase = Readonly< | "children" | "onLayout" | "testID" - | "tooltip" > & { accessibilityLabel?: string accessible?: boolean @@ -2713,7 +2670,6 @@ declare type ImagePropsBase = Readonly< srcSet?: string testID?: string tintColor?: ColorValue - tooltip?: string width?: number } > @@ -2769,6 +2725,18 @@ declare type IndeterminateProgressBarAndroidStyleAttrProp = { | "SmallInverse" } declare type IndicatorSize = "large" | "small" | number +declare class Info { + any_blank_count: number + any_blank_ms: number + any_blank_speed_sum: number + mostly_blank_count: number + mostly_blank_ms: number + pixels_blank: number + pixels_sampled: number + pixels_scrolled: number + sample_count: number + total_time_spent: number +} declare type InnerViewInstance = React.ComponentRef declare type InputAccessoryView = typeof InputAccessoryView declare type InputAccessoryViewProps = { @@ -2886,6 +2854,7 @@ declare interface IPerformanceLogger { stopTimespan(key: string, timestamp?: number, extras?: Extras): void } declare function isEnabled(): boolean +declare type Item = any declare type Keyboard = typeof Keyboard declare class KeyboardAvoidingView extends React.Component< KeyboardAvoidingViewProps, @@ -2930,12 +2899,6 @@ declare type KeyboardEventEasing = | "keyboard" | "linear" declare type KeyboardEventName = keyof KeyboardEventDefinitions -declare type KeyboardEventProps = { - readonly keyDownEvents?: Array - readonly keyUpEvents?: Array - readonly onKeyDown?: (event: KeyEvent) => void - readonly onKeyUp?: (event: KeyEvent) => void -} declare class KeyboardImpl { addListener( eventType: K, @@ -2977,21 +2940,7 @@ declare type KeyboardTypeOptions = | KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS -declare type KeyEvent = NativeSyntheticEvent<{ - readonly altKey: boolean - readonly ArrowDown: boolean - readonly ArrowLeft: boolean - readonly ArrowRight: boolean - readonly ArrowUp: boolean - readonly capsLockKey: boolean - readonly ctrlKey: boolean - readonly functionKey: boolean - readonly helpKey: boolean - readonly key: string - readonly metaKey: boolean - readonly numericPadKey: boolean - readonly shiftKey: boolean -}> +declare function keyExtractor(item: any, index: number): string declare type KeysOfUnion = T extends any ? keyof T : never declare type LayoutAnimation = typeof LayoutAnimation declare type LayoutAnimationAnim = { @@ -3077,6 +3026,49 @@ declare class LinkingImpl extends NativeEventEmitter { }>, ): Promise } +declare class ListMetricsAggregator_default { + cartesianOffset(flowRelativeOffset: number): number + flowRelativeOffset( + layout: LayoutRectangle, + referenceContentLength?: null | number | undefined, + ): number + getAverageCellLength(): number + getCellMetrics( + index: number, + props: CellMetricProps, + ): CellMetrics | null | undefined + getCellMetricsApprox(index: number, props: CellMetricProps): CellMetrics + getCellOffsetApprox(index: number, props: CellMetricProps): number + getContentLength(): number + getHighestMeasuredCellIndex(): number + hasContentLength(): boolean + notifyCellLayout($$PARAM_0$$: { + cellIndex: number + cellKey: string + layout: LayoutRectangle + orientation: ListOrientation + }): boolean + notifyCellUnmounted(cellKey: string): void + notifyListContentLayout($$PARAM_0$$: { + layout: { + readonly height: number + readonly width: number + } + orientation: ListOrientation + }): void +} +declare type ListOrientation = { + horizontal: boolean + rtl: boolean +} +declare type ListRenderItem = ( + info: ListRenderItemInfo, +) => React.ReactNode +declare type ListRenderItemInfo = { + index: number + item: ItemT + separators: Separators +} declare type LogBox = typeof LogBox declare type LogData = { readonly category: Category @@ -3112,18 +3104,6 @@ declare type MacOSPlatform = { get isVision(): boolean get Version(): string } -declare type MacOSViewProps = { - readonly acceptsFirstMouse?: boolean - readonly allowsVibrancy?: boolean - readonly draggedTypes?: DraggedTypesType - readonly enableFocusRing?: boolean - readonly inverted?: boolean - readonly mouseDownCanMoveWindow?: boolean - readonly tooltip?: string - readonly onDragEnter?: (event: DragEvent) => void - readonly onDragLeave?: (event: DragEvent) => void - readonly onDrop?: (event: DragEvent) => void -} declare type Mapping = | AnimatedValue_default | AnimatedValueXY_default @@ -3217,7 +3197,6 @@ declare type MouseEvent = NativeSyntheticEvent<{ readonly timestamp: number }> declare type MouseEventProps = { - readonly onDoubleClick?: (event: MouseEvent) => void readonly onMouseEnter?: (event: MouseEvent) => void readonly onMouseLeave?: (event: MouseEvent) => void } @@ -3338,7 +3317,6 @@ declare type NativeScrollEvent = { readonly contentOffset: NativeScrollPoint readonly contentSize: NativeScrollSize readonly layoutMeasurement: NativeScrollSize - readonly preferredScrollerStyle?: string readonly responderIgnoreScroll?: boolean readonly targetContentOffset?: NativeScrollPoint readonly velocity?: NativeScrollVelocity @@ -3396,18 +3374,13 @@ declare type NativeTextProps = Readonly< } > declare type NativeTouchEvent = { - readonly altKey?: boolean - readonly button?: number readonly changedTouches: ReadonlyArray - readonly ctrlKey?: boolean readonly force?: number readonly identifier: number readonly locationX: number readonly locationY: number - readonly metaKey?: boolean readonly pageX: number readonly pageY: number - readonly shiftKey?: boolean readonly target: number | undefined readonly timestamp: number readonly touches: ReadonlyArray @@ -3451,7 +3424,6 @@ declare type OnAnimationDidFailCallback = () => void declare type OpaqueColorValue = NativeColorValue declare type OptionalFlatListProps = { columnWrapperStyle?: ViewStyleProp - enableSelectionOnKeyPress?: boolean extraData?: any fadingEdgeLength?: | (number | undefined) @@ -3462,7 +3434,6 @@ declare type OptionalFlatListProps = { horizontal?: boolean initialNumToRender?: number initialScrollIndex?: number - initialSelectedIndex?: number inverted?: boolean keyExtractor?: (item: ItemT, index: number) => string numColumns?: number @@ -3488,6 +3459,78 @@ declare type OptionalSectionListProps = { removeClippedSubviews?: boolean renderItem?: SectionListRenderItem } +declare type OptionalVirtualizedListProps = { + CellRendererComponent?: React.ComponentType> + debug?: boolean + disableVirtualization?: boolean + extraData?: any + horizontal?: boolean + initialNumToRender?: number + initialScrollIndex?: number + inverted?: boolean + ItemSeparatorComponent?: React.ComponentType + keyExtractor?: (item: Item, index: number) => string + ListEmptyComponent?: React.ComponentType | React.JSX.Element + ListFooterComponent?: React.ComponentType | React.JSX.Element + ListFooterComponentStyle?: StyleProp + ListHeaderComponent?: React.ComponentType | React.JSX.Element + ListHeaderComponentStyle?: StyleProp + ListItemComponent?: React.ComponentType | React.JSX.Element + maxToRenderPerBatch?: number + onEndReached?: (info: { distanceFromEnd: number }) => void + onEndReachedThreshold?: number + onRefresh?: () => void + onScrollToIndexFailed?: (info: { + averageItemLength: number + highestMeasuredFrameIndex: number + index: number + }) => void + onStartReached?: (info: { distanceFromStart: number }) => void + onStartReachedThreshold?: number + onViewableItemsChanged?: (info: { + changed: Array + viewableItems: Array + }) => void + persistentScrollbar?: boolean + progressViewOffset?: number + refreshControl?: React.JSX.Element + refreshing?: boolean + removeClippedSubviews?: boolean + renderItem?: ListRenderItem + updateCellsBatchingPeriod?: number + viewabilityConfig?: ViewabilityConfig + viewabilityConfigCallbackPairs?: Array + windowSize?: number + getItemLayout?: ( + data: any, + index: number, + ) => { + index: number + length: number + offset: number + } + renderScrollComponent?: (props: ScrollViewProps) => React.JSX.Element +} +declare type OptionalVirtualizedSectionListProps< + ItemT, + SectionT = DefaultVirtualizedSectionT, +> = { + onEndReached?: ($$PARAM_0$$: { distanceFromEnd: number }) => void + renderSectionFooter?: (info: { section: SectionT }) => null | React.ReactNode + renderSectionHeader?: (info: { section: SectionT }) => null | React.ReactNode + SectionSeparatorComponent?: React.ComponentType + stickySectionHeadersEnabled?: boolean + renderItem?: (info: { + index: number + item: ItemT + section: SectionT + separators: { + highlight: () => void + unhighlight: () => void + updateProps: (select: "leading" | "trailing", newProps: Object) => void + } + }) => null | React.ReactNode +} declare type OrientationChangeEvent = { readonly orientation: "landscape" | "portrait" } @@ -3534,11 +3577,6 @@ declare type PassThroughProps = { readonly passthroughAnimatedPropExplicitValues?: null | ViewProps } declare type PasswordRules = string -declare type PastedTypesType = PasteType | ReadonlyArray -declare type PasteEvent = NativeSyntheticEvent<{ - readonly dataTransfer: DataTransfer -}> -declare type PasteType = "fileUrl" | "image" | "string" declare type Permission = PermissionsType[keyof PermissionsType] declare type PermissionsAndroid = typeof PermissionsAndroid declare class PermissionsAndroidImpl { @@ -3701,12 +3739,10 @@ declare type PressabilityConfig = { readonly disabled?: boolean readonly hitSlop?: RectOrSize readonly minPressDuration?: number - readonly onBlur?: (event: BlurEvent) => void - readonly onFocus?: (event: FocusEvent) => void + readonly onBlur?: (event: BlurEvent) => unknown + readonly onFocus?: (event: FocusEvent) => unknown readonly onHoverIn?: (event: MouseEvent) => unknown readonly onHoverOut?: (event: MouseEvent) => unknown - readonly onKeyDown?: (event: KeyEvent) => void - readonly onKeyUp?: (event: KeyEvent) => void readonly onLongPress?: (event: GestureResponderEvent) => unknown readonly onPress?: (event: GestureResponderEvent) => unknown readonly onPressIn?: (event: GestureResponderEvent) => unknown @@ -3722,8 +3758,6 @@ declare type PressableAndroidRippleConfig = { radius?: number } declare type PressableBaseProps = { - readonly acceptsFirstMouse?: boolean - readonly allowsVibrancy?: boolean readonly android_disableSound?: boolean readonly android_ripple?: PressableAndroidRippleConfig readonly cancelable?: boolean @@ -3734,18 +3768,9 @@ declare type PressableBaseProps = { readonly delayHoverOut?: number readonly delayLongPress?: number readonly disabled?: boolean - readonly draggedTypes?: DraggedTypesType - readonly enableFocusRing?: boolean readonly hitSlop?: RectOrSize - readonly keyDownEvents?: Array - readonly keyUpEvents?: Array - readonly mouseDownCanMoveWindow?: boolean - readonly onBlur?: (event: BlurEvent) => void - readonly onFocus?: (event: FocusEvent) => void readonly onHoverIn?: (event: MouseEvent) => unknown readonly onHoverOut?: (event: MouseEvent) => unknown - readonly onKeyDown?: (event: KeyEvent) => void - readonly onKeyUp?: (event: KeyEvent) => void readonly onLayout?: (event: LayoutChangeEvent) => unknown readonly onLongPress?: (event: GestureResponderEvent) => unknown readonly onPress?: (event: GestureResponderEvent) => unknown @@ -3758,10 +3783,6 @@ declare type PressableBaseProps = { | ViewStyleProp readonly testID?: string readonly testOnly_pressed?: boolean - readonly tooltip?: string - readonly onDragEnter?: (event: DragEvent) => void - readonly onDragLeave?: (event: DragEvent) => void - readonly onDrop?: (event: DragEvent) => void } declare type PressableProps = Readonly< Omit & PressableBaseProps @@ -4135,6 +4156,17 @@ declare type RequiredFlatListProps = { declare type RequiredSectionListProps = { sections: ReadonlyArray> } +declare type RequiredVirtualizedListProps = { + data?: any + getItem: (data: any, index: number) => Item | undefined + getItemCount: (data: any) => number +} +declare type RequiredVirtualizedSectionListProps< + ItemT, + SectionT = DefaultVirtualizedSectionT, +> = { + sections: ReadonlyArray> +} declare type requireNativeComponent = typeof requireNativeComponent declare type ResolvedAssetSource = { readonly height: number | undefined @@ -4279,6 +4311,13 @@ declare type ScheduleLocalNotificationDetails = } declare type ScrollEvent = NativeSyntheticEvent declare type ScrollResponderType = ScrollViewImperativeMethods +declare type ScrollToLocationParamsType = { + animated?: boolean + itemIndex: number + sectionIndex: number + viewOffset?: number + viewPosition?: number +} declare type ScrollView = typeof ScrollView declare type ScrollViewBaseProps = { readonly children?: React.ReactNode @@ -4286,10 +4325,8 @@ declare type ScrollViewBaseProps = { readonly contentOffset?: PointProp readonly decelerationRate?: DecelerationRateType readonly disableIntervalMomentum?: boolean - readonly hasOverlayStyleIndicator?: boolean readonly horizontal?: boolean readonly innerViewRef?: React.Ref - readonly inverted?: boolean readonly invertStickyHeaders?: boolean readonly keyboardDismissMode?: "interactive" | "none" | "on-drag" readonly keyboardShouldPersistTaps?: @@ -4492,6 +4529,28 @@ declare type ScrollViewStickyHeaderProps = { readonly scrollViewHeight: number | undefined readonly onLayout: (event: LayoutChangeEvent) => void } +declare type SectionBase< + SectionItemT, + SectionT = DefaultVirtualizedSectionT, +> = { + data: ReadonlyArray + ItemSeparatorComponent?: React.ComponentType + key?: string + renderItem?: (info: { + index: number + item: SectionItemT + section: SectionListData + separators: { + highlight: () => void + unhighlight: () => void + updateProps: (select: "leading" | "trailing", newProps: Object) => void + } + }) => null | React.JSX.Element + keyExtractor?: ( + item: SectionItemT | undefined, + index?: number | undefined, + ) => string +} declare class SectionList< ItemT = any, SectionT = DefaultSectionT, @@ -4505,6 +4564,13 @@ declare class SectionList< scrollToLocation(params: ScrollToLocationParamsType): void setNativeProps(props: Object): void } +declare type SectionListData< + SectionItemT, + SectionT = DefaultVirtualizedSectionT, +> = + | (Readonly> & SectionT) + | (SectionBase & SectionT) + | SectionT declare type SectionListProps = Omit< Omit< VirtualizedSectionListProps, @@ -4528,13 +4594,18 @@ declare type SectionListRenderItem = ( declare type SectionListRenderItemInfo< ItemT, SectionT = DefaultSectionT, -> = Omit, "section"> & { +> = ListRenderItemInfo & { section: SectionListData } declare type Selection = { readonly end: number readonly start: number } +declare type Separators = { + highlight: () => void + unhighlight: () => void + updateProps: (select: "leading" | "trailing", newProps: Object) => void +} declare type sequence = typeof sequence declare function setColorScheme( colorScheme: ColorSchemeName | null | undefined, @@ -4552,11 +4623,6 @@ declare function setSurfaceProps( appParameters: Object, displayMode?: number, ): void -declare type SettingChangeEvent = NativeSyntheticEvent<{ - readonly autoCorrectEnabled: boolean - readonly grammarCheckEnabled: boolean - readonly spellCheckEnabled: boolean -}> declare type Settings = typeof Settings declare function setWrapperComponentProvider( provider: WrapperComponentProvider, @@ -4793,6 +4859,34 @@ declare function startHeadlessTask( taskKey: string, data: any, ): void +declare type State = { + cellsAroundViewport: { + first: number + last: number + } + firstVisibleItemKey: string | undefined + pendingScrollUpdateCount: number + renderMask: CellRenderMask +} +declare class StateSafePureComponent_default< + Props, + State extends {}, +> extends React.PureComponent { + constructor(props: Props) + setState( + partialState: + | ( + | (( + $$PARAM_0$$: State, + $$PARAM_1$$: Props, + ) => null | Pick | undefined) + | Pick + ) + | null + | undefined, + callback?: () => unknown, + ): void +} declare class StatusBar extends React.Component { static currentHeight: null | number | undefined componentDidMount(): void @@ -4830,9 +4924,9 @@ declare type StatusBarPropsIOS = { readonly showHideTransition?: "fade" | "none" | "slide" } declare type StatusBarStyle = keyof { - "dark-content": ColorValue + "dark-content": string default: string - "light-content": ColorValue + "light-content": string } declare type StickyHeaderComponentType = ( props: ScrollViewStickyHeaderProps & { @@ -4860,14 +4954,6 @@ declare namespace StyleSheet { } } declare type SubmitBehavior = "blurAndSubmit" | "newline" | "submit" -declare type SubmitKeyEvent = { - readonly altKey?: boolean - readonly ctrlKey?: boolean - readonly functionKey?: boolean - readonly key: string - readonly metaKey?: boolean - readonly shiftKey?: boolean -} declare type subtract = typeof subtract declare type Switch = typeof Switch declare type SwitchChangeEvent = NativeSyntheticEvent @@ -4911,12 +4997,6 @@ declare type SwitchPropsIOS = { declare type SwitchRef = React.ComponentRef< typeof $$AndroidSwitchNativeComponent | typeof $$SwitchNativeComponent > -declare type SystemEffectMacOS = - | "deepPressed" - | "disabled" - | "none" - | "pressed" - | "rollover" declare namespace Systrace { export { isEnabled, @@ -5131,7 +5211,7 @@ declare type TextInputBaseProps = { readonly onChangeText?: (text: string) => unknown readonly onContentSizeChange?: (e: TextInputContentSizeChangeEvent) => unknown readonly onEndEditing?: (e: TextInputEndEditingEvent) => unknown - readonly onFocus?: (e: TextInputFocusEvent) => void + readonly onFocus?: (e: TextInputFocusEvent) => unknown readonly onKeyPress?: (e: TextInputKeyPressEvent) => unknown readonly onPress?: (event: GestureResponderEvent) => unknown readonly onPressIn?: (event: GestureResponderEvent) => unknown @@ -5169,8 +5249,6 @@ declare type TextInputComponentStatics = { readonly currentlyFocusedField: () => number | undefined readonly currentlyFocusedInput: () => HostInstance | undefined readonly focusTextInput: (textField: HostInstance | undefined) => void - readonly onTextInputBlur: (textField: HostInstance | undefined) => void - readonly onTextInputFocus: (textField: HostInstance | undefined) => void } } declare type TextInputContentSizeChangeEvent = @@ -5195,7 +5273,6 @@ declare interface TextInputInstance extends HostInstance { readonly clear: () => void readonly getNativeRef: () => HostInstance | undefined readonly isFocused: () => boolean - readonly setGhostText: (ghostText: string | undefined) => void readonly setSelection: (start: number, end: number) => void } declare type TextInputIOSProps = { @@ -5241,28 +5318,11 @@ declare type TextInputKeyPressEventData = Readonly< target?: number } > -declare type TextInputMacOSProps = { - readonly clearTextOnSubmit?: boolean - readonly grammarCheck?: boolean - readonly hideVerticalScrollIndicator?: boolean - readonly keyDownEvents?: ReadonlyArray - readonly keyUpEvents?: ReadonlyArray - readonly onAutoCorrectChange?: (e: SettingChangeEvent) => unknown - readonly onGrammarCheckChange?: (e: SettingChangeEvent) => unknown - readonly onKeyDown?: (e: KeyEvent) => unknown - readonly onKeyUp?: (e: KeyEvent) => unknown - readonly onSpellCheckChange?: (e: SettingChangeEvent) => unknown - readonly pastedTypes?: PastedTypesType - readonly submitKeyEvents?: ReadonlyArray - readonly tooltip?: string - readonly onPaste?: (event: PasteEvent) => void -} declare type TextInputProps = Readonly< Omit & TextInputIOSProps & TextInputAndroidProps & - TextInputBaseProps & - TextInputMacOSProps + TextInputBaseProps > declare type TextInputSelectionChangeEvent = NativeSyntheticEvent @@ -5302,7 +5362,6 @@ declare type TextProps = Readonly< TextPointerEventProps & TextPropsIOS & TextPropsAndroid & - TextPropsMacOS & TextBaseProps & AccessibilityProps > @@ -5331,11 +5390,6 @@ declare type TextPropsIOS = { lineBreakStrategyIOS?: "hangul-word" | "none" | "push-out" | "standard" suppressHighlighting?: boolean } -declare type TextPropsMacOS = { - enableFocusRing?: boolean - focusable?: boolean - tooltip?: string -} declare type TextStyle = ____TextStyle_Internal declare type TextStyleProp = ____TextStyleProp_Internal declare type Timespan = { @@ -5495,8 +5549,8 @@ declare type TouchableWithoutFeedbackProps = Readonly< importantForAccessibility?: "auto" | "no-hide-descendants" | "no" | "yes" nativeID?: string onAccessibilityAction?: (event: AccessibilityActionEvent) => unknown - onBlur?: (event: BlurEvent) => void - onFocus?: (event: FocusEvent) => void + onBlur?: (event: BlurEvent) => unknown + onFocus?: (event: FocusEvent) => unknown onLayout?: (event: LayoutChangeEvent) => unknown onLongPress?: (event: GestureResponderEvent) => unknown onPress?: (event: GestureResponderEvent) => unknown @@ -5511,17 +5565,7 @@ declare type TouchableWithoutFeedbackProps = Readonly< declare type TouchableWithoutFeedbackPropsAndroid = { touchSoundDisabled?: boolean } -declare type TouchableWithoutFeedbackPropsIOS = { - acceptsFirstMouse?: boolean - draggedTypes?: DraggedTypesType - enableFocusRing?: boolean - tooltip?: string - onDragEnter?: (event: DragEvent) => void - onDragLeave?: (event: DragEvent) => void - onDrop?: (event: DragEvent) => void - onMouseEnter?: (event: MouseEvent) => void - onMouseLeave?: (event: MouseEvent) => void -} +declare type TouchableWithoutFeedbackPropsIOS = {} declare type TouchEventProps = { readonly onTouchCancel?: (e: GestureResponderEvent) => void readonly onTouchCancelCapture?: (e: GestureResponderEvent) => void @@ -5585,6 +5629,55 @@ declare function View( ref?: React.Ref> }, ): React.ReactNode +declare type ViewabilityConfig = { + readonly itemVisiblePercentThreshold?: number + readonly minimumViewTime?: number + readonly viewAreaCoveragePercentThreshold?: number + readonly waitForInteraction?: boolean +} +declare type ViewabilityConfigCallbackPair = { + viewabilityConfig: ViewabilityConfig + onViewableItemsChanged: (info: { + changed: Array + viewableItems: Array + }) => void +} +declare class ViewabilityHelper_default { + computeViewableItems( + props: CellMetricProps, + scrollOffset: number, + viewportHeight: number, + listMetrics: ListMetricsAggregator_default, + renderRange?: { + first: number + last: number + }, + ): Array + constructor(config?: ViewabilityConfig) + dispose(): void + onUpdate( + props: CellMetricProps, + scrollOffset: number, + viewportHeight: number, + listMetrics: ListMetricsAggregator_default, + createViewToken: ( + index: number, + isViewable: boolean, + props: CellMetricProps, + ) => ViewToken, + onViewableItemsChanged: ($$PARAM_0$$: { + changed: Array + viewableItems: Array + }) => void, + renderRange?: { + first: number + last: number + }, + ): void + recordInteraction(): void + resetViewableIndices(): void +} +declare type ViewabilityHelperT = typeof ViewabilityHelper_default declare type ViewBaseProps = { readonly children?: React.ReactNode readonly collapsable?: boolean @@ -5635,10 +5728,8 @@ declare type ViewProps = Readonly< PointerEventProps & FocusEventProps & TouchEventProps & - KeyboardEventProps & ViewPropsAndroid & ViewPropsIOS & - MacOSViewProps & AccessibilityProps & ViewBaseProps > @@ -5661,11 +5752,79 @@ declare type ViewPropsIOS = { } declare type ViewStyle = ____ViewStyle_Internal declare type ViewStyleProp = ____ViewStyleProp_Internal +declare type ViewToken = { + index: number | undefined + isViewable: boolean + item: any + key: string + section?: any +} declare type VirtualizedList = typeof VirtualizedList -declare type VirtualizedListType = typeof VirtualizedLists.VirtualizedList +declare class VirtualizedList_default extends StateSafePureComponent_default< + VirtualizedListProps, + State +> { + static contextType: typeof VirtualizedListContext + state: State + componentDidMount(): void + componentDidUpdate(prevProps: VirtualizedListProps): void + componentWillUnmount(): void + constructor(props: VirtualizedListProps) + flashScrollIndicators(): void + static getDerivedStateFromProps( + newProps: VirtualizedListProps, + prevState: State, + ): State + getScrollableNode(): null | number | undefined + getScrollRef(): null | React.ComponentRef | undefined + getScrollResponder(): null | ScrollResponderType | undefined + hasMore(): boolean + measureLayoutRelativeToContainingList(): void + recordInteraction(): void + render(): React.ReactNode + scrollToEnd( + params?: + | null + | undefined + | { + animated?: boolean + }, + ): void + scrollToIndex(params: { + animated?: boolean + index: number + viewOffset?: number + viewPosition?: number + }): any + scrollToItem(params: { + animated?: boolean + item: Item + viewOffset?: number + viewPosition?: number + }): void + scrollToOffset(params: { animated?: boolean; offset: number }): void + setNativeProps(props: Object): void +} +declare type VirtualizedListContext = typeof VirtualizedListContext +declare function VirtualizedListContextResetter($$PARAM_0$$: { + children: React.ReactNode +}): React.ReactNode +declare type VirtualizedListContextResetterT = + typeof VirtualizedListContextResetter +declare type VirtualizedListProps = ScrollViewProps & + RequiredVirtualizedListProps & + OptionalVirtualizedListProps +declare type VirtualizedListT = typeof VirtualizedList_default +declare type VirtualizedListT_2 = typeof VirtualizedList_default +declare type VirtualizedListType = typeof $$index.VirtualizedList declare type VirtualizedSectionList = typeof VirtualizedSectionList -declare type VirtualizedSectionListType = - typeof VirtualizedLists.VirtualizedSectionList +declare type VirtualizedSectionListProps< + ItemT, + SectionT = DefaultVirtualizedSectionT, +> = RequiredVirtualizedSectionListProps & + OptionalVirtualizedSectionListProps & + Omit +declare type VirtualizedSectionListType = typeof $$index.VirtualizedSectionList declare enum VirtualViewMode { Hidden = 2, Prerender = 1, @@ -5753,23 +5912,23 @@ declare type WrapperComponentProvider = ( export { AccessibilityActionEvent, // 9247c3f0 AccessibilityInfo, // 70604904 - AccessibilityProps, // d961eb5c - AccessibilityRole, // 3cf8c6c5 + AccessibilityProps, // 5a2836fc + AccessibilityRole, // f2f2e066 AccessibilityState, // b0c2b3f7 AccessibilityValue, // cf8bcb74 ActionSheetIOS, // 88e6bfb0 ActionSheetIOSOptions, // 1756eb5a ActivityIndicator, // 8d041a45 - ActivityIndicatorProps, // 097c4116 - Alert, // 24958ab5 + ActivityIndicatorProps, // 0edeb628 + Alert, // 5bf12165 AlertButton, // bf1a3b60 AlertButtonStyle, // ec9fb242 - AlertOptions, // 39b16cfa + AlertOptions, // a0cdac0f AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // 72e7bf88 + Animated, // b3949f33 AppConfig, // ebddad4b - AppRegistry, // eb54df94 + AppRegistry, // 6cdee1d6 AppState, // f7097b1b AppStateEvent, // 80f034c3 AppStateStatus, // 447e5ef2 @@ -5780,15 +5939,14 @@ export { BlurEvent, // ab745200 BoxShadowValue, // b679703f Button, // dd130b61 - ButtonProps, // 48492067 + ButtonProps, // 99495f51 Clipboard, // 9b8c878e CodegenTypes, // 1b38ac82 ColorSchemeName, // 31a4350e ColorValue, // 98989a8f - ColorWithSystemEffectMacOS, // df1263b4 ComponentProvider, // b5c60ddd ComponentProviderInstrumentationHook, // 9f640048 - CursorValue, // 2c77888f + CursorValue, // 26522595 DevMenu, // 99e9fcd6 DevSettings, // 1a2f3a5f DeviceEventEmitter, // 31dc96e7 @@ -5800,13 +5958,11 @@ export { DisplayMetrics, // 1dc35cef DisplayMetricsAndroid, // 872e62eb DrawerLayoutAndroid, // 14121b61 - DrawerLayoutAndroidProps, // 1e182ba5 + DrawerLayoutAndroidProps, // 11c0dfe2 DrawerSlideEvent, // ad024574 DropShadowValue, // e9df2606 DynamicColorIOS, // 1f9b3410 DynamicColorIOSTuple, // 023ce58e - DynamicColorMacOS, // f47c1c7d - DynamicColorMacOSTuple, // 692ec192 Easing, // b624f91d EasingFunction, // 14aee4c0 EdgeInsetsValue, // bd44afe6 @@ -5816,12 +5972,12 @@ export { EventSubscription, // b8d084aa ExtendedExceptionData, // 5a6ccf5a FilterFunction, // bf24c0e3 - FlatList, // 2d0f495e - FlatListProps, // ec6dc7bf + FlatList, // 0b12ef25 + FlatListProps, // d185db31 FocusEvent, // 1dc2b592 FontVariant, // 7c7558bb - GestureResponderEvent, // 98a7d008 - GestureResponderHandlers, // 28a84dba + GestureResponderEvent, // 9c9a1b0d + GestureResponderHandlers, // 2c0e77cb Handle, // 2d65285d HostComponent, // b6281cf9 HostInstance, // b159a964 @@ -5829,30 +5985,30 @@ export { IOSKeyboardEvent, // e67bfe3a IgnorePattern, // ec6f6ece Image, // 04474205 - ImageBackground, // d81f0f5b - ImageBackgroundProps, // c0a5d733 + ImageBackground, // b588909c + ImageBackgroundProps, // f9de269c ImageErrorEvent, // 66044485 ImageLoadEvent, // 62e6be9b ImageProgressEventIOS, // 3d6ffb7a - ImageProps, // ffb1a3ed + ImageProps, // d77401e6 ImagePropsAndroid, // 9fd9bcbb - ImagePropsBase, // ee772e03 + ImagePropsBase, // efd768f1 ImagePropsIOS, // c788030b ImageRequireSource, // 681d683b ImageResolvedAssetSource, // f3060931 ImageSize, // 1c47cf88 ImageSource, // 48c7f316 ImageSourcePropType, // bfb5e5c6 - ImageStyle, // 6d9dfbb6 + ImageStyle, // 8b22ac76 ImageURISource, // 016eb083 InputAccessoryView, // 591855d8 - InputAccessoryViewProps, // fc574890 + InputAccessoryViewProps, // 4b6f5450 InputModeOptions, // 4e8581b9 Insets, // e7fe432a InteractionManager, // 301bfa63 Keyboard, // 87311c77 - KeyboardAvoidingView, // ce2a914e - KeyboardAvoidingViewProps, // 811bf314 + KeyboardAvoidingView, // ab2d7999 + KeyboardAvoidingViewProps, // 8e348419 KeyboardEvent, // c3f895d4 KeyboardEventEasing, // af4091c8 KeyboardEventName, // 59299ad6 @@ -5869,8 +6025,8 @@ export { LayoutConformanceProps, // 055f03b8 LayoutRectangle, // 6601b294 Linking, // 292de0a0 - ListRenderItem, - ListRenderItemInfo, + ListRenderItem, // b5353fd8 + ListRenderItemInfo, // e8595b03 LogBox, // b58880c6 LogData, // 89af6d4c MeasureInWindowOnSuccessCallback, // a285f598 @@ -5878,7 +6034,7 @@ export { MeasureOnSuccessCallback, // 82824e59 Modal, // 78e8a79d ModalBaseProps, // 574f2b2d - ModalProps, // e09479a5 + ModalProps, // 3fb62261 ModalPropsAndroid, // 515fb173 ModalPropsIOS, // 6053cb61 ModeChangeEvent, // 0dc5e81f @@ -5893,14 +6049,14 @@ export { NativeModules, // 1cf72876 NativeMouseEvent, // 2d5b5c9f NativePointerEvent, // 5f27ae9c - NativeScrollEvent, // 431aad2d + NativeScrollEvent, // caad7f53 NativeSyntheticEvent, // 29455160 - NativeTouchEvent, // e9fce623 + NativeTouchEvent, // 59b676df NativeUIEvent, // 44ac26ac Networking, // b674447b OpaqueColorValue, // 25f3fa5b PanResponder, // 98a9b6fc - PanResponderCallbacks, // 49ff5e35 + PanResponderCallbacks, // 0567f479 PanResponderGestureState, // 54baf558 PanResponderInstance, // c8b0d00c Permission, // 06473f4f @@ -5915,11 +6071,11 @@ export { PointerEvent, // 3c454015 Pressable, // 3c6e4eb9 PressableAndroidRippleConfig, // 42bc9727 - PressableProps, // b5931c41 + PressableProps, // 4d37b376 PressableStateCallbackType, // 9af36561 ProcessedColorValue, // 33f74304 ProgressBarAndroid, // 03e66cf5 - ProgressBarAndroidProps, // 570a1f9e + ProgressBarAndroidProps, // 9302458b PromiseTask, // 5102c862 PublicRootInstance, // 8040afd7 PublicTextInstance, // 7d73f802 @@ -5927,8 +6083,8 @@ export { PushNotificationIOS, // b4d1fe78 PushNotificationPermissions, // c2e7ae4f Rationale, // 5df1b1c1 - RefreshControl, // e4d31e08 - RefreshControlProps, // 91da4678 + RefreshControl, // effd2a00 + RefreshControlProps, // fca5a05f RefreshControlPropsAndroid, // 99f64c97 RefreshControlPropsIOS, // 72a36381 Registry, // e1ed403e @@ -5937,27 +6093,27 @@ export { Role, // af7b889d RootTag, // 3cd10504 RootTagContext, // 15b60335 - RootViewStyleProvider, // 267bc77f + RootViewStyleProvider, // cc8d50e9 Runnable, // 2cb32c54 Runnables, // d3749ae1 SafeAreaView, // 4364c7bb ScaledSize, // 07e417c7 - ScrollEvent, // 87a8bd23 + ScrollEvent, // 865efb2e ScrollResponderType, // 525b353d - ScrollToLocationParamsType, + ScrollToLocationParamsType, // d7ecdad1 ScrollView, // 7fb7c469 ScrollViewImperativeMethods, // 97a0b5ac - ScrollViewProps, // af322be8 + ScrollViewProps, // b276b839 ScrollViewPropsAndroid, // 84e2134b - ScrollViewPropsIOS, // fd8eda6d + ScrollViewPropsIOS, // a2902f33 ScrollViewScrollToOptions, // 3313411e - SectionBase, - SectionList, // 1b65b322 - SectionListData, - SectionListProps, // d2fcd6f4 - SectionListRenderItem, // c118edfb - SectionListRenderItemInfo, // bd038703 - Separators, + SectionBase, // 0ccaedac + SectionList, // ba8c31d9 + SectionListData, // 1c80bb2e + SectionListProps, // 177096d2 + SectionListRenderItem, // cffebb53 + SectionListRenderItemInfo, // 946c2128 + Separators, // 6a45f7e3 Settings, // 4282b0da Share, // e4591b32 ShareAction, // ead1004a @@ -5966,16 +6122,16 @@ export { ShareContent, // 7c627896 ShareOptions, // 800c3a4e SimpleTask, // 0e619d11 - StatusBar, // e7cd8aa8 + StatusBar, // 5e08d563 StatusBarAnimation, // 7fd047e6 StatusBarProps, // 06c98add - StatusBarStyle, // 49e3b6de + StatusBarStyle, // 986b2051 StyleProp, // fa0e9b4a StyleSheet, // 02b98c20 SubmitBehavior, // c4ddf490 Switch, // aebc9941 SwitchChangeEvent, // 056868be - SwitchProps, // 9fe56453 + SwitchProps, // 57b2101f Systrace, // b5aa21fc TVViewPropsIOS, // 330ce7b5 TargetedEvent, // 16e98910 @@ -5988,40 +6144,40 @@ export { TextInputContentSizeChangeEvent, // f6f7ecae TextInputEndEditingEvent, // 254671ea TextInputFocusEvent, // 29cebb63 - TextInputIOSProps, // e8905f3e + TextInputIOSProps, // 0d05a855 TextInputKeyPressEvent, // 8047f716 - TextInputProps, // a1863973 + TextInputProps, // 5cda62e0 TextInputSelectionChangeEvent, // 3a657f0b TextInputSubmitEditingEvent, // b350617f TextLayoutEvent, // e289bd3c - TextProps, // 90a80d06 - TextStyle, // 88ac4ff3 + TextProps, // 0f0be34d + TextStyle, // f3404e2b ToastAndroid, // b4875e35 Touchable, // 93eb6c63 TouchableHighlight, // b4304a98 - TouchableHighlightProps, // d1f0537e - TouchableNativeFeedback, // 4e736ea9 - TouchableNativeFeedbackProps, // ccfc56b6 + TouchableHighlightProps, // 7212b9cf + TouchableNativeFeedback, // 1562b2eb + TouchableNativeFeedbackProps, // 8a4eed44 TouchableOpacity, // 7e33acfd - TouchableOpacityProps, // e1e0f0ae - TouchableWithoutFeedback, // 165173e0 - TouchableWithoutFeedbackProps, // 3e0cac05 + TouchableOpacityProps, // 189c11df + TouchableWithoutFeedback, // d5fb023d + TouchableWithoutFeedbackProps, // 26d3cf4e TransformsStyle, // 65e70f18 TurboModule, // dfe29706 TurboModuleRegistry, // badfcca2 UIManager, // 8d2c8281 UTFSequence, // baacd11b Vibration, // 315e131d - View, // 7ded047f - ViewProps, // f4470407 - ViewPropsAndroid, // ffa079f9 + View, // 75d9e33b + ViewProps, // 0ab8ceda + ViewPropsAndroid, // f3d007c3 ViewPropsIOS, // 58ee19bf - ViewStyle, // c0170ec0 + ViewStyle, // c2db0e6e VirtualViewMode, // 85a69ef6 VirtualizedList, // 4d513939 - VirtualizedListProps, + VirtualizedListProps, // 8526b87a VirtualizedSectionList, // 446ba0df - VirtualizedSectionListProps, + VirtualizedSectionListProps, // de510cb4 WrapperComponentProvider, // 9cf3844c codegenNativeCommands, // e16d62f7 codegenNativeComponent, // ed4c8103 diff --git a/packages/rn-tester/metro.config.js b/packages/rn-tester/metro.config.js index e2979d5bbb05..9e5e60a7712a 100644 --- a/packages/rn-tester/metro.config.js +++ b/packages/rn-tester/metro.config.js @@ -10,7 +10,8 @@ 'use strict'; -const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); +const {getDefaultConfig} = require('@react-native/metro-config'); +const {mergeConfig} = require('metro-config'); const path = require('path'); /** @@ -38,11 +39,7 @@ const config = { blockList: [/..\/react-native\/sdks\/hermes/], extraNodeModules: { 'react-native': path.resolve(__dirname, '../react-native'), - // [macOS] Under Yarn's pnpm linker, files inside the react-native-macos - // package self-reference via `react-native`, which Metro redirects to the - // real package name `react-native-macos`. That name isn't self-resolvable - // in pnpm's strict layout, so map it to the workspace explicitly. - 'react-native-macos': path.resolve(__dirname, '../react-native'), + 'react-native-macos': path.resolve(__dirname, '../react-native'), // [macOS] pnpm can't self-resolve the react-native -> react-native-macos redirect }, platforms: ['ios', 'macos', 'android'], // [macOS] }, diff --git a/scripts/build-types/BuildApiSnapshot.js b/scripts/build-types/BuildApiSnapshot.js index 48676652bba4..815f251b125f 100644 --- a/scripts/build-types/BuildApiSnapshot.js +++ b/scripts/build-types/BuildApiSnapshot.js @@ -254,11 +254,6 @@ async function getProcessedSnapshotResult( const cleanedRollup = sourceRollup .replace(/\/\*[\s\S]*?\*\//gm, '') // Remove block comments .replace(/\\\\.*$/gm, '') // Remove inline comments - // Normalize module specifiers that resolved through node_modules back to a - // bare package name. Under Yarn's pnpm linker, API Extractor emits imports - // via the on-disk (symlinked) path, e.g. - // "../../react-native/node_modules/@react-native-macos/virtualized-lists". - .replace(/(from\s+["'])[^"']*\/node_modules\/([^"']+)(["'])/gm, '$1$2$3') .replace(/^\s+$/gm, '') // Clear whitespace-only lines .replace(/\n+/gm, '\n'); // Collapse empty lines From a8290e917125a7ea87cf0c28296a18f6b611e662 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 16:11:12 -0700 Subject: [PATCH 09/10] chore: address review - [macOS] start/end fence tags and yarn pnpm mode wording - Fence the .flowconfig name_mapper block and the .yarnrc.yml packageExtensions block with [macOS] / macOS] start/end tags per the fork convention. - Reword the metro.config.js alias comment to use 'yarn pnpm mode' terminology. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .flowconfig | 5 ++--- .yarnrc.yml | 13 ++++++------- packages/rn-tester/metro.config.js | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.flowconfig b/.flowconfig index 12e5bfc2931e..96277a41df5f 100644 --- a/.flowconfig +++ b/.flowconfig @@ -69,12 +69,11 @@ munge_underscores=true module.name_mapper='^react-native$' -> '/packages/react-native/index.js' module.name_mapper='^react-native/\(.*\)$' -> '/packages/react-native/\1' module.name_mapper='^@react-native/dev-middleware$' -> '/packages/dev-middleware' -; [macOS] Resolve workspace packages that are referenced by name (including -; self-references) so Flow can resolve them under Yarn's pnpm linker, which does -; not hoist them into a shared node_modules. +; [macOS] Resolve workspace self-references (incl. @react-native/fantom) in yarn pnpm mode module.name_mapper='^@react-native/fantom$' -> '/private/react-native-fantom/src/index.js' module.name_mapper='^@react-native/fantom/\(.*\)$' -> '/private/react-native-fantom/\1' module.name_mapper='^@react-native/core-cli-utils$' -> '/packages/core-cli-utils/src/index.flow.js' +; macOS] 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\)$' -> '/packages/react-native/Libraries/Image/RelativeImageStub' module.system.haste.module_ref_prefix=m# diff --git a/.yarnrc.yml b/.yarnrc.yml index 5808bc2ff139..61a81547d826 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -6,13 +6,11 @@ npmMinimalAgeGate: 7d yarnPath: .yarn/releases/yarn-4.12.0.cjs -# [macOS] Declare direct dependencies that upstream package manifests omit and -# that were previously resolved only via a hoisted node_modules. The pnpm linker -# uses a strict, non-hoisted layout, so these must be declared. Centralizing them -# here (rather than editing each package.json) keeps the upstream-tracked -# manifests pristine and confines the pnpm-compat shims to this fork-only file. -# Third-party only: yarn.config.cjs constraints do not govern packageExtensions -# deps, so no @react-native/* workspace deps belong here (they must stay in a +# [macOS] Declare direct dependencies that upstream package manifests omit and that +# were previously resolved via a hoisted node_modules. In yarn pnpm mode the strict, +# non-hoisted layout requires them. Centralizing them here keeps the upstream-tracked +# manifests pristine. Third-party only: yarn.config.cjs constraints don't govern +# packageExtensions, so no @react-native/* deps belong here (they must stay in a # manifest to remain under release-branch version-pinning). packageExtensions: "@react-native/codegen@*": @@ -43,3 +41,4 @@ packageExtensions: "metro": "^0.82.5" "metro-config": "^0.82.5" "source-map": "^0.7.4" +# macOS] diff --git a/packages/rn-tester/metro.config.js b/packages/rn-tester/metro.config.js index 9e5e60a7712a..7ed5386ac94c 100644 --- a/packages/rn-tester/metro.config.js +++ b/packages/rn-tester/metro.config.js @@ -39,7 +39,7 @@ const config = { blockList: [/..\/react-native\/sdks\/hermes/], extraNodeModules: { 'react-native': path.resolve(__dirname, '../react-native'), - 'react-native-macos': path.resolve(__dirname, '../react-native'), // [macOS] pnpm can't self-resolve the react-native -> react-native-macos redirect + 'react-native-macos': path.resolve(__dirname, '../react-native'), // [macOS] resolve the react-native -> react-native-macos redirect in yarn pnpm mode }, platforms: ['ios', 'macos', 'android'], // [macOS] }, From c371d34ff25beb6974a70c88ce490b275ec695ef Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 16:57:10 -0700 Subject: [PATCH 10/10] fix: pin source-map to ^0.6.1 for fantom in yarn pnpm mode Fantom uses the synchronous SourceMapConsumer constructor (the 0.6.x API); source-map 0.7+ returns a Promise. The ^0.7.4 shim resolved fantom to 0.7.6, which would break its stack-trace symbolication at runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .yarnrc.yml | 2 +- yarn.lock | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index 61a81547d826..2fb7124f02d3 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -40,5 +40,5 @@ packageExtensions: "jest-message-util": "^29.7.0" "metro": "^0.82.5" "metro-config": "^0.82.5" - "source-map": "^0.7.4" + "source-map": "^0.6.1" # macOS] diff --git a/yarn.lock b/yarn.lock index 6fa11991373f..d5f250b9a590 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12837,13 +12837,6 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.7.4": - version: 0.7.6 - resolution: "source-map@npm:0.7.6" - checksum: 10c0/59f6f05538539b274ba771d2e9e32f6c65451982510564438e048bc1352f019c6efcdc6dd07909b1968144941c14015c2c7d4369fb7c4d7d53ae769716dcc16c - languageName: node - linkType: hard - "spawndamnit@npm:^3.0.1": version: 3.0.1 resolution: "spawndamnit@npm:3.0.1"