mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
113
Commits
@@ -14,8 +14,12 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client cmake build-essential \
|
||||
sudo apt install -y git openssh-client build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
|
||||
# Install cmake 3.28.3-1build7
|
||||
sudo apt-get install cmake=3.28.3-1build7
|
||||
sudo ln -sf /usr/bin/cmake /usr/local/bin/cmake
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
|
||||
@@ -14,23 +14,23 @@ runs:
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
path: 'C:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
shell: powershell
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p C:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force C:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: v2-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
key: v3-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
path: |
|
||||
D:\tmp\hermes\win64-bin\
|
||||
D:\tmp\hermes\hermes\icu\
|
||||
D:\tmp\hermes\hermes\deps\
|
||||
D:\tmp\hermes\hermes\build_release\
|
||||
C:\tmp\hermes\win64-bin\
|
||||
C:\tmp\hermes\hermes\icu\
|
||||
C:\tmp\hermes\hermes\deps\
|
||||
C:\tmp\hermes\hermes\build_release\
|
||||
- name: setup-msbuild
|
||||
uses: microsoft/setup-msbuild@v1.3.2
|
||||
- name: Set up workspace
|
||||
@@ -39,6 +39,9 @@ runs:
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
|
||||
- name: Downgrade CMake
|
||||
shell: powershell
|
||||
run: choco install cmake --version 3.31.6 --force
|
||||
- name: Build HermesC for Windows
|
||||
shell: powershell
|
||||
run: |
|
||||
@@ -60,7 +63,7 @@ runs:
|
||||
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
|
||||
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
|
||||
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 17 2022' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
if (-not $?) { throw "Failed to configure Hermes" }
|
||||
echo "Running windows build..."
|
||||
cd build_release
|
||||
@@ -80,4 +83,4 @@ runs:
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
path: C:\tmp\hermes\win64-bin\
|
||||
|
||||
@@ -22,10 +22,13 @@ jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
run: mockRun,
|
||||
sleep: mockSleep,
|
||||
verifyPublishedPackage: mockVerifyPublishedPackage,
|
||||
getNpmPackageInfo: mockGetNpmPackageInfo,
|
||||
}));
|
||||
|
||||
jest.mock('../verifyPublishedPackage.js', () => ({
|
||||
verifyPublishedPackage: mockVerifyPublishedPackage,
|
||||
}));
|
||||
|
||||
const getMockGithub = () => ({
|
||||
rest: {
|
||||
actions: {
|
||||
|
||||
@@ -13,6 +13,11 @@ const mockVerifyPublishedPackage = jest.fn();
|
||||
const silence = () => {};
|
||||
|
||||
jest.mock('../utils.js', () => ({
|
||||
log: silence,
|
||||
sleep: silence,
|
||||
}));
|
||||
|
||||
jest.mock('../verifyPublishedPackage.js', () => ({
|
||||
verifyPublishedPackage: mockVerifyPublishedPackage,
|
||||
}));
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {run, sleep, log, verifyPublishedPackage} = require('./utils.js');
|
||||
const {run, sleep, log} = require('./utils.js');
|
||||
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
|
||||
|
||||
const TAG_AS_LATEST_REGEX = /#publish-packages-to-npm&latest/;
|
||||
|
||||
@@ -68,6 +69,9 @@ module.exports.verifyPublishedTemplate = async (
|
||||
retries = MAX_RETRIES,
|
||||
) => {
|
||||
try {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.slice(1);
|
||||
}
|
||||
await verifyPublishedPackage(
|
||||
TEMPLATE_NPM_PKG,
|
||||
version,
|
||||
|
||||
@@ -9,13 +9,7 @@
|
||||
|
||||
const {execSync} = require('child_process');
|
||||
|
||||
function run(cmd) {
|
||||
return execSync(cmd, 'utf8').toString().trim();
|
||||
}
|
||||
|
||||
async function sleep(seconds) {
|
||||
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
||||
}
|
||||
const log = (...args) => console.log(...args);
|
||||
|
||||
async function getNpmPackageInfo(pkg, versionOrTag) {
|
||||
return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp =>
|
||||
@@ -23,7 +17,13 @@ async function getNpmPackageInfo(pkg, versionOrTag) {
|
||||
);
|
||||
}
|
||||
|
||||
const log = (...args) => console.log(...args);
|
||||
async function sleep(seconds) {
|
||||
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
||||
}
|
||||
|
||||
function run(cmd) {
|
||||
return execSync(cmd, 'utf8').toString().trim();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
log,
|
||||
|
||||
@@ -42,7 +42,7 @@ async function verifyPublishedPackage(
|
||||
}
|
||||
|
||||
log(
|
||||
`🐌 ${packageName}@${tag} → ${pkg.version} on npm and not ${version} as expected, retrying...`,
|
||||
`🐌 ${packageName}@${tag} → ${json.version} on npm and not ${version} as expected, retrying...`,
|
||||
);
|
||||
} catch (e) {
|
||||
log(`Nope, fetch failed: ${e.message}`);
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {run, sleep, log, verifyPublishedPackage} = require('./utils.js');
|
||||
const {run, sleep, log} = require('./utils.js');
|
||||
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
|
||||
const REACT_NATIVE_NPM_PKG = 'react-native';
|
||||
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
|
||||
/**
|
||||
@@ -22,5 +23,8 @@ module.exports.verifyReleaseOnNpm = async (
|
||||
retries = MAX_RETRIES,
|
||||
) => {
|
||||
const tag = version.includes('-rc.') ? 'next' : latest ? 'latest' : null;
|
||||
if (version.startsWith('v')) {
|
||||
version = version.slice(1);
|
||||
}
|
||||
await verifyPublishedPackage(REACT_NATIVE_NPM_PKG, version, tag, retries);
|
||||
};
|
||||
|
||||
@@ -119,12 +119,12 @@ jobs:
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
|
||||
@@ -45,11 +45,16 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install cmake
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.9'
|
||||
- name: Build HermesC Apple
|
||||
uses: ./.github/actions/build-hermesc-apple
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
needs: [build_hermesc_apple, prepare_hermes_workspace]
|
||||
@@ -68,6 +73,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install cmake
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.9'
|
||||
- name: Build Slice
|
||||
uses: ./.github/actions/build-apple-slices-hermes
|
||||
with:
|
||||
@@ -115,12 +124,12 @@ jobs:
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
@@ -133,27 +142,6 @@ jobs:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_android:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs: [set_release_type]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Android
|
||||
uses: ./.github/actions/build-android
|
||||
with:
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
|
||||
build_npm_package:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs:
|
||||
@@ -163,7 +151,6 @@ jobs:
|
||||
build_hermes_macos,
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
build_android,
|
||||
prebuild_apple_dependencies,
|
||||
]
|
||||
container:
|
||||
@@ -226,6 +213,6 @@ jobs:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const {verifyReleaseOnNpm} = require('./.github/workflow-scripts/verifyReleaseOnNpm.js');
|
||||
const {isLatest()} = require('./.github/workflow-scripts/publishTemplate.js');
|
||||
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
|
||||
const version = "${{ github.ref_name }}";
|
||||
await verifyReleaseOnNpm(version, isLatest());
|
||||
|
||||
@@ -63,6 +63,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install cmake
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.9'
|
||||
- name: Build HermesC Apple
|
||||
uses: ./.github/actions/build-hermesc-apple
|
||||
with:
|
||||
@@ -87,6 +91,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install cmake
|
||||
uses: jwlawson/actions-setup-cmake@v2
|
||||
with:
|
||||
cmake-version: '3.31.9'
|
||||
- name: Build Slice
|
||||
uses: ./.github/actions/build-apple-slices-hermes
|
||||
with:
|
||||
@@ -411,12 +419,12 @@ jobs:
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
|
||||
@@ -54,6 +54,8 @@ nexusPublishing {
|
||||
sonatype {
|
||||
username.set(sonatypeUsername)
|
||||
password.set(sonatypePassword)
|
||||
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
|
||||
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-9
@@ -29,8 +29,7 @@
|
||||
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
|
||||
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript-offline": "dtslint --localTs node_modules/typescript/lib packages/react-native/types",
|
||||
"test-typescript": "dtslint packages/react-native/types",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.test.json",
|
||||
"test": "jest",
|
||||
"fantom": "JS_DIR='..' yarn jest --config packages/react-native-fantom/config/jest.config.js",
|
||||
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
|
||||
@@ -49,10 +48,9 @@
|
||||
"@babel/plugin-transform-regenerator": "^7.24.7",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/preset-flow": "^7.24.7",
|
||||
"@definitelytyped/dtslint": "^0.0.127",
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@react-native/metro-babel-transformer": "0.79.0-main",
|
||||
"@react-native/metro-config": "0.79.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.79.7",
|
||||
"@react-native/metro-config": "0.79.7",
|
||||
"@tsconfig/node18": "1.0.1",
|
||||
"@types/react": "^19.0.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
@@ -89,10 +87,9 @@
|
||||
"jest-diff": "^29.7.0",
|
||||
"jest-junit": "^10.0.0",
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"jscodeshift": "^0.14.0",
|
||||
"metro-babel-register": "^0.81.0",
|
||||
"metro-memory-fs": "^0.81.0",
|
||||
"metro-transform-plugins": "^0.81.0",
|
||||
"metro-babel-register": "^0.82.0",
|
||||
"metro-memory-fs": "^0.82.0",
|
||||
"metro-transform-plugins": "^0.82.0",
|
||||
"micromatch": "^4.0.4",
|
||||
"node-fetch": "^2.2.0",
|
||||
"nullthrows": "^1.1.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -30,18 +30,18 @@ const {
|
||||
} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\");
|
||||
let nativeComponentName = 'RCTModule';
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'RCTModule',
|
||||
uiViewClassName: \\"RCTModule\\",
|
||||
bubblingEventTypes: {
|
||||
topBubblingEventDefinedInlineNull: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onBubblingEventDefinedInlineNullCapture',
|
||||
bubbled: 'onBubblingEventDefinedInlineNull'
|
||||
captured: \\"onBubblingEventDefinedInlineNullCapture\\",
|
||||
bubbled: \\"onBubblingEventDefinedInlineNull\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
directEventTypes: {
|
||||
topDirectEventDefinedInlineNull: {
|
||||
registrationName: 'onDirectEventDefinedInlineNull'
|
||||
registrationName: \\"onDirectEventDefinedInlineNull\\"
|
||||
}
|
||||
},
|
||||
validAttributes: {
|
||||
@@ -93,18 +93,18 @@ const {
|
||||
} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\");
|
||||
let nativeComponentName = 'RCTModule';
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'RCTModule',
|
||||
uiViewClassName: \\"RCTModule\\",
|
||||
bubblingEventTypes: {
|
||||
topBubblingEventDefinedInlineNull: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onBubblingEventDefinedInlineNullCapture',
|
||||
bubbled: 'onBubblingEventDefinedInlineNull'
|
||||
captured: \\"onBubblingEventDefinedInlineNullCapture\\",
|
||||
bubbled: \\"onBubblingEventDefinedInlineNull\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
directEventTypes: {
|
||||
topDirectEventDefinedInlineNull: {
|
||||
registrationName: 'onDirectEventDefinedInlineNull'
|
||||
registrationName: \\"onDirectEventDefinedInlineNull\\"
|
||||
}
|
||||
},
|
||||
validAttributes: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.79.0-main"
|
||||
"@react-native/codegen": "0.79.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,17 +22,17 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.79.0-main",
|
||||
"@react-native/dev-middleware": "0.79.7",
|
||||
"chalk": "^4.0.0",
|
||||
"debug": "^2.2.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro": "^0.81.0",
|
||||
"metro-config": "^0.81.0",
|
||||
"metro-core": "^0.81.0",
|
||||
"metro": "^0.82.0",
|
||||
"metro-config": "^0.82.0",
|
||||
"metro-core": "^0.82.0",
|
||||
"semver": "^7.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"metro-resolver": "^0.81.0"
|
||||
"metro-resolver": "^0.82.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-native-community/cli": "*"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@generated SignedSource<<347069bf171def94f2e48bf1e82bb02d>>
|
||||
Git revision: 97e9912605ce73b06f67fc607c1a5c434a67d6de
|
||||
@generated SignedSource<<9e23a5a4010ff3bcfbba08cbb7e7a860>>
|
||||
Git revision: 8f145a057709173f4025da317121a10366ef171a
|
||||
Built with --nohooks: false
|
||||
Is local checkout: false
|
||||
Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend
|
||||
Remote branch: main
|
||||
Remote URL: https://github.com/facebook/react-native-devtools-frontend
|
||||
Remote branch: 0.79-stable
|
||||
GN build args (overrides only):
|
||||
is_official_build = true
|
||||
Git status in checkout:
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Dev server middleware for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -23,7 +23,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@isaacs/ttlcache": "^1.4.1",
|
||||
"@react-native/debugger-frontend": "0.79.0-main",
|
||||
"@react-native/debugger-frontend": "0.79.7",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@react-native/eslint-plugin": "0.79.0-main",
|
||||
"@react-native/eslint-plugin": "0.79.7",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
||||
"@react-native/codegen": "0.79.0-main",
|
||||
"@react-native/codegen": "0.79.7",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+28
-1
@@ -8,12 +8,14 @@
|
||||
package com.facebook.react.utils
|
||||
|
||||
import com.facebook.react.utils.PropertyUtils.DEFAULT_INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY_DEFAULT
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_USE_HERMES_NIGHTLY
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_VERSION_NAME
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_INCLUDE_JITPACK_REPOSITORY
|
||||
import java.io.File
|
||||
import java.net.URI
|
||||
@@ -28,6 +30,12 @@ internal object DependencyUtils {
|
||||
* party libraries which are auto-linked.
|
||||
*/
|
||||
fun configureRepositories(project: Project) {
|
||||
val exclusiveEnterpriseRepository = project.rootProject.exclusiveEnterpriseRepository()
|
||||
if (exclusiveEnterpriseRepository != null) {
|
||||
project.logger.lifecycle(
|
||||
"Replacing ALL Maven Repositories with: $exclusiveEnterpriseRepository")
|
||||
}
|
||||
|
||||
project.rootProject.allprojects { eachProject ->
|
||||
with(eachProject) {
|
||||
if (hasProperty(INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO)) {
|
||||
@@ -36,8 +44,18 @@ internal object DependencyUtils {
|
||||
repo.content { it.excludeGroup("org.webkit") }
|
||||
}
|
||||
}
|
||||
|
||||
if (exclusiveEnterpriseRepository != null) {
|
||||
// We remove all previously set repositories and only configure the proxy provided by the
|
||||
// user.
|
||||
rootProject.repositories.clear()
|
||||
mavenRepoFromUrl(exclusiveEnterpriseRepository)
|
||||
// We return here as we don't want to configure other repositories as well.
|
||||
return@allprojects
|
||||
}
|
||||
|
||||
// We add the snapshot for users on nightlies.
|
||||
mavenRepoFromUrl("https://oss.sonatype.org/content/repositories/snapshots/") { repo ->
|
||||
mavenRepoFromUrl("https://central.sonatype.com/repository/maven-snapshots/") { repo ->
|
||||
repo.content { it.excludeGroup("org.webkit") }
|
||||
}
|
||||
repositories.mavenCentral { repo ->
|
||||
@@ -181,4 +199,13 @@ internal object DependencyUtils {
|
||||
property(INCLUDE_JITPACK_REPOSITORY).toString().toBoolean()
|
||||
else -> INCLUDE_JITPACK_REPOSITORY_DEFAULT
|
||||
}
|
||||
|
||||
internal fun Project.exclusiveEnterpriseRepository() =
|
||||
when {
|
||||
hasProperty(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
|
||||
property(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
|
||||
hasProperty(EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
|
||||
property(EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ import org.gradle.api.Action
|
||||
import org.gradle.api.JavaVersion
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.AppliedPlugin
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension
|
||||
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
||||
|
||||
internal object JdkConfiguratorUtils {
|
||||
/**
|
||||
@@ -42,10 +42,10 @@ internal object JdkConfiguratorUtils {
|
||||
project.pluginManager.withPlugin("com.android.application", action)
|
||||
project.pluginManager.withPlugin("com.android.library", action)
|
||||
project.pluginManager.withPlugin("org.jetbrains.kotlin.android") {
|
||||
project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(17)
|
||||
project.kotlinExtension.jvmToolchain(17)
|
||||
}
|
||||
project.pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
|
||||
project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(17)
|
||||
project.kotlinExtension.jvmToolchain(17)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -30,6 +30,12 @@ object PropertyUtils {
|
||||
const val INCLUDE_JITPACK_REPOSITORY = "includeJitpackRepository"
|
||||
const val SCOPED_INCLUDE_JITPACK_REPOSITORY = "react.includeJitpackRepository"
|
||||
|
||||
/**
|
||||
* Public property that allows to configure an enterprise repository proxy as exclusive repository
|
||||
*/
|
||||
const val EXCLUSIVE_ENTEPRISE_REPOSITORY = "exclusiveEnterpriseRepository"
|
||||
const val SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY = "react.exclusiveEnterpriseRepository"
|
||||
|
||||
/** By default we include JitPack to avoid breaking user builds */
|
||||
internal const val INCLUDE_JITPACK_REPOSITORY_DEFAULT = true
|
||||
|
||||
|
||||
+46
-3
@@ -10,6 +10,7 @@ package com.facebook.react.utils
|
||||
import com.facebook.react.tests.createProject
|
||||
import com.facebook.react.utils.DependencyUtils.configureDependencies
|
||||
import com.facebook.react.utils.DependencyUtils.configureRepositories
|
||||
import com.facebook.react.utils.DependencyUtils.exclusiveEnterpriseRepository
|
||||
import com.facebook.react.utils.DependencyUtils.getDependencySubstitutions
|
||||
import com.facebook.react.utils.DependencyUtils.mavenRepoFromURI
|
||||
import com.facebook.react.utils.DependencyUtils.mavenRepoFromUrl
|
||||
@@ -45,7 +46,7 @@ class DependencyUtilsTest {
|
||||
|
||||
@Test
|
||||
fun configureRepositories_containsSnapshotRepo() {
|
||||
val repositoryURI = URI.create("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
val repositoryURI = URI.create("https://central.sonatype.com/repository/maven-snapshots/")
|
||||
val project = createProject()
|
||||
|
||||
configureRepositories(project)
|
||||
@@ -99,6 +100,24 @@ class DependencyUtilsTest {
|
||||
.isNotNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureRepositories_withExclusiveEnterpriseRepository_replacesAllRepositories() {
|
||||
val repositoryURI = URI.create("https://maven.myfabolousorganization.it")
|
||||
|
||||
val project = createProject()
|
||||
project.rootProject.extensions.extraProperties.set(
|
||||
"exclusiveEnterpriseRepository", repositoryURI.toString())
|
||||
|
||||
configureRepositories(project)
|
||||
|
||||
assertThat(project.repositories).hasSize(1)
|
||||
assertThat(
|
||||
project.repositories.firstOrNull {
|
||||
it is MavenArtifactRepository && it.url == repositoryURI
|
||||
})
|
||||
.isNotNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureRepositories_withIncludeJitpackRepositoryFalse_doesNotContainJitPack() {
|
||||
val repositoryURI = URI.create("https://www.jitpack.io")
|
||||
@@ -176,7 +195,7 @@ class DependencyUtilsTest {
|
||||
|
||||
@Test
|
||||
fun configureRepositories_snapshotRepoHasHigherPriorityThanMavenCentral() {
|
||||
val repositoryURI = URI.create("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
val repositoryURI = URI.create("https://central.sonatype.com/repository/maven-snapshots/")
|
||||
val mavenCentralURI = URI.create("https://repo.maven.apache.org/maven2/")
|
||||
val project = createProject()
|
||||
|
||||
@@ -470,7 +489,7 @@ class DependencyUtilsTest {
|
||||
@Test
|
||||
fun shouldAddJitPack_withUnscopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set("react.includeJitpackRepository", "false")
|
||||
project.extensions.extraProperties.set("includeJitpackRepository", "false")
|
||||
assertThat(project.shouldAddJitPack()).isFalse()
|
||||
}
|
||||
|
||||
@@ -479,4 +498,28 @@ class DependencyUtilsTest {
|
||||
val project = createProject(tempFolder.root)
|
||||
assertThat(project.shouldAddJitPack()).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_withScopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set(
|
||||
"react.exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
|
||||
assertThat(project.exclusiveEnterpriseRepository())
|
||||
.isEqualTo("https://maven.myfabolousorganization.it")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_withUnscopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set(
|
||||
"exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
|
||||
assertThat(project.exclusiveEnterpriseRepository())
|
||||
.isEqualTo("https://maven.myfabolousorganization.it")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_defaultIsTrue() {
|
||||
val project = createProject(tempFolder.root)
|
||||
assertThat(project.exclusiveEnterpriseRepository()).isNull()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "helloworld",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"bootstrap": "node ./cli.js bootstrap",
|
||||
@@ -13,16 +13,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "19.0.0",
|
||||
"react-native": "1000.0.0"
|
||||
"react-native": "0.79.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/runtime": "^7.25.0",
|
||||
"@react-native/babel-preset": "0.79.0-main",
|
||||
"@react-native/core-cli-utils": "0.79.0-main",
|
||||
"@react-native/eslint-config": "0.79.0-main",
|
||||
"@react-native/metro-config": "0.79.0-main",
|
||||
"@react-native/babel-preset": "0.79.7",
|
||||
"@react-native/core-cli-utils": "0.79.7",
|
||||
"@react-native/eslint-config": "0.79.7",
|
||||
"@react-native/metro-config": "0.79.7",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^12.0.0",
|
||||
"eslint": "^8.19.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,9 +26,9 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.79.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.79.0-main",
|
||||
"metro-config": "^0.81.0",
|
||||
"metro-runtime": "^0.81.0"
|
||||
"@react-native/js-polyfills": "0.79.7",
|
||||
"@react-native/metro-babel-transformer": "0.79.7",
|
||||
"metro-config": "^0.82.0",
|
||||
"metro-runtime": "^0.82.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export function getDefaultConfig(projectRoot: string): ConfigT {
|
||||
resolver: {
|
||||
resolverMainFields: ['react-native', 'browser', 'main'],
|
||||
platforms: ['android', 'ios'],
|
||||
unstable_conditionNames: ['require', 'import', 'react-native'],
|
||||
unstable_conditionNames: ['react-native'],
|
||||
},
|
||||
serializer: {
|
||||
// Note: This option is overridden in cli-plugin-metro (getOverrideConfig)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Babel preset for React Native applications",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -55,7 +55,7 @@
|
||||
"@babel/plugin-transform-typescript": "^7.25.2",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.24.7",
|
||||
"@babel/template": "^7.25.0",
|
||||
"@react-native/babel-plugin-codegen": "0.79.0-main",
|
||||
"@react-native/babel-plugin-codegen": "0.79.7",
|
||||
"babel-plugin-syntax-hermes-parser": "0.25.1",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"react-refresh": "^0.14.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-babel-transformer",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Babel transformer for React Native applications.",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.79.0-main",
|
||||
"@react-native/babel-preset": "0.79.7",
|
||||
"hermes-parser": "0.25.1",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/bots",
|
||||
"description": "React Native Bots",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen-typescript-test",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"private": true,
|
||||
"description": "TypeScript related unit test for @react-native/codegen",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"prepare": "yarn run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.79.0-main"
|
||||
"@react-native/codegen": "0.79.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
|
||||
+85
-171
@@ -19,21 +19,16 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ArrayPropsNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ArrayPropsNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"ArrayPropsNativeComponentView\\",
|
||||
validAttributes: {
|
||||
names: true,
|
||||
disableds: true,
|
||||
progress: true,
|
||||
radii: true,
|
||||
|
||||
colors: {
|
||||
process: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/StyleSheet/processColorArray')),
|
||||
process: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/StyleSheet/processColorArray'))
|
||||
},
|
||||
|
||||
srcs: true,
|
||||
points: true,
|
||||
edgeInsets: true,
|
||||
@@ -41,10 +36,9 @@ export const __INTERNAL_VIEW_CONFIG = {
|
||||
sizes: true,
|
||||
object: true,
|
||||
arrayOfObjects: true,
|
||||
arrayOfMixed: true,
|
||||
},
|
||||
arrayOfMixed: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -69,17 +63,13 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'BooleanPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'BooleanPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"BooleanPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
disabledNullable: true,
|
||||
},
|
||||
disabledNullable: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -104,18 +94,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ColorPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ColorPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"ColorPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
tintColor: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default,
|
||||
},
|
||||
},
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -140,16 +126,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'DimensionPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'DimensionPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"DimensionPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
marginBack: true,
|
||||
},
|
||||
marginBack: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -174,13 +156,10 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'EdgeInsetsPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'EdgeInsetsPropNativeComponentView',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"EdgeInsetsPropNativeComponentView\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -205,17 +184,13 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'EnumPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'EnumPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"EnumPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
alignment: true,
|
||||
intervals: true,
|
||||
},
|
||||
intervals: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -241,29 +216,23 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');
|
||||
|
||||
let nativeComponentName = 'EventNestedObjectPropsNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'EventNestedObjectPropsNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"EventNestedObjectPropsNativeComponentView\\",
|
||||
bubblingEventTypes: {
|
||||
topChange: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onChangeCapture',
|
||||
bubbled: 'onChange',
|
||||
},
|
||||
},
|
||||
captured: \\"onChangeCapture\\",
|
||||
bubbled: \\"onChange\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
|
||||
...ConditionallyIgnoredEventHandlers({
|
||||
onChange: true,
|
||||
}),
|
||||
},
|
||||
onChange: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -289,62 +258,51 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');
|
||||
|
||||
let nativeComponentName = 'EventPropsNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'EventPropsNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"EventPropsNativeComponentView\\",
|
||||
bubblingEventTypes: {
|
||||
topPaperDirectName: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onChangeCapture',
|
||||
bubbled: 'onChange',
|
||||
},
|
||||
captured: \\"onChangeCapture\\",
|
||||
bubbled: \\"onChange\\"
|
||||
}
|
||||
},
|
||||
|
||||
topEnd: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onEndCapture',
|
||||
bubbled: 'onEnd',
|
||||
},
|
||||
captured: \\"onEndCapture\\",
|
||||
bubbled: \\"onEnd\\"
|
||||
}
|
||||
},
|
||||
|
||||
topPaperBubblingName: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onEventBubblingWithPaperNameCapture',
|
||||
bubbled: 'onEventBubblingWithPaperName',
|
||||
},
|
||||
},
|
||||
captured: \\"onEventBubblingWithPaperNameCapture\\",
|
||||
bubbled: \\"onEventBubblingWithPaperName\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
directEventTypes: {
|
||||
topEventDirect: {
|
||||
registrationName: 'onEventDirect',
|
||||
registrationName: \\"onEventDirect\\"
|
||||
},
|
||||
|
||||
topPaperDirectName: {
|
||||
registrationName: 'onEventDirectWithPaperName',
|
||||
registrationName: \\"onEventDirectWithPaperName\\"
|
||||
},
|
||||
|
||||
topPaperBubblingName: {
|
||||
registrationName: 'onOrientationChange',
|
||||
},
|
||||
registrationName: \\"onOrientationChange\\"
|
||||
}
|
||||
},
|
||||
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
|
||||
...ConditionallyIgnoredEventHandlers({
|
||||
onChange: true,
|
||||
onEventDirect: true,
|
||||
onEventDirectWithPaperName: true,
|
||||
onOrientationChange: true,
|
||||
onEnd: true,
|
||||
onEventBubblingWithPaperName: true,
|
||||
}),
|
||||
},
|
||||
onEventBubblingWithPaperName: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -369,11 +327,8 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'FloatPropsNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'FloatPropsNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"FloatPropsNativeComponentView\\",
|
||||
validAttributes: {
|
||||
blurRadius: true,
|
||||
blurRadius2: true,
|
||||
@@ -381,10 +336,9 @@ export const __INTERNAL_VIEW_CONFIG = {
|
||||
blurRadius4: true,
|
||||
blurRadius5: true,
|
||||
blurRadius6: true,
|
||||
blurRadiusNullable: true,
|
||||
},
|
||||
blurRadiusNullable: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -409,18 +363,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ImagePropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ImagePropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"ImagePropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
thumbImage: {
|
||||
process: require('react-native/Libraries/Image/resolveAssetSource'),
|
||||
},
|
||||
},
|
||||
process: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Image/resolveAssetSource'))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -445,18 +395,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'IntegerPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'IntegerPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"IntegerPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
progress1: true,
|
||||
progress2: true,
|
||||
progress3: true,
|
||||
},
|
||||
progress3: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -482,29 +428,23 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');
|
||||
|
||||
let nativeComponentName = 'RCTInterfaceOnlyComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'RCTInterfaceOnlyComponent',
|
||||
|
||||
uiViewClassName: \\"RCTInterfaceOnlyComponent\\",
|
||||
bubblingEventTypes: {
|
||||
topChange: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onChangeCapture',
|
||||
bubbled: 'onChange',
|
||||
},
|
||||
},
|
||||
captured: \\"onChangeCapture\\",
|
||||
bubbled: \\"onChange\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
validAttributes: {
|
||||
title: true,
|
||||
|
||||
...ConditionallyIgnoredEventHandlers({
|
||||
onChange: true,
|
||||
}),
|
||||
},
|
||||
onChange: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -529,16 +469,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'MixedPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MixedPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"MixedPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
mixedProp: true,
|
||||
},
|
||||
mixedProp: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -563,30 +499,23 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'MultiNativePropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MultiNativePropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"MultiNativePropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
thumbImage: {
|
||||
process: require('react-native/Libraries/Image/resolveAssetSource'),
|
||||
process: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Image/resolveAssetSource'))
|
||||
},
|
||||
|
||||
color: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default,
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default
|
||||
},
|
||||
|
||||
thumbTintColor: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default,
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default
|
||||
},
|
||||
|
||||
point: {
|
||||
diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer')),
|
||||
},
|
||||
},
|
||||
diff: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer'))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -611,13 +540,10 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'NoPropsNoEventsNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'NoPropsNoEventsNativeComponentView',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"NoPropsNoEventsNativeComponentView\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -642,18 +568,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ObjectPropsNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ObjectPropsNativeComponent',
|
||||
|
||||
uiViewClassName: \\"ObjectPropsNativeComponent\\",
|
||||
validAttributes: {
|
||||
objectProp: true,
|
||||
objectArrayProp: true,
|
||||
objectPrimitiveRequiredProp: true,
|
||||
},
|
||||
objectPrimitiveRequiredProp: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -678,18 +600,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'PointPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'PointPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"PointPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
startPoint: {
|
||||
diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer')),
|
||||
},
|
||||
},
|
||||
diff: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer'))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -714,17 +632,13 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'StringPropNativeComponentView';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'StringPropNativeComponentView',
|
||||
|
||||
uiViewClassName: \\"StringPropNativeComponentView\\",
|
||||
validAttributes: {
|
||||
placeholder: true,
|
||||
defaultValue: true,
|
||||
},
|
||||
defaultValue: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -29,24 +29,24 @@
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/parser": "^7.25.3",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-parser": "0.25.1",
|
||||
"invariant": "^2.2.4",
|
||||
"jscodeshift": "^17.0.0",
|
||||
"nullthrows": "^1.1.1",
|
||||
"yargs": "^17.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.24.7",
|
||||
"@babel/plugin-transform-class-properties": "^7.25.4",
|
||||
"@babel/plugin-transform-destructuring": "^7.24.8",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
||||
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7",
|
||||
"@babel/plugin-transform-object-rest-spread": "^7.24.7",
|
||||
"@babel/plugin-transform-optional-chaining": "^7.24.8",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.24.7",
|
||||
"@babel/plugin-transform-destructuring": "^7.24.8",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"chalk": "^4.0.0",
|
||||
"hermes-estree": "0.25.1",
|
||||
@@ -55,6 +55,6 @@
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/preset-env": "^7.1.6"
|
||||
"@babel/core": "*"
|
||||
}
|
||||
}
|
||||
|
||||
+126
-137
@@ -16,7 +16,8 @@ import type {
|
||||
} from '../../CodegenSchema';
|
||||
import type {SchemaType} from '../../CodegenSchema';
|
||||
|
||||
const j = require('jscodeshift');
|
||||
const core = require('@babel/core');
|
||||
const t = core.types;
|
||||
|
||||
// File path -> contents
|
||||
type FilesOutput = Map<string, string>;
|
||||
@@ -50,6 +51,10 @@ ${componentConfig}
|
||||
// this multiple times.
|
||||
const UIMANAGER_IMPORT = 'const {UIManager} = require("react-native")';
|
||||
|
||||
function expression(input: string) {
|
||||
return core.template.expression(input)();
|
||||
}
|
||||
|
||||
function getReactDiffProcessValue(typeAnnotation: PropTypeAnnotation) {
|
||||
switch (typeAnnotation.type) {
|
||||
case 'BooleanTypeAnnotation':
|
||||
@@ -61,25 +66,29 @@ function getReactDiffProcessValue(typeAnnotation: PropTypeAnnotation) {
|
||||
case 'StringEnumTypeAnnotation':
|
||||
case 'Int32EnumTypeAnnotation':
|
||||
case 'MixedTypeAnnotation':
|
||||
return j.literal(true);
|
||||
return t.booleanLiteral(true);
|
||||
case 'ReservedPropTypeAnnotation':
|
||||
switch (typeAnnotation.name) {
|
||||
case 'ColorPrimitive':
|
||||
return j.template
|
||||
.expression`{ process: require('react-native/Libraries/StyleSheet/processColor').default }`;
|
||||
return expression(
|
||||
`{ process: require('react-native/Libraries/StyleSheet/processColor').default }`,
|
||||
);
|
||||
case 'ImageSourcePrimitive':
|
||||
return j.template
|
||||
.expression`{ process: require('react-native/Libraries/Image/resolveAssetSource') }`;
|
||||
return expression(
|
||||
"{ process: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Image/resolveAssetSource')) }",
|
||||
);
|
||||
case 'ImageRequestPrimitive':
|
||||
throw new Error('ImageRequest should not be used in props');
|
||||
case 'PointPrimitive':
|
||||
return j.template
|
||||
.expression`{ diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer')) }`;
|
||||
return expression(
|
||||
`{ diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer')) }`,
|
||||
);
|
||||
case 'EdgeInsetsPrimitive':
|
||||
return j.template
|
||||
.expression`{ diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/insetsDiffer')) }`;
|
||||
return expression(
|
||||
`{ diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/insetsDiffer')) }`,
|
||||
);
|
||||
case 'DimensionPrimitive':
|
||||
return j.literal(true);
|
||||
return t.booleanLiteral(true);
|
||||
default:
|
||||
(typeAnnotation.name: empty);
|
||||
throw new Error(
|
||||
@@ -90,20 +99,21 @@ function getReactDiffProcessValue(typeAnnotation: PropTypeAnnotation) {
|
||||
if (typeAnnotation.elementType.type === 'ReservedPropTypeAnnotation') {
|
||||
switch (typeAnnotation.elementType.name) {
|
||||
case 'ColorPrimitive':
|
||||
return j.template
|
||||
.expression`{ process: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/StyleSheet/processColorArray')) }`;
|
||||
return expression(
|
||||
`{ process: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/StyleSheet/processColorArray')) }`,
|
||||
);
|
||||
case 'ImageSourcePrimitive':
|
||||
case 'PointPrimitive':
|
||||
case 'EdgeInsetsPrimitive':
|
||||
case 'DimensionPrimitive':
|
||||
return j.literal(true);
|
||||
return t.booleanLiteral(true);
|
||||
default:
|
||||
throw new Error(
|
||||
`Received unknown array native typeAnnotation: "${typeAnnotation.elementType.name}"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
return j.literal(true);
|
||||
return t.booleanLiteral(true);
|
||||
default:
|
||||
(typeAnnotation: empty);
|
||||
throw new Error(
|
||||
@@ -134,7 +144,7 @@ ${
|
||||
: ''
|
||||
}
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = VIEW_CONFIG;
|
||||
export const __INTERNAL_VIEW_CONFIG = %%VIEW_CONFIG%%;
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
`.trim();
|
||||
@@ -180,13 +190,16 @@ function getValidAttributesForEvents(
|
||||
"const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');",
|
||||
);
|
||||
|
||||
const validAttributes = j.objectExpression(
|
||||
const validAttributes = t.objectExpression(
|
||||
events.map(eventType => {
|
||||
return j.property('init', j.identifier(eventType.name), j.literal(true));
|
||||
return t.objectProperty(
|
||||
t.identifier(eventType.name),
|
||||
t.booleanLiteral(true),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
return j.callExpression(j.identifier('ConditionallyIgnoredEventHandlers'), [
|
||||
return t.callExpression(t.identifier('ConditionallyIgnoredEventHandlers'), [
|
||||
validAttributes,
|
||||
]);
|
||||
}
|
||||
@@ -195,20 +208,20 @@ function generateBubblingEventInfo(
|
||||
event: EventTypeShape,
|
||||
nameOveride: void | string,
|
||||
) {
|
||||
return j.property(
|
||||
'init',
|
||||
j.identifier(normalizeInputEventName(nameOveride || event.name)),
|
||||
j.objectExpression([
|
||||
j.property(
|
||||
'init',
|
||||
j.identifier('phasedRegistrationNames'),
|
||||
j.objectExpression([
|
||||
j.property(
|
||||
'init',
|
||||
j.identifier('captured'),
|
||||
j.literal(`${event.name}Capture`),
|
||||
return t.objectProperty(
|
||||
t.identifier(normalizeInputEventName(nameOveride || event.name)),
|
||||
t.objectExpression([
|
||||
t.objectProperty(
|
||||
t.identifier('phasedRegistrationNames'),
|
||||
t.objectExpression([
|
||||
t.objectProperty(
|
||||
t.identifier('captured'),
|
||||
t.stringLiteral(`${event.name}Capture`),
|
||||
),
|
||||
t.objectProperty(
|
||||
t.identifier('bubbled'),
|
||||
t.stringLiteral(event.name),
|
||||
),
|
||||
j.property('init', j.identifier('bubbled'), j.literal(event.name)),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
@@ -219,14 +232,12 @@ function generateDirectEventInfo(
|
||||
event: EventTypeShape,
|
||||
nameOveride: void | string,
|
||||
) {
|
||||
return j.property(
|
||||
'init',
|
||||
j.identifier(normalizeInputEventName(nameOveride || event.name)),
|
||||
j.objectExpression([
|
||||
j.property(
|
||||
'init',
|
||||
j.identifier('registrationName'),
|
||||
j.literal(event.name),
|
||||
return t.objectProperty(
|
||||
t.identifier(normalizeInputEventName(nameOveride || event.name)),
|
||||
t.objectExpression([
|
||||
t.objectProperty(
|
||||
t.identifier('registrationName'),
|
||||
t.stringLiteral(event.name),
|
||||
),
|
||||
]),
|
||||
);
|
||||
@@ -261,20 +272,15 @@ function buildViewConfig(
|
||||
}
|
||||
});
|
||||
|
||||
const validAttributes = j.objectExpression([
|
||||
const validAttributes = t.objectExpression([
|
||||
...componentProps.map(schemaProp => {
|
||||
return j.property(
|
||||
'init',
|
||||
j.identifier(schemaProp.name),
|
||||
return t.objectProperty(
|
||||
t.identifier(schemaProp.name),
|
||||
getReactDiffProcessValue(schemaProp.typeAnnotation),
|
||||
);
|
||||
}),
|
||||
...(componentEvents.length > 0
|
||||
? [
|
||||
j.spreadProperty(
|
||||
getValidAttributesForEvents(componentEvents, imports),
|
||||
),
|
||||
]
|
||||
? [t.spreadElement(getValidAttributesForEvents(componentEvents, imports))]
|
||||
: []),
|
||||
]);
|
||||
|
||||
@@ -294,15 +300,6 @@ function buildViewConfig(
|
||||
return bubblingEvents;
|
||||
}, []);
|
||||
|
||||
const bubblingEvents =
|
||||
bubblingEventNames.length > 0
|
||||
? j.property(
|
||||
'init',
|
||||
j.identifier('bubblingEventTypes'),
|
||||
j.objectExpression(bubblingEventNames),
|
||||
)
|
||||
: null;
|
||||
|
||||
const directEventNames = component.events
|
||||
.filter(event => event.bubblingType === 'direct')
|
||||
.reduce((directEvents: Array<any>, event) => {
|
||||
@@ -319,27 +316,34 @@ function buildViewConfig(
|
||||
return directEvents;
|
||||
}, []);
|
||||
|
||||
const directEvents =
|
||||
directEventNames.length > 0
|
||||
? j.property(
|
||||
'init',
|
||||
j.identifier('directEventTypes'),
|
||||
j.objectExpression(directEventNames),
|
||||
)
|
||||
: null;
|
||||
|
||||
const properties = [
|
||||
j.property(
|
||||
'init',
|
||||
j.identifier('uiViewClassName'),
|
||||
j.literal(componentName),
|
||||
t.objectProperty(
|
||||
t.identifier('uiViewClassName'),
|
||||
t.stringLiteral(componentName),
|
||||
),
|
||||
bubblingEvents,
|
||||
directEvents,
|
||||
j.property('init', j.identifier('validAttributes'), validAttributes),
|
||||
].filter(Boolean);
|
||||
];
|
||||
|
||||
return j.objectExpression(properties);
|
||||
if (bubblingEventNames.length > 0) {
|
||||
properties.push(
|
||||
t.objectProperty(
|
||||
t.identifier('bubblingEventTypes'),
|
||||
t.objectExpression(bubblingEventNames),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (directEventNames.length > 0) {
|
||||
properties.push(
|
||||
t.objectProperty(
|
||||
t.identifier('directEventTypes'),
|
||||
t.objectExpression(directEventNames),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
properties.push(
|
||||
t.objectProperty(t.identifier('validAttributes'), validAttributes),
|
||||
);
|
||||
return t.objectExpression(properties);
|
||||
}
|
||||
|
||||
function buildCommands(
|
||||
@@ -358,45 +362,32 @@ function buildCommands(
|
||||
'const {dispatchCommand} = require("react-native/Libraries/ReactNative/RendererProxy");',
|
||||
);
|
||||
|
||||
const properties = commands.map(command => {
|
||||
const commandName = command.name;
|
||||
const params = command.typeAnnotation.params;
|
||||
const commandsObject = t.objectExpression(
|
||||
commands.map(command => {
|
||||
const commandName = command.name;
|
||||
const params = command.typeAnnotation.params;
|
||||
|
||||
const commandNameLiteral = j.literal(commandName);
|
||||
const commandNameIdentifier = j.identifier(commandName);
|
||||
const arrayParams = j.arrayExpression(
|
||||
params.map(param => {
|
||||
return j.identifier(param.name);
|
||||
}),
|
||||
);
|
||||
const dispatchCommandCall = t.callExpression(
|
||||
t.identifier('dispatchCommand'),
|
||||
[
|
||||
t.identifier('ref'),
|
||||
t.stringLiteral(commandName),
|
||||
t.arrayExpression(params.map(param => t.identifier(param.name))),
|
||||
],
|
||||
);
|
||||
|
||||
const expression = j.template
|
||||
.expression`dispatchCommand(ref, ${commandNameLiteral}, ${arrayParams})`;
|
||||
return t.objectMethod(
|
||||
'method',
|
||||
t.identifier(commandName),
|
||||
[t.identifier('ref'), ...params.map(param => t.identifier(param.name))],
|
||||
t.blockStatement([t.expressionStatement(dispatchCommandCall)]),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
const functionParams = params.map(param => {
|
||||
return j.identifier(param.name);
|
||||
});
|
||||
|
||||
const property = j.property(
|
||||
'init',
|
||||
commandNameIdentifier,
|
||||
j.functionExpression(
|
||||
null,
|
||||
[j.identifier('ref'), ...functionParams],
|
||||
j.blockStatement([j.expressionStatement(expression)]),
|
||||
),
|
||||
);
|
||||
property.method = true;
|
||||
|
||||
return property;
|
||||
});
|
||||
|
||||
return j.exportNamedDeclaration(
|
||||
j.variableDeclaration('const', [
|
||||
j.variableDeclarator(
|
||||
j.identifier('Commands'),
|
||||
j.objectExpression(properties),
|
||||
),
|
||||
return t.exportNamedDeclaration(
|
||||
t.variableDeclaration('const', [
|
||||
t.variableDeclarator(t.identifier('Commands'), commandsObject),
|
||||
]),
|
||||
);
|
||||
}
|
||||
@@ -431,42 +422,40 @@ module.exports = {
|
||||
component.paperComponentNameDeprecated,
|
||||
});
|
||||
|
||||
const replacedSourceRoot = j.withParser('flow')(replacedTemplate);
|
||||
|
||||
const paperComponentName =
|
||||
component.paperComponentName ?? componentName;
|
||||
|
||||
replacedSourceRoot
|
||||
.find(j.Identifier, {
|
||||
name: 'VIEW_CONFIG',
|
||||
})
|
||||
.replaceWith(
|
||||
buildViewConfig(
|
||||
schema,
|
||||
paperComponentName,
|
||||
component,
|
||||
imports,
|
||||
),
|
||||
);
|
||||
const replacedSourceRoot = core.template.program(
|
||||
replacedTemplate,
|
||||
)({
|
||||
VIEW_CONFIG: buildViewConfig(
|
||||
schema,
|
||||
paperComponentName,
|
||||
component,
|
||||
imports,
|
||||
),
|
||||
});
|
||||
|
||||
const commands = buildCommands(
|
||||
const commandsExport = buildCommands(
|
||||
schema,
|
||||
paperComponentName,
|
||||
component,
|
||||
imports,
|
||||
);
|
||||
if (commands) {
|
||||
replacedSourceRoot
|
||||
.find(j.ExportDefaultDeclaration)
|
||||
.insertAfter(j(commands).toSource());
|
||||
if (commandsExport) {
|
||||
replacedSourceRoot.body.push(commandsExport);
|
||||
}
|
||||
|
||||
const replacedSource: string = replacedSourceRoot.toSource({
|
||||
quote: 'single',
|
||||
trailingComma: true,
|
||||
});
|
||||
|
||||
return replacedSource;
|
||||
const replacedSource = core.transformFromAstSync(
|
||||
replacedSourceRoot,
|
||||
undefined,
|
||||
{
|
||||
babelrc: false,
|
||||
browserslistConfigFile: false,
|
||||
configFile: false,
|
||||
},
|
||||
);
|
||||
return replacedSource.code;
|
||||
})
|
||||
.join('\n\n');
|
||||
})
|
||||
|
||||
+149
-297
@@ -19,21 +19,16 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ArrayPropsNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ArrayPropsNativeComponent',
|
||||
|
||||
uiViewClassName: \\"ArrayPropsNativeComponent\\",
|
||||
validAttributes: {
|
||||
names: true,
|
||||
disableds: true,
|
||||
progress: true,
|
||||
radii: true,
|
||||
|
||||
colors: {
|
||||
process: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/StyleSheet/processColorArray')),
|
||||
process: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/StyleSheet/processColorArray'))
|
||||
},
|
||||
|
||||
srcs: true,
|
||||
points: true,
|
||||
dimensions: true,
|
||||
@@ -41,10 +36,9 @@ export const __INTERNAL_VIEW_CONFIG = {
|
||||
object: true,
|
||||
array: true,
|
||||
arrayOfArrayOfObject: true,
|
||||
arrayOfMixed: true,
|
||||
},
|
||||
arrayOfMixed: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -69,16 +63,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ArrayPropsNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ArrayPropsNativeComponent',
|
||||
|
||||
uiViewClassName: \\"ArrayPropsNativeComponent\\",
|
||||
validAttributes: {
|
||||
nativePrimitives: true,
|
||||
},
|
||||
nativePrimitives: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -103,16 +93,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'BooleanPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'BooleanPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"BooleanPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -137,18 +123,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ColorPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ColorPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"ColorPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
tintColor: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default,
|
||||
},
|
||||
},
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -174,23 +156,18 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {dispatchCommand} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\");
|
||||
|
||||
let nativeComponentName = 'CommandNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'CommandNativeComponent',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"CommandNativeComponent\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
|
||||
export const Commands = {
|
||||
flashScrollIndicators(ref) {
|
||||
dispatchCommand(ref, \\"flashScrollIndicators\\", []);
|
||||
},
|
||||
|
||||
allTypes(ref, x, y, z, message, animated, locations) {
|
||||
dispatchCommand(ref, \\"allTypes\\", [x, y, z, message, animated, locations]);
|
||||
}
|
||||
flashScrollIndicators(ref) {
|
||||
dispatchCommand(ref, \\"flashScrollIndicators\\", []);
|
||||
},
|
||||
allTypes(ref, x, y, z, message, animated, locations) {
|
||||
dispatchCommand(ref, \\"allTypes\\", [x, y, z, message, animated, locations]);
|
||||
}
|
||||
};
|
||||
",
|
||||
}
|
||||
@@ -216,30 +193,23 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {dispatchCommand} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\");
|
||||
|
||||
let nativeComponentName = 'CommandNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'CommandNativeComponent',
|
||||
|
||||
uiViewClassName: \\"CommandNativeComponent\\",
|
||||
validAttributes: {
|
||||
accessibilityHint: true,
|
||||
},
|
||||
accessibilityHint: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
|
||||
export const Commands = {
|
||||
handleRootTag(ref, rootTag) {
|
||||
dispatchCommand(ref, \\"handleRootTag\\", [rootTag]);
|
||||
},
|
||||
|
||||
hotspotUpdate(ref, x, y) {
|
||||
dispatchCommand(ref, \\"hotspotUpdate\\", [x, y]);
|
||||
},
|
||||
|
||||
addItems(ref, items) {
|
||||
dispatchCommand(ref, \\"addItems\\", [items]);
|
||||
}
|
||||
handleRootTag(ref, rootTag) {
|
||||
dispatchCommand(ref, \\"handleRootTag\\", [rootTag]);
|
||||
},
|
||||
hotspotUpdate(ref, x, y) {
|
||||
dispatchCommand(ref, \\"hotspotUpdate\\", [x, y]);
|
||||
},
|
||||
addItems(ref, items) {
|
||||
dispatchCommand(ref, \\"addItems\\", [items]);
|
||||
}
|
||||
};
|
||||
",
|
||||
}
|
||||
@@ -264,16 +234,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'DimensionPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'DimensionPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"DimensionPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
marginBack: true,
|
||||
},
|
||||
marginBack: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -298,21 +264,17 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'DoublePropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'DoublePropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"DoublePropNativeComponent\\",
|
||||
validAttributes: {
|
||||
blurRadius: true,
|
||||
blurRadius2: true,
|
||||
blurRadius3: true,
|
||||
blurRadius4: true,
|
||||
blurRadius5: true,
|
||||
blurRadius6: true,
|
||||
},
|
||||
blurRadius6: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -338,29 +300,23 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');
|
||||
|
||||
let nativeComponentName = 'EventsNestedObjectNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'EventsNestedObjectNativeComponent',
|
||||
|
||||
uiViewClassName: \\"EventsNestedObjectNativeComponent\\",
|
||||
bubblingEventTypes: {
|
||||
topChange: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onChangeCapture',
|
||||
bubbled: 'onChange',
|
||||
},
|
||||
},
|
||||
captured: \\"onChangeCapture\\",
|
||||
bubbled: \\"onChange\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
|
||||
...ConditionallyIgnoredEventHandlers({
|
||||
onChange: true,
|
||||
}),
|
||||
},
|
||||
onChange: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -386,62 +342,51 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');
|
||||
|
||||
let nativeComponentName = 'EventsNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'EventsNativeComponent',
|
||||
|
||||
uiViewClassName: \\"EventsNativeComponent\\",
|
||||
bubblingEventTypes: {
|
||||
topChange: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onChangeCapture',
|
||||
bubbled: 'onChange',
|
||||
},
|
||||
captured: \\"onChangeCapture\\",
|
||||
bubbled: \\"onChange\\"
|
||||
}
|
||||
},
|
||||
|
||||
topArrayEventType: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onArrayEventTypeCapture',
|
||||
bubbled: 'onArrayEventType',
|
||||
},
|
||||
captured: \\"onArrayEventTypeCapture\\",
|
||||
bubbled: \\"onArrayEventType\\"
|
||||
}
|
||||
},
|
||||
|
||||
topEnd: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onEndCapture',
|
||||
bubbled: 'onEnd',
|
||||
},
|
||||
},
|
||||
captured: \\"onEndCapture\\",
|
||||
bubbled: \\"onEnd\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
directEventTypes: {
|
||||
topEventDirect: {
|
||||
registrationName: 'onEventDirect',
|
||||
registrationName: \\"onEventDirect\\"
|
||||
},
|
||||
|
||||
topOrientationChange: {
|
||||
registrationName: 'onOrientationChange',
|
||||
registrationName: \\"onOrientationChange\\"
|
||||
},
|
||||
|
||||
topEventWithMixedPropAttribute: {
|
||||
registrationName: 'onEventWithMixedPropAttribute',
|
||||
},
|
||||
registrationName: \\"onEventWithMixedPropAttribute\\"
|
||||
}
|
||||
},
|
||||
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
|
||||
...ConditionallyIgnoredEventHandlers({
|
||||
onChange: true,
|
||||
onArrayEventType: true,
|
||||
onEventDirect: true,
|
||||
onOrientationChange: true,
|
||||
onEnd: true,
|
||||
onEventWithMixedPropAttribute: true,
|
||||
}),
|
||||
},
|
||||
onEventWithMixedPropAttribute: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -467,34 +412,28 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');
|
||||
|
||||
let nativeComponentName = 'RCTInterfaceOnlyComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'RCTInterfaceOnlyComponent',
|
||||
|
||||
uiViewClassName: \\"RCTInterfaceOnlyComponent\\",
|
||||
bubblingEventTypes: {
|
||||
topPaperChange: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onChangeCapture',
|
||||
bubbled: 'onChange',
|
||||
},
|
||||
},
|
||||
captured: \\"onChangeCapture\\",
|
||||
bubbled: \\"onChange\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
directEventTypes: {
|
||||
topPaperDirectChange: {
|
||||
registrationName: 'onDirectChange',
|
||||
},
|
||||
registrationName: \\"onDirectChange\\"
|
||||
}
|
||||
},
|
||||
|
||||
validAttributes: {
|
||||
...ConditionallyIgnoredEventHandlers({
|
||||
onChange: true,
|
||||
onDirectChange: true,
|
||||
}),
|
||||
},
|
||||
onDirectChange: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -519,13 +458,10 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ExcludedAndroidComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ExcludedAndroidComponent',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"ExcludedAndroidComponent\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -550,13 +486,10 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ExcludedAndroidIosComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ExcludedAndroidIosComponent',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"ExcludedAndroidIosComponent\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -581,26 +514,19 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ExcludedIosComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ExcludedIosComponent',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"ExcludedIosComponent\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
|
||||
let nativeComponentName = 'MultiFileIncludedNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MultiFileIncludedNativeComponent',
|
||||
|
||||
uiViewClassName: \\"MultiFileIncludedNativeComponent\\",
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -625,21 +551,17 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'FloatPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'FloatPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"FloatPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
blurRadius: true,
|
||||
blurRadius2: true,
|
||||
blurRadius3: true,
|
||||
blurRadius4: true,
|
||||
blurRadius5: true,
|
||||
blurRadius6: true,
|
||||
},
|
||||
blurRadius6: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -664,18 +586,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ImagePropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ImagePropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"ImagePropNativeComponent\\",
|
||||
validAttributes: {
|
||||
thumbImage: {
|
||||
process: require('react-native/Libraries/Image/resolveAssetSource'),
|
||||
},
|
||||
},
|
||||
process: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Image/resolveAssetSource'))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -700,18 +618,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'InsetsPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'InsetsPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"InsetsPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
contentInset: {
|
||||
diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/insetsDiffer')),
|
||||
},
|
||||
},
|
||||
diff: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/insetsDiffer'))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -736,16 +650,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'Int32EnumPropsNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'Int32EnumPropsNativeComponent',
|
||||
|
||||
uiViewClassName: \\"Int32EnumPropsNativeComponent\\",
|
||||
validAttributes: {
|
||||
maxInterval: true,
|
||||
},
|
||||
maxInterval: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -770,18 +680,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'IntegerPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'IntegerPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"IntegerPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
progress1: true,
|
||||
progress2: true,
|
||||
progress3: true,
|
||||
},
|
||||
progress3: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -807,29 +713,23 @@ const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/
|
||||
const {ConditionallyIgnoredEventHandlers} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');
|
||||
|
||||
let nativeComponentName = 'RCTInterfaceOnlyComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'RCTInterfaceOnlyComponent',
|
||||
|
||||
uiViewClassName: \\"RCTInterfaceOnlyComponent\\",
|
||||
bubblingEventTypes: {
|
||||
topChange: {
|
||||
phasedRegistrationNames: {
|
||||
captured: 'onChangeCapture',
|
||||
bubbled: 'onChange',
|
||||
},
|
||||
},
|
||||
captured: \\"onChangeCapture\\",
|
||||
bubbled: \\"onChange\\"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
validAttributes: {
|
||||
accessibilityHint: true,
|
||||
|
||||
...ConditionallyIgnoredEventHandlers({
|
||||
onChange: true,
|
||||
}),
|
||||
},
|
||||
onChange: true
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -854,16 +754,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'MixedPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MixedPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"MixedPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
mixedProp: true,
|
||||
},
|
||||
mixedProp: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -888,30 +784,23 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ImageColorPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ImageColorPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"ImageColorPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
thumbImage: {
|
||||
process: require('react-native/Libraries/Image/resolveAssetSource'),
|
||||
process: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Image/resolveAssetSource'))
|
||||
},
|
||||
|
||||
color: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default,
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default
|
||||
},
|
||||
|
||||
thumbTintColor: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default,
|
||||
process: require('react-native/Libraries/StyleSheet/processColor').default
|
||||
},
|
||||
|
||||
point: {
|
||||
diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer')),
|
||||
},
|
||||
},
|
||||
diff: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer'))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -936,13 +825,10 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'NoPropsNoEventsComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'NoPropsNoEventsComponent',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"NoPropsNoEventsComponent\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -967,16 +853,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'ObjectProps';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'ObjectProps',
|
||||
|
||||
uiViewClassName: \\"ObjectProps\\",
|
||||
validAttributes: {
|
||||
objectProp: true,
|
||||
},
|
||||
objectProp: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -1001,18 +883,14 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'PointPropNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'PointPropNativeComponent',
|
||||
|
||||
uiViewClassName: \\"PointPropNativeComponent\\",
|
||||
validAttributes: {
|
||||
startPoint: {
|
||||
diff: ((req) => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer')),
|
||||
},
|
||||
},
|
||||
diff: (req => 'default' in req ? req.default : req)(require('react-native/Libraries/Utilities/differ/pointsDiffer'))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -1037,16 +915,12 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'StringEnumPropsNativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'StringEnumPropsNativeComponent',
|
||||
|
||||
uiViewClassName: \\"StringEnumPropsNativeComponent\\",
|
||||
validAttributes: {
|
||||
alignment: true,
|
||||
},
|
||||
alignment: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -1071,17 +945,13 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'StringPropComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'StringPropComponent',
|
||||
|
||||
uiViewClassName: \\"StringPropComponent\\",
|
||||
validAttributes: {
|
||||
accessibilityHint: true,
|
||||
accessibilityRole: true,
|
||||
},
|
||||
accessibilityRole: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -1106,29 +976,21 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'MultiFile1NativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MultiFile1NativeComponent',
|
||||
|
||||
uiViewClassName: \\"MultiFile1NativeComponent\\",
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
|
||||
let nativeComponentName = 'MultiFile2NativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MultiFile2NativeComponent',
|
||||
|
||||
uiViewClassName: \\"MultiFile2NativeComponent\\",
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -1153,29 +1015,21 @@ Map {
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
|
||||
let nativeComponentName = 'MultiComponent1NativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MultiComponent1NativeComponent',
|
||||
|
||||
uiViewClassName: \\"MultiComponent1NativeComponent\\",
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
|
||||
let nativeComponentName = 'MultiComponent2NativeComponent';
|
||||
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'MultiComponent2NativeComponent',
|
||||
|
||||
uiViewClassName: \\"MultiComponent2NativeComponent\\",
|
||||
validAttributes: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
@@ -1208,12 +1062,10 @@ if (UIManager.hasViewManagerConfig('NativeComponentName')) {
|
||||
} else {
|
||||
throw new Error('Failed to find native component for either \\"NativeComponentName\\" or \\"DeprecatedNativeComponentName\\"');
|
||||
}
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: 'NativeComponentName',
|
||||
validAttributes: {},
|
||||
uiViewClassName: \\"NativeComponentName\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
|
||||
",
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/compatibility-check",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -29,7 +29,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.79.0-main"
|
||||
"@react-native/codegen": "0.79.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-remove-types": "^2.237.2",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/fantom",
|
||||
"private": true,
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"main": "src/index.js",
|
||||
"description": "Internal integration testing and benchmarking tool for React Native",
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"description": "PopupMenu for the Android platform",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@react-native/codegen": "0.79.0-main"
|
||||
"@react-native/codegen": "0.79.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/oss-library-example",
|
||||
"version": "0.79.0-main",
|
||||
"version": "0.79.7",
|
||||
"private": true,
|
||||
"description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.",
|
||||
"license": "MIT",
|
||||
@@ -26,8 +26,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.79.0-main",
|
||||
"react-native": "1000.0.0"
|
||||
"@react-native/babel-preset": "0.79.7",
|
||||
"react-native": "0.79.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -140,4 +140,11 @@
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
- (void)loadSourceForBridge:(RCTBridge *)bridge
|
||||
onProgress:(RCTSourceLoadProgressBlock)onProgress
|
||||
onComplete:(RCTSourceLoadBlock)loadCallback
|
||||
{
|
||||
[RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] onProgress:onProgress onComplete:loadCallback];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <react/runtime/JSRuntimeFactoryCAPI.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// Forward declarations for umbrella headers.
|
||||
// In implementations, import `<react/runtime/JSRuntimeFactoryCAPI.h>` to obtain the actual type.
|
||||
typedef void *JSRuntimeFactoryRef;
|
||||
|
||||
@protocol RCTJSRuntimeConfiguratorProtocol
|
||||
|
||||
- (JSRuntimeFactoryRef)createJSRuntimeFactory;
|
||||
|
||||
@@ -193,6 +193,15 @@ using namespace facebook::react;
|
||||
return RCTAppSetupDefaultModuleFromClass(moduleClass, self.delegate.dependencyProvider);
|
||||
}
|
||||
|
||||
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(extraModulesForBridge:)]) {
|
||||
return [_delegate extraModulesForBridge:bridge];
|
||||
}
|
||||
|
||||
return @[];
|
||||
}
|
||||
|
||||
#pragma mark - RCTComponentViewFactoryComponentProvider
|
||||
|
||||
- (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
|
||||
@@ -305,6 +314,10 @@ class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefau
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool useShadowNodeStateOnClone() override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
- (void)_setUpFeatureFlags
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
||||
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
|
||||
#import <react/runtime/JSRuntimeFactory.h>
|
||||
#import <react/runtime/JSRuntimeFactoryCAPI.h>
|
||||
|
||||
@implementation RCTRootViewFactoryConfiguration
|
||||
|
||||
|
||||
+13
-1
@@ -81,7 +81,19 @@ export class URL {
|
||||
let baseUrl = null;
|
||||
if (!base || validateBaseUrl(url)) {
|
||||
this._url = url;
|
||||
if (!this._url.endsWith('/')) {
|
||||
if (this._url.includes('#')) {
|
||||
const split = this._url.split('#');
|
||||
const beforeHash = split[0];
|
||||
const website = beforeHash.split('://')[1];
|
||||
if (!website.includes('/')) {
|
||||
this._url = split.join('/#');
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!this._url.endsWith('/') &&
|
||||
!(this._url.includes('?') || this._url.includes('#'))
|
||||
) {
|
||||
this._url += '/';
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -14,8 +14,8 @@ export const version: $ReadOnly<{
|
||||
patch: number,
|
||||
prerelease: string | null,
|
||||
}> = {
|
||||
major: 1000,
|
||||
minor: 0,
|
||||
patch: 0,
|
||||
major: 0,
|
||||
minor: 79,
|
||||
patch: 7,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
@@ -49,13 +49,8 @@ RCT_EXPORT_MODULE()
|
||||
_queue.maxConcurrentOperationCount = 2;
|
||||
}
|
||||
|
||||
__weak NSBlockOperation *weakOp;
|
||||
NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
|
||||
NSBlockOperation *strongOp = weakOp; // Strong reference to avoid deallocation during execution
|
||||
if (strongOp == nil || [strongOp isCancelled]) {
|
||||
return;
|
||||
}
|
||||
|
||||
__weak __block NSBlockOperation *weakOp;
|
||||
__block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
|
||||
// Get mime type
|
||||
NSRange firstSemicolon = [request.URL.resourceSpecifier rangeOfString:@";"];
|
||||
NSString *mimeType =
|
||||
@@ -67,15 +62,15 @@ RCT_EXPORT_MODULE()
|
||||
expectedContentLength:-1
|
||||
textEncodingName:nil];
|
||||
|
||||
[delegate URLRequest:strongOp didReceiveResponse:response];
|
||||
[delegate URLRequest:weakOp didReceiveResponse:response];
|
||||
|
||||
// Load data
|
||||
NSError *error;
|
||||
NSData *data = [NSData dataWithContentsOfURL:request.URL options:NSDataReadingMappedIfSafe error:&error];
|
||||
if (data) {
|
||||
[delegate URLRequest:strongOp didReceiveData:data];
|
||||
[delegate URLRequest:weakOp didReceiveData:data];
|
||||
}
|
||||
[delegate URLRequest:strongOp didCompleteWithError:error];
|
||||
[delegate URLRequest:weakOp didCompleteWithError:error];
|
||||
}];
|
||||
|
||||
weakOp = op;
|
||||
|
||||
@@ -53,19 +53,14 @@ RCT_EXPORT_MODULE()
|
||||
_fileQueue.maxConcurrentOperationCount = 4;
|
||||
}
|
||||
|
||||
__weak NSBlockOperation *weakOp;
|
||||
NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
|
||||
NSBlockOperation *strongOp = weakOp; // Strong reference to avoid deallocation during execution
|
||||
if (strongOp == nil || [strongOp isCancelled]) {
|
||||
return;
|
||||
}
|
||||
|
||||
__weak __block NSBlockOperation *weakOp;
|
||||
__block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
|
||||
// Get content length
|
||||
NSError *error = nil;
|
||||
NSFileManager *fileManager = [NSFileManager new];
|
||||
NSDictionary<NSString *, id> *fileAttributes = [fileManager attributesOfItemAtPath:request.URL.path error:&error];
|
||||
if (!fileAttributes) {
|
||||
[delegate URLRequest:strongOp didCompleteWithError:error];
|
||||
[delegate URLRequest:weakOp didCompleteWithError:error];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,14 +77,14 @@ RCT_EXPORT_MODULE()
|
||||
expectedContentLength:[fileAttributes[NSFileSize] ?: @-1 integerValue]
|
||||
textEncodingName:nil];
|
||||
|
||||
[delegate URLRequest:strongOp didReceiveResponse:response];
|
||||
[delegate URLRequest:weakOp didReceiveResponse:response];
|
||||
|
||||
// Load data
|
||||
NSData *data = [NSData dataWithContentsOfURL:request.URL options:NSDataReadingMappedIfSafe error:&error];
|
||||
if (data) {
|
||||
[delegate URLRequest:strongOp didReceiveData:data];
|
||||
[delegate URLRequest:weakOp didReceiveData:data];
|
||||
}
|
||||
[delegate URLRequest:strongOp didCompleteWithError:error];
|
||||
[delegate URLRequest:weakOp didCompleteWithError:error];
|
||||
}];
|
||||
|
||||
weakOp = op;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#if RCT_ENABLE_INSPECTOR
|
||||
#import "RCTInspectorDevServerHelper.h"
|
||||
#endif
|
||||
#import <React/RCTInitializeUIKitProxies.h>
|
||||
#import <jsinspector-modern/InspectorFlags.h>
|
||||
#import <jsinspector-modern/InspectorInterfaces.h>
|
||||
#import <jsinspector-modern/ReactCdp.h>
|
||||
@@ -511,6 +512,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||
_bundleURL = [RCTConvert NSURL:_bundleURL.absoluteString];
|
||||
|
||||
RCTExecuteOnMainQueue(^{
|
||||
RCTInitializeUIKitProxies();
|
||||
RCTRegisterReloadCommandListener(self);
|
||||
RCTReloadCommandSetBundleURL(self->_bundleURL);
|
||||
});
|
||||
|
||||
@@ -21,9 +21,9 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(1000),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(79),
|
||||
RCTVersionPatch: @(7),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
});
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
#import <React/RCTEventDispatcherProtocol.h>
|
||||
#import <React/RCTInitializing.h>
|
||||
#import <React/RCTInvalidating.h>
|
||||
#import <React/RCTKeyWindowValuesProxy.h>
|
||||
#import <React/RCTUtils.h>
|
||||
#import <React/RCTWindowSafeAreaProxy.h>
|
||||
#import <atomic>
|
||||
|
||||
#import "CoreModulesPlugins.h"
|
||||
@@ -31,8 +29,13 @@ using namespace facebook::react;
|
||||
NSDictionary *_currentInterfaceDimensions;
|
||||
BOOL _isFullscreen;
|
||||
std::atomic<BOOL> _invalidated;
|
||||
NSDictionary *_constants;
|
||||
|
||||
__weak UIWindow *_applicationWindow;
|
||||
}
|
||||
|
||||
static NSString *const kFrameKeyPath = @"frame";
|
||||
|
||||
@synthesize moduleRegistry = _moduleRegistry;
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
@@ -40,14 +43,26 @@ RCT_EXPORT_MODULE()
|
||||
- (instancetype)init
|
||||
{
|
||||
if (self = [super init]) {
|
||||
[[RCTKeyWindowValuesProxy sharedInstance] startObservingWindowSizeIfNecessary];
|
||||
_applicationWindow = RCTKeyWindow();
|
||||
[_applicationWindow addObserver:self forKeyPath:kFrameKeyPath options:NSKeyValueObservingOptionNew context:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath
|
||||
ofObject:(id)object
|
||||
change:(NSDictionary *)change
|
||||
context:(void *)context
|
||||
{
|
||||
if ([keyPath isEqualToString:kFrameKeyPath]) {
|
||||
[self interfaceFrameDidChange];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
|
||||
}
|
||||
}
|
||||
|
||||
+ (BOOL)requiresMainQueueSetup
|
||||
{
|
||||
return NO;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (dispatch_queue_t)methodQueue
|
||||
@@ -81,7 +96,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
|
||||
_currentInterfaceOrientation = [RCTKeyWindowValuesProxy sharedInstance].currentInterfaceOrientation;
|
||||
_currentInterfaceOrientation = RCTKeyWindow().windowScene.interfaceOrientation;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(interfaceFrameDidChange)
|
||||
@@ -98,6 +113,15 @@ RCT_EXPORT_MODULE()
|
||||
selector:@selector(invalidate)
|
||||
name:RCTBridgeWillInvalidateModulesNotification
|
||||
object:nil];
|
||||
|
||||
_constants = @{
|
||||
@"Dimensions" : [self _exportedDimensions],
|
||||
// Note:
|
||||
// This prop is deprecated and will be removed in a future release.
|
||||
// Please use this only for a quick and temporary solution.
|
||||
// Use <SafeAreaView> instead.
|
||||
@"isIPhoneX_deprecated" : @(RCTIsIPhoneNotched()),
|
||||
};
|
||||
}
|
||||
|
||||
- (void)invalidate
|
||||
@@ -120,6 +144,8 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillInvalidateModulesNotification object:nil];
|
||||
|
||||
[_applicationWindow removeObserver:self forKeyPath:kFrameKeyPath];
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
|
||||
#endif
|
||||
@@ -132,8 +158,13 @@ static BOOL RCTIsIPhoneNotched()
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
dispatch_once(&onceToken, ^{
|
||||
RCTAssertMainQueue();
|
||||
|
||||
// 20pt is the top safeArea value in non-notched devices
|
||||
isIPhoneNotched = [RCTWindowSafeAreaProxy sharedInstance].currentSafeAreaInsets.top > 20;
|
||||
UIWindow *keyWindow = RCTKeyWindow();
|
||||
if (keyWindow) {
|
||||
isIPhoneNotched = keyWindow.safeAreaInsets.top > 20;
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
@@ -142,11 +173,13 @@ static BOOL RCTIsIPhoneNotched()
|
||||
|
||||
static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
|
||||
{
|
||||
RCTAssertMainQueue();
|
||||
UIScreen *mainScreen = UIScreen.mainScreen;
|
||||
CGSize screenSize = mainScreen.bounds.size;
|
||||
UIView *mainWindow = RCTKeyWindow();
|
||||
|
||||
// We fallback to screen size if a key window is not found.
|
||||
CGSize windowSize = [RCTKeyWindowValuesProxy sharedInstance].windowSize;
|
||||
CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize;
|
||||
|
||||
NSDictionary<NSString *, NSNumber *> *dimsWindow = @{
|
||||
@"width" : @(windowSize.width),
|
||||
@@ -170,7 +203,10 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
|
||||
RCTAssert(_moduleRegistry, @"Failed to get exported dimensions: RCTModuleRegistry is nil");
|
||||
RCTAccessibilityManager *accessibilityManager =
|
||||
(RCTAccessibilityManager *)[_moduleRegistry moduleForName:"AccessibilityManager"];
|
||||
RCTAssert(accessibilityManager, @"Failed to get exported dimensions: AccessibilityManager is nil");
|
||||
// TOOD(T225745315): For some reason, accessibilityManager is nil in some cases.
|
||||
// We default the fontScale to 1.0 in this case. This should be okay: if we assume
|
||||
// that accessibilityManager will eventually become available, js will eventually
|
||||
// be updated with the correct fontScale.
|
||||
CGFloat fontScale = accessibilityManager ? accessibilityManager.multiplier : 1.0;
|
||||
return RCTExportedDimensions(fontScale);
|
||||
}
|
||||
@@ -182,14 +218,7 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
|
||||
|
||||
- (NSDictionary<NSString *, id> *)getConstants
|
||||
{
|
||||
return @{
|
||||
@"Dimensions" : [self _exportedDimensions],
|
||||
// Note:
|
||||
// This prop is deprecated and will be removed in a future release.
|
||||
// Please use this only for a quick and temporary solution.
|
||||
// Use <SafeAreaView> instead.
|
||||
@"isIPhoneX_deprecated" : @(RCTIsIPhoneNotched()),
|
||||
};
|
||||
return _constants;
|
||||
}
|
||||
|
||||
- (void)didReceiveNewContentSizeMultiplier
|
||||
@@ -209,10 +238,11 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
|
||||
- (void)interfaceOrientationDidChange
|
||||
{
|
||||
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
|
||||
UIWindow *keyWindow = RCTKeyWindow();
|
||||
UIInterfaceOrientation nextOrientation = keyWindow.windowScene.interfaceOrientation;
|
||||
UIApplication *application = RCTSharedApplication();
|
||||
UIInterfaceOrientation nextOrientation = RCTKeyWindow().windowScene.interfaceOrientation;
|
||||
|
||||
BOOL isRunningInFullScreen = CGRectEqualToRect(keyWindow.frame, keyWindow.screen.bounds);
|
||||
BOOL isRunningInFullScreen =
|
||||
CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);
|
||||
// We are catching here two situations for multitasking view:
|
||||
// a) The app is in Split View and the container gets resized -> !isRunningInFullScreen
|
||||
// b) The app changes to/from fullscreen example: App runs in slide over mode and goes into fullscreen->
|
||||
@@ -275,4 +305,4 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
|
||||
Class RCTDeviceInfoCls(void)
|
||||
{
|
||||
return RCTDeviceInfo.class;
|
||||
}
|
||||
}
|
||||
+18
-4
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
||||
|
||||
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
||||
{
|
||||
[_viewsToBeMounted addObject:@{
|
||||
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
||||
kRCTLegacyInteropChildComponentKey : childComponentView
|
||||
}];
|
||||
if (_adapter && index == _adapter.paperView.reactSubviews.count) {
|
||||
// This is a new child view that is being added to the end of the children array.
|
||||
// After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
|
||||
// Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
|
||||
// called and the `finalizeUpdate` is not invoked.
|
||||
if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
|
||||
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
|
||||
[_adapter.paperView insertReactSubview:target atIndex:index];
|
||||
} else {
|
||||
[_adapter.paperView insertReactSubview:childComponentView atIndex:index];
|
||||
}
|
||||
[_adapter.paperView didUpdateReactSubviews];
|
||||
} else {
|
||||
[_viewsToBeMounted addObject:@{
|
||||
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
||||
kRCTLegacyInteropChildComponentKey : childComponentView
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ using namespace facebook::react;
|
||||
const auto &newSwitchProps = static_cast<const SwitchProps &>(*props);
|
||||
|
||||
// `value`
|
||||
if (oldSwitchProps.value != newSwitchProps.value) {
|
||||
if (!_isInitialValueSet || oldSwitchProps.value != newSwitchProps.value) {
|
||||
BOOL shouldAnimate = _isInitialValueSet == YES;
|
||||
[_switchView setOn:newSwitchProps.value animated:shouldAnimate];
|
||||
}
|
||||
|
||||
+23
-20
@@ -101,11 +101,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
||||
[_backedTextInputView.defaultTextAttributes mutableCopy];
|
||||
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
|
||||
eventEmitterWrapper.eventEmitter = _eventEmitter;
|
||||
defaultAttributes[RCTAttributedStringEventEmitterKey] = eventEmitterWrapper;
|
||||
#endif
|
||||
defaultAttributes[RCTAttributedStringEventEmitterKey] = RCTWrapEventEmitter(_eventEmitter);
|
||||
|
||||
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
||||
}
|
||||
@@ -272,10 +268,8 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) {
|
||||
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
||||
RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier()));
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
defaultAttributes[RCTAttributedStringEventEmitterKey] =
|
||||
_backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
|
||||
#endif
|
||||
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
||||
}
|
||||
|
||||
@@ -704,6 +698,11 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
}
|
||||
|
||||
- (void)_restoreTextSelection
|
||||
{
|
||||
[self _restoreTextSelectionAndIgnoreCaretChange:NO];
|
||||
}
|
||||
|
||||
- (void)_restoreTextSelectionAndIgnoreCaretChange:(BOOL)ignore
|
||||
{
|
||||
const auto &selection = static_cast<const TextInputProps &>(*_props).selection;
|
||||
if (!selection.has_value()) {
|
||||
@@ -713,6 +712,9 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
offset:selection->start];
|
||||
auto end = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument offset:selection->end];
|
||||
auto range = [_backedTextInputView textRangeFromPosition:start toPosition:end];
|
||||
if (ignore && range.empty) {
|
||||
return;
|
||||
}
|
||||
[_backedTextInputView setSelectedTextRange:range notifyDelegate:YES];
|
||||
}
|
||||
|
||||
@@ -727,19 +729,20 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
// Updating the UITextView attributedText, for example changing the lineHeight, the color or adding
|
||||
// a new paragraph with \n, causes the cursor to move to the end of the Text and scroll.
|
||||
// This is fixed by restoring the cursor position and scrolling to that position (iOS issue 652653).
|
||||
if (selectedRange.empty) {
|
||||
// Maintaining a cursor position relative to the end of the old text.
|
||||
NSInteger offsetStart = [_backedTextInputView offsetFromPosition:_backedTextInputView.beginningOfDocument
|
||||
toPosition:selectedRange.start];
|
||||
NSInteger offsetFromEnd = oldTextLength - offsetStart;
|
||||
NSInteger newOffset = attributedString.string.length - offsetFromEnd;
|
||||
UITextPosition *position = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
|
||||
offset:newOffset];
|
||||
[_backedTextInputView setSelectedTextRange:[_backedTextInputView textRangeFromPosition:position toPosition:position]
|
||||
notifyDelegate:YES];
|
||||
[_backedTextInputView scrollRangeToVisible:NSMakeRange(offsetStart, 0)];
|
||||
}
|
||||
[self _restoreTextSelection];
|
||||
// Maintaining a cursor position relative to the end of the old text.
|
||||
NSInteger offsetStart = [_backedTextInputView offsetFromPosition:_backedTextInputView.beginningOfDocument
|
||||
toPosition:selectedRange.start];
|
||||
NSInteger offsetFromEnd = oldTextLength - offsetStart;
|
||||
NSInteger newOffset = attributedString.string.length - offsetFromEnd;
|
||||
UITextPosition *position = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
|
||||
offset:newOffset];
|
||||
[_backedTextInputView setSelectedTextRange:[_backedTextInputView textRangeFromPosition:position toPosition:position]
|
||||
notifyDelegate:YES];
|
||||
[_backedTextInputView scrollRangeToVisible:NSMakeRange(offsetStart, 0)];
|
||||
|
||||
// A zero-length selection range can cause the caret position to change on iOS,
|
||||
// and we have already updated the caret position, so we can safely ignore caret changing in this place.
|
||||
[self _restoreTextSelectionAndIgnoreCaretChange:YES];
|
||||
[self _updateTypingAttributes];
|
||||
_lastStringStateWasUpdatedWith = attributedString;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public class com/facebook/react/DebugCorePackage$$ReactModuleInfoProvider : com/
|
||||
public abstract class com/facebook/react/HeadlessJsTaskService : android/app/Service, com/facebook/react/jstasks/HeadlessJsTaskEventListener {
|
||||
public static final field Companion Lcom/facebook/react/HeadlessJsTaskService$Companion;
|
||||
public fun <init> ()V
|
||||
public static final fun acquireWakeLockNow (Landroid/content/Context;)V
|
||||
protected final fun getReactContext ()Lcom/facebook/react/bridge/ReactContext;
|
||||
protected final fun getReactHost ()Lcom/facebook/react/ReactHost;
|
||||
protected final fun getReactNativeHost ()Lcom/facebook/react/ReactNativeHost;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0
|
||||
VERSION_NAME=0.79.7
|
||||
react.internal.publishingGroup=com.facebook.react
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+1
@@ -166,6 +166,7 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
|
||||
* Acquire a wake lock to ensure the device doesn't go to sleep while processing background
|
||||
* tasks.
|
||||
*/
|
||||
@JvmStatic
|
||||
@SuppressLint("WakelockTimeout")
|
||||
public fun acquireWakeLockNow(context: Context) {
|
||||
if (wakeLock == null || wakeLock?.isHeld == false) {
|
||||
|
||||
+2
-2
@@ -1399,14 +1399,14 @@ public class ReactInstanceManager {
|
||||
new RuntimeException(
|
||||
"detachRootViewFromInstance called with ReactRootView with invalid id"));
|
||||
}
|
||||
|
||||
clearReactRoot(reactRoot);
|
||||
} else {
|
||||
reactContext
|
||||
.getCatalystInstance()
|
||||
.getJSModule(AppRegistry.class)
|
||||
.unmountApplicationComponentAtRootTag(reactRoot.getRootViewTag());
|
||||
}
|
||||
|
||||
clearReactRoot(reactRoot);
|
||||
}
|
||||
|
||||
@ThreadConfined(UI)
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ import android.app.Activity
|
||||
import android.util.Pair
|
||||
import android.view.View
|
||||
import com.facebook.react.bridge.DefaultJSExceptionHandler
|
||||
import com.facebook.react.bridge.JSExceptionHandler
|
||||
import com.facebook.react.bridge.ReactContext
|
||||
import com.facebook.react.bridge.ReadableArray
|
||||
import com.facebook.react.common.SurfaceDelegate
|
||||
@@ -34,7 +35,7 @@ import java.io.File
|
||||
*/
|
||||
public open class ReleaseDevSupportManager : DevSupportManager {
|
||||
|
||||
private val defaultJSExceptionHandler: DefaultJSExceptionHandler = DefaultJSExceptionHandler()
|
||||
private val defaultJSExceptionHandler: JSExceptionHandler = DefaultJSExceptionHandler()
|
||||
|
||||
public override fun showNewJavaError(message: String?, e: Throwable?): Unit = Unit
|
||||
|
||||
|
||||
+13
-8
@@ -173,7 +173,7 @@ public class FabricUIManager
|
||||
private final CopyOnWriteArrayList<UIManagerListener> mListeners = new CopyOnWriteArrayList<>();
|
||||
|
||||
private boolean mMountNotificationScheduled = false;
|
||||
private final List<Integer> mMountedSurfaceIds = new ArrayList<>();
|
||||
private List<Integer> mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
|
||||
|
||||
@ThreadConfined(UI)
|
||||
@NonNull
|
||||
@@ -1254,12 +1254,15 @@ public class FabricUIManager
|
||||
|
||||
// Collect surface IDs for all the mount items
|
||||
for (MountItem mountItem : mountItems) {
|
||||
if (mountItem != null && !mMountedSurfaceIds.contains(mountItem.getSurfaceId())) {
|
||||
mMountedSurfaceIds.add(mountItem.getSurfaceId());
|
||||
if (mountItem != null
|
||||
&& !mSurfaceIdsWithPendingMountNotification.contains(mountItem.getSurfaceId())) {
|
||||
mSurfaceIdsWithPendingMountNotification.add(mountItem.getSurfaceId());
|
||||
}
|
||||
}
|
||||
|
||||
if (!mMountNotificationScheduled && !mMountedSurfaceIds.isEmpty()) {
|
||||
if (!mMountNotificationScheduled && !mSurfaceIdsWithPendingMountNotification.isEmpty()) {
|
||||
mMountNotificationScheduled = true;
|
||||
|
||||
// Notify mount when the effects are visible and prevent mount hooks to
|
||||
// delay paint.
|
||||
UiThreadUtil.getUiThreadHandler()
|
||||
@@ -1269,17 +1272,19 @@ public class FabricUIManager
|
||||
public void run() {
|
||||
mMountNotificationScheduled = false;
|
||||
|
||||
// Create a copy in case mount hooks trigger more mutations
|
||||
final List<Integer> surfaceIdsToReportMount =
|
||||
mSurfaceIdsWithPendingMountNotification;
|
||||
mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
|
||||
|
||||
final @Nullable FabricUIManagerBinding binding = mBinding;
|
||||
if (binding == null || mDestroyed) {
|
||||
mMountedSurfaceIds.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int surfaceId : mMountedSurfaceIds) {
|
||||
for (int surfaceId : surfaceIdsToReportMount) {
|
||||
binding.reportMount(surfaceId);
|
||||
}
|
||||
|
||||
mMountedSurfaceIds.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+18
-3
@@ -685,7 +685,15 @@ public class SurfaceMountingManager {
|
||||
return;
|
||||
}
|
||||
|
||||
ViewState viewState = getViewState(reactTag);
|
||||
ViewState viewState = getNullableViewState(reactTag);
|
||||
|
||||
if (viewState == null) {
|
||||
ReactSoftExceptionLogger.logSoftException(
|
||||
ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
|
||||
new ReactNoCrashSoftException(
|
||||
"Unable to find viewState for tag: " + reactTag + " for updateProps"));
|
||||
return;
|
||||
}
|
||||
viewState.mCurrentProps = new ReactStylesDiffMap(props);
|
||||
View view = viewState.mView;
|
||||
|
||||
@@ -833,9 +841,16 @@ public class SurfaceMountingManager {
|
||||
parent.requestLayout();
|
||||
}
|
||||
|
||||
ViewState parentViewState = getViewState(parentTag);
|
||||
// TODO T212247085: Make this non-nullable again after rolling out
|
||||
// disableMountItemReorderingAndroid
|
||||
ViewState parentViewState = getNullableViewState(parentTag);
|
||||
IViewGroupManager<?> parentViewManager = null;
|
||||
if (parentViewState.mViewManager != null) {
|
||||
if (parentViewState == null) {
|
||||
ReactSoftExceptionLogger.logSoftException(
|
||||
ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
|
||||
new ReactNoCrashSoftException(
|
||||
"Unable to find viewState for tag: " + parentTag + " for updateLayout"));
|
||||
} else if (parentViewState.mViewManager != null) {
|
||||
parentViewManager = (IViewGroupManager) parentViewState.mViewManager;
|
||||
}
|
||||
if (parentViewManager == null || !parentViewManager.needsCustomLayoutForChildren()) {
|
||||
|
||||
+38
-20
@@ -22,6 +22,7 @@ import com.facebook.react.fabric.mounting.SurfaceMountingManager;
|
||||
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
|
||||
import com.facebook.react.uimanager.StateWrapper;
|
||||
import com.facebook.systrace.Systrace;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* This class represents a batch of {@link MountItem}s, represented directly as int buffers to
|
||||
@@ -199,7 +200,7 @@ final class IntBufferBatchMountItem implements BatchMountItem {
|
||||
public String toString() {
|
||||
try {
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append(String.format("IntBufferBatchMountItem [surface:%d]:\n", mSurfaceId));
|
||||
s.append(String.format(Locale.ROOT, "IntBufferBatchMountItem [surface:%d]:\n", mSurfaceId));
|
||||
int i = 0, j = 0;
|
||||
while (i < mIntBufferLen) {
|
||||
int rawType = mIntBuffer[i++];
|
||||
@@ -211,49 +212,65 @@ final class IntBufferBatchMountItem implements BatchMountItem {
|
||||
j += 3;
|
||||
s.append(
|
||||
String.format(
|
||||
Locale.ROOT,
|
||||
"CREATE [%d] - layoutable:%d - %s\n",
|
||||
mIntBuffer[i++], mIntBuffer[i++], componentName));
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
componentName));
|
||||
} else if (type == INSTRUCTION_DELETE) {
|
||||
s.append(String.format("DELETE [%d]\n", mIntBuffer[i++]));
|
||||
s.append(String.format(Locale.ROOT, "DELETE [%d]\n", mIntBuffer[i++]));
|
||||
} else if (type == INSTRUCTION_INSERT) {
|
||||
s.append(
|
||||
String.format(
|
||||
"INSERT [%d]->[%d] @%d\n", mIntBuffer[i++], mIntBuffer[i++], mIntBuffer[i++]));
|
||||
Locale.ROOT,
|
||||
"INSERT [%d]->[%d] @%d\n",
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++]));
|
||||
} else if (type == INSTRUCTION_REMOVE) {
|
||||
s.append(
|
||||
String.format(
|
||||
"REMOVE [%d]->[%d] @%d\n", mIntBuffer[i++], mIntBuffer[i++], mIntBuffer[i++]));
|
||||
Locale.ROOT,
|
||||
"REMOVE [%d]->[%d] @%d\n",
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++]));
|
||||
} else if (type == INSTRUCTION_UPDATE_PROPS) {
|
||||
Object props = mObjBuffer[j++];
|
||||
String propsString =
|
||||
IS_DEVELOPMENT_ENVIRONMENT
|
||||
? (props != null ? props.toString() : "<null>")
|
||||
: "<hidden>";
|
||||
s.append(String.format("UPDATE PROPS [%d]: %s\n", mIntBuffer[i++], propsString));
|
||||
s.append(
|
||||
String.format(
|
||||
Locale.ROOT, "UPDATE PROPS [%d]: %s\n", mIntBuffer[i++], propsString));
|
||||
} else if (type == INSTRUCTION_UPDATE_STATE) {
|
||||
StateWrapper state = (StateWrapper) mObjBuffer[j++];
|
||||
String stateString =
|
||||
IS_DEVELOPMENT_ENVIRONMENT
|
||||
? (state != null ? state.toString() : "<null>")
|
||||
: "<hidden>";
|
||||
s.append(String.format("UPDATE STATE [%d]: %s\n", mIntBuffer[i++], stateString));
|
||||
} else if (type == INSTRUCTION_UPDATE_LAYOUT) {
|
||||
int reactTag = mIntBuffer[i++];
|
||||
int parentTag = mIntBuffer[i++];
|
||||
int x = mIntBuffer[i++];
|
||||
int y = mIntBuffer[i++];
|
||||
int w = mIntBuffer[i++];
|
||||
int h = mIntBuffer[i++];
|
||||
int displayType = mIntBuffer[i++];
|
||||
int layoutDirection = mIntBuffer[i++];
|
||||
s.append(
|
||||
String.format(
|
||||
"UPDATE LAYOUT [%d]->[%d]: x:%d y:%d w:%d h:%d displayType:%d layoutDirection:"
|
||||
+ " %d\n",
|
||||
parentTag, reactTag, x, y, w, h, displayType, layoutDirection));
|
||||
Locale.ROOT, "UPDATE STATE [%d]: %s\n", mIntBuffer[i++], stateString));
|
||||
} else if (type == INSTRUCTION_UPDATE_LAYOUT) {
|
||||
s.append(
|
||||
String.format(
|
||||
Locale.ROOT,
|
||||
"UPDATE LAYOUT [%d]->[%d]: x:%d y:%d w:%d h:%d displayType:%d"
|
||||
+ " layoutDirection:%d\n",
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++]));
|
||||
} else if (type == INSTRUCTION_UPDATE_PADDING) {
|
||||
s.append(
|
||||
String.format(
|
||||
Locale.ROOT,
|
||||
"UPDATE PADDING [%d]: top:%d right:%d bottom:%d left:%d\n",
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
@@ -263,6 +280,7 @@ final class IntBufferBatchMountItem implements BatchMountItem {
|
||||
} else if (type == INSTRUCTION_UPDATE_OVERFLOW_INSET) {
|
||||
s.append(
|
||||
String.format(
|
||||
Locale.ROOT,
|
||||
"UPDATE OVERFLOWINSET [%d]: left:%d top:%d right:%d bottom:%d\n",
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
@@ -271,7 +289,7 @@ final class IntBufferBatchMountItem implements BatchMountItem {
|
||||
mIntBuffer[i++]));
|
||||
} else if (type == INSTRUCTION_UPDATE_EVENT_EMITTER) {
|
||||
j += 1;
|
||||
s.append(String.format("UPDATE EVENTEMITTER [%d]\n", mIntBuffer[i++]));
|
||||
s.append(String.format(Locale.ROOT, "UPDATE EVENTEMITTER [%d]\n", mIntBuffer[i++]));
|
||||
} else {
|
||||
FLog.e(TAG, "String so far: " + s.toString());
|
||||
throw new IllegalArgumentException(
|
||||
|
||||
+13
-7
@@ -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<<5e27f8a6852293234595697743315ff8>>
|
||||
* @generated SignedSource<<fa641112b3a8888ba2b24cf8829e9382>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -238,18 +238,18 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = accessor.traceTurboModulePromiseRejectionsOnAndroid()
|
||||
|
||||
/**
|
||||
* When enabled, runtime shadow node references will be updated during the commit. This allows running RSNRU from any thread without corrupting the renderer state.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = accessor.updateRuntimeShadowNodeReferencesOnCommit()
|
||||
|
||||
/**
|
||||
* In Bridgeless mode, use the always available javascript error reporting pipeline.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun useAlwaysAvailableJSErrorHandling(): Boolean = accessor.useAlwaysAvailableJSErrorHandling()
|
||||
|
||||
/**
|
||||
* If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun useEditTextStockAndroidFocusBehavior(): Boolean = accessor.useEditTextStockAndroidFocusBehavior()
|
||||
|
||||
/**
|
||||
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
|
||||
*/
|
||||
@@ -274,6 +274,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun useRawPropsJsiValue(): Boolean = accessor.useRawPropsJsiValue()
|
||||
|
||||
/**
|
||||
* Use the state stored on the source shadow node when cloning it instead of reading in the most recent state on the shadow node family.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun useShadowNodeStateOnClone(): Boolean = accessor.useShadowNodeStateOnClone()
|
||||
|
||||
/**
|
||||
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
|
||||
*/
|
||||
|
||||
+21
-11
@@ -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<<b59cecccbe734a126dcd20f76d0ce7c7>>
|
||||
* @generated SignedSource<<9ecb711480b7d6c22bac380c28d035bc>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -55,12 +55,13 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var removeTurboModuleManagerDelegateMutexCache: Boolean? = null
|
||||
private var throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOSCache: Boolean? = null
|
||||
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
|
||||
private var useFabricInteropCache: Boolean? = null
|
||||
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
|
||||
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
|
||||
private var useRawPropsJsiValueCache: Boolean? = null
|
||||
private var useShadowNodeStateOnCloneCache: Boolean? = null
|
||||
private var useTurboModuleInteropCache: Boolean? = null
|
||||
private var useTurboModulesCache: Boolean? = null
|
||||
|
||||
@@ -379,6 +380,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean {
|
||||
var cached = updateRuntimeShadowNodeReferencesOnCommitCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.updateRuntimeShadowNodeReferencesOnCommit()
|
||||
updateRuntimeShadowNodeReferencesOnCommitCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useAlwaysAvailableJSErrorHandling(): Boolean {
|
||||
var cached = useAlwaysAvailableJSErrorHandlingCache
|
||||
if (cached == null) {
|
||||
@@ -388,15 +398,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useEditTextStockAndroidFocusBehavior(): Boolean {
|
||||
var cached = useEditTextStockAndroidFocusBehaviorCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.useEditTextStockAndroidFocusBehavior()
|
||||
useEditTextStockAndroidFocusBehaviorCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useFabricInterop(): Boolean {
|
||||
var cached = useFabricInteropCache
|
||||
if (cached == null) {
|
||||
@@ -433,6 +434,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useShadowNodeStateOnClone(): Boolean {
|
||||
var cached = useShadowNodeStateOnCloneCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.useShadowNodeStateOnClone()
|
||||
useShadowNodeStateOnCloneCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useTurboModuleInterop(): Boolean {
|
||||
var cached = useTurboModuleInteropCache
|
||||
if (cached == null) {
|
||||
|
||||
+5
-3
@@ -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<<08b51adfc7c09f0f26f2b3c8351cda01>>
|
||||
* @generated SignedSource<<2151e5ec5d04924e742f37b527dc23b9>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -98,9 +98,9 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean
|
||||
@DoNotStrip @JvmStatic public external fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useEditTextStockAndroidFocusBehavior(): Boolean
|
||||
@DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useFabricInterop(): Boolean
|
||||
|
||||
@@ -110,6 +110,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useRawPropsJsiValue(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useShadowNodeStateOnClone(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useTurboModuleInterop(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useTurboModules(): Boolean
|
||||
|
||||
+5
-3
@@ -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<<0041e37961e68474a6d092dc0f8a4903>>
|
||||
* @generated SignedSource<<56f86a3a0c0bbf453cf45a0db541ef54>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -93,9 +93,9 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false
|
||||
|
||||
override fun useAlwaysAvailableJSErrorHandling(): Boolean = false
|
||||
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = false
|
||||
|
||||
override fun useEditTextStockAndroidFocusBehavior(): Boolean = true
|
||||
override fun useAlwaysAvailableJSErrorHandling(): Boolean = false
|
||||
|
||||
override fun useFabricInterop(): Boolean = false
|
||||
|
||||
@@ -105,6 +105,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun useRawPropsJsiValue(): Boolean = false
|
||||
|
||||
override fun useShadowNodeStateOnClone(): Boolean = false
|
||||
|
||||
override fun useTurboModuleInterop(): Boolean = false
|
||||
|
||||
override fun useTurboModules(): Boolean = false
|
||||
|
||||
+23
-12
@@ -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<<e5c1e722f33148fe3aa36ccab62e2293>>
|
||||
* @generated SignedSource<<5b016fd6298477856116736e37c37c6f>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -59,12 +59,13 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var removeTurboModuleManagerDelegateMutexCache: Boolean? = null
|
||||
private var throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOSCache: Boolean? = null
|
||||
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
|
||||
private var useFabricInteropCache: Boolean? = null
|
||||
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
|
||||
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
|
||||
private var useRawPropsJsiValueCache: Boolean? = null
|
||||
private var useShadowNodeStateOnCloneCache: Boolean? = null
|
||||
private var useTurboModuleInteropCache: Boolean? = null
|
||||
private var useTurboModulesCache: Boolean? = null
|
||||
|
||||
@@ -418,6 +419,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean {
|
||||
var cached = updateRuntimeShadowNodeReferencesOnCommitCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.updateRuntimeShadowNodeReferencesOnCommit()
|
||||
accessedFeatureFlags.add("updateRuntimeShadowNodeReferencesOnCommit")
|
||||
updateRuntimeShadowNodeReferencesOnCommitCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useAlwaysAvailableJSErrorHandling(): Boolean {
|
||||
var cached = useAlwaysAvailableJSErrorHandlingCache
|
||||
if (cached == null) {
|
||||
@@ -428,16 +439,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useEditTextStockAndroidFocusBehavior(): Boolean {
|
||||
var cached = useEditTextStockAndroidFocusBehaviorCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.useEditTextStockAndroidFocusBehavior()
|
||||
accessedFeatureFlags.add("useEditTextStockAndroidFocusBehavior")
|
||||
useEditTextStockAndroidFocusBehaviorCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useFabricInterop(): Boolean {
|
||||
var cached = useFabricInteropCache
|
||||
if (cached == null) {
|
||||
@@ -478,6 +479,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useShadowNodeStateOnClone(): Boolean {
|
||||
var cached = useShadowNodeStateOnCloneCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.useShadowNodeStateOnClone()
|
||||
accessedFeatureFlags.add("useShadowNodeStateOnClone")
|
||||
useShadowNodeStateOnCloneCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useTurboModuleInterop(): Boolean {
|
||||
var cached = useTurboModuleInteropCache
|
||||
if (cached == null) {
|
||||
|
||||
+2
@@ -17,4 +17,6 @@ public class ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android(
|
||||
override fun enableFabricRenderer(): Boolean = bridgelessEnabled || fabricEnabled
|
||||
|
||||
override fun useTurboModules(): Boolean = bridgelessEnabled || turboModulesEnabled
|
||||
|
||||
override fun useShadowNodeStateOnClone(): Boolean = true
|
||||
}
|
||||
|
||||
+5
-3
@@ -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<<9a223b4f79e4612eb193036256bfebc5>>
|
||||
* @generated SignedSource<<b4d6157922f6182dd588d5ae5b54ead9>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -93,9 +93,9 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip public fun useAlwaysAvailableJSErrorHandling(): Boolean
|
||||
@DoNotStrip public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean
|
||||
|
||||
@DoNotStrip public fun useEditTextStockAndroidFocusBehavior(): Boolean
|
||||
@DoNotStrip public fun useAlwaysAvailableJSErrorHandling(): Boolean
|
||||
|
||||
@DoNotStrip public fun useFabricInterop(): Boolean
|
||||
|
||||
@@ -105,6 +105,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun useRawPropsJsiValue(): Boolean
|
||||
|
||||
@DoNotStrip public fun useShadowNodeStateOnClone(): Boolean
|
||||
|
||||
@DoNotStrip public fun useTurboModuleInterop(): Boolean
|
||||
|
||||
@DoNotStrip public fun useTurboModules(): Boolean
|
||||
|
||||
+3
-16
@@ -13,8 +13,6 @@ import android.os.Build
|
||||
import android.view.View
|
||||
import android.view.WindowInsetsController
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.facebook.common.logging.FLog
|
||||
import com.facebook.fbreact.specs.NativeStatusBarManagerAndroidSpec
|
||||
import com.facebook.react.bridge.GuardedRunnable
|
||||
@@ -23,6 +21,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.bridge.UiThreadUtil
|
||||
import com.facebook.react.common.ReactConstants
|
||||
import com.facebook.react.module.annotations.ReactModule
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder.getStatusBarHeightPx
|
||||
import com.facebook.react.uimanager.PixelUtil
|
||||
import com.facebook.react.views.view.setStatusBarTranslucency
|
||||
import com.facebook.react.views.view.setStatusBarVisibility
|
||||
@@ -34,29 +33,17 @@ public class StatusBarModule(reactContext: ReactApplicationContext?) :
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
override fun getTypedExportedConstants(): Map<String, Any> {
|
||||
val currentActivity = reactApplicationContext.currentActivity
|
||||
val statusBarColor =
|
||||
currentActivity?.window?.statusBarColor?.let { color ->
|
||||
String.format("#%06X", 0xFFFFFF and color)
|
||||
} ?: "black"
|
||||
return mapOf(
|
||||
HEIGHT_KEY to PixelUtil.toDIPFromPixel(getStatusBarHeightPx()),
|
||||
HEIGHT_KEY to PixelUtil.toDIPFromPixel(getStatusBarHeightPx(currentActivity).toFloat()),
|
||||
DEFAULT_BACKGROUND_COLOR_KEY to statusBarColor,
|
||||
)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
private fun getStatusBarHeightPx(): Float {
|
||||
val windowInsets =
|
||||
currentActivity?.window?.decorView?.let(ViewCompat::getRootWindowInsets) ?: return 0f
|
||||
return windowInsets
|
||||
.getInsets(
|
||||
WindowInsetsCompat.Type.statusBars() or
|
||||
WindowInsetsCompat.Type.navigationBars() or
|
||||
WindowInsetsCompat.Type.displayCutout())
|
||||
.top
|
||||
.toFloat()
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
override fun setColor(colorDouble: Double, animated: Boolean) {
|
||||
val color = colorDouble.toInt()
|
||||
|
||||
+3
-3
@@ -15,8 +15,8 @@ import java.util.Map;
|
||||
|
||||
public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 1000,
|
||||
"minor", 0,
|
||||
"patch", 0,
|
||||
"major", 0,
|
||||
"minor", 79,
|
||||
"patch", 7,
|
||||
"prerelease", null);
|
||||
}
|
||||
|
||||
+13
@@ -7,9 +7,12 @@
|
||||
|
||||
package com.facebook.react.uimanager
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.bridge.WritableNativeMap
|
||||
|
||||
@@ -99,4 +102,14 @@ public object DisplayMetricsHolder {
|
||||
putDouble("fontScale", fontScale)
|
||||
putDouble("densityDpi", displayMetrics.densityDpi.toDouble())
|
||||
}
|
||||
|
||||
internal fun getStatusBarHeightPx(activity: Activity?): Int {
|
||||
val windowInsets = activity?.window?.decorView?.let(ViewCompat::getRootWindowInsets) ?: return 0
|
||||
return windowInsets
|
||||
.getInsets(
|
||||
WindowInsetsCompat.Type.statusBars() or
|
||||
WindowInsetsCompat.Type.navigationBars() or
|
||||
WindowInsetsCompat.Type.displayCutout())
|
||||
.top
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -671,9 +671,6 @@ public class NativeViewHierarchyManager {
|
||||
View rootView = mTagsToViews.get(rootViewTag);
|
||||
dropView(rootView);
|
||||
mRootTags.delete(rootViewTag);
|
||||
if (rootView != null) {
|
||||
rootView.setId(View.NO_ID);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -136,10 +136,10 @@ internal data class BorderRadiusStyle(
|
||||
(startStart ?: topStart ?: topLeft ?: uniform)?.resolve(width, height)
|
||||
?: zeroRadii,
|
||||
bottomLeft =
|
||||
(endEnd ?: bottomStart ?: bottomRight ?: uniform)?.resolve(width, height)
|
||||
(endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.resolve(width, height)
|
||||
?: zeroRadii,
|
||||
bottomRight =
|
||||
(startEnd ?: bottomEnd ?: bottomLeft ?: uniform)?.resolve(width, height)
|
||||
(startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.resolve(width, height)
|
||||
?: zeroRadii,
|
||||
width = width,
|
||||
height = height,
|
||||
|
||||
+26
@@ -39,6 +39,8 @@ import com.facebook.react.bridge.WritableNativeMap
|
||||
import com.facebook.react.common.ReactConstants
|
||||
import com.facebook.react.common.annotations.VisibleForTesting
|
||||
import com.facebook.react.config.ReactFeatureFlags
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder.getStatusBarHeightPx
|
||||
import com.facebook.react.uimanager.JSPointerDispatcher
|
||||
import com.facebook.react.uimanager.JSTouchDispatcher
|
||||
import com.facebook.react.uimanager.PixelUtil.pxToDp
|
||||
@@ -52,6 +54,7 @@ import com.facebook.react.views.view.ReactViewGroup
|
||||
import com.facebook.react.views.view.setStatusBarTranslucency
|
||||
import com.facebook.react.views.view.setSystemBarsTranslucency
|
||||
import java.util.Objects
|
||||
import com.facebook.yoga.annotations.DoNotStrip
|
||||
|
||||
/**
|
||||
* ReactModalHostView is a view that sits in the view hierarchy representing a Modal view.
|
||||
@@ -66,6 +69,7 @@ import java.util.Objects
|
||||
* addition and removal of views to the DialogRootViewGroup.
|
||||
*/
|
||||
@SuppressLint("ViewConstructor")
|
||||
@DoNotStrip
|
||||
public class ReactModalHostView(context: ThemedReactContext) :
|
||||
ViewGroup(context), LifecycleEventListener {
|
||||
|
||||
@@ -121,6 +125,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
private var createNewDialog = false
|
||||
|
||||
init {
|
||||
initStatusBarHeight(context)
|
||||
dialogRootViewGroup = DialogRootViewGroup(context)
|
||||
}
|
||||
|
||||
@@ -448,6 +453,26 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
|
||||
private companion object {
|
||||
private const val TAG = "ReactModalHost"
|
||||
|
||||
// We store the status bar height to be able to properly position
|
||||
// the modal on the first render.
|
||||
private var statusBarHeight = 0
|
||||
|
||||
private fun initStatusBarHeight(reactContext: ReactContext) {
|
||||
statusBarHeight = getStatusBarHeightPx(reactContext.currentActivity)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@DoNotStrip
|
||||
private fun getScreenDisplayMetricsWithoutInsets(): Long {
|
||||
val displayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics()
|
||||
return encodeFloatsToLong(
|
||||
displayMetrics.widthPixels.toFloat().pxToDp(),
|
||||
(displayMetrics.heightPixels - statusBarHeight).toFloat().pxToDp())
|
||||
}
|
||||
|
||||
private fun encodeFloatsToLong(width: Float, height: Float): Long =
|
||||
(width.toRawBits().toLong()) shl 32 or (height.toRawBits().toLong())
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -463,6 +488,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
*/
|
||||
public class DialogRootViewGroup internal constructor(context: Context) :
|
||||
ReactViewGroup(context), RootView {
|
||||
|
||||
internal var stateWrapper: StateWrapper? = null
|
||||
internal var eventDispatcher: EventDispatcher? = null
|
||||
|
||||
|
||||
+19
-36
@@ -36,6 +36,7 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
@@ -146,9 +147,6 @@ public class ReactEditText extends AppCompatEditText {
|
||||
|
||||
public ReactEditText(Context context) {
|
||||
super(context);
|
||||
if (!ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
|
||||
setFocusableInTouchMode(false);
|
||||
}
|
||||
|
||||
mInputMethodManager =
|
||||
(InputMethodManager)
|
||||
@@ -191,9 +189,7 @@ public class ReactEditText extends AppCompatEditText {
|
||||
// selection on accessibility click to undo that.
|
||||
setSelection(length);
|
||||
}
|
||||
return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
|
||||
? requestFocusProgramatically()
|
||||
: requestFocusInternal();
|
||||
return requestFocusProgramatically();
|
||||
}
|
||||
return super.performAccessibilityAction(host, action, args);
|
||||
}
|
||||
@@ -341,29 +337,28 @@ public class ReactEditText extends AppCompatEditText {
|
||||
return super.onTextContextMenuItem(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFocus() {
|
||||
boolean useStockFocusBehavior = ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior();
|
||||
if (!useStockFocusBehavior) {
|
||||
setFocusableInTouchMode(false);
|
||||
public void clearFocusAndMaybeRefocus() {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P || !isInTouchMode()) {
|
||||
super.clearFocus();
|
||||
} else {
|
||||
// Avoid refocusing to a new view on old versions of Android by default
|
||||
// by preventing `requestFocus()` on the rootView from moving focus to any child.
|
||||
// https://cs.android.com/android/_/android/platform/frameworks/base/+/bdc66cb5a0ef513f4306edf9156cc978b08e06e4
|
||||
ViewGroup rootViewGroup = (ViewGroup)getRootView();
|
||||
int oldDescendantFocusability = rootViewGroup.getDescendantFocusability();
|
||||
rootViewGroup.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||
super.clearFocus();
|
||||
rootViewGroup.setDescendantFocusability(oldDescendantFocusability);
|
||||
}
|
||||
super.clearFocus();
|
||||
|
||||
hideSoftKeyboard();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
|
||||
// This is a no-op so that when the OS calls requestFocus(), nothing will happen. ReactEditText
|
||||
// is a controlled component, which means its focus is controlled by JS, with two exceptions:
|
||||
// autofocus when it's attached to the window, and responding to accessibility events. In both
|
||||
// of these cases, we call requestFocusInternal() directly.
|
||||
return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
|
||||
? super.requestFocus(direction, previouslyFocusedRect)
|
||||
: isFocused();
|
||||
/* package */ void clearFocusFromJS() {
|
||||
clearFocusAndMaybeRefocus();
|
||||
}
|
||||
|
||||
private boolean requestFocusInternal() {
|
||||
setFocusableInTouchMode(true);
|
||||
// We must explicitly call this method on the super class; if we call requestFocus() without
|
||||
// any arguments, it will call into the overridden requestFocus(int, Rect) above, which no-ops.
|
||||
boolean focused = super.requestFocus(View.FOCUS_DOWN, null);
|
||||
@@ -656,15 +651,7 @@ public class ReactEditText extends AppCompatEditText {
|
||||
|
||||
// VisibleForTesting from {@link TextInputEventsTestCase}.
|
||||
public void requestFocusFromJS() {
|
||||
if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
|
||||
requestFocusProgramatically();
|
||||
} else {
|
||||
requestFocusInternal();
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ void clearFocusFromJS() {
|
||||
clearFocus();
|
||||
requestFocusProgramatically();
|
||||
}
|
||||
|
||||
// VisibleForTesting from {@link TextInputEventsTestCase}.
|
||||
@@ -1107,11 +1094,7 @@ public class ReactEditText extends AppCompatEditText {
|
||||
}
|
||||
|
||||
if (mAutoFocus && !mDidAttachToWindow) {
|
||||
if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
|
||||
requestFocusProgramatically();
|
||||
} else {
|
||||
requestFocusInternal();
|
||||
}
|
||||
requestFocusProgramatically();
|
||||
}
|
||||
|
||||
mDidAttachToWindow = true;
|
||||
|
||||
+1
-1
@@ -1164,7 +1164,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
}
|
||||
|
||||
if (shouldBlur) {
|
||||
editText.clearFocus();
|
||||
editText.clearFocusAndMaybeRefocus();
|
||||
}
|
||||
|
||||
// Prevent default behavior except when we want it to insert a newline.
|
||||
|
||||
-3
@@ -588,9 +588,6 @@ public class ReactViewGroup extends ViewGroup
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
checkViewClippingTag(child, Boolean.TRUE);
|
||||
if (!customDrawOrderDisabled()) {
|
||||
if (indexOfChild(child) == -1) {
|
||||
return;
|
||||
}
|
||||
getDrawingOrderHelper().handleRemoveView(child);
|
||||
setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
|
||||
} else {
|
||||
|
||||
+27
-13
@@ -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<<91c1a65790aa5946a354ab8a1966a5f4>>
|
||||
* @generated SignedSource<<cf0734c38bab916ecaf361bc557b8802>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -249,15 +249,15 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useAlwaysAvailableJSErrorHandling() override {
|
||||
bool updateRuntimeShadowNodeReferencesOnCommit() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useAlwaysAvailableJSErrorHandling");
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("updateRuntimeShadowNodeReferencesOnCommit");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useEditTextStockAndroidFocusBehavior() override {
|
||||
bool useAlwaysAvailableJSErrorHandling() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useEditTextStockAndroidFocusBehavior");
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useAlwaysAvailableJSErrorHandling");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
@@ -285,6 +285,12 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useShadowNodeStateOnClone() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useShadowNodeStateOnClone");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useTurboModuleInterop() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useTurboModuleInterop");
|
||||
@@ -476,16 +482,16 @@ bool JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndr
|
||||
return ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::updateRuntimeShadowNodeReferencesOnCommit(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useEditTextStockAndroidFocusBehavior(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useEditTextStockAndroidFocusBehavior();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useFabricInterop(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useFabricInterop();
|
||||
@@ -506,6 +512,11 @@ bool JReactNativeFeatureFlagsCxxInterop::useRawPropsJsiValue(
|
||||
return ReactNativeFeatureFlags::useRawPropsJsiValue();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useShadowNodeStateOnClone(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useShadowNodeStateOnClone();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useTurboModuleInterop();
|
||||
@@ -652,12 +663,12 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"traceTurboModulePromiseRejectionsOnAndroid",
|
||||
JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid),
|
||||
makeNativeMethod(
|
||||
"updateRuntimeShadowNodeReferencesOnCommit",
|
||||
JReactNativeFeatureFlagsCxxInterop::updateRuntimeShadowNodeReferencesOnCommit),
|
||||
makeNativeMethod(
|
||||
"useAlwaysAvailableJSErrorHandling",
|
||||
JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling),
|
||||
makeNativeMethod(
|
||||
"useEditTextStockAndroidFocusBehavior",
|
||||
JReactNativeFeatureFlagsCxxInterop::useEditTextStockAndroidFocusBehavior),
|
||||
makeNativeMethod(
|
||||
"useFabricInterop",
|
||||
JReactNativeFeatureFlagsCxxInterop::useFabricInterop),
|
||||
@@ -670,6 +681,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"useRawPropsJsiValue",
|
||||
JReactNativeFeatureFlagsCxxInterop::useRawPropsJsiValue),
|
||||
makeNativeMethod(
|
||||
"useShadowNodeStateOnClone",
|
||||
JReactNativeFeatureFlagsCxxInterop::useShadowNodeStateOnClone),
|
||||
makeNativeMethod(
|
||||
"useTurboModuleInterop",
|
||||
JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop),
|
||||
|
||||
+6
-3
@@ -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<<610104213a5eba23b797e27377d71b52>>
|
||||
* @generated SignedSource<<f295d109e9a81ce2d2040a5fc89e9ada>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -135,10 +135,10 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool traceTurboModulePromiseRejectionsOnAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useAlwaysAvailableJSErrorHandling(
|
||||
static bool updateRuntimeShadowNodeReferencesOnCommit(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useEditTextStockAndroidFocusBehavior(
|
||||
static bool useAlwaysAvailableJSErrorHandling(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useFabricInterop(
|
||||
@@ -153,6 +153,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool useRawPropsJsiValue(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useShadowNodeStateOnClone(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useTurboModuleInterop(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
+2
-2
@@ -88,13 +88,13 @@ class BorderRadiusStyleTest {
|
||||
arrayOf(
|
||||
BorderRadiusProp.BORDER_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_START_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_END_RADIUS,
|
||||
BorderRadiusProp.BORDER_END_END_RADIUS),
|
||||
ComputedBorderRadiusProp.COMPUTED_BORDER_BOTTOM_RIGHT_RADIUS to
|
||||
arrayOf(
|
||||
BorderRadiusProp.BORDER_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_LEFT_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_END_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_START_RADIUS,
|
||||
BorderRadiusProp.BORDER_START_END_RADIUS),
|
||||
)
|
||||
|
||||
|
||||
@@ -109,7 +109,11 @@ Pod::Spec.new do |s|
|
||||
sss.dependency folly_dep_name, folly_version
|
||||
sss.compiler_flags = folly_compiler_flags
|
||||
sss.source_files = "react/renderer/components/modal/**/*.{m,mm,cpp,h}"
|
||||
sss.exclude_files = "react/renderer/components/modal/tests"
|
||||
sss.exclude_files = [
|
||||
"react/renderer/components/modal/tests",
|
||||
"react/renderer/components/modal/platform/android/**/*.{cpp,h}",
|
||||
"react/renderer/components/modal/platform/cxx/**/*.{cpp,h}"
|
||||
]
|
||||
sss.header_dir = "react/renderer/components/modal"
|
||||
end
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
#define REACT_NATIVE_VERSION_MAJOR 1000
|
||||
#define REACT_NATIVE_VERSION_MINOR 0
|
||||
#define REACT_NATIVE_VERSION_PATCH 0
|
||||
#define REACT_NATIVE_VERSION_MAJOR 0
|
||||
#define REACT_NATIVE_VERSION_MINOR 79
|
||||
#define REACT_NATIVE_VERSION_PATCH 7
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 1000;
|
||||
int32_t Minor = 0;
|
||||
int32_t Patch = 0;
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 79;
|
||||
int32_t Patch = 7;
|
||||
std::string_view Prerelease = "";
|
||||
} ReactNativeVersion;
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ Pod::Spec.new do |s|
|
||||
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||||
s.pod_target_xcconfig = {
|
||||
"HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES",
|
||||
}
|
||||
s.header_dir = "reacthermes"
|
||||
s.dependency "React-cxxreact", version
|
||||
|
||||
@@ -32,6 +32,6 @@ Pod::Spec.new do |s|
|
||||
s.dependency "React-jsi", version
|
||||
|
||||
s.subspec "Fabric" do |ss|
|
||||
ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)" }
|
||||
ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)", "DEFINES_MODULE" => "YES" }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -48,8 +48,11 @@ Pod::Spec.new do |s|
|
||||
s.header_mappings_dir = "./"
|
||||
end
|
||||
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
|
||||
s.pod_target_xcconfig = {
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES",
|
||||
}
|
||||
|
||||
s.dependency "React-cxxreact", version
|
||||
s.dependency "React-jsi", version
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <ReactCommon/RuntimeExecutor.h>
|
||||
#include <cxxreact/MessageQueueThread.h>
|
||||
#include <jsi/jsi.h>
|
||||
@@ -72,3 +74,5 @@ class JSIRuntimeHolder : public JSRuntime {
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -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<<3d4eefc7af1e9d594ade8339c261ca01>>
|
||||
* @generated SignedSource<<1c90106ded5dc5f08cdec4dede695341>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -166,12 +166,12 @@ bool ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid() {
|
||||
return getAccessor().traceTurboModulePromiseRejectionsOnAndroid();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling() {
|
||||
return getAccessor().useAlwaysAvailableJSErrorHandling();
|
||||
bool ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit() {
|
||||
return getAccessor().updateRuntimeShadowNodeReferencesOnCommit();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useEditTextStockAndroidFocusBehavior() {
|
||||
return getAccessor().useEditTextStockAndroidFocusBehavior();
|
||||
bool ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling() {
|
||||
return getAccessor().useAlwaysAvailableJSErrorHandling();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useFabricInterop() {
|
||||
@@ -190,6 +190,10 @@ bool ReactNativeFeatureFlags::useRawPropsJsiValue() {
|
||||
return getAccessor().useRawPropsJsiValue();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useShadowNodeStateOnClone() {
|
||||
return getAccessor().useShadowNodeStateOnClone();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useTurboModuleInterop() {
|
||||
return getAccessor().useTurboModuleInterop();
|
||||
}
|
||||
|
||||
@@ -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<<55a526204b386d34058c86183d5b97ac>>
|
||||
* @generated SignedSource<<ce2f5895234f1cfb30374c72db54ccce>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -214,16 +214,16 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool traceTurboModulePromiseRejectionsOnAndroid();
|
||||
|
||||
/**
|
||||
* When enabled, runtime shadow node references will be updated during the commit. This allows running RSNRU from any thread without corrupting the renderer state.
|
||||
*/
|
||||
RN_EXPORT static bool updateRuntimeShadowNodeReferencesOnCommit();
|
||||
|
||||
/**
|
||||
* In Bridgeless mode, use the always available javascript error reporting pipeline.
|
||||
*/
|
||||
RN_EXPORT static bool useAlwaysAvailableJSErrorHandling();
|
||||
|
||||
/**
|
||||
* If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.
|
||||
*/
|
||||
RN_EXPORT static bool useEditTextStockAndroidFocusBehavior();
|
||||
|
||||
/**
|
||||
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
|
||||
*/
|
||||
@@ -244,6 +244,11 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool useRawPropsJsiValue();
|
||||
|
||||
/**
|
||||
* Use the state stored on the source shadow node when cloning it instead of reading in the most recent state on the shadow node family.
|
||||
*/
|
||||
RN_EXPORT static bool useShadowNodeStateOnClone();
|
||||
|
||||
/**
|
||||
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
|
||||
*/
|
||||
|
||||
+40
-22
@@ -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<<c30a4dea1d32e2838f6e5db6442a3f78>>
|
||||
* @generated SignedSource<<f975f6ffd2d6ec5d9057585ac0613c23>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -659,6 +659,24 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit() {
|
||||
auto flagValue = updateRuntimeShadowNodeReferencesOnCommit_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(35, "updateRuntimeShadowNodeReferencesOnCommit");
|
||||
|
||||
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
|
||||
updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
|
||||
auto flagValue = useAlwaysAvailableJSErrorHandling_.load();
|
||||
|
||||
@@ -668,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(35, "useAlwaysAvailableJSErrorHandling");
|
||||
markFlagAsAccessed(36, "useAlwaysAvailableJSErrorHandling");
|
||||
|
||||
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
|
||||
useAlwaysAvailableJSErrorHandling_ = flagValue;
|
||||
@@ -677,24 +695,6 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useEditTextStockAndroidFocusBehavior() {
|
||||
auto flagValue = useEditTextStockAndroidFocusBehavior_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(36, "useEditTextStockAndroidFocusBehavior");
|
||||
|
||||
flagValue = currentProvider_->useEditTextStockAndroidFocusBehavior();
|
||||
useEditTextStockAndroidFocusBehavior_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
|
||||
auto flagValue = useFabricInterop_.load();
|
||||
|
||||
@@ -767,6 +767,24 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() {
|
||||
auto flagValue = useShadowNodeStateOnClone_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(41, "useShadowNodeStateOnClone");
|
||||
|
||||
flagValue = currentProvider_->useShadowNodeStateOnClone();
|
||||
useShadowNodeStateOnClone_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
|
||||
auto flagValue = useTurboModuleInterop_.load();
|
||||
|
||||
@@ -776,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(41, "useTurboModuleInterop");
|
||||
markFlagAsAccessed(42, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = flagValue;
|
||||
@@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(42, "useTurboModules");
|
||||
markFlagAsAccessed(43, "useTurboModules");
|
||||
|
||||
flagValue = currentProvider_->useTurboModules();
|
||||
useTurboModules_ = flagValue;
|
||||
|
||||
+6
-4
@@ -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<<95aa4a8b8859f26b901112df1517b1f1>>
|
||||
* @generated SignedSource<<978f828e7368b8802f8eaa5194e86e2f>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -67,12 +67,13 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool removeTurboModuleManagerDelegateMutex();
|
||||
bool throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS();
|
||||
bool traceTurboModulePromiseRejectionsOnAndroid();
|
||||
bool updateRuntimeShadowNodeReferencesOnCommit();
|
||||
bool useAlwaysAvailableJSErrorHandling();
|
||||
bool useEditTextStockAndroidFocusBehavior();
|
||||
bool useFabricInterop();
|
||||
bool useNativeViewConfigsInBridgelessMode();
|
||||
bool useOptimizedEventBatchingOnAndroid();
|
||||
bool useRawPropsJsiValue();
|
||||
bool useShadowNodeStateOnClone();
|
||||
bool useTurboModuleInterop();
|
||||
bool useTurboModules();
|
||||
|
||||
@@ -86,7 +87,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 43> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 44> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> disableMountItemReorderingAndroid_;
|
||||
@@ -123,12 +124,13 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> removeTurboModuleManagerDelegateMutex_;
|
||||
std::atomic<std::optional<bool>> throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS_;
|
||||
std::atomic<std::optional<bool>> traceTurboModulePromiseRejectionsOnAndroid_;
|
||||
std::atomic<std::optional<bool>> updateRuntimeShadowNodeReferencesOnCommit_;
|
||||
std::atomic<std::optional<bool>> useAlwaysAvailableJSErrorHandling_;
|
||||
std::atomic<std::optional<bool>> useEditTextStockAndroidFocusBehavior_;
|
||||
std::atomic<std::optional<bool>> useFabricInterop_;
|
||||
std::atomic<std::optional<bool>> useNativeViewConfigsInBridgelessMode_;
|
||||
std::atomic<std::optional<bool>> useOptimizedEventBatchingOnAndroid_;
|
||||
std::atomic<std::optional<bool>> useRawPropsJsiValue_;
|
||||
std::atomic<std::optional<bool>> useShadowNodeStateOnClone_;
|
||||
std::atomic<std::optional<bool>> useTurboModuleInterop_;
|
||||
std::atomic<std::optional<bool>> useTurboModules_;
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user