diff --git a/js/react_native/android/gradle.properties b/js/react_native/android/gradle.properties index 3461ce4919d38..760f20941e4a1 100644 --- a/js/react_native/android/gradle.properties +++ b/js/react_native/android/gradle.properties @@ -13,7 +13,7 @@ org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF #Tue Jan 26 17:36:02 PST 2021 android.enableJetifier=true android.useAndroidX=true -OnnxruntimeModule_buildToolsVersion=33.0.0 +OnnxruntimeModule_buildToolsVersion=34.0.0 OnnxruntimeModule_compileSdkVersion=34 OnnxruntimeModule_minSdkVersion=24 OnnxruntimeModule_targetSdkVersion=34 diff --git a/js/react_native/babel.config.js b/js/react_native/babel.config.js index e2240f1f51f8b..4cdc3a76687e4 100644 --- a/js/react_native/babel.config.js +++ b/js/react_native/babel.config.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = { - presets: ['module:metro-react-native-babel-preset'], + presets: ['module:@react-native/babel-preset'], }; diff --git a/js/react_native/e2e/android/app/build.gradle b/js/react_native/e2e/android/app/build.gradle index 68eaacc1908c3..cb00b814c0abc 100644 --- a/js/react_native/e2e/android/app/build.gradle +++ b/js/react_native/e2e/android/app/build.gradle @@ -1,8 +1,6 @@ apply plugin: "com.android.application" apply plugin: "com.facebook.react" -import com.android.build.OutputFile - /** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. @@ -13,8 +11,8 @@ react { // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen - // codegenDir = file("../node_modules/react-native-codegen") + // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen + // codegenDir = file("../node_modules/@react-native/codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js // cliFile = file("../node_modules/react-native/cli.js") @@ -52,14 +50,6 @@ react { // hermesFlags = ["-O", "-output-source-map"] } -/** - * Set this to true to create four separate APKs instead of one, - * one for each native architecture. This is useful if you don't - * use App Bundles (https://developer.android.com/guide/app-bundle/) - * and want to have separate APKs to upload to the Play Store. - */ -def enableSeparateBuildPerCPUArchitecture = false - /** * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ @@ -78,18 +68,10 @@ def enableProguardInReleaseBuilds = false */ def jscFlavor = 'org.webkit:android-jsc:+' -/** - * Private function to get the list of Native Architectures you want to build. - * This reads the value from reactNativeArchitectures in your gradle.properties - * file and works together with the --active-arch-only flag of react-native run-android. - */ -def reactNativeArchitectures() { - def value = project.getProperties().get("reactNativeArchitectures") - return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] -} android { + buildToolsVersion rootProject.ext.buildToolsVersion compileSdkVersion rootProject.ext.compileSdkVersion namespace "com.example.reactnativeonnxruntimemodule" compileOptions { @@ -109,14 +91,6 @@ android { testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - splits { - abi { - reset() - enable enableSeparateBuildPerCPUArchitecture - universalApk false // If true, also generate a universal APK - include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" - } - } signingConfigs { debug { storeFile rootProject.file('debug.keystore') @@ -135,20 +109,6 @@ android { proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro" } } - // applicationVariants are e.g. debug, release - applicationVariants.all { variant -> - variant.outputs.each { output -> - // For each separate APK per architecture, set a unique version code as described here: - // https://developer.android.com/studio/build/configure-apk-splits.html - def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] - def abi = output.getFilter(OutputFile.ABI) - if (abi != null) { // null for the universal-debug, universal-release variants - output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode - } - - } - } } repositories { @@ -164,19 +124,8 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - - implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" + implementation("com.facebook.react:flipper-integration") implementation 'androidx.test.ext:junit:1.1.5' - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { - exclude group:'com.facebook.fbjni' - } - debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { - exclude group:'com.facebook.flipper' - exclude group:'com.squareup.okhttp3', module:'okhttp' - } - debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { - exclude group:'com.facebook.flipper' - } if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") diff --git a/js/react_native/e2e/android/app/src/debug/AndroidManifest.xml b/js/react_native/e2e/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index fa26aa56e1c14..0000000000000 --- a/js/react_native/e2e/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/js/react_native/e2e/android/app/src/debug/java/com/example/reactnativeonnxruntimemodule/ReactNativeFlipper.java b/js/react_native/e2e/android/app/src/debug/java/com/example/reactnativeonnxruntimemodule/ReactNativeFlipper.java deleted file mode 100644 index 3f0a2311b6b6f..0000000000000 --- a/js/react_native/e2e/android/app/src/debug/java/com/example/reactnativeonnxruntimemodule/ReactNativeFlipper.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - *

