diff --git a/.ado/android-pr.yml b/.ado/android-pr.yml deleted file mode 100644 index d2944341aeca87..00000000000000 --- a/.ado/android-pr.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This file defines the Android PR build steps used during the CI loop -name: $(Date:yyyyMMdd).$(Rev:.r) - -trigger: none # will disable CI builds entirely - -pr: - branches: - include: - - main - - '*-stable' - paths: - exclude: - - '*.md' - -variables: - - template: variables/vars.yml - -jobs: - - job: AndroidRNPR - displayName: Android React Native PR - pool: cxe-ubuntu-20-04-large - timeoutInMinutes: 90 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - steps: - - checkout: self # self represents the repo where the initial Pipelines YAML file was found - clean: true # whether to fetch clean each time - # fetchDepth: 2 # the depth of commits to ask Git to fetch - lfs: false # whether to download Git-LFS files - submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules - persistCredentials: false # set to 'true' to leave the OAuth token in the Git config after the initial fetch - - - template: templates/android-build-office-setup.yml - - - template: templates/android-build-office.yml - - - template: templates/download-android-dependencies.yml - parameters: - artifact_feed: react-native/react-native-public - - - template: templates/android-nuget-pack.yml - - - task: CmdLine@2 - displayName: 'Npm pack' - inputs: - script: node .ado/npmOfficePack.js --fake - env: - BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory) - BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory) - BUILD_SOURCEBRANCH: $(Build.SourceBranch) - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - githubApiToken: $(githubAuthToken) - -# In RN64 "clean" task tries to run the build again. It is reproing in 0.64-stable branch but fixed in 0.65-stable. -# I can't zero on the exact cause .. but turns out the issue is with rntester clean task. -# -# mganandraj@RNDroid:~/github/rnm-64$ ./gradlew :packages:rn-tester:android:app:clean --dry-run -# :packages:react-native-codegen:android:buildCodegenCLI SKIPPED -# :packages:rn-tester:android:app:generateCodegenSchemaFromJavaScript SKIPPED -# :packages:rn-tester:android:app:generateCodegenArtifactsFromSchema SKIPPED -# :ReactAndroid:extractAARHeaders SKIPPED -# :ReactAndroid:extractJNIFiles SKIPPED -# :ReactAndroid:generateCodegenSchemaFromJavaScript SKIPPED -# :ReactAndroid:generateCodegenArtifactsFromSchema SKIPPED -# :ReactAndroid:prepareBoost SKIPPED -# :ReactAndroid:createNativeDepsDirectories SKIPPED -# .. -# - task: CmdLine@2 -# displayName: gradlew clean -# inputs: -# script: ./gradlew clean - - - task: PublishBuildArtifacts@1 - displayName: 'Publish final artifacts' - inputs: - PathtoPublish: '$(Build.StagingDirectory)/final' - ArtifactName: 'ReactNative-Final' diff --git a/.ado/android_symlink_ndk.bat b/.ado/android_symlink_ndk.bat deleted file mode 100644 index 157a6ffa8fc294..00000000000000 --- a/.ado/android_symlink_ndk.bat +++ /dev/null @@ -1,28 +0,0 @@ -REM @if "%DEBUG%" == "" @echo off - -REM Android tools doesn't support SDK/NDK paths containing space in it. -REM This scrip creates a symlink to Android NDK to work around the limitation. -REM We use the - -set ANDROID_NDK_SYMLINK_PATH=c:\android_ndk_symlink__ - -REM 1. Try ANDROID_NDK environment variable -set ANDROID_NDK_PATH=%ANDROID_NDK% - -REM 2. May be SDK has ndk-bundle in it. -IF "%ANDROID_NDK_PATH%"=="" set ANDROID_NDK_PATH=%ANDROID_home%\ndk-bundle - -echo %ANDROID_NDK_PATH% - -if exist %ANDROID_NDK_PATH% ( - mklink /J %ANDROID_NDK_SYMLINK_PATH% "%ANDROID_NDK_PATH%" - goto :success -) else ( - goto :error -) - -:success -exit /b 0 - -:error -exit /b 1 \ No newline at end of file diff --git a/.ado/apple-pr.yml b/.ado/apple-pr.yml index 54d14b189f7f2d..490e88b6fab74c 100644 --- a/.ado/apple-pr.yml +++ b/.ado/apple-pr.yml @@ -18,19 +18,12 @@ pr: jobs: - job: JavaScriptRNPR displayName: JavaScript React Native PR - strategy: - matrix: - office: - apply_office_patches: 'true' - public: - apply_office_patches: 'false' pool: vmImage: $(VmImageApple) demands: ['xcode', 'sh', 'npm'] steps: - template: templates/apple-job-javascript.yml parameters: - apply_office_patches: $(apply_office_patches) slice_name: $(slice_name) xcode_version: $(xcode_version) @@ -42,10 +35,9 @@ jobs: packager_platform: 'ios' xcode_sdk: iphonesimulator xcode_scheme: 'RNTester' - xcode_destination: 'platform=iOS Simulator,OS=latest,name=iPhone 12' + xcode_destination: 'platform=iOS Simulator,OS=latest,name=iPhone 14' xcode_actions_debug: 'build test' xcode_actions_release: 'build' - apply_office_patches: 'false' macos: packager_platform: 'macos' xcode_sdk: macosx @@ -53,23 +45,6 @@ jobs: xcode_destination: 'platform=macOS,arch=x86_64' xcode_actions_debug: 'build test' xcode_actions_release: 'build' - apply_office_patches: 'false' - ios-office: - packager_platform: 'ios' - xcode_sdk: iphonesimulator - xcode_scheme: 'RNTester' - xcode_destination: 'platform=iOS Simulator,OS=latest,name=iPhone 12' - xcode_actions_debug: 'build test' - xcode_actions_release: 'build' - apply_office_patches: 'true' - macos-office: - packager_platform: 'macos' - xcode_sdk: macosx - xcode_scheme: 'RNTester-macOS' - xcode_destination: 'platform=macOS,arch=x86_64' - xcode_actions_debug: 'build test' - xcode_actions_release: 'build' - apply_office_patches: 'true' pool: vmImage: $(VmImageApple) demands: ['xcode', 'sh', 'npm'] @@ -85,7 +60,6 @@ jobs: xcode_actions_debug: $(xcode_actions_debug) xcode_actions_release: $(xcode_actions_release) xcode_destination: $(xcode_destination) - apply_office_patches: $(apply_office_patches) slice_name: $(slice_name) xcode_version: $(xcode_version) diff --git a/.ado/bumpOfficeFileVersions.js b/.ado/bumpOfficeFileVersions.js deleted file mode 100644 index 27dff30cad46be..00000000000000 --- a/.ado/bumpOfficeFileVersions.js +++ /dev/null @@ -1,3 +0,0 @@ -// @ts-check -const {updateVersionsInFiles} = require('./versionUtils'); -updateVersionsInFiles('microsoft'); \ No newline at end of file diff --git a/.ado/downloadAndroidDependencies.py b/.ado/downloadAndroidDependencies.py deleted file mode 100644 index 5180763fa55713..00000000000000 --- a/.ado/downloadAndroidDependencies.py +++ /dev/null @@ -1,121 +0,0 @@ -import json -import logging -import maven_dependency_utils -import os -import re -import shutil -import subprocess -import sys -import time - - -desired_sdk = os.getenv("ANDROID_SDK_ROOT") -if not desired_sdk: - logging.error("Environment variable ANDROID_SDK_ROOT must be set.") - exit(-1) - -if os.getenv("ANDROID_NDK"): - desired_ndk = os.getenv("ANDROID_NDK") -elif os.path.exists(os.path.join(desired_sdk, "ndk-bundle")): - desired_ndk = os.path.join(desired_sdk, "ndk-bundle") -elif os.path.exists(os.path.join(desired_sdk, "ndk")): - desired_ndk = os.path.join(desired_sdk, "ndk") -else: - logging.error("Environment variable ANDROID_NDK must be set.") - exit(-1) - -desired_jdk = os.getenv("JAVA_HOME") -if not desired_jdk: - logging.error("Environment variable JAVA_HOME must be set.") - exit(-1) - -def ensure_output_dir(output_dir_path): - # Move out if already exists. - if os.path.exists(output_dir_path): - logging.debug(output_dir_path + " exists ! Trying to move it.") - output_dir_path_copy = output_dir_path + '-' + time.strftime("%Y%m%d-%H%M%S") - shutil.move(output_dir_path, output_dir_path_copy ) - - # If it still exists, fail the execution. - if os.path.exists(output_dir_path): - logging.error("Unable to cleanup existing dependency directory: " + output_dir_path) - logging.error("Move it away manually and rerun the script.") - -## Returns a list of strings, where the strings correspond to standard maven artifacts, i.e. groupId:artifactId:version -def get_dependencies(react_native_dir): - result = subprocess.run('./gradlew :ReactAndroid:dependencies --configuration api', stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=react_native_dir, shell=True) - if (result.returncode == 0): - return re.findall(r'^\S---\s+(\S*)', result.stdout.decode('utf-8'), re.MULTILINE) - else: - logging.error('Failed to get dependencies. Printing gradle output: ') - logging.error(result.stderr.decode('utf-8')) - exit(-1) - -def main(): - if len(sys.argv) == 2: - react_native_dir = sys.argv[1] - else: - react_native_dir = os.getcwd() - - # Some smoke checks to ensure that we have a valid react-native checkout. - packageJsonFile = os.path.join(react_native_dir, "package.json") - with open(packageJsonFile) as packageJsonText: - packageJson = json.load(packageJsonText) - if(packageJson[u'name'] != u'react-native' and packageJson[u'name'] != u'react-native-macos'): - logging.info("Not a valid RN repo path!") - exit(-1) - - if (not os.path.join(react_native_dir, "ReactAndroid", "build.gradle")): - logging.info("Not a valid RN repo path!") - exit(-1) - - dependency_dir_root = os.path.join(react_native_dir, "android", "dependencies") - dependency_dir_maven = os.path.join(dependency_dir_root, "cross", "cross", "x-none", "maven") - dependency_dir_native = dependency_dir_root - dependency_dir_hermes = os.path.join(dependency_dir_root, "hermes") - log_file_path = os.path.join(react_native_dir, "android", "log_" + time.strftime("%Y%m%d-%H%M%S") + ".txt" ) - - if(not os.path.exists(os.path.join(react_native_dir, "android"))): - os.mkdir(os.path.join(react_native_dir, "android")) - - logging.basicConfig(level = logging.DEBUG, filename = log_file_path) - logging.info("react_native_dir: " + react_native_dir) - logging.info("Maven dependency path: " + dependency_dir_maven) - logging.info("Native dependency path: " + dependency_dir_native) - - # Ensure we have an output directory - ensure_output_dir(dependency_dir_root) - - # Download a transitive dependency closure of the ReactAndroid project - dependencies = get_dependencies(react_native_dir); - maven_dependency_utils.download_transitive_closure(artifacts=dependencies, output_directory_path=dependency_dir_maven, gradle_path='gradlew', ignore_metadata_redirection=True, resolve_to_single_version=False) - - # Extract the native libraries from maven packages - office_abi_mappings = {'arm64-v8a':'droidarm64', 'armeabi-v7a':'droidarm', 'x86':'droidx86','x86_64':'droidx64'} - maven_dependency_utils.extract_native_modules(dependency_dir_maven, dependency_dir_native, office_abi_mappings) - - # Copy and extract hermes. - dependency_dir_hermes_android_aar_path = os.path.join(dependency_dir_hermes, "android") - hermes_engine_node_modules_path = os.path.join(react_native_dir, "node_modules", "hermes-engine") - shutil.copytree(os.path.join(hermes_engine_node_modules_path, "android"), dependency_dir_hermes_android_aar_path) - shutil.copytree(os.path.join(hermes_engine_node_modules_path, "linux64-bin"), os.path.join(dependency_dir_hermes, "linux64-bin")) - shutil.copytree(os.path.join(hermes_engine_node_modules_path, "win64-bin"), os.path.join(dependency_dir_hermes, "win64-bin")) - shutil.copytree(os.path.join(hermes_engine_node_modules_path, "osx-bin"), os.path.join(dependency_dir_hermes, "osx-bin")) - shutil.copy(os.path.join(hermes_engine_node_modules_path, "package.json"), dependency_dir_hermes) - - dependency_dir_hermes_android_native_debug = os.path.join(dependency_dir_hermes_android_aar_path, "debug") - dependency_dir_hermes_android_native_release = os.path.join(dependency_dir_hermes_android_aar_path, "ship") - maven_dependency_utils.extract_native_modules_from_archive(os.path.join(dependency_dir_hermes_android_aar_path, "hermes-debug.aar"), dependency_dir_hermes_android_native_debug, office_abi_mappings) - maven_dependency_utils.extract_native_modules_from_archive(os.path.join(dependency_dir_hermes_android_aar_path, "hermes-cppruntime-debug.aar"), dependency_dir_hermes_android_native_debug, office_abi_mappings) - - maven_dependency_utils.extract_native_modules_from_archive(os.path.join(dependency_dir_hermes_android_aar_path, "hermes-release.aar"), dependency_dir_hermes_android_native_release, office_abi_mappings) - maven_dependency_utils.extract_native_modules_from_archive(os.path.join(dependency_dir_hermes_android_aar_path, "hermes-cppruntime-release.aar"), dependency_dir_hermes_android_native_release, office_abi_mappings) - - # Copy log file into the dependency root folder. - shutil.copy(log_file_path, os.path.join(dependency_dir_root)) - - with open(log_file_path, "r") as fin: - print(fin.read()) - -if __name__ == '__main__': - main() diff --git a/.ado/npmOfficePack.js b/.ado/npmOfficePack.js deleted file mode 100644 index 949f683fe0bba3..00000000000000 --- a/.ado/npmOfficePack.js +++ /dev/null @@ -1,66 +0,0 @@ -// @ts-check -// Create a tar asset for publishing to the Office feed - -const fs = require("fs"); -const path = require("path"); -const execSync = require("child_process").execSync; -const {publishBranchName, gatherVersionInfo} = require('./versionUtils'); - -function exec(command) { - try { - console.log(`Running command: ${command}`); - return execSync(command, { - stdio: "inherit" - }); - } catch (err) { - process.exitCode = 1; - console.log(`Failure running: ${command}`); - throw err; - } -} - -function doPublish(fakeMode) { - console.log(`Target branch to publish to: ${publishBranchName}`); - - const {releaseVersion, branchVersionSuffix} = gatherVersionInfo() - - const onlyTagSource = !!branchVersionSuffix; - if (!onlyTagSource) { - // -------- Generating Android Artifacts with JavaDoc - const depsEnvPrefix = "REACT_NATIVE_BOOST_PATH=" + path.join(process.env.BUILD_SOURCESDIRECTORY, "build_deps"); - const gradleCommand = path.join(process.env.BUILD_SOURCESDIRECTORY, "gradlew") + " installArchives"; - exec( depsEnvPrefix + " " + gradleCommand ); - - // undo uncommenting javadoc setting - exec("git checkout ReactAndroid/gradle.properties"); - } - - // Create tar file - exec(`npm pack`); - - const npmTarFileName = `react-native-${releaseVersion}.tgz`; - const npmTarPath = path.resolve(__dirname, '..', npmTarFileName); - const finalTarDir = path.join(process.env.BUILD_STAGINGDIRECTORY, 'final'); - const finalTarPath = path.join(finalTarDir, npmTarFileName); - - if (!fs.existsSync(finalTarDir)) { - fs.mkdirSync(finalTarDir); - } - - console.log(`Copying tar file ${npmTarPath} to: ${finalTarPath}`) - - if(fakeMode) { - if (!fs.existsSync(npmTarPath)) - throw "The final artifact to be published is missing."; - } else { - fs.copyFileSync(npmTarPath, finalTarPath); - } -} - -var args = process.argv.slice(2); - -let fakeMode = false; -if (args.length > 0 && args[0] === '--fake') - fakeMode = true; - -doPublish(fakeMode); diff --git a/.ado/publish.yml b/.ado/publish.yml index b45523f4b35023..78fa05fdd71d8a 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -179,71 +179,6 @@ jobs: artifactName: SBom-RNMacOSInitNpmJSPublish-$(System.JobAttempt) targetPath: $(System.DefaultWorkingDirectory)/_manifest - - job: RNGithubOfficePublish - displayName: React-Native GitHub Publish to Office - pool: cxeiss-ubuntu-20-04-large - timeoutInMinutes: 120 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - condition: contains(variables['Build.SourceBranchName'], '-stable') - dependsOn: - - Compliance - steps: - - checkout: self # self represents the repo where the initial Pipelines YAML file was found - clean: true # whether to fetch clean each time - # fetchDepth: 2 # the depth of commits to ask Git to fetch - lfs: false # whether to download Git-LFS files - submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules - persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch - - - template: templates/android-build-office-setup.yml - - - bash: | - echo "##vso[task.prependpath]/home/linuxbrew/.linuxbrew/bin" - echo ##vso[task.prependpath]/home/linuxbrew/.linuxbrew/sbin - displayName: Add Homebrew to PATH - - - task: CmdLine@2 - displayName: Bump package version - inputs: - script: node .ado/bumpOfficeFileVersions.js - - # Publish will fail if package.json is marked as private - - task: CmdLine@2 - displayName: Remove workspace config from package.json - inputs: - script: node .ado/removeWorkspaceConfig.js - - - template: templates/android-build-office.yml - - # Enumerate and download all dependencies .. - - template: templates/download-android-dependencies.yml - parameters: - artifact_feed: Office - - - template: templates/android-nuget-pack.yml - - - task: CmdLine@2 - displayName: 'Npm pack' - inputs: - script: node .ado/npmOfficePack.js - env: - BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory) - BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory) - BUILD_SOURCEBRANCH: $(Build.SourceBranch) - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - githubApiToken: $(githubAuthToken) - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 📒 Generate Manifest - inputs: - BuildDropPath: $(Build.StagingDirectory)/final - - - task: PublishBuildArtifacts@1 - displayName: 'Publish final artifacts' - inputs: - PathtoPublish: '$(Build.StagingDirectory)/final' - ArtifactName: 'ReactNative-Final' - - job: Compliance displayName: React-Native GitHub Compliance pipeline pool: OE-OfficePublic diff --git a/.ado/renamePackageForOffice.js b/.ado/renamePackageForOffice.js deleted file mode 100644 index 19138d94535263..00000000000000 --- a/.ado/renamePackageForOffice.js +++ /dev/null @@ -1,14 +0,0 @@ -// @ts-check -const fs = require("fs"); -const path = require("path"); - -const pkgJsonPath = path.resolve(__dirname, "../package.json"); - -function updatePackageName(name) { - let pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf8")); - pkgJson.name = name; - fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2)); - console.log(`Updating package.json to name ${name}`); -} - -updatePackageName('react-native'); \ No newline at end of file diff --git a/.ado/setup_droid_deps.bat b/.ado/setup_droid_deps.bat deleted file mode 100644 index f5e0acd79a53cb..00000000000000 --- a/.ado/setup_droid_deps.bat +++ /dev/null @@ -1,18 +0,0 @@ -@if "%DEBUG%" == "" @echo off - -REM Assuming the script is run from the root directory of a local clone of Microsoft fork of react-native. i.e. http:\\github.com\Microsoft\react-native - -set BUILD_DEPS_DIR=build_deps - -IF EXIST %BUILD_DEPS_DIR% ( - rmdir /s /q %BUILD_DEPS_DIR% - if errorlevel 1 echo "Cleaning up the build dependency directory failed !" 1>&2 -) - -mkdir %BUILD_DEPS_DIR% - -mkdir %BUILD_DEPS_DIR%\boost_1_68_0 -mklink /D /J %BUILD_DEPS_DIR%\boost_1_68_0\boost ReactAndroid\packages\boost.1.68.0.0\lib\native\include\boost - -REM When setting up locally, set the environement variable as follows. -REM set REACT_NATIVE_BOOST_PATH=%CD%\%BUILD_DEPS_DIR% \ No newline at end of file diff --git a/.ado/setup_droid_deps.sh b/.ado/setup_droid_deps.sh deleted file mode 100755 index 0b4775ccabe246..00000000000000 --- a/.ado/setup_droid_deps.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -BUILD_DEPS_DIR=build_deps - -rm -rf $BUILD_DEPS_DIR -mkdir $BUILD_DEPS_DIR - -mkdir $BUILD_DEPS_DIR/boost_1_68_0 -ln -s "$PWD/ReactAndroid/packages/boost.1.68.0.0/lib/native/include/boost" "$BUILD_DEPS_DIR/boost_1_68_0/boost" -# export REACT_NATIVE_BOOST_PATH=$BUILD_DEPS_DIR \ No newline at end of file diff --git a/.ado/templates/android-build-office-setup.yml b/.ado/templates/android-build-office-setup.yml deleted file mode 100644 index 0480fc1aa7b0a1..00000000000000 --- a/.ado/templates/android-build-office-setup.yml +++ /dev/null @@ -1,62 +0,0 @@ -steps: - - task: UseNode@1 - inputs: - version: '16.x' - - - template: apple-droid-node-patching.yml - parameters: - apply_office_patches: true - - # Install NuGet - - task: CmdLine@2 - displayName: Install NuGet - inputs: - script: curl -o $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe --create-dirs https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - - - task: CmdLine@2 - displayName: "Rename package to react-native" - inputs: - script: node .ado/renamePackageForOffice.js - - - task: CmdLine@2 - displayName: yarn install - inputs: - script: yarn install --frozen-lockfile - - # scripts/set-rn-version.js - # - # update the following files to the commit id. - # package.json (-> npm package version) - # gradle.properties (-> aar version) - # gradle.properties (-> aar version) - # - # The following files are updated for runtime version checking. - # ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java - # React/Base/RCTVersion.m - # ReactCommon/cxxreact/ReactNativeVersion.h - # Libraries/Core/ReactNativeVersion.js - # - # --nightly --autogenerateVersionNumber => version = `0.0.0-${currentCommit.slice(0, 9)}`; - # When on main branch or non-stable branch. - - task: CmdLine@2 - displayName: Set canary package version - inputs: - script: node scripts/set-rn-version.js --nightly --autogenerateVersionNumber --skipUpdateRuby # TODO(macOS GH#1148): Remove --skipUpdateRuby flag once we clean up version update scripts - condition: or(eq(variables['Build.SourceBranchName'], 'main'), not(contains(variables['Build.SourceBranchName'], '-stable'))) - - # TODO: We don't seem to be running set-rn-version.js for stable branches, hence we would end up publishing using the values in the repository. - - - task: CmdLine@2 - displayName: nuget restore - inputs: - script: mono $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe restore $(System.DefaultWorkingDirectory)/ReactAndroid/packages.config -PackagesDirectory $(System.DefaultWorkingDirectory)/ReactAndroid/packages/ -Verbosity Detailed -NonInteractive - - - task: CmdLine@2 - displayName: Setup Build Dependencies - inputs: - script: chmod +x .ado/setup_droid_deps.sh && .ado/setup_droid_deps.sh - - - task: CmdLine@2 - displayName: Remove RNTesterApp.android.bundle - inputs: - script: rm -f ./packages/rn-tester/js/RNTesterApp.android.bundle diff --git a/.ado/templates/android-build-office.yml b/.ado/templates/android-build-office.yml deleted file mode 100644 index 18bda219075a23..00000000000000 --- a/.ado/templates/android-build-office.yml +++ /dev/null @@ -1,35 +0,0 @@ -steps: - - task: CmdLine@2 - displayName: Create RNTester bundle - inputs: - script: node cli.js bundle --entry-file ./packages/rn-tester/js/RNTesterApp.android.js --bundle-output ./packages/rn-tester/js/RNTesterApp.android.bundle --platform android - - - task: CmdLine@2 - displayName: gradlew installArchives - inputs: - script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs" - - # We have separate tasks to build rn-tester for debug and release due to a regression upstream. See https://github.com/facebook/react-native/issues/34168. - - task: CmdLine@2 - displayName: Build rn-tester debug - inputs: - script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew :packages:rn-tester:android:app:assembleDebug - - - task: CmdLine@2 - displayName: Build rn-tester release - inputs: - script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew :packages:rn-tester:android:app:assembleRelease - - - task: CopyFiles@2 - displayName: 'Copy rn-tester apks to build artifacts' - inputs: - SourceFolder: '$(System.DefaultWorkingDirectory)/packages/rn-tester/android/app/build/outputs/apk' - Contents: '**' - TargetFolder: '$(Build.StagingDirectory)/final/rn-tester' - - - task: CopyFiles@2 - displayName: 'Copy rn-tester android bundle to build artifacts' - inputs: - SourceFolder: '$(System.DefaultWorkingDirectory)/packages/rn-tester/js' - Contents: 'RNTesterApp.android.bundle' - TargetFolder: '$(Build.StagingDirectory)/final/rn-tester' \ No newline at end of file diff --git a/.ado/templates/android-nuget-pack.yml b/.ado/templates/android-nuget-pack.yml deleted file mode 100644 index c739f1b986fc8a..00000000000000 --- a/.ado/templates/android-nuget-pack.yml +++ /dev/null @@ -1,15 +0,0 @@ -steps: - - task: PowerShell@2 - displayName: Extract version from package.json, and put it in `buildNumber` variable - inputs: - targetType: inline # filePath | inline - script: | - $lines = Get-Content package.json | Where {$_ -match '^\s*"version":.*'} - $npmVersion = $lines.Trim().Split()[1].Trim('",'); - echo "##vso[task.setvariable variable=buildNumber]$npmVersion" - - # Very similar to the default pack task .. but appends 'ndk21b' to the nuget pack version - - task: CmdLine@2 - displayName: 'NuGet pack' - inputs: - script: NDK=ndk`$(System.DefaultWorkingDirectory)/gradlew -q ReactAndroid:properties | grep ndkVersion | awk '{print $2}' | awk -F. '{print $1}'`; mono $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe pack $(System.DefaultWorkingDirectory)/ReactAndroid/ReactAndroid.nuspec -OutputDirectory $(Build.StagingDirectory)/final -Properties buildNumber=$(buildNumber)-$NDK\;commitId=$(Build.SourceVersion) \ No newline at end of file diff --git a/.ado/templates/apple-droid-node-patching.yml b/.ado/templates/apple-droid-node-patching.yml deleted file mode 100644 index f0219d1e4c8c46..00000000000000 --- a/.ado/templates/apple-droid-node-patching.yml +++ /dev/null @@ -1,8 +0,0 @@ -parameters: - apply_office_patches: '' - -steps: - - task: CmdLine@2 - displayName: Apply Android specific patches for Office consumption - inputs: - script: npm_config_yes=true npx @rnx-kit/patcher-rnmacos patch $(System.DefaultWorkingDirectory) Build OfficeRNHost V8 Focus MAC JniUtils RootViewAttach --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }} diff --git a/.ado/templates/apple-job-javascript.yml b/.ado/templates/apple-job-javascript.yml index ab60d3c523015c..9a741d6349a59b 100644 --- a/.ado/templates/apple-job-javascript.yml +++ b/.ado/templates/apple-job-javascript.yml @@ -1,5 +1,4 @@ parameters: - apply_office_patches: '' slice_name: '' xcode_version: '' diff --git a/.ado/templates/apple-job-react-native.yml b/.ado/templates/apple-job-react-native.yml index 84a2812165aa55..d29079b427ab2c 100644 --- a/.ado/templates/apple-job-react-native.yml +++ b/.ado/templates/apple-job-react-native.yml @@ -6,7 +6,6 @@ parameters: xcode_actions_debug: '' xcode_actions_release: '' xcode_destination: '' - apply_office_patches: '' slice_name: '' xcode_version: '' diff --git a/.ado/templates/download-android-dependencies.yml b/.ado/templates/download-android-dependencies.yml deleted file mode 100644 index 895970585bcd64..00000000000000 --- a/.ado/templates/download-android-dependencies.yml +++ /dev/null @@ -1,14 +0,0 @@ -parameters: - artifact_feed: '' - -steps: - - task: PipAuthenticate@1 - displayName: 'Pip Authenticate to react-native-public' - inputs: - artifactFeeds: '${{ parameters.artifact_feed }}' - - # Verify depenendencies can be enumerated and downloaded .. - - task: CmdLine@2 - displayName: 'Verify Dependencies can be enumerated' - inputs: - script: pip3 install maven-dependency-utils==1.24.0 && python3 .ado/downloadAndroidDependencies.py $(Build.SourcesDirectory) && tree $(Build.SourcesDirectory)/android diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 81da3a377fb1f9..84732381c5654e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,8 +3,3 @@ # the global will be requested for # review when someone opens a pull request. * @microsoft/apple-rn-team - -# React Android specific ones -/ReactAndroid/ @microsoft/rnandroid -/android-patches/ @microsoft/rnandroid -/.ado/**/*droid* @microsoft/rnandroid diff --git a/Libraries/Components/View/ViewAccessibility.js b/Libraries/Components/View/ViewAccessibility.js index 95f857a8ad8b07..08f8082fcb58c7 100644 --- a/Libraries/Components/View/ViewAccessibility.js +++ b/Libraries/Components/View/ViewAccessibility.js @@ -12,11 +12,6 @@ import type {SyntheticEvent} from '../../Types/CoreEventTypes'; -// [TODO(android ISS) -export type AccessibilityNodeInfoProp = { - clickable: boolean, -}; // ]TODO(android ISS) - // This must be kept in sync with the AccessibilityRolesMask in RCTViewManager.m export type AccessibilityRole = | 'none' diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index eafca80b051ed0..177a9615dbc57f 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -29,7 +29,6 @@ import type { AccessibilityValue, AccessibilityActionEvent, AccessibilityActionInfo, - AccessibilityNodeInfoProp, // TODO(android ISS) } from './ViewAccessibility'; // [TODO(macOS GH#774) @@ -288,23 +287,6 @@ type AndroidViewProps = $ReadOnly<{| */ needsOffscreenAlphaCompositing?: ?boolean, - /** - * When `true`, indicates that the view is clickable. By default, - * all the touchable elements are clickable. - * - * @platform android - */ - focusable?: ?boolean, // TODO(android ISS) - - /** - * When `clickable` is true, the system will try to invoke this function - * when the user performs a click. - * - * @platform android - */ - - onClick?: ?(event: PressEvent) => mixed, // TODO(android ISS) - /** * Indicates to accessibility services whether the user should be notified * when this view changes. Works for Android API >= 19 only. @@ -315,13 +297,6 @@ type AndroidViewProps = $ReadOnly<{| */ accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'), - /** - * fired when the view focus changes (gain->lose or lose->gain) - * - * @platform android - */ - onFocusChange?: ?(event: SyntheticEvent<{}>) => mixed, // TODO(android ISS) - /** * Controls how view is important for accessibility which is if it * fires accessibility events and if it is reported to accessibility services @@ -333,8 +308,6 @@ type AndroidViewProps = $ReadOnly<{| */ importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'), - accessibilityNodeInfo?: AccessibilityNodeInfoProp, // TODO(android ISS) - /** * Whether to force the Android TV focus engine to move focus to this view. * diff --git a/android-patches/README.md b/android-patches/README.md deleted file mode 100644 index 9b246b9632fd6e..00000000000000 --- a/android-patches/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Android Patches for react-native internal deployment - -This folder contains the patches applied during CI flow to this codebase, when generating the Office "flavour" of `react-native`. - -This is how it happens: - -* `.ado/publish.yml` has a job called `RNGithubOfficePublish` -* That uses as template `templates/android-build-office.yml` -* That when used invokes `.ado/templates/apple-droid-node-patching.yml` passing the parameter `apply_office_patches` as `true` -* This last file is the one that *actually* triggers the patching script - -## Patching tool - -We use the tool [`patcher-rnmacos`](https://github.com/microsoft/rnx-kit/tree/main/incubator/patcher-rnmacos) that is hosted in the `rnx-kit` repo, via `npx`. Please refer to the README of the package for details on how it works. diff --git a/android-patches/patches/Build/ReactAndroid/Android-prebuilt.mk b/android-patches/patches/Build/ReactAndroid/Android-prebuilt.mk deleted file mode 100644 index 8fce977bb69683..00000000000000 --- a/android-patches/patches/Build/ReactAndroid/Android-prebuilt.mk +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/ReactAndroid/Android-prebuilt.mk b/ReactAndroid/Android-prebuilt.mk -index 18f8c26620..1e5afe5751 100644 ---- a/ReactAndroid/Android-prebuilt.mk -+++ b/ReactAndroid/Android-prebuilt.mk -@@ -34,7 +34,7 @@ include $(CLEAR_VARS) - LOCAL_MODULE := folly_json - LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libfolly_json.so - LOCAL_EXPORT_C_INCLUDES := \ -- $(THIRD_PARTY_NDK_DIR)/boost/boost_1_63_0 \ -+ $(THIRD_PARTY_NDK_DIR)/boost/boost_1_68_0 \ - $(THIRD_PARTY_NDK_DIR)/double-conversion \ - $(THIRD_PARTY_NDK_DIR)/folly - # Note: Sync with folly/Android.mk. diff --git a/android-patches/patches/Build/ReactAndroid/NuGet.Config b/android-patches/patches/Build/ReactAndroid/NuGet.Config deleted file mode 100644 index fa1a425d26aacd..00000000000000 --- a/android-patches/patches/Build/ReactAndroid/NuGet.Config +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/ReactAndroid/NuGet.Config b/ReactAndroid/NuGet.Config -new file mode 100644 -index 0000000000..5d6eee562c ---- /dev/null -+++ b/ReactAndroid/NuGet.Config -@@ -0,0 +1,13 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file diff --git a/android-patches/patches/Build/ReactAndroid/ReactAndroid.nuspec b/android-patches/patches/Build/ReactAndroid/ReactAndroid.nuspec deleted file mode 100644 index 8dbc7c5ddaf36c..00000000000000 --- a/android-patches/patches/Build/ReactAndroid/ReactAndroid.nuspec +++ /dev/null @@ -1,319 +0,0 @@ -diff --git a/ReactAndroid/ReactAndroid.nuspec b/ReactAndroid/ReactAndroid.nuspec -new file mode 100644 -index 00000000000..d468fe65341 ---- /dev/null -+++ b/ReactAndroid/ReactAndroid.nuspec -@@ -0,0 +1,312 @@ -+ -+ -+ -+ OfficeReact.Android -+ $buildNumber$ -+ Contains Android Implementation of React-Native -+ Microsoft -+ https://github.com/microsoft/react-native -+ -+ false -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file diff --git a/android-patches/patches/Build/ReactAndroid/build.gradle b/android-patches/patches/Build/ReactAndroid/build.gradle deleted file mode 100644 index 550d2615b33b15..00000000000000 --- a/android-patches/patches/Build/ReactAndroid/build.gradle +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle -index cae7d90ada9..c299dac0c5b 100644 ---- a/ReactAndroid/build.gradle -+++ b/ReactAndroid/build.gradle -@@ -41,6 +41,8 @@ def dependenciesPath = System.getenv("REACT_NATIVE_DEPENDENCIES") - // and the build will use that. - def boostPath = dependenciesPath ?: System.getenv("REACT_NATIVE_BOOST_PATH") - -+def V8Path = 'packages/ReactNative.V8Jsi.Android.0.66.0-stable-v2' -+ - // Setup build type for NDK, supported values: {debug, release} - def nativeBuildType = System.getenv("NATIVE_BUILD_TYPE") ?: "release" - -@@ -86,11 +88,22 @@ task downloadFolly(dependsOn: createNativeDepsDirectories, type: Download) { - dest(new File(downloadsDir, "folly-${FOLLY_VERSION}.tar.gz")) - } - -+def follyReplaceContent = ''' -+ ssize_t r; -+ do { -+ r = open(name, flags, mode); -+ } while (r == -1 && errno == EINTR); -+ return r; -+''' -+ - task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) { - from(dependenciesPath ?: tarTree(downloadFolly.dest)) - from("src/main/jni/third-party/folly/Android.mk") - include("folly-${FOLLY_VERSION}/folly/**/*", "Android.mk") - eachFile { fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/") } -+ // Fixes problem with Folly failing to build on certain systems. See -+ // https://github.com/facebook/react-native/issues/28298 -+ filter { line -> line.replaceAll('return int\\(wrapNoInt\\(open, name, flags, mode\\)\\);', follyReplaceContent) } - includeEmptyDirs = false - into("$thirdPartyNdkDir/folly") - } -@@ -144,6 +157,14 @@ task prepareHermes(dependsOn: createNativeDepsDirectories, type: Copy) { - into "$thirdPartyNdkDir/hermes" - } - -+task prepareV8() { -+ copy { -+ from "src/main/jni/third-party/v8jsi/" -+ include("*.mk") -+ into "$thirdPartyNdkDir/v8jsi" -+ } -+} -+ - task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) { - src("https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz") - onlyIfNewer(true) -@@ -280,12 +301,7 @@ task androidSourcesJar(type: Jar) { - - android { - compileSdkVersion 31 -- -- // Used to override the NDK path & version on internal CI -- if (System.getenv("ANDROID_NDK") != null && System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) { -- ndkPath System.getenv("ANDROID_NDK") -- ndkVersion System.getenv("LOCAL_ANDROID_NDK_VERSION") -- } -+ ndkVersion "25.0.8775105" - - defaultConfig { - minSdkVersion(21) -@@ -312,6 +328,7 @@ android { - "REACT_COMMON_DIR=$projectDir/../ReactCommon", - "REACT_GENERATED_SRC_DIR=$buildDir/generated/source", - "REACT_SRC_DIR=$projectDir/src/main/java/com/facebook/react", -+ "V8_NUGET_DIR=$projectDir/$V8Path", - "-j${ndkBuildJobs()}" - - if (Os.isFamily(Os.FAMILY_MAC)) { -@@ -331,7 +348,7 @@ android { - } - } - -- preBuild.dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent, extractNativeDependencies) -+ preBuild.dependsOn(prepareJSC, prepareHermes, prepareV8, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent, extractNativeDependencies) - preBuild.dependsOn("generateCodegenArtifactsFromSchema") - - sourceSets.main { -@@ -351,6 +368,10 @@ android { - packagingOptions { - exclude("META-INF/NOTICE") - exclude("META-INF/LICENSE") -+ -+ if (project.hasProperty('param') ? project.property('param').equals("excludeLibs") : false) { -+ exclude '**/*.so' -+ } - } - - configurations { diff --git a/android-patches/patches/Build/ReactAndroid/gradle.properties b/android-patches/patches/Build/ReactAndroid/gradle.properties deleted file mode 100644 index f2153576003c79..00000000000000 --- a/android-patches/patches/Build/ReactAndroid/gradle.properties +++ /dev/null @@ -1,11 +0,0 @@ ---- ./ReactAndroid/gradle.properties 2022-01-11 17:41:28.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/Build/ReactAndroid/gradle.properties 2022-01-12 15:04:31.000000000 -0800 -@@ -15,7 +15,7 @@ - OKHTTP_VERSION=4.9.2 - SO_LOADER_VERSION=0.10.3 - --BOOST_VERSION=1_63_0 -+BOOST_VERSION=1_68_0 - DOUBLE_CONVERSION_VERSION=1.1.6 - FOLLY_VERSION=2021.06.28.00 - FMT_VERSION=6.2.1 diff --git a/android-patches/patches/Build/ReactAndroid/packages.config b/android-patches/patches/Build/ReactAndroid/packages.config deleted file mode 100644 index f0410dd9364ee2..00000000000000 --- a/android-patches/patches/Build/ReactAndroid/packages.config +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/ReactAndroid/packages.config b/ReactAndroid/packages.config -new file mode 100644 -index 0000000000..dcaed5f4d0 ---- /dev/null -+++ b/ReactAndroid/packages.config -@@ -0,0 +1,5 @@ -+ -+ -+ -+ -+ diff --git a/android-patches/patches/Build/ReactAndroid/src/main/jni/third-party/boost/Android.mk b/android-patches/patches/Build/ReactAndroid/src/main/jni/third-party/boost/Android.mk deleted file mode 100644 index 9a0b5c9f0793ea..00000000000000 --- a/android-patches/patches/Build/ReactAndroid/src/main/jni/third-party/boost/Android.mk +++ /dev/null @@ -1,13 +0,0 @@ ---- ./ReactAndroid/src/main/jni/third-party/boost/Android.mk 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/Build/ReactAndroid/src/main/jni/third-party/boost/Android.mk 2022-01-12 15:51:16.000000000 -0800 -@@ -6,8 +6,8 @@ - # They are required for Folly futures to compile successfully. - LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/asm/$(TARGET_ARCH)/*.S) - --LOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0 --LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0 -+LOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_68_0 -+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_68_0 - - LOCAL_MODULE := boost - diff --git a/android-patches/patches/Build/ReactCommon/yoga/yoga/Yoga.cpp b/android-patches/patches/Build/ReactCommon/yoga/yoga/Yoga.cpp deleted file mode 100644 index 8eb2191619686b..00000000000000 --- a/android-patches/patches/Build/ReactCommon/yoga/yoga/Yoga.cpp +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp -index 99862797b9b..20389d4f240 100644 ---- a/ReactCommon/yoga/yoga/Yoga.cpp -+++ b/ReactCommon/yoga/yoga/Yoga.cpp -@@ -2229,7 +2229,7 @@ static float YGDistributeFreeSpaceSecondPass( - depth, - generationCount); - node->setLayoutHadOverflow( -- node->getLayout().hadOverflow() | -+ node->getLayout().hadOverflow() || - currentRelativeChild->getLayout().hadOverflow()); - } - return deltaFreeSpace; diff --git a/android-patches/patches/Build/build.gradle.kts b/android-patches/patches/Build/build.gradle.kts deleted file mode 100644 index 20645f0df0be4d..00000000000000 --- a/android-patches/patches/Build/build.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/build.gradle.kts b/build.gradle.kts -index 4725963eae0..7c71d628832 100644 ---- a/build.gradle.kts -+++ b/build.gradle.kts -@@ -5,9 +5,6 @@ - * LICENSE file in the root directory of this source tree. - */ - --val ndkPath by extra(System.getenv("ANDROID_NDK")) --val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION")) -- - buildscript { - repositories { - google() diff --git a/android-patches/patches/Focus/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js b/android-patches/patches/Focus/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js deleted file mode 100644 index db1d0d4a34ed58..00000000000000 --- a/android-patches/patches/Focus/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +++ /dev/null @@ -1,15 +0,0 @@ ---- ./Libraries/Components/View/ReactNativeViewViewConfigAndroid.js 2021-11-08 14:22:26.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/Focus/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js 2022-01-12 15:04:31.000000000 -0800 -@@ -19,6 +19,12 @@ - captured: 'onSelectCapture', - }, - }, -+ topOnFocusChange: { -+ phasedRegistrationNames: { -+ bubbled: 'onFocusChange', -+ captured: 'onFocusChangeCapture', -+ }, -+ }, - topAssetDidLoad: { - phasedRegistrationNames: { - bubbled: 'onAssetDidLoad', diff --git a/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.java b/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.java deleted file mode 100644 index 24f4ed68de6c73..00000000000000 --- a/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.java +++ /dev/null @@ -1,58 +0,0 @@ ---- ./ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.java 2021-10-25 12:38:05.000000000 -0700 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.java 2022-01-12 15:04:31.000000000 -0800 -@@ -7,7 +7,10 @@ - - package com.facebook.react.views.view; - -+import android.view.FocusFinder; - import android.view.View; -+import android.view.ViewGroup; -+import androidx.annotation.NonNull; - import com.facebook.react.bridge.UiThreadUtil; - import com.facebook.react.uimanager.ViewGroupManager; - import com.facebook.react.uimanager.annotations.ReactProp; -@@ -71,10 +74,44 @@ - } - parent.removeViewWithSubviewClippingEnabled(child); - } else { -+ // Prevent focus leaks due to removal of a focused View -+ if (parent.getChildAt(index).hasFocus()) { -+ giveFocusToAppropriateView(parent, parent.getChildAt(index)); -+ } - parent.removeViewAt(index); - } - } - -+ private void giveFocusToAppropriateView(@NonNull ViewGroup parent, @NonNull View focusedView) { -+ // Search for appropriate sibling -+ View viewToTakeFocus = null; -+ while (parent != null) { -+ // Search DOWN -+ viewToTakeFocus = FocusFinder.getInstance().findNextFocus(parent, focusedView, View.FOCUS_DOWN); -+ if (viewToTakeFocus == null) { -+ // Search RIGHT -+ viewToTakeFocus = FocusFinder.getInstance().findNextFocus(parent, focusedView, View.FOCUS_RIGHT); -+ if (viewToTakeFocus == null) { -+ // Search UP -+ viewToTakeFocus = FocusFinder.getInstance().findNextFocus(parent, focusedView, View.FOCUS_UP); -+ if (viewToTakeFocus == null) { -+ // Search LEFT -+ viewToTakeFocus = FocusFinder.getInstance().findNextFocus(parent, focusedView, View.FOCUS_LEFT); -+ } -+ } -+ } -+ if (viewToTakeFocus != null || !(parent.getParent() instanceof ViewGroup)) { -+ break; -+ } -+ parent = (ViewGroup) parent.getParent(); -+ } -+ -+ // Give focus to View -+ if (viewToTakeFocus != null) { -+ viewToTakeFocus.requestFocus(); -+ } -+ } -+ - @Override - public void removeAllViews(T parent) { - UiThreadUtil.assertOnUiThread(); diff --git a/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewFocusEvent.java b/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewFocusEvent.java deleted file mode 100644 index 1db7dd87932eb8..00000000000000 --- a/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewFocusEvent.java +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewFocusEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewFocusEvent.java -new file mode 100644 -index 0000000000..87364957dc ---- /dev/null -+++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewFocusEvent.java -@@ -0,0 +1,49 @@ -+/** -+ * Copyright (c) 2015-present, Facebook, Inc. -+ * -+ * 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.views.view; -+ -+import com.facebook.react.bridge.Arguments; -+import com.facebook.react.bridge.WritableMap; -+import com.facebook.react.uimanager.events.Event; -+import com.facebook.react.uimanager.events.RCTEventEmitter; -+ -+/** -+ * Event emitted by native View when it receives focus. -+ */ -+/* package */ class ReactViewFocusEvent extends Event { -+ -+ private static final String EVENT_NAME = "topOnFocusChange"; -+ private boolean mHasFocus; -+ -+ public ReactViewFocusEvent(int viewId, boolean hasFocus) { -+ super(viewId); -+ mHasFocus = hasFocus; -+ } -+ -+ @Override -+ public String getEventName() { -+ return EVENT_NAME; -+ } -+ -+ @Override -+ public boolean canCoalesce() { -+ return false; -+ } -+ -+ @Override -+ public void dispatch(RCTEventEmitter rctEventEmitter) { -+ rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData()); -+ } -+ -+ private WritableMap serializeEventData() { -+ WritableMap eventData = Arguments.createMap(); -+ eventData.putInt("target", getViewTag()); -+ eventData.putBoolean("hasFocus", mHasFocus); -+ return eventData; -+ } -+} diff --git a/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java b/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java deleted file mode 100644 index 4ba74394cdb58e..00000000000000 --- a/android-patches/patches/Focus/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +++ /dev/null @@ -1,106 +0,0 @@ ---- ".\\react-native-macos\\ReactAndroid\\src\\main\\java\\com\\facebook\\react\\views\\view\\ReactViewManager.java" 2022-06-03 10:43:46.680561400 -0700 -+++ ".\\react-native-macos2\\ReactAndroid\\src\\main\\java\\com\\facebook\\react\\views\\view\\ReactViewManager.java" 2022-06-03 10:36:55.352465500 -0700 -@@ -26,6 +26,7 @@ - import com.facebook.react.uimanager.Spacing; - import com.facebook.react.uimanager.ThemedReactContext; - import com.facebook.react.uimanager.UIManagerHelper; -+import com.facebook.react.uimanager.UIManagerModule; - import com.facebook.react.uimanager.ViewProps; - import com.facebook.react.uimanager.annotations.ReactProp; - import com.facebook.react.uimanager.annotations.ReactPropGroup; -@@ -49,8 +50,13 @@ - Spacing.START, - Spacing.END, - }; -- private static final int CMD_HOTSPOT_UPDATE = 1; -- private static final int CMD_SET_PRESSED = 2; -+ // Focus or blur call on native components (through NativeMethodsMixin) redirects to TextInputState.js -+ // which dispatches focusTextInput or blurTextInput commands. These commands are mapped to FOCUS_TEXT_INPUT=1 -+ // and BLUR_TEXT_INPUT=2 in ReactTextInputManager, hence these constants value should be in sync with ReactTextInputManager. -+ private static final int FOCUS_TEXT_INPUT = 1; -+ private static final int BLUR_TEXT_INPUT = 2; -+ private static final int CMD_HOTSPOT_UPDATE = 3; -+ private static final int CMD_SET_PRESSED = 4; - private static final String HOTSPOT_UPDATE_KEY = "hotspotUpdate"; - - @ReactProp(name = "accessible") -@@ -121,6 +127,36 @@ - } - } - -+ @Nullable -+ @Override -+ public Map getExportedCustomBubblingEventTypeConstants() { -+ return MapBuilder.builder() -+ .put( -+ "topOnFocusChange", -+ MapBuilder.of( -+ "phasedRegistrationNames", -+ MapBuilder.of("bubbled", "onFocusChange","captured", "onFocusChangeCapture"))) -+ .build(); -+ } -+ -+ @Override -+ protected void addEventEmitters( -+ final ThemedReactContext reactContext, -+ final ReactViewGroup reactViewGroup) { -+ reactViewGroup.setOnFocusChangeListener( -+ new View.OnFocusChangeListener() { -+ @Override -+ public void onFocusChange(View v, boolean hasFocus) { -+ EventDispatcher eventDispatcher = -+ reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); -+ eventDispatcher.dispatchEvent( -+ new ReactViewFocusEvent(reactViewGroup.getId(), hasFocus)); -+ } -+ } -+ ); -+ } -+ -+ - @ReactProp(name = "borderStyle") - public void setBorderStyle(ReactViewGroup view, @Nullable String borderStyle) { - view.setBorderStyle(borderStyle); -@@ -303,7 +339,7 @@ - - @Override - public Map getCommandsMap() { -- return MapBuilder.of(HOTSPOT_UPDATE_KEY, CMD_HOTSPOT_UPDATE, "setPressed", CMD_SET_PRESSED); -+ return MapBuilder.of("focusTextInput", FOCUS_TEXT_INPUT, "blurTextInput", BLUR_TEXT_INPUT, HOTSPOT_UPDATE_KEY, CMD_HOTSPOT_UPDATE, "setPressed", CMD_SET_PRESSED); - } - - @Override -@@ -319,6 +355,16 @@ - handleSetPressed(root, args); - break; - } -+ case FOCUS_TEXT_INPUT: -+ { -+ root.requestFocus(); -+ break; -+ } -+ case BLUR_TEXT_INPUT: -+ { -+ root.clearFocus(); -+ break; -+ } - } - } - -@@ -335,6 +381,16 @@ - handleSetPressed(root, args); - break; - } -+ case "focusTextInput": -+ { -+ root.requestFocus(); -+ break; -+ } -+ case "blurTextInput": -+ { -+ root.clearFocus(); -+ break; -+ } - } - } - diff --git a/android-patches/patches/JniUtils/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk b/android-patches/patches/JniUtils/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk deleted file mode 100644 index 9a1e0401d25be9..00000000000000 --- a/android-patches/patches/JniUtils/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- /dev/code/rnm-66-fresh/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk 2022-02-13 19:54:48.571686475 -0800 -+++ /dev/code/react-native-macos/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk 2022-02-13 19:52:50.350473816 -0800 -@@ -39,7 +39,7 @@ - libreact_render_uimanager \ - libreact_utils \ - libreact_config \ -- libreactnativeutilsjni \ -+ libreactnativejni \ - librrc_image \ - librrc_root \ - librrc_unimplementedview \ diff --git a/android-patches/patches/JniUtils/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk b/android-patches/patches/JniUtils/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk deleted file mode 100644 index 12c534fa7b8491..00000000000000 --- a/android-patches/patches/JniUtils/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- /dev/code/rnm-66-fresh/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk 2022-02-13 19:54:48.579686559 -0800 -+++ /dev/code/react-native-macos/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk 2022-02-13 19:53:04.134612248 -0800 -@@ -19,7 +19,7 @@ - - LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall - --LOCAL_SHARED_LIBRARIES = libfb libfbjni libreactnativeutilsjni libruntimeexecutor -+LOCAL_SHARED_LIBRARIES = libfb libfbjni libreactnativejni libruntimeexecutor - - LOCAL_STATIC_LIBRARIES = libcallinvoker libreactperfloggerjni - diff --git a/android-patches/patches/JniUtils/ReactAndroid/src/main/jni/react/jni/Android.mk b/android-patches/patches/JniUtils/ReactAndroid/src/main/jni/react/jni/Android.mk deleted file mode 100644 index 4674e04a6d4ae4..00000000000000 --- a/android-patches/patches/JniUtils/ReactAndroid/src/main/jni/react/jni/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- /dev/code/rnm-66-fresh/ReactAndroid/src/main/jni/react/jni/Android.mk 2022-02-13 19:54:48.595686727 -0800 -+++ /dev/code/react-native-macos/ReactAndroid/src/main/jni/react/jni/Android.mk 2022-02-13 19:53:07.962650850 -0800 -@@ -90,7 +90,7 @@ - libfolly_json \ - libglog_init \ - libreact_render_runtimescheduler \ -- libreactnativeutilsjni \ -+ libreactnativejni \ - libruntimeexecutor \ - libyoga \ - logger diff --git a/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/progressbar/Android.mk b/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/progressbar/Android.mk deleted file mode 100644 index aa582b0d5365d1..00000000000000 --- a/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/progressbar/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- /dev/code/rnm-66-fresh/ReactCommon/react/renderer/components/progressbar/Android.mk 2022-02-13 19:54:48.619686978 -0800 -+++ /dev/code/react-native-macos/ReactCommon/react/renderer/components/progressbar/Android.mk 2022-02-13 19:53:12.522696921 -0800 -@@ -34,7 +34,7 @@ - libreact_render_debug \ - libreact_render_graphics \ - libreact_render_uimanager \ -- libreactnativeutilsjni \ -+ libreactnativejni \ - librrc_view \ - libyoga - diff --git a/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/slider/Android.mk b/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/slider/Android.mk deleted file mode 100644 index 474a7448f797b9..00000000000000 --- a/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/slider/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- /dev/code/rnm-66-fresh/ReactCommon/react/renderer/components/slider/Android.mk 2022-02-13 19:54:48.619686978 -0800 -+++ /dev/code/react-native-macos/ReactCommon/react/renderer/components/slider/Android.mk 2022-02-13 19:53:21.558788484 -0800 -@@ -36,7 +36,7 @@ - libreact_render_imagemanager \ - libreact_render_mapbuffer \ - libreact_render_uimanager \ -- libreactnativeutilsjni \ -+ libreactnativejni \ - librrc_image \ - librrc_view \ - libyoga diff --git a/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/switch/Android.mk b/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/switch/Android.mk deleted file mode 100644 index f86a468cd81dfb..00000000000000 --- a/android-patches/patches/JniUtils/ReactCommon/react/renderer/components/switch/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- /home/mganandraj/code/rnm-66-fresh/ReactCommon/react/renderer/components/switch/Android.mk 2022-02-13 19:54:48.619686978 -0800 -+++ /home/mganandraj/code/react-native-macos/ReactCommon/react/renderer/components/switch/Android.mk 2022-02-13 19:53:25.274826242 -0800 -@@ -34,7 +34,7 @@ - libreact_render_debug \ - libreact_render_graphics \ - libreact_render_uimanager \ -- libreactnativeutilsjni \ -+ libreactnativejni \ - librrc_view \ - libyoga - diff --git a/android-patches/patches/JniUtils/ReactCommon/react/renderer/textlayoutmanager/Android.mk b/android-patches/patches/JniUtils/ReactCommon/react/renderer/textlayoutmanager/Android.mk deleted file mode 100644 index 056945e0095a91..00000000000000 --- a/android-patches/patches/JniUtils/ReactCommon/react/renderer/textlayoutmanager/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- /home/mganandraj/code/rnm-66-fresh/ReactCommon/react/renderer/textlayoutmanager/Android.mk 2022-02-13 19:54:48.631687103 -0800 -+++ /home/mganandraj/code/react-native-macos/ReactCommon/react/renderer/textlayoutmanager/Android.mk 2022-02-13 19:53:28.338857418 -0800 -@@ -30,7 +30,7 @@ - libreact_render_telemetry \ - libreact_render_uimanager \ - libreact_utils \ -- libreactnativeutilsjni \ -+ libreactnativejni \ - libyoga - - LOCAL_STATIC_LIBRARIES := diff --git a/android-patches/patches/MAC/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevSettingsModule.java b/android-patches/patches/MAC/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevSettingsModule.java deleted file mode 100644 index 579478331d0851..00000000000000 --- a/android-patches/patches/MAC/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevSettingsModule.java +++ /dev/null @@ -1,12 +0,0 @@ ---- ./ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevSettingsModule.java 2021-01-28 10:24:44.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/MAC/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevSettingsModule.java 2022-01-12 15:04:31.000000000 -0800 -@@ -118,4 +118,9 @@ - public void removeListeners(double count) { - // iOS only - } -+ -+ @Override -+ public void setIsSecondaryClickToShowDevMenuEnabled(boolean enabled) { -+ // macOS only. -+ } - } diff --git a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java deleted file mode 100644 index 1f6c51950d6a49..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ /dev/null @@ -1,44 +0,0 @@ ---- ./ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java 2022-01-12 15:04:31.000000000 -0800 -@@ -52,6 +52,7 @@ - import com.facebook.infer.annotation.ThreadSafe; - import com.facebook.react.bridge.Arguments; - import com.facebook.react.bridge.CatalystInstance; -+import com.facebook.react.bridge.CatalystInstance.CatalystInstanceEventListener; - import com.facebook.react.bridge.CatalystInstanceImpl; - import com.facebook.react.bridge.JSBundleLoader; - import com.facebook.react.bridge.JSIModulePackage; -@@ -186,6 +187,7 @@ - private final @Nullable ReactPackageTurboModuleManagerDelegate.Builder mTMMDelegateBuilder; - private List mViewManagers; - private boolean mUseFallbackBundle = false; -+ private @Nullable CatalystInstanceEventListener mCatalystInstanceEventListener; - - private class ReactContextInitParams { - private final JavaScriptExecutorFactory mJsExecutorFactory; -@@ -206,6 +208,15 @@ - } - } - -+ /** -+ * -+ * Register CatalystInstanceEventListener -+ * This methods is called from Office ReactNativeHost -+ */ -+ public void setCatalystInstanceEventListener(CatalystInstanceEventListener catalystInstanceEventListener) { -+ mCatalystInstanceEventListener = catalystInstanceEventListener; -+ } -+ - /** Creates a builder that is capable of creating an instance of {@link ReactInstanceManager}. */ - public static ReactInstanceManagerBuilder builder() { - return new ReactInstanceManagerBuilder(); -@@ -1333,7 +1344,8 @@ - .setJSExecutor(jsExecutor) - .setRegistry(nativeModuleRegistry) - .setJSBundleLoader(jsBundleLoader) -- .setNativeModuleCallExceptionHandler(exceptionHandler); -+ .setNativeModuleCallExceptionHandler(exceptionHandler) -+ .setCatalystInstanceEventListener(mCatalystInstanceEventListener); - - ReactMarker.logMarker(CREATE_CATALYST_INSTANCE_START); - // CREATE_CATALYST_INSTANCE_END is in JSCExecutor.cpp diff --git a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java deleted file mode 100644 index b8d3c1598f249d..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +++ /dev/null @@ -1,14 +0,0 @@ ---- ./ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java 2021-11-08 14:22:26.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java 2022-01-12 15:04:31.000000000 -0800 -@@ -131,4 +131,11 @@ - * hasNativeModule, and getNativeModules can also return TurboModules. - */ - void setTurboModuleManager(JSIModule getter); -+ -+ long getPointerOfInstancePointer(); -+ -+ public interface CatalystInstanceEventListener { -+ void onModuleRegistryCreated(CatalystInstance catalystInstance); -+ } -+ - } diff --git a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java deleted file mode 100644 index e714f519764f1a..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ ---- ./ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java 2022-01-12 16:18:35.000000000 -0800 -@@ -119,7 +119,8 @@ - final JavaScriptExecutor jsExecutor, - final NativeModuleRegistry nativeModuleRegistry, - final JSBundleLoader jsBundleLoader, -- NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) { -+ NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler, -+ CatalystInstanceEventListener catalystInstanceEventListener) { - FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge."); - Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createCatalystInstanceImpl"); - -@@ -137,6 +138,15 @@ - mTraceListener = new JSProfilerTraceListener(this); - Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); - -+ FLog.d(ReactConstants.TAG, "Create module registry"); -+ createModuleRegistry(mNativeModulesQueueThread, -+ mNativeModuleRegistry.getJavaModules(this), -+ mNativeModuleRegistry.getCxxModules()); -+ if (catalystInstanceEventListener != null) { -+ FLog.d(ReactConstants.TAG, "Invoking callback onModuleRegistryCreated"); -+ catalystInstanceEventListener.onModuleRegistryCreated(this); -+ } -+ - FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge"); - Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "initializeCxxBridge"); - -@@ -147,10 +157,7 @@ - initializeBridge( - new BridgeCallback(this), - jsExecutor, -- mReactQueueConfiguration.getJSQueueThread(), -- mNativeModulesQueueThread, -- mNativeModuleRegistry.getJavaModules(this), -- mNativeModuleRegistry.getCxxModules()); -+ mReactQueueConfiguration.getJSQueueThread()); - FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge"); - Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); - -@@ -211,15 +218,17 @@ - private native void jniExtendNativeModules( - Collection javaModules, Collection cxxModules); - -+ private native void createModuleRegistry( -+ MessageQueueThread moduleQueue, -+ Collection javaModules, -+ Collection cxxModules); -+ - private native void warnOnLegacyNativeModuleSystemUse(); - - private native void initializeBridge( - ReactCallback callback, - JavaScriptExecutor jsExecutor, -- MessageQueueThread jsQueue, -- MessageQueueThread moduleQueue, -- Collection javaModules, -- Collection cxxModules); -+ MessageQueueThread jsQueue); - - @Override - public void setSourceURLs(String deviceURL, String remoteURL) { -@@ -400,7 +409,8 @@ - mJavaScriptContextHolder.clear(); - - mHybridData.resetNative(); -- getReactQueueConfiguration().destroy(); -+ // TODO :: Office patch :: Not sure why is this needed ? -+ // getReactQueueConfiguration().destroy(); - FLog.d( - ReactConstants.TAG, - "CatalystInstanceImpl.destroy() end"); -@@ -569,6 +579,7 @@ - } - - private native long getJavaScriptContext(); -+ public native long getPointerOfInstancePointer(); - - private void incrementPendingJSCalls() { - int oldPendingCalls = mPendingJSCalls.getAndIncrement(); -@@ -672,6 +683,7 @@ - private @Nullable NativeModuleRegistry mRegistry; - private @Nullable JavaScriptExecutor mJSExecutor; - private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler; -+ private @Nullable CatalystInstanceEventListener mCatalystInstanceEventListener; - - public Builder setReactQueueConfigurationSpec( - ReactQueueConfigurationSpec ReactQueueConfigurationSpec) { -@@ -699,13 +711,20 @@ - return this; - } - -+ public Builder setCatalystInstanceEventListener( -+ CatalystInstanceEventListener catalystInstanceEventListener) { -+ mCatalystInstanceEventListener = catalystInstanceEventListener; -+ return this; -+ } -+ - public CatalystInstanceImpl build() { - return new CatalystInstanceImpl( - Assertions.assertNotNull(mReactQueueConfigurationSpec), - Assertions.assertNotNull(mJSExecutor), - Assertions.assertNotNull(mRegistry), - Assertions.assertNotNull(mJSBundleLoader), -- Assertions.assertNotNull(mNativeModuleCallExceptionHandler)); -+ Assertions.assertNotNull(mNativeModuleCallExceptionHandler), -+ mCatalystInstanceEventListener); - } - } - } diff --git a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java deleted file mode 100644 index 1b607d315c6ea3..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java +++ /dev/null @@ -1,30 +0,0 @@ ---- /dev/code/rnm-66-fresh/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java 2022-02-13 19:54:48.563686391 -0800 -+++ /dev/code/react-native-macos/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java 2022-02-13 22:53:50.732054489 -0800 -@@ -31,6 +31,27 @@ - Systrace.beginSection( - TRACE_TAG_REACT_JAVA_BRIDGE, "ReactBridge.staticInit::load:reactnativejni"); - ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_START); -+ -+ // JS Engine is configurable.. And we exepct only one packaged -+ // Hence ignore failure -+ try { -+ SoLoader.loadLibrary("hermes"); -+ }catch (UnsatisfiedLinkError jscE){} -+ -+ try { -+ SoLoader.loadLibrary("v8jsi"); -+ }catch (UnsatisfiedLinkError jscE){} -+ -+ SoLoader.loadLibrary("glog"); -+ SoLoader.loadLibrary("glog_init"); -+ SoLoader.loadLibrary("fb"); -+ SoLoader.loadLibrary("fbjni"); -+ SoLoader.loadLibrary("yoga"); -+ SoLoader.loadLibrary("folly_json"); -+ SoLoader.loadLibrary("reactperfloggerjni"); -+ SoLoader.loadLibrary("jsinspector"); -+ SoLoader.loadLibrary("jsi"); -+ SoLoader.loadLibrary("logger"); - SoLoader.loadLibrary("reactnativejni"); - ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_END); - Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); diff --git a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp deleted file mode 100644 index c2722d3e82fb52..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ /dev/null @@ -1,95 +0,0 @@ ---- ./ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp 2022-01-12 16:43:26.000000000 -0800 -@@ -106,6 +106,7 @@ - void CatalystInstanceImpl::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", CatalystInstanceImpl::initHybrid), -+ makeNativeMethod("createModuleRegistry", CatalystInstanceImpl::createModuleRegistry), - makeNativeMethod( - "initializeBridge", CatalystInstanceImpl::initializeBridge), - makeNativeMethod( -@@ -138,6 +139,7 @@ - CatalystInstanceImpl::handleMemoryPressure), - makeNativeMethod( - "getRuntimeExecutor", CatalystInstanceImpl::getRuntimeExecutor), -+ makeNativeMethod("getPointerOfInstancePointer", CatalystInstanceImpl::getPointerOfInstancePointer), - makeNativeMethod( - "getRuntimeScheduler", CatalystInstanceImpl::getRuntimeScheduler), - makeNativeMethod( -@@ -151,6 +153,23 @@ - JNativeRunnable::registerNatives(); - } - -+void CatalystInstanceImpl::createModuleRegistry( -+ jni::alias_ref nativeModulesQueue, -+ jni::alias_ref::javaobject> javaModules, -+ jni::alias_ref::javaobject> cxxModules) { -+ moduleMessageQueue_ = std::make_shared(nativeModulesQueue); -+ -+ moduleRegistry_ = std::make_shared( -+ buildNativeModuleList( -+ std::weak_ptr(instance_), -+ javaModules, -+ cxxModules, -+ moduleMessageQueue_ -+ )); -+ -+ instance_->setModuleRegistry(moduleRegistry_); -+} -+ - void log(ReactNativeLogLevel level, const char *message) { - switch (level) { - case ReactNativeLogLevelInfo: -@@ -175,19 +194,14 @@ - jni::alias_ref callback, - // This executor is actually a factory holder. - JavaScriptExecutorHolder *jseh, -- jni::alias_ref jsQueue, -- jni::alias_ref nativeModulesQueue, -- jni::alias_ref::javaobject> -- javaModules, -- jni::alias_ref::javaobject> -- cxxModules) { -+ jni::alias_ref jsQueue) { - set_react_native_logfunc(&log); - - // TODO mhorowitz: how to assert here? - // Assertions.assertCondition(mBridge == null, "initializeBridge should be - // called once"); -- moduleMessageQueue_ = -- std::make_shared(nativeModulesQueue); -+ // moduleMessageQueue_ = -+ // std::make_shared(nativeModulesQueue); - - // This used to be: - // -@@ -206,12 +220,13 @@ - // don't need jsModuleDescriptions any more, all the way up and down the - // stack. - -- moduleRegistry_ = std::make_shared(buildNativeModuleList( -- std::weak_ptr(instance_), -- javaModules, -- cxxModules, -- moduleMessageQueue_)); -+ // moduleRegistry_ = std::make_shared(buildNativeModuleList( -+ // std::weak_ptr(instance_), -+ // javaModules, -+ // cxxModules, -+ // moduleMessageQueue_)); - -+ // TODO:: Office - Assert that moduleRegistry_ is created .. i.e. not null - instance_->initializeBridge( - std::make_unique(callback, moduleMessageQueue_), - jseh->getExecutorFactory(), -@@ -344,6 +359,10 @@ - instance_->handleMemoryPressure(pressureLevel); - } - -+jlong CatalystInstanceImpl::getPointerOfInstancePointer() { -+ return (jlong) (intptr_t) (&instance_); -+} -+ - jni::alias_ref - CatalystInstanceImpl::getJSCallInvokerHolder() { - if (!jsCallInvokerHolder_) { diff --git a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h b/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h deleted file mode 100644 index 903a67c031b049..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +++ /dev/null @@ -1,34 +0,0 @@ ---- ./ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h 2022-01-12 15:04:31.000000000 -0800 -@@ -55,17 +55,16 @@ - bool enableRuntimeScheduler, - bool enableRuntimeSchedulerInTurboModule); - -+ void createModuleRegistry( -+ jni::alias_ref nativeModulesQueue, -+ jni::alias_ref::javaobject> javaModules, -+ jni::alias_ref::javaobject> cxxModules); -+ - void initializeBridge( - jni::alias_ref callback, - // This executor is actually a factory holder. - JavaScriptExecutorHolder *jseh, -- jni::alias_ref jsQueue, -- jni::alias_ref moduleQueue, -- jni::alias_ref< -- jni::JCollection::javaobject> -- javaModules, -- jni::alias_ref::javaobject> -- cxxModules); -+ jni::alias_ref jsQueue); - - // When called from CatalystInstanceImpl.java, warnings will be logged when - // CxxNativeModules are used. Java NativeModule usages log error in Java. -@@ -108,6 +107,7 @@ - void setGlobalVariable(std::string propName, std::string &&jsonValue); - jlong getJavaScriptContext(); - void handleMemoryPressure(int pressureLevel); -+ jlong getPointerOfInstancePointer(); - - void createAndInstallRuntimeSchedulerIfNecessary(); - diff --git a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxModule.h b/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxModule.h deleted file mode 100644 index c4bb8388785a42..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxModule.h +++ /dev/null @@ -1,11 +0,0 @@ ---- ./ReactCommon/cxxreact/CxxModule.h 2021-10-25 12:38:05.000000000 -0700 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactCommon/cxxreact/CxxModule.h 2022-01-12 15:04:31.000000000 -0800 -@@ -14,8 +14,6 @@ - - #include - --using namespace std::placeholders; -- - namespace facebook { - namespace react { - diff --git a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.cpp b/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.cpp deleted file mode 100644 index f78445c43b0f9d..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.cpp +++ /dev/null @@ -1,21 +0,0 @@ ---- ./ReactCommon/cxxreact/CxxNativeModule.cpp 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.cpp 2022-01-12 15:04:31.000000000 -0800 -@@ -249,5 +249,18 @@ - } - } - -+// Adding this factory method so that Office Android can delay load binary reactnativejni -+std::unique_ptr Make(std::weak_ptr instance, -+ std::string name, -+ xplat::module::CxxModule::Provider provider, -+ std::shared_ptr messageQueueThread) -+{ -+ return std::make_unique( -+ instance, -+ std::move(name) /*ModuleName*/, -+ std::move(provider) /*Provider*/, -+ std::move(messageQueueThread)); -+} -+ - } // namespace react - } // namespace facebook diff --git a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.h b/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.h deleted file mode 100644 index c69a5fecba67df..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.h +++ /dev/null @@ -1,15 +0,0 @@ ---- ./ReactCommon/cxxreact/CxxNativeModule.h 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactCommon/cxxreact/CxxNativeModule.h 2022-01-12 16:48:12.000000000 -0800 -@@ -48,6 +48,12 @@ - unsigned int hookId, - folly::dynamic &&args) override; - -+ // Adding this factory method so that Office Android can delay load binary reactnativejni -+ static std::unique_ptr Make(std::weak_ptr instance, -+ std::string name, -+ xplat::module::CxxModule::Provider provider, -+ std::shared_ptr messageQueueThread); -+ - static void setShouldWarnOnUse(bool value); - - private: diff --git a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/Instance.cpp b/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/Instance.cpp deleted file mode 100644 index cbce5e708c3268..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/Instance.cpp +++ /dev/null @@ -1,14 +0,0 @@ ---- ./ReactCommon/cxxreact/Instance.cpp 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactCommon/cxxreact/Instance.cpp 2022-01-12 15:04:31.000000000 -0800 -@@ -40,6 +40,11 @@ - } - } - -+void Instance::setModuleRegistry( -+ std::shared_ptr moduleRegistry) { -+ moduleRegistry_ = std::move(moduleRegistry); -+} -+ - void Instance::initializeBridge( - std::unique_ptr callback, - std::shared_ptr jsef, diff --git a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/Instance.h b/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/Instance.h deleted file mode 100644 index 2792adeb842685..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/Instance.h +++ /dev/null @@ -1,11 +0,0 @@ ---- ./ReactCommon/cxxreact/Instance.h 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/OfficeRNHost/ReactCommon/cxxreact/Instance.h 2022-01-12 15:04:31.000000000 -0800 -@@ -42,6 +42,8 @@ - class RN_EXPORT Instance { - public: - ~Instance(); -+ -+ void setModuleRegistry(std::shared_ptr moduleRegistry); - void initializeBridge( - std::unique_ptr callback, - std::shared_ptr jsef, diff --git a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/PlatformBundleInfo.h b/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/PlatformBundleInfo.h deleted file mode 100644 index 312e9d96c028f6..00000000000000 --- a/android-patches/patches/OfficeRNHost/ReactCommon/cxxreact/PlatformBundleInfo.h +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/ReactCommon/cxxreact/PlatformBundleInfo.h b/ReactCommon/cxxreact/PlatformBundleInfo.h -new file mode 100644 -index 0000000000..84fb4a2aa6 ---- /dev/null -+++ b/ReactCommon/cxxreact/PlatformBundleInfo.h -@@ -0,0 +1,15 @@ -+#pragma once -+ -+#include -+ -+namespace facebook { namespace react { -+ -+struct PlatformBundleInfo -+{ -+ std::unique_ptr Bundle; -+ std::string BundleUrl; -+ std::string BytecodePath; -+ uint64_t Version; -+}; -+ -+}}//namespace facebook::react -\ No newline at end of file diff --git a/android-patches/patches/RootViewAttach/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/android-patches/patches/RootViewAttach/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java deleted file mode 100644 index 29054272f38258..00000000000000 --- a/android-patches/patches/RootViewAttach/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ /dev/null @@ -1,25 +0,0 @@ ---- /dev/code/rnm-66-fresh/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java 2022-02-13 19:54:48.563686391 -0800 -+++ /dev/code/react-native-macos/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java 2022-02-13 22:34:45.828345952 -0800 -@@ -441,16 +441,12 @@ - mInitialUITemplate = initialUITemplate; - - mReactInstanceManager.createReactContextInBackground(); -- // if in this experiment, we initialize the root earlier in startReactApplication -- // instead of waiting for the initial measure -- if (ReactFeatureFlags.enableEagerRootViewAttachment) { -- if (!mWasMeasured) { -- // Ideally, those values will be used by default, but we only update them here to scope -- // this change to `enableEagerRootViewAttachment` experiment. -- setSurfaceConstraintsToScreenSize(); -- } -- attachToReactInstanceManager(); -- } -+ if (!mWasMeasured) { -+ // Ideally, those values will be used by default, but we only update them here to scope -+ // this change to `enableEagerRootViewAttachment` experiment. -+ setSurfaceConstraintsToScreenSize(); -+ } -+ attachToReactInstanceManager(); - } finally { - Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); - } diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java deleted file mode 100644 index dd89ac6c90f7c0..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +++ /dev/null @@ -1,77 +0,0 @@ ---- ./ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/V8/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java 2022-01-12 15:04:31.000000000 -0800 -@@ -31,6 +31,7 @@ - import com.facebook.react.devsupport.interfaces.DevSupportManager; - import com.facebook.react.jscexecutor.JSCExecutor; - import com.facebook.react.jscexecutor.JSCExecutorFactory; -+import com.facebook.react.v8executor.V8ExecutorFactory; - import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; - import com.facebook.react.packagerconnection.RequestHandler; - import com.facebook.react.uimanager.UIImplementationProvider; -@@ -67,8 +68,21 @@ - private @Nullable ReactPackageTurboModuleManagerDelegate.Builder mTMMDelegateBuilder; - private @Nullable SurfaceDelegateFactory mSurfaceDelegateFactory; - -+ public enum JSEngine { -+ Hermes, -+ V8 -+ } -+ -+ private JSEngine mJSEngine = JSEngine.V8; -+ - /* package protected */ ReactInstanceManagerBuilder() {} - -+ public ReactInstanceManagerBuilder setJSEngine( -+ JSEngine jsEngine) { -+ mJSEngine = jsEngine; -+ return this; -+ } -+ - /** Sets a provider of {@link UIImplementation}. Uses default provider if null is passed. */ - public ReactInstanceManagerBuilder setUIImplementationProvider( - @Nullable UIImplementationProvider uiImplementationProvider) { -@@ -345,41 +359,11 @@ - - private JavaScriptExecutorFactory getDefaultJSExecutorFactory( - String appName, String deviceName, Context applicationContext) { -- try { -- // If JSC is included, use it as normal -- initializeSoLoaderIfNecessary(applicationContext); -- JSCExecutor.loadLibrary(); -- return new JSCExecutorFactory(appName, deviceName); -- } catch (UnsatisfiedLinkError jscE) { -- // https://github.com/facebook/hermes/issues/78 shows that -- // people who aren't trying to use Hermes are having issues. -- // https://github.com/facebook/react-native/issues/25923#issuecomment-554295179 -- // includes the actual JSC error in at least one case. -- // -- // So, if "__cxa_bad_typeid" shows up in the jscE exception -- // message, then we will assume that's the failure and just -- // throw now. -- -- if (jscE.getMessage().contains("__cxa_bad_typeid")) { -- throw jscE; -- } -- -- // Otherwise use Hermes -- try { -+ if(mJSEngine == JSEngine.V8) { -+ return new V8ExecutorFactory(appName, deviceName); -+ } else { - HermesExecutor.loadLibrary(); - return new HermesExecutorFactory(); -- } catch (UnsatisfiedLinkError hermesE) { -- // If we get here, either this is a JSC build, and of course -- // Hermes failed (since it's not in the APK), or it's a Hermes -- // build, and Hermes had a problem. -- -- // We suspect this is a JSC issue (it's the default), so we -- // will throw that exception, but we will print hermesE first, -- // since it could be a Hermes issue and we don't want to -- // swallow that. -- hermesE.printStackTrace(); -- throw jscE; - } -- } - } - } diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java deleted file mode 100644 index be1a0f37c80f9c..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java +++ /dev/null @@ -1,12 +0,0 @@ ---- ./ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/V8/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java 2022-01-12 17:07:55.000000000 -0800 -@@ -115,6 +115,9 @@ - FABRIC_BATCH_EXECUTION_END, - FABRIC_UPDATE_UI_MAIN_THREAD_START, - FABRIC_UPDATE_UI_MAIN_THREAD_END, -+ BYTECODE_CREATION_FAILED, -+ BYTECODE_READ_FAILED, -+ BYTECODE_WRITE_FAILED, - // New markers used by bridge and bridgeless loading below this line - REACT_BRIDGE_LOADING_START, - REACT_BRIDGE_LOADING_END, diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/Android.mk b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/Android.mk deleted file mode 100644 index c123399b34fd80..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/Android.mk +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/ReactAndroid/src/main/java/com/facebook/react/v8executor/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/v8executor/Android.mk -new file mode 100644 -index 0000000000..8e28a3ddfd ---- /dev/null -+++ b/ReactAndroid/src/main/java/com/facebook/react/v8executor/Android.mk -@@ -0,0 +1,21 @@ -+# Copyright (c) Facebook, Inc. and its affiliates. -+# -+# This source code is licensed under the MIT license found in the -+# LICENSE file in the root directory of this source tree. -+ -+LOCAL_PATH := $(call my-dir) -+ -+include $(CLEAR_VARS) -+ -+LOCAL_MODULE := v8executor -+ -+LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) -+ -+LOCAL_C_INCLUDES := $(LOCAL_PATH) $(THIRD_PARTY_NDK_DIR)/.. -+ -+LOCAL_CFLAGS += -fvisibility=hidden -fexceptions -frtti -+ -+LOCAL_STATIC_LIBRARIES := libjsi libjsireact -+LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libreactnativejni v8jsi -+ -+include $(BUILD_SHARED_LIBRARY) diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/OnLoad.cpp b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/OnLoad.cpp deleted file mode 100644 index 98bfe9e1e735ba..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/OnLoad.cpp +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/ReactAndroid/src/main/java/com/facebook/react/v8executor/OnLoad.cpp b/ReactAndroid/src/main/java/com/facebook/react/v8executor/OnLoad.cpp -new file mode 100644 -index 0000000000..dbfcd275ec ---- /dev/null -+++ b/ReactAndroid/src/main/java/com/facebook/react/v8executor/OnLoad.cpp -@@ -0,0 +1,51 @@ -+// Copyright (c) Facebook, Inc. and its affiliates. -+// -+// This source code is licensed under the MIT license found in the -+ // LICENSE file in the root directory of this source tree. -+ -+#include -+#include -+#include -+#include -+ -+#include "V8ExecutorFactory.h" -+ -+namespace facebook { -+namespace react { -+ -+// This is not like JSCJavaScriptExecutor, which calls JSC directly. This uses -+// JSIExecutor with V8Runtime. -+class V8ExecutorHolder -+ : public jni::HybridClass { -+ public: -+ static constexpr auto kJavaDescriptor = "Lcom/facebook/react/v8executor/V8Executor;"; -+ -+ static jni::local_ref initHybrid( -+ jni::alias_ref, ReadableNativeMap* v8Config) { -+ // This is kind of a weird place for stuff, but there's no other -+ // good place for initialization which is specific to JSC on -+ // Android. -+ JReactMarker::setLogPerfMarkerIfNeeded(); -+ // TODO mhorowitz T28461666 fill in some missing nice to have glue -+ return makeCxxInstance(folly::make_unique(v8Config->consume())); -+ } -+ -+ static void registerNatives() { -+ registerHybrid({ -+ makeNativeMethod("initHybrid", V8ExecutorHolder::initHybrid), -+ }); -+ } -+ -+ private: -+ friend HybridBase; -+ using HybridBase::HybridBase; -+}; -+ -+} // namespace react -+} // namespace facebook -+ -+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { -+ return facebook::jni::initialize(vm, [] { -+ facebook::react::V8ExecutorHolder::registerNatives(); -+ }); -+} -\ No newline at end of file diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8Executor.java b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8Executor.java deleted file mode 100644 index 0dc9c0d1160b70..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8Executor.java +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8Executor.java b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8Executor.java -new file mode 100644 -index 0000000000..c28186d613 ---- /dev/null -+++ b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8Executor.java -@@ -0,0 +1,32 @@ -+/** -+ * Copyright (c) 2015-present, Facebook, Inc. -+ * -+ *

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.v8executor; -+ -+import com.facebook.jni.HybridData; -+import com.facebook.proguard.annotations.DoNotStrip; -+import com.facebook.react.bridge.JavaScriptExecutor; -+import com.facebook.react.bridge.ReadableNativeMap; -+import com.facebook.soloader.SoLoader; -+ -+@DoNotStrip -+/* package */ class V8Executor extends JavaScriptExecutor { -+ static { -+ SoLoader.loadLibrary("v8executor"); -+ } -+ -+ /* package */ V8Executor(ReadableNativeMap v8Config) { -+ super(initHybrid(v8Config)); -+ } -+ -+ @Override -+ public String getName() { -+ return "V8Executor"; -+ } -+ -+ private static native HybridData initHybrid(ReadableNativeMap v8Config); -+} diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp deleted file mode 100644 index da5fe8a79ad0d1..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp -new file mode 100644 -index 0000000000..16de96d215 ---- /dev/null -+++ b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp -@@ -0,0 +1,35 @@ -+#include -+#include -+#include -+#include -+#include -+ -+#include "V8ExecutorFactory.h" -+ -+namespace facebook { namespace react { namespace jsi { -+ -+V8ExecutorFactory::V8ExecutorFactory(folly::dynamic&& v8Config) : -+ m_v8Config(std::move(v8Config)) {} -+ -+ std::unique_ptr V8ExecutorFactory::createJSExecutor( -+ std::shared_ptr delegate, -+ std::shared_ptr jsQueue) { -+ -+ auto logger = std::make_shared([](const std::string& message, unsigned int logLevel) { -+ reactAndroidLoggingHook(message, logLevel); -+ }); -+ -+ auto installBindings = [](facebook::jsi::Runtime &runtime) { -+ react::Logger androidLogger = -+ static_cast( -+ &reactAndroidLoggingHook); -+ react::bindNativeLogger(runtime, androidLogger); -+ }; -+ -+ return folly::make_unique( -+ facebook::v8runtime::makeV8Runtime(m_v8Config.getDefault("CacheDirectory", "").getString(), logger), -+ delegate, -+ JSIExecutor::defaultTimeoutInvoker, -+ installBindings); -+ } -+ }}} // namespace facebook::react::jsi diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.h b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.h deleted file mode 100644 index 5955b2e921687d..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.h +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.h b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.h -new file mode 100644 -index 0000000000..0606103d3a ---- /dev/null -+++ b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.h -@@ -0,0 +1,17 @@ -+#include -+#include -+ -+namespace facebook { namespace react { namespace jsi { -+ -+class V8ExecutorFactory : public JSExecutorFactory { -+public: -+ V8ExecutorFactory(folly::dynamic&& v8Config); -+ -+ std::unique_ptr createJSExecutor( -+ std::shared_ptr delegate, -+ std::shared_ptr jsQueue) override; -+ -+private: -+ folly::dynamic m_v8Config; -+}; -+}}} // namespace facebook::react::jsi diff --git a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.java b/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.java deleted file mode 100644 index e5f2d58b68a577..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.java +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.java b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.java -new file mode 100644 -index 0000000000..04447562c7 ---- /dev/null -+++ b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.java -@@ -0,0 +1,93 @@ -+/* -+ * Copyright (c) 2015-present, Facebook, Inc. -+ * -+ * 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.v8executor; -+ -+import com.facebook.react.bridge.JavaScriptExecutor; -+import com.facebook.react.bridge.JavaScriptExecutorFactory; -+import com.facebook.react.bridge.WritableNativeMap; -+ -+public class V8ExecutorFactory implements JavaScriptExecutorFactory { -+ public static class V8ConfigParams { -+ public enum CacheType { -+ NoCache, -+ CodeCache, -+ FullCodeCache -+ } -+ -+ private String mCacheDirectory; -+ private CacheType mCacheType; -+ private boolean mUseLazyScriptCompilation; -+ -+ public String getCacheDirectory() { -+ return mCacheDirectory; -+ } -+ -+ public V8ConfigParams.CacheType getCacheType() { -+ return mCacheType; -+ } -+ -+ public boolean useLazyScriptCompilation() { -+ return mUseLazyScriptCompilation; -+ } -+ -+ public V8ConfigParams() { -+ mCacheType = CacheType.NoCache; -+ mCacheDirectory = ""; -+ } -+ -+ public V8ConfigParams(String cacheDirectory, CacheType cacheType, boolean useLazyScriptCompilation) { -+ mCacheDirectory = cacheDirectory; -+ mCacheType = cacheType; -+ mUseLazyScriptCompilation = useLazyScriptCompilation; -+ } -+ } -+ -+ private final String mAppName; -+ private final String mDeviceName; -+ private V8ConfigParams mV8ConfigParams; -+ -+ public V8ExecutorFactory(String appName, String deviceName) { -+ this.mAppName = appName; -+ this.mDeviceName = deviceName; -+ this.mV8ConfigParams = new V8ConfigParams(); -+ } -+ -+ public V8ExecutorFactory(String appName, String deviceName, V8ConfigParams v8ConfigParams) { -+ this.mAppName = appName; -+ this.mDeviceName = deviceName; -+ this.mV8ConfigParams = v8ConfigParams; -+ } -+ -+ @Override -+ public JavaScriptExecutor create() throws Exception { -+ WritableNativeMap v8Config = new WritableNativeMap(); -+ v8Config.putString("OwnerIdentity", "ReactNative"); -+ v8Config.putString("AppIdentity", mAppName); -+ v8Config.putString("DeviceIdentity", mDeviceName); -+ v8Config.putString("CacheDirectory", mV8ConfigParams.getCacheDirectory()); -+ v8Config.putBoolean("UseLazyScriptCompilation", mV8ConfigParams.useLazyScriptCompilation()); -+ v8Config.putInt("CacheType", mV8ConfigParams.getCacheType().ordinal()); -+ -+ return new V8Executor(v8Config); -+ } -+ -+ @Override -+ public void startSamplingProfiler() { -+ // Nope -+ } -+ -+ @Override -+ public void stopSamplingProfiler(String filename) { -+ // Nope -+ } -+ -+ @Override -+ public String toString() { -+ return "JSIExecutor+V8Runtime"; -+ } -+} diff --git a/android-patches/patches/V8/ReactAndroid/src/main/jni/react/jni/Android.mk b/android-patches/patches/V8/ReactAndroid/src/main/jni/react/jni/Android.mk deleted file mode 100644 index b088c485618c54..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/jni/react/jni/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ ---- ./ReactAndroid/src/main/jni/react/jni/Android.mk 2022-01-11 17:41:29.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/V8/ReactAndroid/src/main/jni/react/jni/Android.mk 2022-01-12 15:04:31.000000000 -0800 -@@ -129,6 +129,7 @@ - $(call import-module,reactperflogger) - $(call import-module,hermes) - $(call import-module,runtimeexecutor) -+$(call import-module,v8jsi) - $(call import-module,react/renderer/runtimescheduler) - $(call import-module,react/nativemodule/core) - -@@ -147,5 +148,6 @@ - include $(REACT_SRC_DIR)/../hermes/reactexecutor/Android.mk - include $(REACT_SRC_DIR)/../hermes/instrumentation/Android.mk - include $(REACT_SRC_DIR)/modules/blob/jni/Android.mk -+include $(REACT_SRC_DIR)/v8executor/Android.mk - - include $(REACT_GENERATED_SRC_DIR)/codegen/jni/Android.mk diff --git a/android-patches/patches/V8/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp b/android-patches/patches/V8/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp deleted file mode 100644 index 747e4b3213a9a3..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +++ /dev/null @@ -1,18 +0,0 @@ ---- ./ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp 2021-11-08 14:22:26.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/V8/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp 2022-01-12 15:04:31.000000000 -0800 -@@ -92,6 +92,15 @@ - case ReactMarker::REACT_INSTANCE_INIT_STOP: - // These are not used on Android. - break; -+ case ReactMarker::BYTECODE_CREATION_FAILED: -+ JReactMarker::logMarker("BYTECODE_CREATION_FAILED"); -+ break; -+ case ReactMarker::BYTECODE_READ_FAILED: -+ JReactMarker::logMarker("BYTECODE_READ_FAILED", tag); -+ break; -+ case ReactMarker::BYTECODE_WRITE_FAILED: -+ JReactMarker::logMarker("BYTECODE_WRITE_FAILED"); -+ break; - } - } - diff --git a/android-patches/patches/V8/ReactAndroid/src/main/jni/third-party/v8jsi/Android.mk b/android-patches/patches/V8/ReactAndroid/src/main/jni/third-party/v8jsi/Android.mk deleted file mode 100644 index 559694b959fa08..00000000000000 --- a/android-patches/patches/V8/ReactAndroid/src/main/jni/third-party/v8jsi/Android.mk +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/ReactAndroid/src/main/jni/third-party/v8jsi/Android.mk b/ReactAndroid/src/main/jni/third-party/v8jsi/Android.mk -new file mode 100644 -index 0000000000..ca299e0278 ---- /dev/null -+++ b/ReactAndroid/src/main/jni/third-party/v8jsi/Android.mk -@@ -0,0 +1,17 @@ -+LOCAL_PATH:= $(call my-dir) -+include $(CLEAR_VARS) -+ -+ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) -+ LIB_PATH := $(V8_NUGET_DIR)/lib/droidarm/ship/x-none -+else ifeq ($(TARGET_ARCH_ABI),x86) -+ LIB_PATH := $(V8_NUGET_DIR)/lib/droidx86/ship/x-none -+else ifeq ($(TARGET_ARCH_ABI), arm64-v8a) -+ LIB_PATH := $(V8_NUGET_DIR)/lib/droidarm64/ship/x-none -+else ifeq ($(TARGET_ARCH_ABI), x86_64) -+ LIB_PATH := $(V8_NUGET_DIR)/lib/droidx64/ship/x-none -+endif -+ -+LOCAL_MODULE := v8jsi -+LOCAL_SRC_FILES := $(LIB_PATH)/libv8jsi.so -+LOCAL_EXPORT_C_INCLUDES := $(V8_NUGET_DIR)/headers -+include $(PREBUILT_SHARED_LIBRARY) -\ No newline at end of file diff --git a/android-patches/patches/V8/ReactCommon/cxxreact/ReactMarker.h b/android-patches/patches/V8/ReactCommon/cxxreact/ReactMarker.h deleted file mode 100644 index f9c8d102f2988b..00000000000000 --- a/android-patches/patches/V8/ReactCommon/cxxreact/ReactMarker.h +++ /dev/null @@ -1,14 +0,0 @@ ---- ./ReactCommon/cxxreact/ReactMarker.h 2021-11-08 14:22:26.000000000 -0800 -+++ /var/folders/vs/8_b205053dddbcv7btj0w0v80000gn/T/update-1h8V3n/merge/V8/ReactCommon/cxxreact/ReactMarker.h 2022-01-12 15:04:31.000000000 -0800 -@@ -28,7 +28,10 @@ - REGISTER_JS_SEGMENT_START, - REGISTER_JS_SEGMENT_STOP, - REACT_INSTANCE_INIT_START, -- REACT_INSTANCE_INIT_STOP -+ REACT_INSTANCE_INIT_STOP, -+ BYTECODE_CREATION_FAILED, -+ BYTECODE_READ_FAILED, -+ BYTECODE_WRITE_FAILED - }; - - #ifdef __APPLE__ diff --git a/android-patches/patches/V8/packages/rn-tester/android/app/build.gradle b/android-patches/patches/V8/packages/rn-tester/android/app/build.gradle deleted file mode 100644 index fa6755746682e0..00000000000000 --- a/android-patches/patches/V8/packages/rn-tester/android/app/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/packages/rn-tester/android/app/build.gradle b/packages/rn-tester/android/app/build.gradle -index cf7a24b4648..6083e54cf0e 100644 ---- a/packages/rn-tester/android/app/build.gradle -+++ b/packages/rn-tester/android/app/build.gradle -@@ -95,7 +95,7 @@ react { - - project.ext.react = [ - enableCodegen: true, // Keep this here until it's sync'ed to Android template. -- enableFabric: (System.getenv('USE_FABRIC') ?: 'true').toBoolean() -+ enableFabric: false - ] - - //apply from: "../../../../react.gradle" -@@ -162,6 +162,9 @@ android { - jsc { - dimension "vm" - } -+ v8 { -+ dimension "vm" -+ } - } - - defaultConfig { -@@ -304,8 +307,10 @@ if (enableCodegen) { - configureNdkBuildRelease.dependsOn(packageReactReleaseNdkLibs) - preHermesReleaseBuild.dependsOn(packageReactReleaseNdkLibs) - preJscReleaseBuild.dependsOn(packageReactReleaseNdkLibs) -+ preV8ReleaseBuild.dependsOn(packageReactReleaseNdkLibs) - configureNdkBuildDebug.dependsOn(packageReactDebugNdkLibs) - preHermesDebugBuild.dependsOn(packageReactDebugNdkLibs) - preJscDebugBuild.dependsOn(packageReactDebugNdkLibs) -+ preV8DebugBuild.dependsOn(packageReactDebugNdkLibs) - } - } diff --git a/android-patches/patches/V8/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java b/android-patches/patches/V8/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java deleted file mode 100644 index 994da713b1b62d..00000000000000 --- a/android-patches/patches/V8/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java -index 1a393ce051d..129a4a8dea2 100644 ---- a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java -+++ b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.java -@@ -7,11 +7,15 @@ - - package com.facebook.react.uiapp; - -+import static com.facebook.react.modules.systeminfo.AndroidInfoHelpers.getFriendlyDeviceName; -+ - import android.app.Application; - import android.content.Context; - import androidx.annotation.NonNull; - import androidx.annotation.Nullable; - import com.facebook.fbreact.specs.SampleTurboModule; -+import com.facebook.hermes.reactexecutor.HermesExecutorFactory; -+import com.facebook.react.jscexecutor.JSCExecutorFactory; - import com.facebook.react.ReactApplication; - import com.facebook.react.ReactInstanceManager; - import com.facebook.react.ReactNativeHost; -@@ -23,6 +27,7 @@ import com.facebook.react.bridge.JSIModuleProvider; - import com.facebook.react.bridge.JSIModuleSpec; - import com.facebook.react.bridge.JSIModuleType; - import com.facebook.react.bridge.JavaScriptContextHolder; -+import com.facebook.react.bridge.JavaScriptExecutorFactory; - import com.facebook.react.bridge.NativeModule; - import com.facebook.react.bridge.ReactApplicationContext; - import com.facebook.react.bridge.UIManager; -@@ -38,6 +43,7 @@ import com.facebook.react.uiapp.component.MyNativeViewManager; - import com.facebook.react.uimanager.ViewManager; - import com.facebook.react.uimanager.ViewManagerRegistry; - import com.facebook.react.views.text.ReactFontManager; -+import com.facebook.react.v8executor.V8ExecutorFactory; - import com.facebook.soloader.SoLoader; - import java.lang.reflect.InvocationTargetException; - import java.util.ArrayList; -@@ -51,6 +57,20 @@ public class RNTesterApplication extends Application implements ReactApplication - - private final ReactNativeHost mReactNativeHost = - new ReactNativeHost(this) { -+ @Override -+ public JavaScriptExecutorFactory getJavaScriptExecutorFactory() { -+ if (BuildConfig.FLAVOR.equals("hermes")) { -+ return new HermesExecutorFactory(); -+ } else if (BuildConfig.FLAVOR.equals("v8")) { -+ return new V8ExecutorFactory(getApplication().getPackageName(), getFriendlyDeviceName()); -+ } else if (BuildConfig.FLAVOR.equals("jsc")) { -+ SoLoader.loadLibrary("jscexecutor"); -+ return new JSCExecutorFactory(getApplication().getPackageName(), getFriendlyDeviceName()); -+ } else { -+ throw new IllegalArgumentException("Missing handler in getJavaScriptExecutorFactory for build flavor: " + BuildConfig.FLAVOR); -+ } -+ } -+ - @Override - public String getJSMainModuleName() { - return "packages/rn-tester/js/RNTesterApp.android"; diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 1c0c52e099c604..e12cef18ace7d3 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -563,8 +563,8 @@ SPEC CHECKSUMS: boost: 613e39eac4239cc72b15421247b5ab05361266a2 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: ed15e075aa758ac0e4c1f8b830bd4e4d40d669e8 - FBLazyVector: 87c82681971d2faef909347142bb79725f9141a5 - FBReactNativeSpec: 4a77572c14ef1f83838946aed59974b8fe8b6b7b + FBLazyVector: 60b63b875d9a3efc175d0c9e400ca47c434bc6d1 + FBReactNativeSpec: 62b8a10066cc7741c1876ef3abb859fc90faaaca Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c @@ -575,44 +575,44 @@ SPEC CHECKSUMS: Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 20113a0d46931b6f096cf8302c68691d75a456ff + glog: 42c4bf47024808486e90b25ea9e5ac3959047641 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 24c6da766832002a4a2aac5f79ee0ca50fbe8507 - RCTRequired: 11d93431c5d4988db55f9433e0563e1a7989f68e - RCTTypeSafety: 5d5fdcaf62a0d68712ecd5cdeffcf88af64f8927 - React: 463e80c3f7d427ecc68995a2945c35e857d6ac2a - React-callinvoker: a1152fd4dc4481bc5fb924da51d3a27033157484 + RCT-Folly: 43adc9ce880eb76792f88c011773cb5c664c1419 + RCTRequired: 711af33fea12120e1e2cd9575de500b1163e0215 + RCTTypeSafety: b68c55552c09b131e99ccffd4394945c6e153e14 + React: 8c7b6cbe6834cdb7eba35d92eb85eab9b8381d03 + React-callinvoker: d4b0c66588902f0ba389c5bef7c014e18a571d7d React-Codegen: 61a79489c164568e1575cc662fa7c9a167215dcc - React-Core: 1e54ad57d6e8fcf6bb26576009dbd98139dc9168 - React-CoreModules: 31a07af1ecfd7cc81f2d395f5b909655a4b99014 - React-cxxreact: 94334221103fc34257d09d91e052325b16652503 - React-jsi: 8dd25c25af4860ec47b33b5612a18e52f339c753 - React-jsiexecutor: 15245ee388f39917abe910e19ce15b6dc8297ba0 - React-jsinspector: 3daa4f43719d2d30303492f2e7226ef2594f4fe5 - React-logger: 33a5bbf9bf2b58c237af94a2785e9a9612997de3 - React-perflogger: f22bd7f4f20fc11daf6e832178b6640a113527ea - React-RCTActionSheet: 7b09b2e8f9a8550dd18817d8bbce2a9bf8dd588c - React-RCTAnimation: 592f8c56ec9795bcd7cd8c28e017c44d13c811b2 - React-RCTBlob: a4d357536f7262f15577200974f8c8adb973764b - React-RCTImage: f8c002d648294cc0755492ad5c0142914accb41b - React-RCTLinking: 66e19e29e9594bd16106e435fa6adc2833c4a062 - React-RCTNetwork: 4da7275b58c1e03244b52c14a521b08b09f4881b - React-RCTPushNotification: 075e3ace8487460355ea1d73dcc95b45ff5b135e - React-RCTSettings: 49be491ecf203570a9a3334183cff6123e3d7e8d - React-RCTTest: e2a4b204a0f92c0e95df838f055dc7cb31b0682c - React-RCTText: 12f877aa4d92e21319a2ab57481f60a42936b06b - React-RCTVibration: 612ffc0f4f119878d64e76de954af68f9ce73c04 - React-runtimeexecutor: c7146105f917b46411fd56b70ba76a6eeed86293 + React-Core: ef10b29be647e9fe6541bee92945c052a2227be7 + React-CoreModules: 43dadecdb2b2c83ef74443941cdf869b429c835c + React-cxxreact: 1d3662e60451049d10bbdcc172d1360e3af4e7f1 + React-jsi: 19eb9069d3f323ac5ffc941707f3f6739f48f2b9 + React-jsiexecutor: 3e39bb047dfbe02d37b6144ca149f0c880bd9ec6 + React-jsinspector: ce7b508215e9f720c345ccd48353c8e426604c09 + React-logger: f624f2cf83c69f2455874ae6f5521475611c5a4f + React-perflogger: a9a9d7a5f9f47c5b56193e3c114fb16ba3a184d2 + React-RCTActionSheet: 1c27530aba6834d35e2005570e96a97c18eb445f + React-RCTAnimation: 73d2ed8c8eecf9dde97c5e4be05d2adbbda58f2c + React-RCTBlob: 43eb87c4b2d788197ffad01c70bfc17e4a1ac6ea + React-RCTImage: 40867075e9927fe2c913e3a852043850ce8d5d6d + React-RCTLinking: 565e4d6fdfd2271935c9d3e2510b6bd2fa372b8f + React-RCTNetwork: 9a0cbc84ba053d739aca05faa3568d366262bdd0 + React-RCTPushNotification: c53e9e576b49a01f63e9649bd7a6203c0c03d6d8 + React-RCTSettings: 7195a08c20f21c0efa71aeacd488485ea80a44d3 + React-RCTTest: 271b54801041f7c9b2a0dbe71827550e84a5bdbb + React-RCTText: b8a9723313c024ca592fa46b040fbb372722525c + React-RCTVibration: 2b44f706a45a1a82458b5d05f394cb601e07da2a + React-runtimeexecutor: 3010cca0a32b0b0ae87e0aae3265f86c4676f501 React-TurboModuleCxx-RNW: 881411415eafe818f9cc3c4016167cc3d219402b - React-TurboModuleCxx-WinRTPort: f08e10e3f2fe09f3013f262b71a3fca393ad6a49 - ReactCommon: 2333fbab287f61ec2f7f4f153267e2f9182e0b73 - ScreenshotManager: 18f0fbb9ba2029c99a88bdc8af18d68297bbc2a9 + React-TurboModuleCxx-WinRTPort: 1fd3447c284a28a6073bfb5c3ec7e12079209fc1 + ReactCommon: 545c27c21c516ab8c40af635cdcc0e20591d5c8c + ScreenshotManager: b378292226c78474e70b139ba2e19f584836c520 SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: aa7d3e09d082a69f610ed7b0b3098b94cdda6e84 + Yoga: 8d41f98023fe4d9e60d4283ec1ac3a3ae4e7f863 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a PODFILE CHECKSUM: cbf4f9be33910397d5f84dd4fcbe56d3d61d42fa -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3