mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
54
Commits
@@ -15,8 +15,6 @@ runs:
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
@@ -45,6 +43,8 @@ runs:
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: ./.github/actions/yarn-install
|
||||
|
||||
@@ -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: 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
|
||||
@@ -83,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\
|
||||
|
||||
@@ -116,12 +116,12 @@ runs:
|
||||
- name: Print Artifacts Directory
|
||||
shell: bash
|
||||
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
with:
|
||||
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Build packages
|
||||
|
||||
@@ -14,6 +14,8 @@ inputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Configure Git
|
||||
|
||||
@@ -35,6 +35,8 @@ runs:
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Start Metro in Debug
|
||||
|
||||
@@ -17,9 +17,6 @@ outputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Setup hermes version
|
||||
shell: bash
|
||||
id: hermes-version
|
||||
@@ -67,6 +64,8 @@ runs:
|
||||
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
|
||||
uses: ./.github/actions/yarn-install
|
||||
|
||||
@@ -4,7 +4,7 @@ inputs:
|
||||
node-version:
|
||||
description: 'The node.js version to use'
|
||||
required: false
|
||||
default: '22'
|
||||
default: '22.14.0'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
@@ -23,6 +23,8 @@ runs:
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Create Hermes folder
|
||||
shell: bash
|
||||
run: mkdir -p "$HERMES_WS_DIR"
|
||||
@@ -34,8 +36,6 @@ runs:
|
||||
- name: Print Downloaded hermes
|
||||
shell: bash
|
||||
run: ls -lR "$HERMES_WS_DIR"
|
||||
- name: Run yarn
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(0);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
expect(mockSleep).toHaveBeenCalledTimes(90);
|
||||
expect(mockExit).toHaveBeenCalledWith(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,13 +13,14 @@ const SLEEP_S = 60; // 1 minute
|
||||
const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min.
|
||||
const ARTIFACT_URL =
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/';
|
||||
const ARTIFACT_NAME = 'react-native-artifacts-';
|
||||
|
||||
async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.substring(1);
|
||||
}
|
||||
|
||||
const artifactUrl = `${ARTIFACT_URL}${version}`;
|
||||
const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`;
|
||||
for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) {
|
||||
const response = await fetch(artifactUrl);
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@ jobs:
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Extract branch name
|
||||
run: |
|
||||
TAG="${{ github.ref_name }}";
|
||||
|
||||
@@ -128,9 +128,9 @@ jobs:
|
||||
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'
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
id: restore-ios-slice
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: packages/react-native/
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
# Move the XCFramework in the destination directory
|
||||
mv /tmp/third-party/packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies.xcframework
|
||||
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
VERSION=$(jq -r '.version' packages/react-native/package.json)
|
||||
echo "$VERSION-${{matrix.flavor}}" > "packages/react-native/third-party/version.txt"
|
||||
cat "packages/react-native/third-party/version.txt"
|
||||
# Check destination directory
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: |
|
||||
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
packages/react-native/.build/headers
|
||||
@@ -140,7 +140,7 @@ jobs:
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/.build/output/xcframeworks
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-node
|
||||
@@ -209,4 +209,4 @@ jobs:
|
||||
path: |
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
|
||||
@@ -125,9 +125,9 @@ jobs:
|
||||
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'
|
||||
|
||||
@@ -392,9 +392,9 @@ jobs:
|
||||
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'
|
||||
@@ -593,7 +593,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: ["24", "22"]
|
||||
node-version: ["24.4.1", "22", "20.19.4"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+6
-6
@@ -26,8 +26,8 @@
|
||||
"set-version": "node ./scripts/releases/set-version.js",
|
||||
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
|
||||
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
|
||||
"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-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
|
||||
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
|
||||
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
|
||||
@@ -52,8 +52,8 @@
|
||||
"@electron/packager": "^18.3.6",
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@microsoft/api-extractor": "^7.52.2",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-main",
|
||||
"@react-native/metro-config": "0.81.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-rc.4",
|
||||
"@react-native/metro-config": "0.81.0-rc.4",
|
||||
"@tsconfig/node22": "22.0.2",
|
||||
"@types/react": "^19.1.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
@@ -90,9 +90,9 @@
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"markdownlint-cli2": "^0.17.2",
|
||||
"markdownlint-rule-relative-links": "^3.0.0",
|
||||
"metro-babel-register": "^0.82.5",
|
||||
"metro-babel-register": "^0.83.1",
|
||||
"metro-memory-fs": "^0.82.5",
|
||||
"metro-transform-plugins": "^0.82.5",
|
||||
"metro-transform-plugins": "^0.83.1",
|
||||
"micromatch": "^4.0.4",
|
||||
"node-fetch": "^2.2.0",
|
||||
"nullthrows": "^1.1.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"files": [
|
||||
"path-support.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -19,14 +19,14 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.81.0-main"
|
||||
"@react-native/codegen": "0.81.0-rc.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,16 +22,16 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.81.0-main",
|
||||
"@react-native/dev-middleware": "0.81.0-rc.4",
|
||||
"debug": "^4.4.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro": "^0.82.5",
|
||||
"metro-config": "^0.82.5",
|
||||
"metro-core": "^0.82.5",
|
||||
"metro": "^0.83.1",
|
||||
"metro-config": "^0.83.1",
|
||||
"metro-core": "^0.83.1",
|
||||
"semver": "^7.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"metro-resolver": "^0.82.5"
|
||||
"metro-resolver": "^0.83.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-native-community/cli": "*",
|
||||
@@ -43,6 +43,6 @@
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ async function runServer(
|
||||
// $FlowIgnore[cannot-write] Assigning to readonly property
|
||||
metroConfig.reporter = reporter;
|
||||
|
||||
const serverInstance = await Metro.runServer(metroConfig, {
|
||||
const {httpServer: serverInstance} = await Metro.runServer(metroConfig, {
|
||||
host: args.host,
|
||||
secure: args.https,
|
||||
secureCert: args.cert,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
@@ -21,7 +21,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -76,9 +76,8 @@ function getNodePackagePath(packageName: string): string {
|
||||
}
|
||||
|
||||
function metro(...args: $ReadOnlyArray<string>): ExecaPromise {
|
||||
const metroPath = getNodePackagePath(path.join('metro', 'src', 'cli.js'));
|
||||
log(`🚇 ${metroPath} ${args.join(' ')} `);
|
||||
return execa('node', [metroPath, ...args]);
|
||||
log(`🚇 metro ${args.join(' ')} `);
|
||||
return execa('npx', ['--offline', 'metro', ...args]);
|
||||
}
|
||||
|
||||
export const tasks = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -20,6 +20,6 @@
|
||||
"BUILD_INFO"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-shell",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -26,7 +26,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0",
|
||||
"node": ">= 20.19.4",
|
||||
"electron": ">=36.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"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.81.0-main",
|
||||
"@react-native/debugger-frontend": "0.81.0-rc.4",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
@@ -35,7 +35,7 @@
|
||||
"ws": "^6.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"selfsigned": "^2.4.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -16,13 +16,13 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@react-native/eslint-plugin": "0.81.0-main",
|
||||
"@react-native/eslint-plugin": "0.81.0-rc.4",
|
||||
"@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.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -22,6 +22,6 @@
|
||||
"hermes-eslint": "0.29.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"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.81.0-main",
|
||||
"@react-native/codegen": "0.81.0-rc.4",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
@@ -36,6 +36,6 @@
|
||||
"hermes-eslint": "0.29.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "./gradlew build",
|
||||
|
||||
+16
@@ -26,5 +26,21 @@ class ReactRootProjectPlugin : Plugin<Project> {
|
||||
it.evaluationDependsOn(":app")
|
||||
}
|
||||
}
|
||||
// We need to make sure that `:app:preBuild` task depends on all other subprojects' preBuild
|
||||
// tasks. This is necessary in order to have all the codegen generated code before the CMake
|
||||
// configuration build kicks in.
|
||||
project.gradle.projectsEvaluated {
|
||||
val appProject = project.rootProject.subprojects.find { it.name == "app" }
|
||||
val appPreBuild = appProject?.tasks?.findByName("preBuild")
|
||||
if (appPreBuild != null) {
|
||||
// Find all other subprojects' preBuild tasks
|
||||
val otherPreBuildTasks =
|
||||
project.rootProject.subprojects
|
||||
.filter { it != appProject }
|
||||
.mapNotNull { it.tasks.findByName("preBuild") }
|
||||
// Make :app:preBuild depend on all others
|
||||
appPreBuild.dependsOn(otherPreBuildTasks)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -148,6 +148,7 @@ abstract class GeneratePackageListTask : DefaultTask() {
|
||||
|
||||
{{ packageImports }}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
|
||||
+3
-1
@@ -233,6 +233,7 @@ class GeneratePackageListTaskTest {
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
@@ -311,7 +312,8 @@ class GeneratePackageListTaskTest {
|
||||
import com.facebook.react.aPackage;
|
||||
// @react-native/another-package
|
||||
import com.facebook.react.anotherPackage;
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.js",
|
||||
@@ -26,9 +26,9 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.81.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-main",
|
||||
"metro-config": "^0.82.5",
|
||||
"metro-runtime": "^0.82.5"
|
||||
"@react-native/js-polyfills": "0.81.0-rc.4",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-rc.4",
|
||||
"metro-config": "^0.83.1",
|
||||
"metro-runtime": "^0.83.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/new-app-screen",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "NewAppScreen component for React Native",
|
||||
"keywords": [
|
||||
"react-native"
|
||||
@@ -30,6 +30,6 @@
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,7 @@ import {ThemedText, useTheme} from './Theme';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Image,
|
||||
Platform,
|
||||
SafeAreaView,
|
||||
ScrollView,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableHighlight,
|
||||
@@ -29,24 +26,32 @@ import {version as ReactNativeVersion} from 'react-native/Libraries/Core/ReactNa
|
||||
|
||||
export type NewAppScreenProps = $ReadOnly<{
|
||||
templateFileName?: string,
|
||||
safeAreaInsets?: $ReadOnly<{
|
||||
top: number,
|
||||
bottom: number,
|
||||
left: number,
|
||||
right: number,
|
||||
}>,
|
||||
}>;
|
||||
|
||||
const statusBarHeightOffset = Platform.select({
|
||||
android: StatusBar.currentHeight || 0,
|
||||
default: 0,
|
||||
});
|
||||
|
||||
export default function NewAppScreen({
|
||||
templateFileName = 'App.tsx',
|
||||
safeAreaInsets = {top: 0, bottom: 0, left: 0, right: 0},
|
||||
}: NewAppScreenProps): React.Node {
|
||||
const {colors} = useTheme();
|
||||
const isDarkMode = useColorScheme() === 'dark';
|
||||
const isLargeScreen = useWindowDimensions().width > 600;
|
||||
|
||||
return (
|
||||
<SafeAreaView style={{backgroundColor: colors.background}}>
|
||||
<ScrollView>
|
||||
<View style={[styles.container, {paddingTop: statusBarHeightOffset}]}>
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.background,
|
||||
paddingTop: safeAreaInsets.top,
|
||||
paddingLeft: safeAreaInsets.left,
|
||||
paddingRight: safeAreaInsets.right,
|
||||
}}>
|
||||
<ScrollView style={{paddingBottom: safeAreaInsets.bottom}}>
|
||||
<View style={styles.container}>
|
||||
<View style={styles.header}>
|
||||
<Image
|
||||
style={styles.logo}
|
||||
@@ -99,7 +104,7 @@ export default function NewAppScreen({
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -11,6 +11,14 @@ import type * as React from 'react';
|
||||
|
||||
export type NewAppScreenProps = Readonly<{
|
||||
templateFileName?: string | undefined;
|
||||
safeAreaInsets?:
|
||||
| Readonly<{
|
||||
top: number;
|
||||
bottom: number;
|
||||
left: number;
|
||||
right: number;
|
||||
}>
|
||||
| undefined;
|
||||
}>;
|
||||
|
||||
export function NewAppScreen(props: NewAppScreenProps): React.ReactNode;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"files": [
|
||||
"console.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Babel preset for React Native applications",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -13,7 +13,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"main": "src/index.js",
|
||||
"files": [
|
||||
@@ -66,7 +66,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.81.0-main",
|
||||
"@react-native/babel-plugin-codegen": "0.81.0-rc.4",
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.1",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"react-refresh": "^0.14.0"
|
||||
|
||||
+22
-14
@@ -38,19 +38,6 @@ function isFirstParty(fileName) {
|
||||
// use `this.foo = bar` instead of `this.defineProperty('foo', ...)`
|
||||
const loose = true;
|
||||
|
||||
const defaultPlugins = [
|
||||
[require('babel-plugin-syntax-hermes-parser'), {parseLangTypes: 'flow'}],
|
||||
[require('babel-plugin-transform-flow-enums')],
|
||||
[require('@babel/plugin-transform-block-scoping')],
|
||||
[require('@babel/plugin-transform-class-properties'), {loose}],
|
||||
[require('@babel/plugin-transform-private-methods'), {loose}],
|
||||
[require('@babel/plugin-transform-private-property-in-object'), {loose}],
|
||||
[require('@babel/plugin-syntax-dynamic-import')],
|
||||
[require('@babel/plugin-syntax-export-default-from')],
|
||||
...passthroughSyntaxPlugins,
|
||||
[require('@babel/plugin-transform-unicode-regex')],
|
||||
];
|
||||
|
||||
// For Static Hermes testing (experimental), the hermes-canary transformProfile
|
||||
// is used to enable regenerator (and some related lowering passes) because SH
|
||||
// requires more Babel lowering than Hermes temporarily.
|
||||
@@ -234,7 +221,28 @@ const getPreset = (src, options) => {
|
||||
plugins: [require('@babel/plugin-transform-flow-strip-types')],
|
||||
},
|
||||
{
|
||||
plugins: defaultPlugins,
|
||||
plugins: [
|
||||
[
|
||||
require('babel-plugin-syntax-hermes-parser'),
|
||||
{
|
||||
parseLangTypes: 'flow',
|
||||
reactRuntimeTarget: '19',
|
||||
...options.hermesParserOptions,
|
||||
},
|
||||
],
|
||||
[require('babel-plugin-transform-flow-enums')],
|
||||
[require('@babel/plugin-transform-block-scoping')],
|
||||
[require('@babel/plugin-transform-class-properties'), {loose}],
|
||||
[require('@babel/plugin-transform-private-methods'), {loose}],
|
||||
[
|
||||
require('@babel/plugin-transform-private-property-in-object'),
|
||||
{loose},
|
||||
],
|
||||
[require('@babel/plugin-syntax-dynamic-import')],
|
||||
[require('@babel/plugin-syntax-export-default-from')],
|
||||
...passthroughSyntaxPlugins,
|
||||
[require('@babel/plugin-transform-unicode-regex')],
|
||||
],
|
||||
},
|
||||
{
|
||||
test: isTypeScriptSource,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-babel-transformer",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Babel transformer for React Native applications.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,7 +14,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"main": "src/index.js",
|
||||
"files": [
|
||||
@@ -27,7 +27,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.81.0-main",
|
||||
"@react-native/babel-preset": "0.81.0-rc.4",
|
||||
"hermes-parser": "0.29.1",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn clean && node scripts/build.js --verbose",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/compatibility-check",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -19,7 +19,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 22.14.0"
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.js",
|
||||
@@ -29,7 +29,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.81.0-main"
|
||||
"@react-native/codegen": "0.81.0-rc.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-remove-types": "^2.237.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.81.0-rc.4",
|
||||
"description": "PopupMenu for the Android platform",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@react-native/codegen": "0.81.0-main"
|
||||
"@react-native/codegen": "0.81.0-rc.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.1.0",
|
||||
|
||||
+2
@@ -12,7 +12,9 @@ import com.facebook.react.bridge.NativeModule
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.uimanager.ViewManager
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
public class OSSLibraryExamplePackage : ReactPackage {
|
||||
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
|
||||
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
|
||||
listOf(NativeSampleModule(reactContext))
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.81.0-main",
|
||||
"react-native": "1000.0.0"
|
||||
"@react-native/babel-preset": "0.81.0-rc.4",
|
||||
"react-native": "0.81.0-rc.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -84,4 +84,5 @@ Pod::Spec.new do |s|
|
||||
|
||||
depend_on_js_engine(s)
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -55,4 +55,5 @@ Pod::Spec.new do |s|
|
||||
end
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
+5
-1
@@ -23,7 +23,7 @@ import {use} from 'react';
|
||||
*
|
||||
* @see https://reactnative.dev/docs/view
|
||||
*/
|
||||
export default component View(
|
||||
component View(
|
||||
ref?: React.RefSetter<React.ElementRef<typeof ViewNativeComponent>>,
|
||||
...props: ViewProps
|
||||
) {
|
||||
@@ -213,3 +213,7 @@ export default component View(
|
||||
}
|
||||
return actualView;
|
||||
}
|
||||
|
||||
View.displayName = 'View';
|
||||
|
||||
export default View;
|
||||
|
||||
@@ -15,8 +15,8 @@ export const version: $ReadOnly<{
|
||||
patch: number,
|
||||
prerelease: string | null,
|
||||
}> = {
|
||||
major: 1000,
|
||||
minor: 0,
|
||||
major: 0,
|
||||
minor: 81,
|
||||
patch: 0,
|
||||
prerelease: null,
|
||||
prerelease: 'rc.4',
|
||||
};
|
||||
|
||||
@@ -53,4 +53,5 @@ Pod::Spec.new do |s|
|
||||
add_dependency(s, "React-NativeModulesApple")
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -50,4 +50,5 @@ Pod::Spec.new do |s|
|
||||
add_dependency(s, "React-featureflags")
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -52,4 +52,5 @@ Pod::Spec.new do |s|
|
||||
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -48,4 +48,6 @@ Pod::Spec.new do |s|
|
||||
add_dependency(s, "React-RCTFBReactNativeSpec")
|
||||
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
|
||||
add_dependency(s, "React-NativeModulesApple")
|
||||
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
|
||||
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
|
||||
add_dependency(s, "React-NativeModulesApple")
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -62,8 +62,7 @@ Pod::Spec.new do |s|
|
||||
CONFIG="Debug"
|
||||
fi
|
||||
|
||||
# TODO(T228219721): Add this for React Native Core as well
|
||||
##### "$NODE_BINARY" "$REACT_NATIVE_PATH/third-party-podspecs/replace_dependencies_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
|
||||
"$NODE_BINARY" "$REACT_NATIVE_PATH/scripts/replace-rncore-version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -73,7 +72,7 @@ Pod::Spec.new do |s|
|
||||
# always run the script without warning
|
||||
script_phase[:always_out_of_date] = "1"
|
||||
end
|
||||
|
||||
|
||||
s.script_phase = script_phase
|
||||
end
|
||||
end
|
||||
|
||||
@@ -83,10 +83,6 @@ Pod::Spec.new do |s|
|
||||
ss.exclude_files = exclude_files
|
||||
ss.private_header_files = "React/Cxx*/*.h"
|
||||
|
||||
# Include prebuilt if we're not building from source
|
||||
if !ReactNativeCoreUtils.build_rncore_from_source()
|
||||
ss.dependency "React-Core-prebuilt", version
|
||||
end
|
||||
end
|
||||
|
||||
s.subspec "DevSupport" do |ss|
|
||||
@@ -137,4 +133,5 @@ Pod::Spec.new do |s|
|
||||
|
||||
depend_on_js_engine(s)
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -21,10 +21,10 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(1000),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(81),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
RCTVersionPrerelease: @"rc.4",
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
|
||||
@@ -63,4 +63,5 @@ Pod::Spec.new do |s|
|
||||
add_dependency(s, "React-NativeModulesApple")
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -61,6 +61,7 @@ Pod::Spec.new do |s|
|
||||
|
||||
depend_on_js_engine(s)
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
|
||||
s.subspec "components" do |ss|
|
||||
ss.source_files = podspec_sources("FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{m,mm,cpp,h}", "FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{h}")
|
||||
|
||||
@@ -97,6 +97,7 @@ Pod::Spec.new do |s|
|
||||
|
||||
depend_on_js_engine(s)
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
|
||||
s.test_spec 'Tests' do |test_spec|
|
||||
test_spec.source_files = podspec_sources("Tests/**/*.{mm}", "")
|
||||
|
||||
@@ -68,4 +68,5 @@ Pod::Spec.new do |s|
|
||||
|
||||
depend_on_js_engine(s)
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
end
|
||||
|
||||
@@ -31,8 +31,8 @@ public abstract class com/facebook/react/HeadlessJsTaskService : android/app/Ser
|
||||
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;
|
||||
protected fun getReactHost ()Lcom/facebook/react/ReactHost;
|
||||
protected fun getReactNativeHost ()Lcom/facebook/react/ReactNativeHost;
|
||||
protected fun getTaskConfig (Landroid/content/Intent;)Lcom/facebook/react/jstasks/HeadlessJsTaskConfig;
|
||||
public fun onBind (Landroid/content/Intent;)Landroid/os/IBinder;
|
||||
public fun onDestroy ()V
|
||||
@@ -353,7 +353,7 @@ public abstract class com/facebook/react/ReactNativeHost {
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/ReactPackage {
|
||||
public abstract fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
|
||||
public fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
|
||||
public abstract fun createViewManagers (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
|
||||
public fun getModule (Ljava/lang/String;Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/NativeModule;
|
||||
}
|
||||
|
||||
@@ -112,6 +112,8 @@ val preparePrefab by
|
||||
Pair(
|
||||
"../ReactCommon/react/renderer/animations/",
|
||||
"react/renderer/animations/"),
|
||||
// react_renderer_bridging
|
||||
Pair("../ReactCommon/react/renderer/bridging/", "react/renderer/bridging/"),
|
||||
// react_renderer_componentregistry
|
||||
Pair(
|
||||
"../ReactCommon/react/renderer/componentregistry/",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0
|
||||
VERSION_NAME=0.81.0-rc.4
|
||||
react.internal.publishingGroup=com.facebook.react
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+1
@@ -22,6 +22,7 @@ import javax.inject.Provider
|
||||
/** Abstract class that supports lazy loading of NativeModules by default. */
|
||||
public abstract class BaseReactPackage : ReactPackage {
|
||||
|
||||
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
|
||||
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
||||
throw UnsupportedOperationException(
|
||||
"createNativeModules method is not supported. Use getModule() method instead.")
|
||||
|
||||
+3
-2
@@ -112,7 +112,8 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
|
||||
* simply have a different mechanism for storing a `ReactNativeHost`, e.g. as a static field
|
||||
* somewhere.
|
||||
*/
|
||||
protected val reactNativeHost: ReactNativeHost
|
||||
@Suppress("DEPRECATION")
|
||||
protected open val reactNativeHost: ReactNativeHost
|
||||
get() = (application as ReactApplication).reactNativeHost
|
||||
|
||||
/**
|
||||
@@ -120,7 +121,7 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
|
||||
* [ReactApplication] and calls [ReactApplication.reactHost]. This method assumes it is called in
|
||||
* new architecture and returns null if not.
|
||||
*/
|
||||
protected val reactHost: ReactHost?
|
||||
protected open val reactHost: ReactHost?
|
||||
get() = (application as ReactApplication).reactHost
|
||||
|
||||
protected val reactContext: ReactContext?
|
||||
|
||||
+2
@@ -92,6 +92,8 @@ public abstract class LazyReactPackage : ReactPackage {
|
||||
* @param reactContext react application context that can be used to create modules
|
||||
* @return A [List]<[NativeModule]> to register
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
|
||||
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
|
||||
buildList {
|
||||
for (holder in getNativeModules(reactContext)) {
|
||||
|
||||
+36
-27
@@ -18,20 +18,22 @@ import android.view.KeyEvent;
|
||||
import android.view.Window;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
|
||||
import com.facebook.react.interfaces.fabric.ReactSurface;
|
||||
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags;
|
||||
import com.facebook.react.modules.core.PermissionListener;
|
||||
import com.facebook.react.views.view.WindowUtilKt;
|
||||
import com.facebook.systrace.Systrace;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Delegate class for {@link ReactActivity}. You can subclass this to provide custom implementations
|
||||
* for e.g. {@link #getReactNativeHost()}, if your Application class doesn't implement {@link
|
||||
* ReactApplication}.
|
||||
*/
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public class ReactActivityDelegate {
|
||||
|
||||
private final @Nullable Activity mActivity;
|
||||
@@ -86,8 +88,11 @@ public class ReactActivityDelegate {
|
||||
* ReactApplication#getReactNativeHost()}. Override this method if your application class does not
|
||||
* implement {@code ReactApplication} or you simply have a different mechanism for storing a
|
||||
* {@code ReactNativeHost}, e.g. as a static field somewhere.
|
||||
*
|
||||
* @deprecated "Do not access {@link ReactNativeHost} directly. This class is going away in the
|
||||
* New Architecture. You should access {@link ReactHost} instead."
|
||||
*/
|
||||
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
|
||||
@Deprecated
|
||||
protected ReactNativeHost getReactNativeHost() {
|
||||
return ((ReactApplication) getPlainActivity().getApplication()).getReactNativeHost();
|
||||
}
|
||||
@@ -107,16 +112,21 @@ public class ReactActivityDelegate {
|
||||
return mReactDelegate;
|
||||
}
|
||||
|
||||
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
|
||||
/**
|
||||
* @deprecated @deprecated "Do not access {@link ReactInstanceManager} directly. This class is
|
||||
* going away in the New Architecture. You should access {@link ReactHost} instead."
|
||||
* @noinspection deprecation
|
||||
*/
|
||||
public ReactInstanceManager getReactInstanceManager() {
|
||||
return mReactDelegate.getReactInstanceManager();
|
||||
return Objects.requireNonNull(mReactDelegate).getReactInstanceManager();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getMainComponentName() {
|
||||
return mMainComponentName;
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
Systrace.traceSection(
|
||||
Systrace.TRACE_TAG_REACT,
|
||||
"ReactActivityDelegate.onCreate::init",
|
||||
@@ -147,6 +157,7 @@ public class ReactActivityDelegate {
|
||||
launchOptions,
|
||||
isFabricEnabled()) {
|
||||
@Override
|
||||
@Nullable
|
||||
protected ReactRootView createRootView() {
|
||||
ReactRootView rootView = ReactActivityDelegate.this.createRootView();
|
||||
if (rootView == null) {
|
||||
@@ -162,31 +173,29 @@ public class ReactActivityDelegate {
|
||||
});
|
||||
}
|
||||
|
||||
protected void loadApp(String appKey) {
|
||||
mReactDelegate.loadApp(appKey);
|
||||
protected void loadApp(@Nullable String appKey) {
|
||||
Objects.requireNonNull(mReactDelegate).loadApp(Objects.requireNonNull(appKey));
|
||||
getPlainActivity().setContentView(mReactDelegate.getReactRootView());
|
||||
}
|
||||
|
||||
public void setReactSurface(ReactSurface reactSurface) {
|
||||
mReactDelegate.setReactSurface(reactSurface);
|
||||
Objects.requireNonNull(mReactDelegate).setReactSurface(reactSurface);
|
||||
}
|
||||
|
||||
public void setReactRootView(ReactRootView reactRootView) {
|
||||
mReactDelegate.setReactRootView(reactRootView);
|
||||
Objects.requireNonNull(mReactDelegate).setReactRootView(reactRootView);
|
||||
}
|
||||
|
||||
public void onUserLeaveHint() {
|
||||
if (mReactDelegate != null) {
|
||||
mReactDelegate.onUserLeaveHint();
|
||||
}
|
||||
Objects.requireNonNull(mReactDelegate).onUserLeaveHint();
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
mReactDelegate.onHostPause();
|
||||
Objects.requireNonNull(mReactDelegate).onHostPause();
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
mReactDelegate.onHostResume();
|
||||
Objects.requireNonNull(mReactDelegate).onHostResume();
|
||||
|
||||
if (mPermissionsCallback != null) {
|
||||
mPermissionsCallback.invoke();
|
||||
@@ -195,43 +204,43 @@ public class ReactActivityDelegate {
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
mReactDelegate.onHostDestroy();
|
||||
Objects.requireNonNull(mReactDelegate).onHostDestroy();
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
mReactDelegate.onActivityResult(requestCode, resultCode, data, true);
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
Objects.requireNonNull(mReactDelegate).onActivityResult(requestCode, resultCode, data, true);
|
||||
}
|
||||
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
return mReactDelegate.onKeyDown(keyCode, event);
|
||||
return Objects.requireNonNull(mReactDelegate).onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
return mReactDelegate.shouldShowDevMenuOrReload(keyCode, event);
|
||||
return Objects.requireNonNull(mReactDelegate).shouldShowDevMenuOrReload(keyCode, event);
|
||||
}
|
||||
|
||||
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
|
||||
return mReactDelegate.onKeyLongPress(keyCode);
|
||||
return Objects.requireNonNull(mReactDelegate).onKeyLongPress(keyCode);
|
||||
}
|
||||
|
||||
public boolean onBackPressed() {
|
||||
return mReactDelegate.onBackPressed();
|
||||
return Objects.requireNonNull(mReactDelegate).onBackPressed();
|
||||
}
|
||||
|
||||
public boolean onNewIntent(Intent intent) {
|
||||
return mReactDelegate.onNewIntent(intent);
|
||||
public boolean onNewIntent(@Nullable Intent intent) {
|
||||
return Objects.requireNonNull(mReactDelegate).onNewIntent(Objects.requireNonNull(intent));
|
||||
}
|
||||
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
mReactDelegate.onWindowFocusChanged(hasFocus);
|
||||
Objects.requireNonNull(mReactDelegate).onWindowFocusChanged(hasFocus);
|
||||
}
|
||||
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
mReactDelegate.onConfigurationChanged(newConfig);
|
||||
Objects.requireNonNull(mReactDelegate).onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
public void requestPermissions(
|
||||
String[] permissions, int requestCode, PermissionListener listener) {
|
||||
String[] permissions, int requestCode, @Nullable PermissionListener listener) {
|
||||
mPermissionListener = listener;
|
||||
getPlainActivity().requestPermissions(permissions, requestCode);
|
||||
}
|
||||
@@ -267,7 +276,7 @@ public class ReactActivityDelegate {
|
||||
* context will no longer be valid.
|
||||
*/
|
||||
public @Nullable ReactContext getCurrentReactContext() {
|
||||
return mReactDelegate.getCurrentReactContext();
|
||||
return Objects.requireNonNull(mReactDelegate).getCurrentReactContext();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
@@ -10,6 +10,10 @@ package com.facebook.react
|
||||
/** Interface that represents an instance of a React Native application */
|
||||
public interface ReactApplication {
|
||||
/** Get the default [ReactNativeHost] for this app. */
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
|
||||
ReplaceWith("reactHost"))
|
||||
public val reactNativeHost: ReactNativeHost
|
||||
|
||||
/**
|
||||
|
||||
+7
-2
@@ -14,7 +14,6 @@ import android.os.Bundle
|
||||
import android.view.KeyEvent
|
||||
import com.facebook.react.bridge.ReactContext
|
||||
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
||||
import com.facebook.react.devsupport.DoubleTapReloadRecognizer
|
||||
import com.facebook.react.devsupport.ReleaseDevSupportManager
|
||||
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
||||
@@ -26,12 +25,17 @@ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
|
||||
* A delegate for handling React Application support. This delegate is unaware whether it is used in
|
||||
* an [Activity] or a [android.app.Fragment].
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
public open class ReactDelegate {
|
||||
private val activity: Activity
|
||||
private var internalReactRootView: ReactRootView? = null
|
||||
private val mainComponentName: String?
|
||||
private var launchOptions: Bundle?
|
||||
private var doubleTapReloadRecognizer: DoubleTapReloadRecognizer?
|
||||
|
||||
@Deprecated(
|
||||
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
|
||||
ReplaceWith("reactHost"))
|
||||
private var reactNativeHost: ReactNativeHost? = null
|
||||
public var reactHost: ReactHost? = null
|
||||
private set
|
||||
@@ -380,7 +384,8 @@ public open class ReactDelegate {
|
||||
return false
|
||||
}
|
||||
|
||||
@DeprecatedInNewArchitecture(message = "Use reactHost")
|
||||
@Deprecated(
|
||||
"Do not access [ReactInstanceManager] directly. This class is going away in the New Architecture. You should use [ReactHost] instead.")
|
||||
public fun getReactInstanceManager(): ReactInstanceManager {
|
||||
val nonNullReactNativeHost =
|
||||
checkNotNull(reactNativeHost) {
|
||||
|
||||
@@ -58,6 +58,10 @@ public open class ReactFragment : Fragment(), PermissionAwareActivity {
|
||||
* method if your application class does not implement `ReactApplication` or you simply have a
|
||||
* different mechanism for storing a `ReactNativeHost`, e.g. as a static field somewhere.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Deprecated(
|
||||
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
|
||||
ReplaceWith("reactHost"))
|
||||
protected open val reactNativeHost: ReactNativeHost?
|
||||
get() = (activity?.application as ReactApplication?)?.reactNativeHost
|
||||
|
||||
|
||||
+5
-5
@@ -10,6 +10,7 @@ package com.facebook.react;
|
||||
import android.app.Application;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.react.bridge.JSExceptionHandler;
|
||||
import com.facebook.react.bridge.JavaScriptExecutorFactory;
|
||||
import com.facebook.react.bridge.ReactMarker;
|
||||
@@ -18,7 +19,6 @@ import com.facebook.react.bridge.UIManagerProvider;
|
||||
import com.facebook.react.common.LifecycleState;
|
||||
import com.facebook.react.common.SurfaceDelegate;
|
||||
import com.facebook.react.common.SurfaceDelegateFactory;
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
@@ -32,12 +32,12 @@ import java.util.List;
|
||||
/**
|
||||
* Simple class that holds an instance of {@link ReactInstanceManager}. This can be used in your
|
||||
* {@link Application class} (see {@link ReactApplication}), or as a static field.
|
||||
*
|
||||
* @deprecated This class will be replaced by com.facebook.react.ReactHost in the New Architecture.
|
||||
*/
|
||||
@DeprecatedInNewArchitecture(
|
||||
message =
|
||||
"This class will be replaced by com.facebook.react.ReactHost in the new architecture of"
|
||||
+ " React Native.")
|
||||
@Deprecated
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public abstract class ReactNativeHost {
|
||||
|
||||
static {
|
||||
|
||||
@@ -10,7 +10,6 @@ package com.facebook.react
|
||||
import com.facebook.react.bridge.NativeModule
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.bridge.UIManager
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
||||
import com.facebook.react.common.annotations.StableReactNativeAPI
|
||||
import com.facebook.react.uimanager.ViewManager
|
||||
|
||||
@@ -34,8 +33,9 @@ public interface ReactPackage {
|
||||
* @return list of native modules to register with the newly created catalyst instance This method
|
||||
* is deprecated in the new Architecture of React Native.
|
||||
*/
|
||||
@DeprecatedInNewArchitecture(message = "Migrate to BaseReactPackage and implement getModule")
|
||||
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule>
|
||||
@Deprecated(message = "Migrate to [BaseReactPackage] and implement [getModule] instead.")
|
||||
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
|
||||
emptyList()
|
||||
|
||||
/** @return a list of view managers that should be registered with [UIManager] */
|
||||
public fun createViewManagers(
|
||||
|
||||
+1
@@ -28,6 +28,7 @@ internal object ReactPackageHelper {
|
||||
FLog.d(
|
||||
ReactConstants.TAG,
|
||||
"${reactPackage.javaClass.simpleName} is not a LazyReactPackage, falling back to old version.")
|
||||
@Suppress("DEPRECATION")
|
||||
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
|
||||
return Iterable {
|
||||
object : Iterator<ModuleHolder> {
|
||||
|
||||
+2
@@ -83,6 +83,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
|
||||
|
||||
if (shouldSupportLegacyPackages()) {
|
||||
// TODO(T145105887): Output warnings that ReactPackage was used
|
||||
@Suppress("DEPRECATION")
|
||||
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
|
||||
|
||||
val moduleMap: MutableMap<String, NativeModule> = mutableMapOf()
|
||||
@@ -94,6 +95,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
|
||||
|
||||
val moduleName = reactModule?.name ?: module.name
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
val moduleInfo: ReactModuleInfo =
|
||||
if (reactModule != null)
|
||||
ReactModuleInfo(
|
||||
|
||||
-2
@@ -16,7 +16,6 @@ import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.infer.annotation.ThreadConfined;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
|
||||
import com.facebook.react.common.annotations.StableReactNativeAPI;
|
||||
import com.facebook.react.common.build.ReactBuildConfig;
|
||||
import java.util.Map;
|
||||
@@ -72,7 +71,6 @@ public abstract class BaseJavaModule implements NativeModule {
|
||||
/**
|
||||
* @return a map of constants this module exports to JS. Supports JSON types.
|
||||
*/
|
||||
@DeprecatedInNewArchitecture()
|
||||
public @Nullable Map<String, Object> getConstants() {
|
||||
return null;
|
||||
}
|
||||
|
||||
+18
-9
@@ -14,11 +14,11 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.infer.annotation.ThreadConfined;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
|
||||
import com.facebook.react.common.annotations.FrameworkAPI;
|
||||
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
@@ -27,16 +27,21 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* This is the bridge-specific concrete subclass of ReactContext. ReactContext has many methods that
|
||||
* delegate to the react instance. This subclass implements those methods, by delegating to the
|
||||
* CatalystInstance. If you need to create a ReactContext within an "bridge context", please create
|
||||
* BridgeReactContext.
|
||||
*
|
||||
* @deprecated This class is deprecated in the New Architecture and will be replaced by {@link
|
||||
* com.facebook.react.runtime.BridgelessReactContext}
|
||||
*/
|
||||
@DeprecatedInNewArchitecture
|
||||
@VisibleForTesting
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public class BridgeReactContext extends ReactApplicationContext {
|
||||
static {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
@@ -119,6 +124,7 @@ public class BridgeReactContext extends ReactApplicationContext {
|
||||
if (mCatalystInstance == null) {
|
||||
raiseCatalystInstanceMissingException();
|
||||
}
|
||||
Assertions.assertNotNull(mCatalystInstance);
|
||||
return mCatalystInstance.hasNativeModule(nativeModuleInterface);
|
||||
}
|
||||
|
||||
@@ -127,6 +133,7 @@ public class BridgeReactContext extends ReactApplicationContext {
|
||||
if (mCatalystInstance == null) {
|
||||
raiseCatalystInstanceMissingException();
|
||||
}
|
||||
Assertions.assertNotNull(mCatalystInstance);
|
||||
return mCatalystInstance.getNativeModules();
|
||||
}
|
||||
|
||||
@@ -139,6 +146,7 @@ public class BridgeReactContext extends ReactApplicationContext {
|
||||
if (mCatalystInstance == null) {
|
||||
raiseCatalystInstanceMissingException();
|
||||
}
|
||||
Assertions.assertNotNull(mCatalystInstance);
|
||||
return mCatalystInstance.getNativeModule(nativeModuleInterface);
|
||||
}
|
||||
|
||||
@@ -147,6 +155,7 @@ public class BridgeReactContext extends ReactApplicationContext {
|
||||
if (mCatalystInstance == null) {
|
||||
raiseCatalystInstanceMissingException();
|
||||
}
|
||||
Assertions.assertNotNull(mCatalystInstance);
|
||||
return mCatalystInstance.getNativeModule(moduleName);
|
||||
}
|
||||
|
||||
@@ -210,8 +219,7 @@ public class BridgeReactContext extends ReactApplicationContext {
|
||||
@Override
|
||||
public void handleException(Exception e) {
|
||||
boolean catalystInstanceVariableExists = mCatalystInstance != null;
|
||||
boolean isCatalystInstanceAlive =
|
||||
catalystInstanceVariableExists && !mCatalystInstance.isDestroyed();
|
||||
boolean isCatalystInstanceAlive = mCatalystInstance != null && !mCatalystInstance.isDestroyed();
|
||||
boolean hasExceptionHandler = getJSExceptionHandler() != null;
|
||||
|
||||
if (isCatalystInstanceAlive && hasExceptionHandler) {
|
||||
@@ -268,18 +276,19 @@ public class BridgeReactContext extends ReactApplicationContext {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DeprecatedInNewArchitecture(
|
||||
message =
|
||||
"This method will be deprecated later as part of Stable APIs with bridge removal and not"
|
||||
+ " encouraged usage.")
|
||||
/**
|
||||
* Get the UIManager for Fabric from the CatalystInstance.
|
||||
*
|
||||
* @return The UIManager when CatalystInstance is active.
|
||||
* @deprecated Do not use this method. Instead use {@link
|
||||
* com.facebook.react.uimanager.UIManagerHelper} method {@code getUIManager} to get the
|
||||
* UIManager instance from the current ReactContext.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public @Nullable UIManager getFabricUIManager() {
|
||||
return mCatalystInstance.getFabricUIManager();
|
||||
//noinspection deprecation
|
||||
return Objects.requireNonNull(mCatalystInstance).getFabricUIManager();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
@@ -32,6 +32,8 @@ protected constructor(
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
"The method canOverrideExistingModule is not used in the New Architecture and will be removed in a future release.")
|
||||
override fun canOverrideExistingModule(): Boolean = false
|
||||
|
||||
override fun invalidate() {
|
||||
|
||||
+1
@@ -53,6 +53,7 @@ public class ModuleHolder {
|
||||
|
||||
public constructor(nativeModule: NativeModule) {
|
||||
name = nativeModule.name
|
||||
@Suppress("DEPRECATION")
|
||||
reactModuleInfo =
|
||||
ReactModuleInfo(
|
||||
nativeModule.name,
|
||||
|
||||
+4
-2
@@ -9,7 +9,6 @@ package com.facebook.react.bridge;
|
||||
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
|
||||
import com.facebook.react.common.annotations.StableReactNativeAPI;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -50,8 +49,11 @@ public interface NativeModule {
|
||||
* of a different package (such as the core one). Trying to override without returning true from
|
||||
* this method is considered an error and will throw an exception during initialization. By
|
||||
* default all modules return false.
|
||||
*
|
||||
* @deprecated The method canOverrideExistingModule is not used in the New Architecture and will
|
||||
* be removed in a future release.
|
||||
*/
|
||||
@DeprecatedInNewArchitecture()
|
||||
@Deprecated
|
||||
default boolean canOverrideExistingModule() {
|
||||
return false;
|
||||
}
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.common.annotations
|
||||
|
||||
/**
|
||||
* Annotates a method or class that will be deprecated once the NewArchitecture is fully released in
|
||||
* OSS.
|
||||
*/
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
|
||||
internal annotation class DeprecatedInNewArchitecture(val message: String = "")
|
||||
+2
@@ -5,6 +5,8 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.defaults
|
||||
|
||||
import android.content.Context
|
||||
|
||||
+2
@@ -5,6 +5,8 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.defaults
|
||||
|
||||
import android.app.Application
|
||||
|
||||
+7
-1
@@ -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<<a4a7c66f4603fc6a56018aba12c942ee>>
|
||||
* @generated SignedSource<<3e4d74a17c15742d35db9e4247f3e1c1>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -312,6 +312,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun preparedTextCacheSize(): Double = accessor.preparedTextCacheSize()
|
||||
|
||||
/**
|
||||
* Enables a new mechanism in ShadowTree to prevent problems caused by multiple threads trying to commit concurrently. If a thread tries to commit a few times unsuccessfully, it will acquire a lock and try again.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun preventShadowTreeCommitExhaustion(): Boolean = accessor.preventShadowTreeCommitExhaustion()
|
||||
|
||||
/**
|
||||
* Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.
|
||||
*/
|
||||
|
||||
+11
-1
@@ -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<<9b6d83d6ea0acbc13bce19d869699079>>
|
||||
* @generated SignedSource<<e7c1c6d184681d98320aac2a23c06288>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -67,6 +67,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
|
||||
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
|
||||
private var preparedTextCacheSizeCache: Double? = null
|
||||
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
|
||||
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
@@ -502,6 +503,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun preventShadowTreeCommitExhaustion(): Boolean {
|
||||
var cached = preventShadowTreeCommitExhaustionCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.preventShadowTreeCommitExhaustion()
|
||||
preventShadowTreeCommitExhaustionCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
|
||||
var cached = traceTurboModulePromiseRejectionsOnAndroidCache
|
||||
if (cached == null) {
|
||||
|
||||
+3
-1
@@ -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<<75760457dea789ab0951d3a22be3341c>>
|
||||
* @generated SignedSource<<ba62d616188ed439c85c66cfd055810d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -122,6 +122,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun preparedTextCacheSize(): Double
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun preventShadowTreeCommitExhaustion(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean
|
||||
|
||||
+3
-1
@@ -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<<48fa8921cc2947a713974c9926e1d806>>
|
||||
* @generated SignedSource<<12c2727291b635ef7c3163d153669c2c>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -117,6 +117,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun preparedTextCacheSize(): Double = 200.0
|
||||
|
||||
override fun preventShadowTreeCommitExhaustion(): Boolean = false
|
||||
|
||||
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false
|
||||
|
||||
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = false
|
||||
|
||||
+12
-1
@@ -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<<356261385b837def94ac5a4ca7ffd05d>>
|
||||
* @generated SignedSource<<3ea9946ef21c8ac8bb9bb63712636e89>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -71,6 +71,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
|
||||
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
|
||||
private var preparedTextCacheSizeCache: Double? = null
|
||||
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
|
||||
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
@@ -553,6 +554,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun preventShadowTreeCommitExhaustion(): Boolean {
|
||||
var cached = preventShadowTreeCommitExhaustionCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.preventShadowTreeCommitExhaustion()
|
||||
accessedFeatureFlags.add("preventShadowTreeCommitExhaustion")
|
||||
preventShadowTreeCommitExhaustionCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
|
||||
var cached = traceTurboModulePromiseRejectionsOnAndroidCache
|
||||
if (cached == null) {
|
||||
|
||||
+2
-2
@@ -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<<c8b19934d19d6b4514a0395edecb1330>>
|
||||
* @generated SignedSource<<58da46268043f086730132430735b720>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -23,5 +23,5 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android :
|
||||
// We could use JNI to get the defaults from C++,
|
||||
// but that is more expensive than just duplicating the defaults here.
|
||||
|
||||
|
||||
override fun preventShadowTreeCommitExhaustion(): Boolean = true
|
||||
}
|
||||
|
||||
+3
-1
@@ -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<<8abf9bfb81265ae0c840457eb6c199bd>>
|
||||
* @generated SignedSource<<1e81de36735c6c9286b228c75c9a0228>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -117,6 +117,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun preparedTextCacheSize(): Double
|
||||
|
||||
@DoNotStrip public fun preventShadowTreeCommitExhaustion(): Boolean
|
||||
|
||||
@DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class BlobProvider : ContentProvider() {
|
||||
var blobModule: BlobModule? = null
|
||||
val context = context?.applicationContext
|
||||
if (context is ReactApplication) {
|
||||
val host = (context as ReactApplication).reactNativeHost
|
||||
@Suppress("DEPRECATION") val host = (context as ReactApplication).reactNativeHost
|
||||
val reactContext =
|
||||
host.reactInstanceManager.currentReactContext
|
||||
?: throw RuntimeException("No ReactContext associated with BlobProvider")
|
||||
|
||||
+3
-3
@@ -12,9 +12,9 @@ package com.facebook.react.modules.systeminfo
|
||||
public object ReactNativeVersion {
|
||||
@JvmField
|
||||
public val VERSION: Map<String, Any?> = mapOf(
|
||||
"major" to 1000,
|
||||
"minor" to 0,
|
||||
"major" to 0,
|
||||
"minor" to 81,
|
||||
"patch" to 0,
|
||||
"prerelease" to null
|
||||
"prerelease" to "rc.4"
|
||||
)
|
||||
}
|
||||
|
||||
+2
-1
@@ -514,7 +514,8 @@ public class ReactHostImpl(
|
||||
internal fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean =
|
||||
reactInstance?.hasNativeModule<T>(nativeModuleInterface) ?: false
|
||||
|
||||
internal val nativeModules: Collection<NativeModule> = reactInstance?.nativeModules ?: listOf()
|
||||
internal val nativeModules: Collection<NativeModule>
|
||||
get() = reactInstance?.nativeModules ?: listOf()
|
||||
|
||||
internal fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T? {
|
||||
if (!ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE &&
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ package com.facebook.react.uimanager
|
||||
import android.view.View
|
||||
import com.facebook.common.logging.FLog
|
||||
import com.facebook.react.bridge.ReadableArray
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
||||
import com.facebook.react.uimanager.ViewManagersPropertyCache.PropSetter
|
||||
import java.util.HashMap
|
||||
|
||||
@@ -70,8 +69,8 @@ public object ViewManagerPropertyUpdater {
|
||||
}
|
||||
}
|
||||
|
||||
@DeprecatedInNewArchitecture
|
||||
@JvmStatic
|
||||
@Deprecated("Use ViewManager#updateProperties to update a view's properties")
|
||||
public fun <T : ReactShadowNode<T>> updateProps(node: T, props: ReactStylesDiffMap) {
|
||||
val setter = findNodeSetter(node.javaClass)
|
||||
val iterator = props.backingMap.entryIterator
|
||||
|
||||
-2
@@ -8,12 +8,10 @@
|
||||
package com.facebook.react.uimanager.common
|
||||
|
||||
import androidx.annotation.IntDef
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Suppress("DEPRECATION")
|
||||
@IntDef(UIManagerType.DEFAULT, UIManagerType.LEGACY, UIManagerType.FABRIC)
|
||||
@DeprecatedInNewArchitecture
|
||||
public annotation class UIManagerType {
|
||||
public companion object {
|
||||
@Deprecated(
|
||||
|
||||
+15
-1
@@ -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<<5effd7d4ac8034424144ea68c82b61a7>>
|
||||
* @generated SignedSource<<cf7b6ff66c614ca2acc6667a80c5590d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -321,6 +321,12 @@ class ReactNativeFeatureFlagsJavaProvider
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool preventShadowTreeCommitExhaustion() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("preventShadowTreeCommitExhaustion");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool traceTurboModulePromiseRejectionsOnAndroid() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("traceTurboModulePromiseRejectionsOnAndroid");
|
||||
@@ -626,6 +632,11 @@ double JReactNativeFeatureFlagsCxxInterop::preparedTextCacheSize(
|
||||
return ReactNativeFeatureFlags::preparedTextCacheSize();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid();
|
||||
@@ -853,6 +864,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"preparedTextCacheSize",
|
||||
JReactNativeFeatureFlagsCxxInterop::preparedTextCacheSize),
|
||||
makeNativeMethod(
|
||||
"preventShadowTreeCommitExhaustion",
|
||||
JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion),
|
||||
makeNativeMethod(
|
||||
"traceTurboModulePromiseRejectionsOnAndroid",
|
||||
JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user