This source code is licensed under the MIT license found in the LICENSE file in the root - * directory of this source tree. - */ -package com.example.reactnativeonnxruntimemodule; - -import android.content.Context; -import com.facebook.flipper.android.AndroidFlipperClient; -import com.facebook.flipper.android.utils.FlipperUtils; -import com.facebook.flipper.core.FlipperClient; -import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; -import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; -import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; -import com.facebook.flipper.plugins.inspector.DescriptorMapping; -import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; -import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; -import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; -import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; -import com.facebook.react.ReactInstanceEventListener; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.modules.network.NetworkingModule; -import okhttp3.OkHttpClient; - -/** - * Class responsible of loading Flipper inside your React Native application. This is the debug - * flavor of it. Here you can add your own plugins and customize the Flipper setup. - */ -public class ReactNativeFlipper { - public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { - if (FlipperUtils.shouldEnableFlipper(context)) { - final FlipperClient client = AndroidFlipperClient.getInstance(context); - - client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); - client.addPlugin(new DatabasesFlipperPlugin(context)); - client.addPlugin(new SharedPreferencesFlipperPlugin(context)); - client.addPlugin(CrashReporterPlugin.getInstance()); - - NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); - NetworkingModule.setCustomClientBuilder( - new NetworkingModule.CustomClientBuilder() { - @Override - public void apply(OkHttpClient.Builder builder) { - builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); - } - }); - client.addPlugin(networkFlipperPlugin); - client.start(); - - // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized - // Hence we run if after all native modules have been initialized - ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); - if (reactContext == null) { - reactInstanceManager.addReactInstanceEventListener( - new ReactInstanceEventListener() { - @Override - public void onReactContextInitialized(ReactContext reactContext) { - reactInstanceManager.removeReactInstanceEventListener(this); - reactContext.runOnNativeModulesQueueThread( - new Runnable() { - @Override - public void run() { - client.addPlugin(new FrescoFlipperPlugin()); - } - }); - } - }); - } else { - client.addPlugin(new FrescoFlipperPlugin()); - } - } - } -} \ No newline at end of file diff --git a/js/react_native/e2e/android/app/src/main/AndroidManifest.xml b/js/react_native/e2e/android/app/src/main/AndroidManifest.xml index d219c7c18f3c2..a44d8099522a9 100644 --- a/js/react_native/e2e/android/app/src/main/AndroidManifest.xml +++ b/js/react_native/e2e/android/app/src/main/AndroidManifest.xml @@ -24,7 +24,6 @@ - diff --git a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MainActivity.java b/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MainActivity.java deleted file mode 100644 index e2e48633ddb6e..0000000000000 --- a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.example.reactnativeonnxruntimemodule; - -import com.facebook.react.ReactActivity; - -public class MainActivity extends ReactActivity { - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "OnnxruntimeModuleExample"; - } -} diff --git a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MainApplication.java b/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MainApplication.java deleted file mode 100644 index 2c59e5dd3d3b1..0000000000000 --- a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MainApplication.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.example.reactnativeonnxruntimemodule; - -import ai.onnxruntime.reactnative.OnnxruntimePackage; -import android.app.Application; -import android.content.Context; -import com.facebook.react.PackageList; -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.soloader.SoLoader; -import java.lang.reflect.InvocationTargetException; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - private static Context appContext; - - private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - @SuppressWarnings("UnnecessaryLocalVariable") List packages = new PackageList(this).getPackages(); - packages.add(new DataHandlerPackage()); - - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - appContext = getApplicationContext(); - SoLoader.init(this, /* native exopackage */ false); - initializeFlipper( - this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled - } - - public static Context getAppContext() { return appContext; } - - /** - * Loads Flipper in React Native templates. - * - * @param context - */ - private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { - if (BuildConfig.DEBUG) { - try { - /* - We use reflection here to pick up the class that initializes Flipper, - since Flipper library is not available in release mode - */ - Class aClass = Class.forName("com.onnxruntimereactnativeExample.ReactNativeFlipper"); - aClass.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) - .invoke(null, context, reactInstanceManager); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } - } -} diff --git a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/DataHandlerPackage.java b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/DataHandlerPackage.java similarity index 94% rename from js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/DataHandlerPackage.java rename to js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/DataHandlerPackage.java index fa321e15c615b..adfd4e0bb755a 100644 --- a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/DataHandlerPackage.java +++ b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/DataHandlerPackage.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.example.reactnativeonnxruntimemodule; +package com.reactnativeonnxruntimemodule; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.NativeModule; diff --git a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MNISTDataHandler.java b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MNISTDataHandler.java similarity index 99% rename from js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MNISTDataHandler.java rename to js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MNISTDataHandler.java index a458901b5314c..c5ba051b6b3ad 100644 --- a/js/react_native/e2e/android/app/src/main/java/com/example/reactnativeonnxruntimemodule/MNISTDataHandler.java +++ b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MNISTDataHandler.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.example.reactnativeonnxruntimemodule; +package com.reactnativeonnxruntimemodule; import static java.util.stream.Collectors.joining; diff --git a/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MainActivity.kt b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MainActivity.kt new file mode 100644 index 0000000000000..e572f50dfdab1 --- /dev/null +++ b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MainActivity.kt @@ -0,0 +1,22 @@ +package com.reactnativeonnxruntimemodule + +import com.facebook.react.ReactActivity +import com.facebook.react.ReactActivityDelegate +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled +import com.facebook.react.defaults.DefaultReactActivityDelegate + +class MainActivity : ReactActivity() { + + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + override fun getMainComponentName(): String = "OnnxruntimeModuleExample" + + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = + DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) +} \ No newline at end of file diff --git a/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MainApplication.kt b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MainApplication.kt new file mode 100644 index 0000000000000..6abd8503872e6 --- /dev/null +++ b/js/react_native/e2e/android/app/src/main/java/com/reactnativeonnxruntimemodule/MainApplication.kt @@ -0,0 +1,48 @@ +package com.rndiffapp + +import android.app.Application +import com.facebook.react.PackageList +import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost +import com.facebook.react.ReactNativeHost +import com.facebook.react.ReactPackage +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load +import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost +import com.facebook.react.defaults.DefaultReactNativeHost +import com.facebook.react.flipper.ReactNativeFlipper +import com.facebook.soloader.SoLoader + +class MainApplication : Application(), ReactApplication { + companion object { + private var appContext: Context + fun getAppContext(): Context = appContext + } + override val reactNativeHost: ReactNativeHost = + object : DefaultReactNativeHost(this) { + override fun getPackages(): List = + PackageList(this).packages.apply { + // Packages that cannot be autolinked yet can be added manually here, for example: + // add(MyReactNativePackage()) + } + + override fun getJSMainModuleName(): String = "index" + + override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG + + override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED + override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED + } + + override val reactHost: ReactHost + get() = getDefaultReactHost(this.applicationContext, reactNativeHost) + override fun onCreate() { + super.onCreate() + appContext = applicationContext + SoLoader.init(this, false) + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + // If you opted-in for the New Architecture, we load the native entry point for this app. + load() + } + ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager) + } +} \ No newline at end of file diff --git a/js/react_native/e2e/android/build.gradle b/js/react_native/e2e/android/build.gradle index abe57d3d4521d..9ad8256fc52dc 100644 --- a/js/react_native/e2e/android/build.gradle +++ b/js/react_native/e2e/android/build.gradle @@ -2,11 +2,11 @@ buildscript { ext { - buildToolsVersion = "33.0.0" + buildToolsVersion = "34.0.0" minSdkVersion = 24 compileSdkVersion = 34 targetSdkVersion = 34 - kotlinVersion = "1.5.30" + kotlinVersion = "1.8.0" } repositories { google() @@ -14,9 +14,11 @@ buildscript { } dependencies { classpath('com.android.tools.build:gradle:7.4.2') - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") classpath("com.facebook.react:react-native-gradle-plugin") + + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -43,3 +45,5 @@ allprojects { maven { url 'https://www.jitpack.io' } } } + +apply plugin: "com.facebook.react.rootproject" \ No newline at end of file diff --git a/js/react_native/e2e/android/gradle.properties b/js/react_native/e2e/android/gradle.properties index 92d178de62ce2..f736e9dbd86d0 100644 --- a/js/react_native/e2e/android/gradle.properties +++ b/js/react_native/e2e/android/gradle.properties @@ -19,7 +19,6 @@ android.useAndroidX=true android.enableJetifier=true -FLIPPER_VERSION=0.182.0 org.gradle.jvmargs=-Xmx4096M # Use this property to enable or disable the Hermes JS engine. diff --git a/js/react_native/e2e/android/gradle/wrapper/gradle-wrapper.properties b/js/react_native/e2e/android/gradle/wrapper/gradle-wrapper.properties index 36268b17b88ae..d11cdd907dd9d 100644 --- a/js/react_native/e2e/android/gradle/wrapper/gradle-wrapper.properties +++ b/js/react_native/e2e/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/js/react_native/e2e/babel.config.js b/js/react_native/e2e/babel.config.js index 96ef381f7825d..ba81fa7f9bb5d 100644 --- a/js/react_native/e2e/babel.config.js +++ b/js/react_native/e2e/babel.config.js @@ -4,7 +4,7 @@ const path = require('path'); const pak = require('../package.json'); module.exports = { - presets: ['module:metro-react-native-babel-preset'], + presets: ['module:@react-native/babel-preset'], plugins: [ [ 'module-resolver', diff --git a/js/react_native/e2e/ios/OnnxruntimeModuleExample/Info.plist b/js/react_native/e2e/ios/OnnxruntimeModuleExample/Info.plist index d73af62336182..7f8698fac0881 100644 --- a/js/react_native/e2e/ios/OnnxruntimeModuleExample/Info.plist +++ b/js/react_native/e2e/ios/OnnxruntimeModuleExample/Info.plist @@ -28,11 +28,10 @@ NSAllowsArbitraryLoads - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking diff --git a/js/react_native/e2e/ios/Podfile b/js/react_native/e2e/ios/Podfile index ba2226c144826..95c915cb41dca 100644 --- a/js/react_native/e2e/ios/Podfile +++ b/js/react_native/e2e/ios/Podfile @@ -19,11 +19,6 @@ target 'OnnxruntimeModuleExample' do use_react_native!( :path => config[:reactNativePath], - # Hermes is now enabled by default. Disable by setting this flag to false. - # Upcoming versions of React Native may rely on get_default_flags(), but - # we make it explicit here to aid in the React Native upgrade process. - - :hermes_enabled => false, # :flipper_configuration => FlipperConfiguration.enabled, :app_path => "#{Pod::Config.instance.installation_root}/.." ) @@ -43,6 +38,5 @@ target 'OnnxruntimeModuleExample' do config[:reactNativePath], :mac_catalyst_enabled => false, ) - __apply_Xcode_12_5_M1_post_install_workaround(installer) end end diff --git a/js/react_native/ios/Podfile b/js/react_native/ios/Podfile index 95e43ee369910..c252d18965ad5 100644 --- a/js/react_native/ios/Podfile +++ b/js/react_native/ios/Podfile @@ -14,16 +14,9 @@ use_frameworks! def shared config = use_native_modules! - # Flags change depending on the env values. - flags = get_default_flags() - use_react_native!( :path => config[:reactNativePath], - # Hermes is now enabled by default. Disable by setting this flag to false. - # Upcoming versions of React Native may rely on get_default_flags(), but - # we make it explicit here to aid in the React Native upgrade process. - :hermes_enabled => false, - :fabric_enabled => false, + :app_path => "#{Pod::Config.instance.installation_root}/.." ) @@ -50,5 +43,4 @@ post_install do |installer| installer, :mac_catalyst_enabled => false ) - __apply_Xcode_12_5_M1_post_install_workaround(installer) end \ No newline at end of file diff --git a/js/react_native/package.json b/js/react_native/package.json index 6b6568814a031..82b76bc067699 100644 --- a/js/react_native/package.json +++ b/js/react_native/package.json @@ -2,7 +2,7 @@ "react-native": "lib/index", "module": "dist/module/index", "engines": { - "node": ">=16" + "node": ">=18" }, "jest": { "modulePathIgnorePatterns": [ diff --git a/js/react_native/tsconfig.json b/js/react_native/tsconfig.json index 2817d5512a186..20e6bcbb4cf01 100644 --- a/js/react_native/tsconfig.json +++ b/js/react_native/tsconfig.json @@ -1,27 +1,3 @@ { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "onnxruntime-react-native": ["./lib/index"] - }, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react", - "lib": ["esnext"], - "module": "esnext", - "moduleResolution": "node", - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noImplicitUseStrict": false, - "noStrictGenericChecks": false, - "noUnusedLocals": true, - "noUnusedParameters": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "strict": true, - "target": "esnext", - "newLine": "LF" - } -} + "extends": "@react-native/typescript-config/tsconfig.json" +} \ No newline at end of file