diff --git a/HelloWorld/.buckconfig b/HelloWorld/.buckconfig deleted file mode 100644 index 934256cb..00000000 --- a/HelloWorld/.buckconfig +++ /dev/null @@ -1,6 +0,0 @@ - -[android] - target = Google Inc.:Google APIs:23 - -[maven_repositories] - central = https://repo1.maven.org/maven2 diff --git a/HelloWorld/.flowconfig b/HelloWorld/.flowconfig deleted file mode 100644 index 3782e447..00000000 --- a/HelloWorld/.flowconfig +++ /dev/null @@ -1,66 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore polyfills -node_modules/react-native/Libraries/polyfills/.* - -; Flow doesn't support platforms -.*/Libraries/Utilities/LoadingView.js - -.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ - -[untyped] -.*/node_modules/@react-native-community/cli/.*/.* - -[include] - -[libs] -node_modules/react-native/interface.js -node_modules/react-native/flow/ - -[options] -emoji=true - -exact_by_default=true - -format.bracket_spacing=false - -module.file_ext=.js -module.file_ext=.json -module.file_ext=.ios.js - -munge_underscores=true - -module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' -module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FlowFixMeProps -suppress_type=$FlowFixMeState - -[lints] -sketchy-null-number=warn -sketchy-null-mixed=warn -sketchy-number=warn -untyped-type-import=warn -nonstrict-import=warn -deprecated-type=warn -unsafe-getters-setters=warn -unnecessary-invariant=warn - -[strict] -deprecated-type -nonstrict-import -sketchy-null -unclear-type -unsafe-getters-setters -untyped-import -untyped-type-import - -[version] -^0.182.0 diff --git a/HelloWorld/.gitignore b/HelloWorld/.gitignore index 6f0aeb93..8c470de6 100644 --- a/HelloWorld/.gitignore +++ b/HelloWorld/.gitignore @@ -31,18 +31,15 @@ local.properties *.iml *.hprof .cxx/ +*.keystore +!debug.keystore + # node.js # node_modules/ npm-debug.log yarn-error.log -# BUCK -buck-out/ -\.buckd/ -*.keystore -!debug.keystore - # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the @@ -61,3 +58,7 @@ buck-out/ # Ruby / CocoaPods /ios/Pods/ /vendor/bundle/ + + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* diff --git a/HelloWorld/Gemfile b/HelloWorld/Gemfile index 5efda89f..1142b1b2 100644 --- a/HelloWorld/Gemfile +++ b/HelloWorld/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '2.7.5' +ruby '>= 2.6.10' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods', '>= 1.11.3' diff --git a/HelloWorld/_node-version b/HelloWorld/_node-version index 19c7bdba..25bf17fc 100644 --- a/HelloWorld/_node-version +++ b/HelloWorld/_node-version @@ -1 +1 @@ -16 \ No newline at end of file +18 \ No newline at end of file diff --git a/HelloWorld/_ruby-version b/HelloWorld/_ruby-version deleted file mode 100644 index a603bb50..00000000 --- a/HelloWorld/_ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.5 diff --git a/HelloWorld/android/app/_BUCK b/HelloWorld/android/app/_BUCK deleted file mode 100644 index 0e779048..00000000 --- a/HelloWorld/android/app/_BUCK +++ /dev/null @@ -1,55 +0,0 @@ -# To learn about Buck see [Docs](https://buckbuild.com/). -# To run your application with Buck: -# - install Buck -# - `npm start` - to start the packager -# - `cd android` -# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` -# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck -# - `buck install -r android/app` - compile, install and run application -# - -load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") - -lib_deps = [] - -create_aar_targets(glob(["libs/*.aar"])) - -create_jar_targets(glob(["libs/*.jar"])) - -android_library( - name = "all-libs", - exported_deps = lib_deps, -) - -android_library( - name = "app-code", - srcs = glob([ - "src/main/java/**/*.java", - ]), - deps = [ - ":all-libs", - ":build_config", - ":res", - ], -) - -android_build_config( - name = "build_config", - package = "com.helloworld", -) - -android_resource( - name = "res", - package = "com.helloworld", - res = "src/main/res", -) - -android_binary( - name = "app", - keystore = "//android/keystores:debug", - manifest = "src/main/AndroidManifest.xml", - package_type = "debug", - deps = [ - ":app-code", - ], -) diff --git a/HelloWorld/android/app/build.gradle b/HelloWorld/android/app/build.gradle index 608db2ce..cb8ee85a 100644 --- a/HelloWorld/android/app/build.gradle +++ b/HelloWorld/android/app/build.gradle @@ -1,127 +1,93 @@ apply plugin: "com.android.application" +apply plugin: "com.facebook.react" import com.android.build.OutputFile -import org.apache.tools.ant.taskdefs.condition.Os + /** - * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets - * and bundleReleaseJsAndAssets). - * These basically call `react-native bundle` with the correct arguments during the Android build - * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the - * bundle directly from the development server. Below you can see all the possible configurations - * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "../../node_modules/react-native/react.gradle"` line. - * - * project.ext.react = [ - * // the name of the generated asset file containing your JS bundle - * bundleAssetName: "index.android.bundle", - * - * // the entry file for bundle generation. If none specified and - * // "index.android.js" exists, it will be used. Otherwise "index.js" is - * // default. Can be overridden with ENTRY_FILE environment variable. - * entryFile: "index.android.js", - * - * // https://reactnative.dev/docs/performance#enable-the-ram-format - * bundleCommand: "ram-bundle", - * - * // whether to bundle JS and assets in debug mode - * bundleInDebug: false, - * - * // whether to bundle JS and assets in release mode - * bundleInRelease: true, - * - * // whether to bundle JS and assets in another build variant (if configured). - * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property can be in the following formats - * // 'bundleIn${productFlavor}${buildType}' - * // 'bundleIn${buildType}' - * // bundleInFreeDebug: true, - * // bundleInPaidRelease: true, - * // bundleInBeta: true, - * - * // whether to disable dev mode in custom build variants (by default only disabled in release) - * // for example: to disable dev mode in the staging build type (if configured) - * devDisabledInStaging: true, - * // The configuration property can be in the following formats - * // 'devDisabledIn${productFlavor}${buildType}' - * // 'devDisabledIn${buildType}' - * - * // the root of your project, i.e. where "package.json" lives - * root: "../../", - * - * // where to put the JS bundle asset in debug mode - * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", - * - * // where to put the JS bundle asset in release mode - * jsBundleDirRelease: "$buildDir/intermediates/assets/release", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in debug mode - * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in release mode - * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", - * - * // by default the gradle tasks are skipped if none of the JS files or assets change; this means - * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to - * // date; if you have any other folders that you want to ignore for performance reasons (gradle - * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ - * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"], - * - * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"], - * - * // supply additional arguments to the packager - * extraPackagerArgs: [] - * ] + * 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. */ - -project.ext.react = [ - enableHermes: true, // clean and rebuild if changing -] - -apply from: "../../node_modules/react-native/react.gradle" +react { + /* Folders */ + // The root of your project, i.e. where "package.json" lives. Default is '..' + // 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 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") + /* Variants */ + // The list of variants to that are debuggable. For those we're going to + // skip the bundling of the JS bundle and the assets. By default is just 'debug'. + // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. + // debuggableVariants = ["liteDebug", "prodDebug"] + /* Bundling */ + // A list containing the node command and its flags. Default is just 'node'. + // nodeExecutableAndArgs = ["node"] + // + // The command to run when bundling. By default is 'bundle' + // bundleCommand = "ram-bundle" + // + // The path to the CLI configuration file. Default is empty. + // bundleConfig = file(../rn-cli.config.js) + // + // The name of the generated asset file containing your JS bundle + // bundleAssetName = "MyApplication.android.bundle" + // + // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' + // entryFile = file("../js/MyApplication.android.js") + // + // A list of extra flags to pass to the 'bundle' commands. + // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle + // extraPackagerArgs = [] + /* Hermes Commands */ + // The hermes compiler command to run. By default it is 'hermesc' + // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" + // + // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" + // hermesFlags = ["-O", "-output-source-map"] +} /** - * Set this to true to create two separate APKs instead of one: - * - An APK that only works on ARM devices - * - An APK that only works on x86 devices - * The advantage is the size of the APK is reduced by about 4MB. - * Upload all the APKs to the Play Store and people will download - * the correct one based on the CPU architecture of their device. + * 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 /** - * Run Proguard to shrink the Java bytecode in release builds. + * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ def enableProguardInReleaseBuilds = false - /** - * The preferred build flavor of JavaScriptCore. + * The preferred build flavor of JavaScriptCore (JSC) * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that - * give correct results when using with locales other than en-US. Note that + * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' /** - * Whether to enable the Hermes VM. - * - * This should be set on project.ext.react and that value will be read here. If it is not set - * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode - * and the benefits of using Hermes will therefore be sharply reduced. - */ -def enableHermes = project.ext.react.get("enableHermes", false); - -/** - * Architectures to build native code for. + * 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") @@ -132,77 +98,16 @@ android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion - + namespace "com.helloworld" defaultConfig { applicationId "com.helloworld" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" - buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() - - if (isNewArchitectureEnabled()) { - // We configure the CMake build only if you decide to opt-in for the New Architecture. - externalNativeBuild { - cmake { - arguments "-DPROJECT_BUILD_DIR=$buildDir", - "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", - "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", - "-DNODE_MODULES_DIR=$rootDir/../node_modules", - "-DANDROID_STL=c++_shared" - } - } - if (!enableSeparateBuildPerCPUArchitecture) { - ndk { - abiFilters (*reactNativeArchitectures()) - } - } - } - } - - if (isNewArchitectureEnabled()) { - // We configure the NDK build only if you decide to opt-in for the New Architecture. - externalNativeBuild { - cmake { - path "$projectDir/src/main/jni/CMakeLists.txt" - } - } - def reactAndroidProjectDir = project(':ReactAndroid').projectDir - def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { - dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") - from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") - into("$buildDir/react-ndk/exported") - } - def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { - dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") - from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") - into("$buildDir/react-ndk/exported") - } - afterEvaluate { - // If you wish to add a custom TurboModule or component locally, - // you should uncomment this line. - // preBuild.dependsOn("generateCodegenArtifactsFromSchema") - preDebugBuild.dependsOn(packageReactNdkDebugLibs) - preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) - - // Due to a bug inside AGP, we have to explicitly set a dependency - // between configureCMakeDebug* tasks and the preBuild tasks. - // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 - configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) - configureCMakeDebug.dependsOn(preDebugBuild) - reactNativeArchitectures().each { architecture -> - tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { - dependsOn("preDebugBuild") - } - tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { - dependsOn("preReleaseBuild") - } - } - } - } - + } splits { - abi { + abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK @@ -248,65 +153,19 @@ android { } dependencies { - implementation fileTree(dir: "libs", include: ["*.jar"]) - - //noinspection GradleDynamicVersion - implementation "com.facebook.react:react-native:+" // From node_modules - - implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" - - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { - exclude group:'com.facebook.fbjni' - } - + // 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") + debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") 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 (enableHermes) { - //noinspection GradleDynamicVersion - implementation("com.facebook.react:hermes-engine:+") { // From node_modules - exclude group:'com.facebook.fbjni' - } + debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") + if (hermesEnabled.toBoolean()) { + implementation("com.facebook.react:hermes-android") } else { implementation jscFlavor } } - -if (isNewArchitectureEnabled()) { - // If new architecture is enabled, we let you build RN from source - // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. - // This will be applied to all the imported transtitive dependency. - configurations.all { - resolutionStrategy.dependencySubstitution { - substitute(module("com.facebook.react:react-native")) - .using(project(":ReactAndroid")) - .because("On New Architecture we're building React Native from source") - substitute(module("com.facebook.react:hermes-engine")) - .using(project(":ReactAndroid:hermes-engine")) - .because("On New Architecture we're building Hermes from source") - } - } -} - -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.implementation - into 'libs' -} - apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) -def isNewArchitectureEnabled() { - // To opt-in for the New Architecture, you can either: - // - Set `newArchEnabled` to true inside the `gradle.properties` file - // - Invoke gradle with `-newArchEnabled=true` - // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` - return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" -} diff --git a/HelloWorld/android/app/build_defs.bzl b/HelloWorld/android/app/build_defs.bzl deleted file mode 100644 index fff270f8..00000000 --- a/HelloWorld/android/app/build_defs.bzl +++ /dev/null @@ -1,19 +0,0 @@ -"""Helper definitions to glob .aar and .jar targets""" - -def create_aar_targets(aarfiles): - for aarfile in aarfiles: - name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] - lib_deps.append(":" + name) - android_prebuilt_aar( - name = name, - aar = aarfile, - ) - -def create_jar_targets(jarfiles): - for jarfile in jarfiles: - name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] - lib_deps.append(":" + name) - prebuilt_jar( - name = name, - binary_jar = jarfile, - ) diff --git a/HelloWorld/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/HelloWorld/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java index 8ed784fe..35c64dbe 100644 --- a/HelloWorld/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java +++ b/HelloWorld/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java @@ -17,7 +17,7 @@ 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.react.ReactFlipperPlugin; + import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; import com.facebook.react.ReactInstanceEventListener; import com.facebook.react.ReactInstanceManager; @@ -25,13 +25,18 @@ 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 ReactFlipperPlugin()); + client.addPlugin(new DatabasesFlipperPlugin(context)); client.addPlugin(new SharedPreferencesFlipperPlugin(context)); client.addPlugin(CrashReporterPlugin.getInstance()); diff --git a/HelloWorld/android/app/src/main/AndroidManifest.xml b/HelloWorld/android/app/src/main/AndroidManifest.xml index 7ba57ca1..4122f36a 100644 --- a/HelloWorld/android/app/src/main/AndroidManifest.xml +++ b/HelloWorld/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/HelloWorld/android/app/src/main/java/com/helloworld/MainActivity.java b/HelloWorld/android/app/src/main/java/com/helloworld/MainActivity.java index 405d80a8..96fcdf2d 100644 --- a/HelloWorld/android/app/src/main/java/com/helloworld/MainActivity.java +++ b/HelloWorld/android/app/src/main/java/com/helloworld/MainActivity.java @@ -2,7 +2,8 @@ import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.ReactRootView; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactActivityDelegate; public class MainActivity extends ReactActivity { @@ -16,33 +17,19 @@ protected String getMainComponentName() { } /** - * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and - * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer - * (Paper). + * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link + * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React + * (aka React 18) with two boolean flags. */ @Override protected ReactActivityDelegate createReactActivityDelegate() { - return new MainActivityDelegate(this, getMainComponentName()); - } - - public static class MainActivityDelegate extends ReactActivityDelegate { - public MainActivityDelegate(ReactActivity activity, String mainComponentName) { - super(activity, mainComponentName); - } - - @Override - protected ReactRootView createRootView() { - ReactRootView reactRootView = new ReactRootView(getContext()); - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); - return reactRootView; - } - - @Override - protected boolean isConcurrentRootEnabled() { - // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). - // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } + return new DefaultReactActivityDelegate( + this, + getMainComponentName(), + // If you opted-in for the New Architecture, we enable the Fabric Renderer. + DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled + // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). + DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled + ); } } diff --git a/HelloWorld/android/app/src/main/java/com/helloworld/MainApplication.java b/HelloWorld/android/app/src/main/java/com/helloworld/MainApplication.java index eedd1929..58e06c16 100644 --- a/HelloWorld/android/app/src/main/java/com/helloworld/MainApplication.java +++ b/HelloWorld/android/app/src/main/java/com/helloworld/MainApplication.java @@ -1,22 +1,21 @@ package com.helloworld; 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.react.config.ReactFeatureFlags; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactNativeHost; import com.facebook.soloader.SoLoader; -import com.helloworld.newarchitecture.MainApplicationReactNativeHost; -import java.lang.reflect.InvocationTargetException; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = - new ReactNativeHost(this) { + new DefaultReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; @@ -35,57 +34,27 @@ protected List getPackages() { protected String getJSMainModuleName() { return "index"; } + @Override + protected boolean isNewArchEnabled() { + return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; + } + @Override + protected Boolean isHermesEnabled() { + return BuildConfig.IS_HERMES_ENABLED; + } }; - - private final ReactNativeHost mNewArchitectureNativeHost = - new MainApplicationReactNativeHost(this); - @Override public ReactNativeHost getReactNativeHost() { - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - return mNewArchitectureNativeHost; - } else { - return mReactNativeHost; - } + return mReactNativeHost; } - @Override public void onCreate() { super.onCreate(); - // If you opted-in for the New Architecture, we enable the TurboModule system - ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; SoLoader.init(this, /* native exopackage */ false); - initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } - - /** - * Loads Flipper in React Native templates. Call this in the onCreate method with something like - * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - * - * @param context - * @param reactInstanceManager - */ - 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.helloworld.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(); - } + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + // If you opted-in for the New Architecture, we load the native entry point for this app. + DefaultNewArchitectureEntryPoint.load(); } + ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } -} +} \ No newline at end of file diff --git a/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java deleted file mode 100644 index 55473c3f..00000000 --- a/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.helloworld.newarchitecture; - -import android.app.Application; -import androidx.annotation.NonNull; -import com.facebook.react.PackageList; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.ReactPackageTurboModuleManagerDelegate; -import com.facebook.react.bridge.JSIModulePackage; -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.ReactApplicationContext; -import com.facebook.react.bridge.UIManager; -import com.facebook.react.fabric.ComponentFactory; -import com.facebook.react.fabric.CoreComponentsRegistry; -import com.facebook.react.fabric.FabricJSIModuleProvider; -import com.facebook.react.fabric.ReactNativeConfig; -import com.facebook.react.uimanager.ViewManagerRegistry; -import com.helloworld.BuildConfig; -import com.helloworld.newarchitecture.components.MainComponentsRegistry; -import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; -import java.util.ArrayList; -import java.util.List; - -/** - * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both - * TurboModule delegates and the Fabric Renderer. - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -public class MainApplicationReactNativeHost extends ReactNativeHost { - public MainApplicationReactNativeHost(Application application) { - super(application); - } - - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: - // packages.add(new TurboReactPackage() { ... }); - // If you have custom Fabric Components, their ViewManagers should also be loaded here - // inside a ReactPackage. - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - - @NonNull - @Override - protected ReactPackageTurboModuleManagerDelegate.Builder - getReactPackageTurboModuleManagerDelegateBuilder() { - // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary - // for the new architecture and to use TurboModules correctly. - return new MainApplicationTurboModuleManagerDelegate.Builder(); - } - - @Override - protected JSIModulePackage getJSIModulePackage() { - return new JSIModulePackage() { - @Override - public List getJSIModules( - final ReactApplicationContext reactApplicationContext, - final JavaScriptContextHolder jsContext) { - final List specs = new ArrayList<>(); - - // Here we provide a new JSIModuleSpec that will be responsible of providing the - // custom Fabric Components. - specs.add( - new JSIModuleSpec() { - @Override - public JSIModuleType getJSIModuleType() { - return JSIModuleType.UIManager; - } - - @Override - public JSIModuleProvider getJSIModuleProvider() { - final ComponentFactory componentFactory = new ComponentFactory(); - CoreComponentsRegistry.register(componentFactory); - - // Here we register a Components Registry. - // The one that is generated with the template contains no components - // and just provides you the one from React Native core. - MainComponentsRegistry.register(componentFactory); - - final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); - - ViewManagerRegistry viewManagerRegistry = - new ViewManagerRegistry( - reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); - - return new FabricJSIModuleProvider( - reactApplicationContext, - componentFactory, - ReactNativeConfig.DEFAULT_CONFIG, - viewManagerRegistry); - } - }); - return specs; - } - }; - } -} diff --git a/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java deleted file mode 100644 index c74d0cca..00000000 --- a/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.helloworld.newarchitecture.components; - -import com.facebook.jni.HybridData; -import com.facebook.proguard.annotations.DoNotStrip; -import com.facebook.react.fabric.ComponentFactory; -import com.facebook.soloader.SoLoader; - -/** - * Class responsible to load the custom Fabric Components. This class has native methods and needs a - * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ - * folder for you). - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -@DoNotStrip -public class MainComponentsRegistry { - static { - SoLoader.loadLibrary("fabricjni"); - } - - @DoNotStrip private final HybridData mHybridData; - - @DoNotStrip - private native HybridData initHybrid(ComponentFactory componentFactory); - - @DoNotStrip - private MainComponentsRegistry(ComponentFactory componentFactory) { - mHybridData = initHybrid(componentFactory); - } - - @DoNotStrip - public static MainComponentsRegistry register(ComponentFactory componentFactory) { - return new MainComponentsRegistry(componentFactory); - } -} diff --git a/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java deleted file mode 100644 index 8593b3bb..00000000 --- a/HelloWorld/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.helloworld.newarchitecture.modules; - -import com.facebook.jni.HybridData; -import com.facebook.react.ReactPackage; -import com.facebook.react.ReactPackageTurboModuleManagerDelegate; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.soloader.SoLoader; -import java.util.List; - -/** - * Class responsible to load the TurboModules. This class has native methods and needs a - * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ - * folder for you). - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -public class MainApplicationTurboModuleManagerDelegate - extends ReactPackageTurboModuleManagerDelegate { - - private static volatile boolean sIsSoLibraryLoaded; - - protected MainApplicationTurboModuleManagerDelegate( - ReactApplicationContext reactApplicationContext, List packages) { - super(reactApplicationContext, packages); - } - - protected native HybridData initHybrid(); - - native boolean canCreateTurboModule(String moduleName); - - public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { - protected MainApplicationTurboModuleManagerDelegate build( - ReactApplicationContext context, List packages) { - return new MainApplicationTurboModuleManagerDelegate(context, packages); - } - } - - @Override - protected synchronized void maybeLoadOtherSoLibraries() { - if (!sIsSoLibraryLoaded) { - // If you change the name of your application .so file in the Android.mk file, - // make sure you update the name here as well. - SoLoader.loadLibrary("helloworld_appmodules"); - sIsSoLibraryLoaded = true; - } - } -} diff --git a/HelloWorld/android/app/src/main/jni/CMakeLists.txt b/HelloWorld/android/app/src/main/jni/CMakeLists.txt deleted file mode 100644 index 91afb1b2..00000000 --- a/HelloWorld/android/app/src/main/jni/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -# Define the library name here. -project(helloworld_appmodules) -# This file includes all the necessary to let you build your application with the New Architecture. -include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) \ No newline at end of file diff --git a/HelloWorld/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/HelloWorld/android/app/src/main/jni/MainApplicationModuleProvider.cpp deleted file mode 100644 index 340b97c7..00000000 --- a/HelloWorld/android/app/src/main/jni/MainApplicationModuleProvider.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "MainApplicationModuleProvider.h" - -#include -#include - -namespace facebook { -namespace react { - -std::shared_ptr MainApplicationModuleProvider( - const std::string &moduleName, - const JavaTurboModule::InitParams ¶ms) { - // Here you can provide your own module provider for TurboModules coming from - // either your application or from external libraries. The approach to follow - // is similar to the following (for a library called `samplelibrary`: - // - // auto module = samplelibrary_ModuleProvider(moduleName, params); - // if (module != nullptr) { - // return module; - // } - // return rncore_ModuleProvider(moduleName, params); - - // Module providers autolinked by RN CLI - auto rncli_module = rncli_ModuleProvider(moduleName, params); - if (rncli_module != nullptr) { - return rncli_module; - } - return rncore_ModuleProvider(moduleName, params); -} - -} // namespace react -} // namespace facebook diff --git a/HelloWorld/android/app/src/main/jni/MainApplicationModuleProvider.h b/HelloWorld/android/app/src/main/jni/MainApplicationModuleProvider.h deleted file mode 100644 index b38ccf53..00000000 --- a/HelloWorld/android/app/src/main/jni/MainApplicationModuleProvider.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include - -#include - -namespace facebook { -namespace react { - -std::shared_ptr MainApplicationModuleProvider( - const std::string &moduleName, - const JavaTurboModule::InitParams ¶ms); - -} // namespace react -} // namespace facebook diff --git a/HelloWorld/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/HelloWorld/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp deleted file mode 100644 index 5fd688c5..00000000 --- a/HelloWorld/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "MainApplicationTurboModuleManagerDelegate.h" -#include "MainApplicationModuleProvider.h" - -namespace facebook { -namespace react { - -jni::local_ref -MainApplicationTurboModuleManagerDelegate::initHybrid( - jni::alias_ref) { - return makeCxxInstance(); -} - -void MainApplicationTurboModuleManagerDelegate::registerNatives() { - registerHybrid({ - makeNativeMethod( - "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), - makeNativeMethod( - "canCreateTurboModule", - MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), - }); -} - -std::shared_ptr -MainApplicationTurboModuleManagerDelegate::getTurboModule( - const std::string &name, - const std::shared_ptr &jsInvoker) { - // Not implemented yet: provide pure-C++ NativeModules here. - return nullptr; -} - -std::shared_ptr -MainApplicationTurboModuleManagerDelegate::getTurboModule( - const std::string &name, - const JavaTurboModule::InitParams ¶ms) { - return MainApplicationModuleProvider(name, params); -} - -bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( - const std::string &name) { - return getTurboModule(name, nullptr) != nullptr || - getTurboModule(name, {.moduleName = name}) != nullptr; -} - -} // namespace react -} // namespace facebook diff --git a/HelloWorld/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/HelloWorld/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h deleted file mode 100644 index 9ee38a81..00000000 --- a/HelloWorld/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include - -#include -#include - -namespace facebook { -namespace react { - -class MainApplicationTurboModuleManagerDelegate - : public jni::HybridClass< - MainApplicationTurboModuleManagerDelegate, - TurboModuleManagerDelegate> { - public: - // Adapt it to the package you used for your Java class. - static constexpr auto kJavaDescriptor = - "Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; - - static jni::local_ref initHybrid(jni::alias_ref); - - static void registerNatives(); - - std::shared_ptr getTurboModule( - const std::string &name, - const std::shared_ptr &jsInvoker) override; - std::shared_ptr getTurboModule( - const std::string &name, - const JavaTurboModule::InitParams ¶ms) override; - - /** - * Test-only method. Allows user to verify whether a TurboModule can be - * created by instances of this class. - */ - bool canCreateTurboModule(const std::string &name); -}; - -} // namespace react -} // namespace facebook diff --git a/HelloWorld/android/app/src/main/jni/MainComponentsRegistry.cpp b/HelloWorld/android/app/src/main/jni/MainComponentsRegistry.cpp deleted file mode 100644 index a27a0e92..00000000 --- a/HelloWorld/android/app/src/main/jni/MainComponentsRegistry.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "MainComponentsRegistry.h" - -#include -#include -#include -#include -#include - -namespace facebook { -namespace react { - -MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} - -std::shared_ptr -MainComponentsRegistry::sharedProviderRegistry() { - auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); - - // Autolinked providers registered by RN CLI - rncli_registerProviders(providerRegistry); - - // Custom Fabric Components go here. You can register custom - // components coming from your App or from 3rd party libraries here. - // - // providerRegistry->add(concreteComponentDescriptorProvider< - // AocViewerComponentDescriptor>()); - return providerRegistry; -} - -jni::local_ref -MainComponentsRegistry::initHybrid( - jni::alias_ref, - ComponentFactory *delegate) { - auto instance = makeCxxInstance(delegate); - - auto buildRegistryFunction = - [](EventDispatcher::Weak const &eventDispatcher, - ContextContainer::Shared const &contextContainer) - -> ComponentDescriptorRegistry::Shared { - auto registry = MainComponentsRegistry::sharedProviderRegistry() - ->createComponentDescriptorRegistry( - {eventDispatcher, contextContainer}); - - auto mutableRegistry = - std::const_pointer_cast(registry); - - mutableRegistry->setFallbackComponentDescriptor( - std::make_shared( - ComponentDescriptorParameters{ - eventDispatcher, contextContainer, nullptr})); - - return registry; - }; - - delegate->buildRegistryFunction = buildRegistryFunction; - return instance; -} - -void MainComponentsRegistry::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), - }); -} - -} // namespace react -} // namespace facebook diff --git a/HelloWorld/android/app/src/main/jni/MainComponentsRegistry.h b/HelloWorld/android/app/src/main/jni/MainComponentsRegistry.h deleted file mode 100644 index d61cbffa..00000000 --- a/HelloWorld/android/app/src/main/jni/MainComponentsRegistry.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace facebook { -namespace react { - -class MainComponentsRegistry - : public facebook::jni::HybridClass { - public: - // Adapt it to the package you used for your Java class. - constexpr static auto kJavaDescriptor = - "Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;"; - - static void registerNatives(); - - MainComponentsRegistry(ComponentFactory *delegate); - - private: - static std::shared_ptr - sharedProviderRegistry(); - - static jni::local_ref initHybrid( - jni::alias_ref, - ComponentFactory *delegate); -}; - -} // namespace react -} // namespace facebook diff --git a/HelloWorld/android/app/src/main/jni/OnLoad.cpp b/HelloWorld/android/app/src/main/jni/OnLoad.cpp deleted file mode 100644 index c569b6e8..00000000 --- a/HelloWorld/android/app/src/main/jni/OnLoad.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "MainApplicationTurboModuleManagerDelegate.h" -#include "MainComponentsRegistry.h" - -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { - return facebook::jni::initialize(vm, [] { - facebook::react::MainApplicationTurboModuleManagerDelegate:: - registerNatives(); - facebook::react::MainComponentsRegistry::registerNatives(); - }); -} diff --git a/HelloWorld/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/HelloWorld/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java new file mode 100644 index 00000000..6eda9233 --- /dev/null +++ b/HelloWorld/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java @@ -0,0 +1,18 @@ +/** + * 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.helloworld; +import android.content.Context; +import com.facebook.react.ReactInstanceManager; +/** + * Class responsible of loading Flipper inside your React Native application. This is the release + * flavor of it so it's empty as we don't want to load Flipper. + */ +public class ReactNativeFlipper { + public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { + // Do nothing as we don't want to initialize Flipper on Release. + } +} \ No newline at end of file diff --git a/HelloWorld/android/build.gradle b/HelloWorld/android/build.gradle index 8569fee3..583a1a1e 100644 --- a/HelloWorld/android/build.gradle +++ b/HelloWorld/android/build.gradle @@ -2,50 +2,20 @@ buildscript { ext { - buildToolsVersion = "31.0.0" + buildToolsVersion = "33.0.0" minSdkVersion = 21 - compileSdkVersion = 31 - targetSdkVersion = 31 + compileSdkVersion = 33 + targetSdkVersion = 33 - if (System.properties['os.arch'] == "aarch64") { - // For M1 Users we need to use the NDK 24 which added support for aarch64 - ndkVersion = "24.0.8215888" - } else { - // Otherwise we default to the side-by-side NDK version from AGP. - ndkVersion = "21.4.7075529" - } + // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. + ndkVersion = "23.1.7779620" } repositories { google() mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:7.2.1") + classpath("com.android.tools.build:gradle:7.3.1") classpath("com.facebook.react:react-native-gradle-plugin") - classpath("de.undercouch:gradle-download-task:5.0.1") - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url("$rootDir/../node_modules/react-native/android") - } - maven { - // Android JSC is installed from npm - url("$rootDir/../node_modules/jsc-android/dist") - } - mavenCentral { - // We don't want to fetch react-native from Maven Central as there are - // older versions over there. - content { - excludeGroup "com.facebook.react" - } - } - google() - maven { url 'https://www.jitpack.io' } } } diff --git a/HelloWorld/android/gradle.properties b/HelloWorld/android/gradle.properties index fa4feae5..360e02c1 100644 --- a/HelloWorld/android/gradle.properties +++ b/HelloWorld/android/gradle.properties @@ -38,3 +38,8 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 # to write custom TurboModules/Fabric components OR use libraries that # are providing them. newArchEnabled=false + + +# Use this property to enable or disable the Hermes JS engine. +# If set to false, you will be using JSC instead. +hermesEnabled=true diff --git a/HelloWorld/android/settings.gradle b/HelloWorld/android/settings.gradle index bd838b9c..ab284c3a 100644 --- a/HelloWorld/android/settings.gradle +++ b/HelloWorld/android/settings.gradle @@ -2,10 +2,3 @@ rootProject.name = 'HelloWorld' apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('../node_modules/react-native-gradle-plugin') - -if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { - include(":ReactAndroid") - project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') - include(":ReactAndroid:hermes-engine") - project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') -} diff --git a/HelloWorld/ios/.xcode.env b/HelloWorld/ios/.xcode.env new file mode 100644 index 00000000..772b339b --- /dev/null +++ b/HelloWorld/ios/.xcode.env @@ -0,0 +1 @@ +export NODE_BINARY=$(command -v node) diff --git a/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj b/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj index afccc265..e6d6c654 100644 --- a/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj @@ -8,12 +8,12 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; }; - 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */; }; + 19B51357919EE1D13057BDCC /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CFC6FEC66AF96DFAF959DB85 /* libPods-HelloWorld-HelloWorldTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + 8265D4684230C7F904215309 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B02B5929891B41FBCECD9FD8 /* libPods-HelloWorld.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -36,14 +36,14 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld-HelloWorldTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = ""; }; - 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; sourceTree = ""; }; - 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 680E1049E6450FBE7954E9CE /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.debug.xcconfig"; sourceTree = ""; }; + 6D1BB4461A8329F1D036C278 /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = ""; }; + B02B5929891B41FBCECD9FD8 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C5021083AC28CA78F9E905FD /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = ""; }; + CFC6FEC66AF96DFAF959DB85 /* libPods-HelloWorld-HelloWorldTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld-HelloWorldTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + F7EA5D38DCDAC6485FEF0E92 /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -51,7 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */, + 19B51357919EE1D13057BDCC /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -59,7 +59,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */, + 8265D4684230C7F904215309 /* libPods-HelloWorld.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -100,8 +100,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */, - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */, + B02B5929891B41FBCECD9FD8 /* libPods-HelloWorld.a */, + CFC6FEC66AF96DFAF959DB85 /* libPods-HelloWorld-HelloWorldTests.a */, ); name = Frameworks; sourceTree = ""; @@ -140,10 +140,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */, - 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */, + C5021083AC28CA78F9E905FD /* Pods-HelloWorld.debug.xcconfig */, + 6D1BB4461A8329F1D036C278 /* Pods-HelloWorld.release.xcconfig */, + 680E1049E6450FBE7954E9CE /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */, + F7EA5D38DCDAC6485FEF0E92 /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -155,12 +155,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HelloWorldTests" */; buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, + C0A2EE43231417705C3BD5BA /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, + FD527FAD8E4A503C68F2EAF1 /* [CP] Embed Pods Frameworks */, + 1016B82F3F5A5489D6EDC0C0 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -176,14 +176,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */; buildPhases = ( - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, + 4B3DE9A883FFE5D96D09D152 /* [CP] Check Pods Manifest.lock */, FD10A7F022414F080027D42C /* Start Packager */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + C9586C074CA64B56FF15DA39 /* [CP] Embed Pods Frameworks */, + 8BE5EFB3262DF63A05A200C1 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -266,24 +266,24 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { + 1016B82F3F5A5489D6EDC0C0 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { + 4B3DE9A883FFE5D96D09D152 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -298,103 +298,103 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HelloWorld-HelloWorldTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-HelloWorld-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + 8BE5EFB3262DF63A05A200C1 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HelloWorld-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { + C0A2EE43231417705C3BD5BA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-HelloWorld-HelloWorldTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { + C9586C074CA64B56FF15DA39 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { + FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + ); + name = "Start Packager"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources.sh\"\n"; + shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; showEnvVarsInLog = 0; }; - FD10A7F022414F080027D42C /* Start Packager */ = { + FD527FAD8E4A503C68F2EAF1 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); - name = "Start Packager"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -430,7 +430,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */; + baseConfigurationReference = 680E1049E6450FBE7954E9CE /* Pods-HelloWorld-HelloWorldTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -444,6 +444,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -457,7 +458,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */; + baseConfigurationReference = F7EA5D38DCDAC6485FEF0E92 /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; @@ -468,6 +469,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -481,7 +483,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */; + baseConfigurationReference = C5021083AC28CA78F9E905FD /* Pods-HelloWorld.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -508,7 +510,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */; + baseConfigurationReference = 6D1BB4461A8329F1D036C278 /* Pods-HelloWorld.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/HelloWorld/ios/HelloWorld/AppDelegate.h b/HelloWorld/ios/HelloWorld/AppDelegate.h index ef1de86a..5d280825 100644 --- a/HelloWorld/ios/HelloWorld/AppDelegate.h +++ b/HelloWorld/ios/HelloWorld/AppDelegate.h @@ -1,8 +1,6 @@ -#import +#import #import -@interface AppDelegate : UIResponder - -@property (nonatomic, strong) UIWindow *window; +@interface AppDelegate : RCTAppDelegate @end diff --git a/HelloWorld/ios/HelloWorld/AppDelegate.mm b/HelloWorld/ios/HelloWorld/AppDelegate.mm index 28475b9c..8d96bb44 100644 --- a/HelloWorld/ios/HelloWorld/AppDelegate.mm +++ b/HelloWorld/ios/HelloWorld/AppDelegate.mm @@ -1,85 +1,18 @@ #import "AppDelegate.h" -#import #import -#import -#import -#if RCT_NEW_ARCH_ENABLED -#import -#import -#import -#import -#import -#import -#import - -static NSString *const kRNConcurrentRoot = @"concurrentRoot"; - -@interface AppDelegate () { - RCTTurboModuleManager *_turboModuleManager; - RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; - std::shared_ptr _reactNativeConfig; - facebook::react::ContextContainer::Shared _contextContainer; -} -@end -#endif @implementation AppDelegate - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - RCTAppSetupPrepareApp(application); - - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - -#if RCT_NEW_ARCH_ENABLED - _contextContainer = std::make_shared(); - _reactNativeConfig = std::make_shared(); - _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); - _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; - bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; -#endif - - NSDictionary *initProps = [self prepareInitialProps]; - UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"HelloWorld", initProps); - - if (@available(iOS 13.0, *)) { - rootView.backgroundColor = [UIColor systemBackgroundColor]; - } else { - rootView.backgroundColor = [UIColor whiteColor]; - } - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. -/// -/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html -/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). -/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. -- (BOOL)concurrentRootEnabled -{ - // Switch this bool to turn on and off the concurrent root - return true; -} - -- (NSDictionary *)prepareInitialProps -{ - NSMutableDictionary *initProps = [NSMutableDictionary new]; - -#ifdef RCT_NEW_ARCH_ENABLED - initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); -#endif - - return initProps; + self.moduleName = @"HelloWorld"; + // You can add your custom initial props in the dictionary below. + // They will be passed down to the ViewController used by React Native. + self.initialProps = @{}; + return [super application:application didFinishLaunchingWithOptions:launchOptions]; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge @@ -90,44 +23,13 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } - -#if RCT_NEW_ARCH_ENABLED - -#pragma mark - RCTCxxBridgeDelegate - -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge -{ - _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge - delegate:self - jsInvoker:bridge.jsCallInvoker]; - return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); -} - -#pragma mark RCTTurboModuleManagerDelegate - -- (Class)getModuleClassFromName:(const char *)name -{ - return RCTCoreModulesClassProvider(name); -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - jsInvoker:(std::shared_ptr)jsInvoker -{ - return nullptr; -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - initParams: - (const facebook::react::ObjCTurboModule::InitParams &)params -{ - return nullptr; -} - -- (id)getModuleInstanceFromClass:(Class)moduleClass +/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. +/// +/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html +/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). +/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`. +- (BOOL)concurrentRootEnabled { - return RCTAppSetupDefaultModuleFromClass(moduleClass); + return true; } - -#endif - @end diff --git a/HelloWorld/ios/HelloWorld/Info.plist b/HelloWorld/ios/HelloWorld/Info.plist index 257f1ad4..a642c3e1 100644 --- a/HelloWorld/ios/HelloWorld/Info.plist +++ b/HelloWorld/ios/HelloWorld/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 1.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/HelloWorld/ios/Podfile b/HelloWorld/ios/Podfile index 308477ed..2a91292b 100644 --- a/HelloWorld/ios/Podfile +++ b/HelloWorld/ios/Podfile @@ -1,8 +1,24 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '12.4' -install! 'cocoapods', :deterministic_uuids => false +platform :ios, min_ios_version_supported +prepare_react_native_project! +# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. +# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded +# +# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` +# ```js +# module.exports = { +# dependencies: { +# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), +# ``` +flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled +linkage = ENV['USE_FRAMEWORKS'] +if linkage != nil + Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green + use_frameworks! :linkage => linkage.to_sym +end + target 'HelloWorld' do config = use_native_modules! @@ -16,12 +32,12 @@ target 'HelloWorld' do # 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 => flags[:fabric_enabled], + :fabric_enabled => true, # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. - :flipper_configuration => FlipperConfiguration.enabled, + :flipper_configuration => flipper_config, # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) diff --git a/HelloWorld/ios/Podfile.lock b/HelloWorld/ios/Podfile.lock index a94ef7a9..2fdf6da9 100644 --- a/HelloWorld/ios/Podfile.lock +++ b/HelloWorld/ios/Podfile.lock @@ -2,14 +2,14 @@ PODS: - boost (1.76.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) - - FBLazyVector (0.70.6) - - FBReactNativeSpec (0.70.6): + - FBLazyVector (0.71.7) + - FBReactNativeSpec (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.70.6) - - RCTTypeSafety (= 0.70.6) - - React-Core (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-Core (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) - Flipper (0.125.0): - Flipper-Folly (~> 2.6) - Flipper-RSocket (~> 1.4) @@ -86,203 +86,543 @@ PODS: - DoubleConversion - fmt (~> 6.2.1) - glog - - RCTRequired (0.70.6) - - RCTTypeSafety (0.70.6): - - FBLazyVector (= 0.70.6) - - RCTRequired (= 0.70.6) - - React-Core (= 0.70.6) - - React (0.70.6): - - React-Core (= 0.70.6) - - React-Core/DevSupport (= 0.70.6) - - React-Core/RCTWebSocket (= 0.70.6) - - React-RCTActionSheet (= 0.70.6) - - React-RCTAnimation (= 0.70.6) - - React-RCTBlob (= 0.70.6) - - React-RCTImage (= 0.70.6) - - React-RCTLinking (= 0.70.6) - - React-RCTNetwork (= 0.70.6) - - React-RCTSettings (= 0.70.6) - - React-RCTText (= 0.70.6) - - React-RCTVibration (= 0.70.6) - - React-bridging (0.70.6): - - RCT-Folly (= 2021.07.22.00) - - React-jsi (= 0.70.6) - - React-callinvoker (0.70.6) - - React-Codegen (0.70.6): - - FBReactNativeSpec (= 0.70.6) - - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.70.6) - - RCTTypeSafety (= 0.70.6) - - React-Core (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-Core (0.70.6): + - RCT-Folly/Fabric (2021.07.22.00): + - boost + - DoubleConversion + - fmt (~> 6.2.1) + - glog + - RCTRequired (0.71.7) + - RCTTypeSafety (0.71.7): + - FBLazyVector (= 0.71.7) + - RCTRequired (= 0.71.7) + - React-Core (= 0.71.7) + - React (0.71.7): + - React-Core (= 0.71.7) + - React-Core/DevSupport (= 0.71.7) + - React-Core/RCTWebSocket (= 0.71.7) + - React-RCTActionSheet (= 0.71.7) + - React-RCTAnimation (= 0.71.7) + - React-RCTBlob (= 0.71.7) + - React-RCTImage (= 0.71.7) + - React-RCTLinking (= 0.71.7) + - React-RCTNetwork (= 0.71.7) + - React-RCTSettings (= 0.71.7) + - React-RCTText (= 0.71.7) + - React-RCTVibration (= 0.71.7) + - React-callinvoker (0.71.7) + - React-Codegen (0.71.7): + - FBReactNativeSpec + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - React-graphics + - React-jsc + - React-jsi + - React-jsiexecutor + - React-rncore + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - React-Core (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-Core/Default (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/CoreModulesHeaders (0.70.6): + - React-Core/CoreModulesHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/Default (0.70.6): + - React-Core/Default (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/DevSupport (0.70.6): + - React-Core/DevSupport (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.6) - - React-Core/RCTWebSocket (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-jsinspector (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-Core/Default (= 0.71.7) + - React-Core/RCTWebSocket (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-jsinspector (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTActionSheetHeaders (0.70.6): + - React-Core/RCTActionSheetHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTAnimationHeaders (0.70.6): + - React-Core/RCTAnimationHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTBlobHeaders (0.70.6): + - React-Core/RCTBlobHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTImageHeaders (0.70.6): + - React-Core/RCTImageHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTLinkingHeaders (0.70.6): + - React-Core/RCTLinkingHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTNetworkHeaders (0.70.6): + - React-Core/RCTNetworkHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTSettingsHeaders (0.70.6): + - React-Core/RCTSettingsHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTTextHeaders (0.70.6): + - React-Core/RCTTextHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTVibrationHeaders (0.70.6): + - React-Core/RCTVibrationHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTWebSocket (0.70.6): + - React-Core/RCTWebSocket (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-Core/Default (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-CoreModules (0.70.6): + - React-CoreModules (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/CoreModulesHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - React-RCTImage (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-cxxreact (0.70.6): - - boost (= 1.76.0) - - DoubleConversion - - glog - - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsinspector (= 0.70.6) - - React-logger (= 0.70.6) - - React-perflogger (= 0.70.6) - - React-runtimeexecutor (= 0.70.6) - - React-jsi (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/CoreModulesHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - React-RCTBlob + - React-RCTImage (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-cxxreact (0.71.7): - boost (= 1.76.0) - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-jsi/Default (= 0.70.6) - - React-jsi/Default (0.70.6): + - React-callinvoker (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsinspector (= 0.71.7) + - React-logger (= 0.71.7) + - React-perflogger (= 0.71.7) + - React-runtimeexecutor (= 0.71.7) + - React-Fabric (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-Fabric/animations (= 0.71.7) + - React-Fabric/attributedstring (= 0.71.7) + - React-Fabric/butter (= 0.71.7) + - React-Fabric/componentregistry (= 0.71.7) + - React-Fabric/componentregistrynative (= 0.71.7) + - React-Fabric/components (= 0.71.7) + - React-Fabric/config (= 0.71.7) + - React-Fabric/core (= 0.71.7) + - React-Fabric/debug_core (= 0.71.7) + - React-Fabric/debug_renderer (= 0.71.7) + - React-Fabric/imagemanager (= 0.71.7) + - React-Fabric/leakchecker (= 0.71.7) + - React-Fabric/mapbuffer (= 0.71.7) + - React-Fabric/mounting (= 0.71.7) + - React-Fabric/runtimescheduler (= 0.71.7) + - React-Fabric/scheduler (= 0.71.7) + - React-Fabric/telemetry (= 0.71.7) + - React-Fabric/templateprocessor (= 0.71.7) + - React-Fabric/textlayoutmanager (= 0.71.7) + - React-Fabric/uimanager (= 0.71.7) + - React-Fabric/utils (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/animations (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/attributedstring (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/butter (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/componentregistry (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/componentregistrynative (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-Fabric/components/activityindicator (= 0.71.7) + - React-Fabric/components/image (= 0.71.7) + - React-Fabric/components/inputaccessory (= 0.71.7) + - React-Fabric/components/legacyviewmanagerinterop (= 0.71.7) + - React-Fabric/components/modal (= 0.71.7) + - React-Fabric/components/root (= 0.71.7) + - React-Fabric/components/safeareaview (= 0.71.7) + - React-Fabric/components/scrollview (= 0.71.7) + - React-Fabric/components/slider (= 0.71.7) + - React-Fabric/components/text (= 0.71.7) + - React-Fabric/components/textinput (= 0.71.7) + - React-Fabric/components/unimplementedview (= 0.71.7) + - React-Fabric/components/view (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/activityindicator (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/image (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/inputaccessory (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/legacyviewmanagerinterop (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/modal (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/root (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/safeareaview (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/scrollview (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/slider (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/text (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/textinput (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/unimplementedview (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/components/view (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - Yoga + - React-Fabric/config (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/core (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/debug_core (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/debug_renderer (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/imagemanager (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-RCTImage (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/leakchecker (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/mapbuffer (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/mounting (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/runtimescheduler (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/scheduler (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/telemetry (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/templateprocessor (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/textlayoutmanager (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-Fabric/uimanager + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/uimanager (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-Fabric/utils (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-graphics (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-graphics (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - React-Core/Default (= 0.71.7) + - React-jsc (0.71.7): + - React-jsc/Fabric (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsc/Fabric (0.71.7): + - React-jsi (= 0.71.7) + - React-jsi (0.71.7): - boost (= 1.76.0) - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-jsiexecutor (0.70.6): + - React-jsiexecutor (0.71.7): - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-perflogger (= 0.70.6) - - React-jsinspector (0.70.6) - - React-logger (0.70.6): + - React-cxxreact (= 0.71.7) + - React-jsi (= 0.71.7) + - React-perflogger (= 0.71.7) + - React-jsinspector (0.71.7) + - React-logger (0.71.7): - glog - react-native-safe-area-context (4.3.4): - RCT-Folly @@ -290,81 +630,102 @@ PODS: - RCTTypeSafety - React-Core - ReactCommon/turbomodule/core - - React-perflogger (0.70.6) - - React-RCTActionSheet (0.70.6): - - React-Core/RCTActionSheetHeaders (= 0.70.6) - - React-RCTAnimation (0.70.6): + - React-perflogger (0.71.7) + - React-RCTActionSheet (0.71.7): + - React-Core/RCTActionSheetHeaders (= 0.71.7) + - React-RCTAnimation (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTAnimationHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTBlob (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTAnimationHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTAppDelegate (0.71.7): + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - ReactCommon/turbomodule/core + - React-RCTBlob (0.71.7): + - RCT-Folly (= 2021.07.22.00) + - React-Codegen (= 0.71.7) + - React-Core/RCTBlobHeaders (= 0.71.7) + - React-Core/RCTWebSocket (= 0.71.7) + - React-jsi (= 0.71.7) + - React-RCTNetwork (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTFabric (0.71.7): + - RCT-Folly/Fabric (= 2021.07.22.00) + - React-Core (= 0.71.7) + - React-Fabric (= 0.71.7) + - React-RCTImage (= 0.71.7) + - React-RCTImage (0.71.7): - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.70.6) - - React-Core/RCTBlobHeaders (= 0.70.6) - - React-Core/RCTWebSocket (= 0.70.6) - - React-jsi (= 0.70.6) - - React-RCTNetwork (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTImage (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTImageHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - React-RCTNetwork (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTLinking (0.71.7): + - React-Codegen (= 0.71.7) + - React-Core/RCTLinkingHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTNetwork (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTImageHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - React-RCTNetwork (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTLinking (0.70.6): - - React-Codegen (= 0.70.6) - - React-Core/RCTLinkingHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTNetwork (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTNetworkHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTSettings (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTNetworkHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTSettings (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTSettingsHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTText (0.71.7): + - React-Core/RCTTextHeaders (= 0.71.7) + - React-RCTVibration (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTSettingsHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTText (0.70.6): - - React-Core/RCTTextHeaders (= 0.70.6) - - React-RCTVibration (0.70.6): + - React-Codegen (= 0.71.7) + - React-Core/RCTVibrationHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-rncore (0.71.7) + - React-runtimeexecutor (0.71.7): + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/bridging (0.71.7): + - DoubleConversion + - glog - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.70.6) - - React-Core/RCTVibrationHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-runtimeexecutor (0.70.6): - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (0.70.6): + - React-callinvoker (= 0.71.7) + - React-Core (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsi (= 0.71.7) + - React-logger (= 0.71.7) + - React-perflogger (= 0.71.7) + - ReactCommon/turbomodule/core (0.71.7): - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-bridging (= 0.70.6) - - React-callinvoker (= 0.70.6) - - React-Core (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-logger (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-callinvoker (= 0.71.7) + - React-Core (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsi (= 0.71.7) + - React-logger (= 0.71.7) + - React-perflogger (= 0.71.7) - RNCAsyncStorage (1.17.12): - React-Core - RNCMaskedView (0.1.11): - React - RNDeviceInfo (10.0.2): - React-Core - - RNGestureHandler (2.5.0): + - RNGestureHandler (2.8.0): - React-Core - - RNReanimated (2.9.1): + - RNReanimated (3.0.2): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -430,10 +791,10 @@ DEPENDENCIES: - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - OpenSSL-Universal (= 1.1.1100) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) + - RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - React (from `../node_modules/react-native/`) - - React-bridging (from `../node_modules/react-native/ReactCommon`) - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) - React-Codegen (from `build/generated/ios`) - React-Core (from `../node_modules/react-native/`) @@ -441,6 +802,10 @@ DEPENDENCIES: - React-Core/RCTWebSocket (from `../node_modules/react-native/`) - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) + - React-Fabric (from `../node_modules/react-native/ReactCommon`) + - React-graphics (from `../node_modules/react-native/ReactCommon/react/renderer/graphics`) + - React-jsc (from `../node_modules/react-native/ReactCommon/jsc`) + - React-jsc/Fabric (from `../node_modules/react-native/ReactCommon/jsc`) - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) @@ -449,13 +814,16 @@ DEPENDENCIES: - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) + - React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`) - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) + - React-RCTFabric (from `../node_modules/react-native/React`) - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) - React-RCTText (from `../node_modules/react-native/Libraries/Text`) - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) + - React-rncore (from `../node_modules/react-native/ReactCommon`) - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" @@ -504,8 +872,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/TypeSafety" React: :path: "../node_modules/react-native/" - React-bridging: - :path: "../node_modules/react-native/ReactCommon" React-callinvoker: :path: "../node_modules/react-native/ReactCommon/callinvoker" React-Codegen: @@ -516,6 +882,12 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/React/CoreModules" React-cxxreact: :path: "../node_modules/react-native/ReactCommon/cxxreact" + React-Fabric: + :path: "../node_modules/react-native/ReactCommon" + React-graphics: + :path: "../node_modules/react-native/ReactCommon/react/renderer/graphics" + React-jsc: + :path: "../node_modules/react-native/ReactCommon/jsc" React-jsi: :path: "../node_modules/react-native/ReactCommon/jsi" React-jsiexecutor: @@ -532,8 +904,12 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/ActionSheetIOS" React-RCTAnimation: :path: "../node_modules/react-native/Libraries/NativeAnimation" + React-RCTAppDelegate: + :path: "../node_modules/react-native/Libraries/AppDelegate" React-RCTBlob: :path: "../node_modules/react-native/Libraries/Blob" + React-RCTFabric: + :path: "../node_modules/react-native/React" React-RCTImage: :path: "../node_modules/react-native/Libraries/Image" React-RCTLinking: @@ -546,6 +922,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/Text" React-RCTVibration: :path: "../node_modules/react-native/Libraries/Vibration" + React-rncore: + :path: "../node_modules/react-native/ReactCommon" React-runtimeexecutor: :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" ReactCommon: @@ -568,11 +946,11 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: a7c83b31436843459a1961bfd74b96033dc77234 + boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - FBLazyVector: 48289402952f4f7a4e235de70a9a590aa0b79ef4 - FBReactNativeSpec: dd1186fd05255e3457baa2f4ca65e94c2cd1e3ac + FBLazyVector: a89a0525bc7ca174675045c2b492b5280d5a2470 + FBReactNativeSpec: 7714e6bc1e9ea23df6c4cb42f0b2fd9c6a3a559c Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 @@ -586,44 +964,49 @@ SPEC CHECKSUMS: glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda - RCTRequired: e1866f61af7049eb3d8e08e8b133abd38bc1ca7a - RCTTypeSafety: 27c2ac1b00609a432ced1ae701247593f07f901e - React: bb3e06418d2cc48a84f9666a576c7b38e89cd7db - React-bridging: 572502ec59c9de30309afdc4932e278214288913 - React-callinvoker: 6b708b79c69f3359d42f1abb4663f620dbd4dadf - React-Codegen: 74e1cd7cee692a8b983c18df3274b5e749de07c8 - React-Core: b587d0a624f9611b0e032505f3d6f25e8daa2bee - React-CoreModules: c6ff48b985e7aa622e82ca51c2c353c7803eb04e - React-cxxreact: ade3d9e63c599afdead3c35f8a8bd12b3da6730b - React-jsi: 5a3952e0c6d57460ad9ee2c905025b4c28f71087 - React-jsiexecutor: b4a65947391c658450151275aa406f2b8263178f - React-jsinspector: 60769e5a0a6d4b32294a2456077f59d0266f9a8b - React-logger: 1623c216abaa88974afce404dc8f479406bbc3a0 + RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 + RCTRequired: 5a4a30ac20c86eeadd6844a9328f78d4168cf9b2 + RCTTypeSafety: 279fc5861a89f0f37db3a585f27f971485b4b734 + React: 88307a9be3bd0e71a6822271cf28b84a587fb97f + React-callinvoker: 35fb980c454104ebe82f0afb9826830089248e08 + React-Codegen: 837304cf1e2aae6b3784954521331dfc3e092b97 + React-Core: 321babf8fcfc49b81505896bc43fc8288865d465 + React-CoreModules: c2b7db313b04d9b71954ffd55d0c2e46bc40e9fb + React-cxxreact: d93d501dc91ff5db1e645f92e2ff5d2f1349049b + React-Fabric: 9c9bc6f7459594b24d7288d1388e91b1b109b22d + React-graphics: a7e870a0b7394a1310f8ec90d17fa26652b294c4 + React-jsc: a2ee2ef9564e9157980fa81e587797e97b582f36 + React-jsi: 22ecc03690968d82c6103ba2818ce7aefa2da59e + React-jsiexecutor: e722e6f755992c2c33ff8a4eb6833e5a55cd8296 + React-jsinspector: 9885f6f94d231b95a739ef7bb50536fb87ce7539 + React-logger: 3f8ebad1be1bf3299d1ab6d7f971802d7395c7ef react-native-safe-area-context: dfe5aa13bee37a0c7e8059d14f72ffc076d120e9 - React-perflogger: 8c79399b0500a30ee8152d0f9f11beae7fc36595 - React-RCTActionSheet: 7316773acabb374642b926c19aef1c115df5c466 - React-RCTAnimation: 5341e288375451297057391227f691d9b2326c3d - React-RCTBlob: b0615fc2daf2b5684ade8fadcab659f16f6f0efa - React-RCTImage: 6487b9600f268ecedcaa86114d97954d31ad4750 - React-RCTLinking: c8018ae9ebfefcec3839d690d4725f8d15e4e4b3 - React-RCTNetwork: 8aa63578741e0fe1205c28d7d4b40dbfdabce8a8 - React-RCTSettings: d00c15ad369cd62242a4dfcc6f277912b4a84ed3 - React-RCTText: f532e5ca52681ecaecea452b3ad7a5b630f50d75 - React-RCTVibration: c75ceef7aa60a33b2d5731ebe5800ddde40cefc4 - React-runtimeexecutor: 15437b576139df27635400de0599d9844f1ab817 - ReactCommon: 349be31adeecffc7986a0de875d7fb0dcf4e251c + React-perflogger: 2d505bbe298e3b7bacdd9e542b15535be07220f6 + React-RCTActionSheet: 0e96e4560bd733c9b37efbf68f5b1a47615892fb + React-RCTAnimation: fd138e26f120371c87e406745a27535e2c8a04ef + React-RCTAppDelegate: 0b535af4d6912d86d7ac57ab689c19643151c2e7 + React-RCTBlob: 830e421bccb2959254af0c0c66deb5d13ddd6674 + React-RCTFabric: 0beb3c1828e88c853b262636d5739920e70c0c22 + React-RCTImage: 92b0966e7c1cadda889e961c474397ad5180e194 + React-RCTLinking: b80f8d0c6e94c54294b0048def51f57eaa9a27af + React-RCTNetwork: 491b0c65ac22edbd6695d12d084b4943103b009b + React-RCTSettings: 97af3e8abe0023349ec015910df3bda1a0380117 + React-RCTText: 33c85753bd714d527d2ae538dc56ec24c6783d84 + React-RCTVibration: 08f132cad9896458776f37c112e71d60aef1c6ae + React-rncore: 3d66059a4b082e1509482ba990c66814deb91646 + React-runtimeexecutor: c5c89f8f543842dd864b63ded1b0bbb9c9445328 + ReactCommon: 7efec56db1e74f34e24beadcdda6942829d19c4c RNCAsyncStorage: 09fc8595e6d6f6d5abf16b23a56b257d9c6b7c5b RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489 RNDeviceInfo: 0a7c1d2532aa7691f9b9925a27e43af006db4dae - RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50 - RNReanimated: 24508aef58348323f891abd6616debf39173f1b9 + RNGestureHandler: 62232ba8f562f7dea5ba1b3383494eb5bf97a4d3 + RNReanimated: f0dd6b881808e635ef0673f89642937d6c141314 RNScreens: 4a1af06327774490d97342c00aee0c2bafb497b7 RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315 SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: 99caf8d5ab45e9d637ee6e0174ec16fbbb01bcfc + Yoga: d56980c8914db0b51692f55533409e844b66133c YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 33d7a51a8f4559dfbd8f66e2a02d13bc02f7faa3 +PODFILE CHECKSUM: 6977c7b659a1c4c2f195c134c7954e2f4977b650 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/HelloWorld/package.json b/HelloWorld/package.json index da4ec0b3..f6b37630 100644 --- a/HelloWorld/package.json +++ b/HelloWorld/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "android": "react-native run-android", - "ios": "react-native run-ios", + "ios": "react-native run-ios --simulator 'iPhone 14'", "start": "react-native start --reset-cache", "test": "jest", "api": "mocker ./mocker", @@ -17,6 +17,7 @@ "doc": "kktd @uiw/react-native-doc/doc/build" }, "dependencies": { + "@kkt/doc": "^1.0.0", "@react-native-async-storage/async-storage": "~1.17.11", "@react-native-community/masked-view": "~0.1.11", "@react-navigation/bottom-tabs": "~6.3.2", @@ -24,38 +25,43 @@ "@react-navigation/stack": "~6.2.2", "@rematch/core": "2.2.0", "@rematch/loading": "2.1.2", + "@shopify/restyle": "2.4.2", "@uiw/formatter": "~1.3.3", "@uiw/react-native": "^4.0.2", - "react": "18.1.0", - "react-native": "0.70.6", + "@uiw/react-native-doc": "^3.0.7", + "react": "18.2.0", + "react-native": "0.71.7", "react-native-device-info": "~10.0.2", - "react-native-gesture-handler": "~2.5.0", - "react-native-reanimated": "~2.9.1", + "react-native-gesture-handler": "2.8.0", + "react-native-reanimated": "~3.0.0", "react-native-safe-area-context": "~4.3.1", "react-native-screens": "~3.15.0", "react-native-svg": "13.9.0", - "react-redux": "7.2.6", - "redux": "4.1.2", "react-query": "~3.39.2", - "@kkt/doc": "^1.0.0", - "@uiw/react-native-doc": "^3.0.7", - "@shopify/restyle": "2.4.2" + "react-redux": "8.0.5", + "redux": "4.1.2" }, "devDependencies": { - "@babel/core": "~7.18.9", - "@babel/runtime": "~7.18.9", - "@react-native-community/eslint-config": "3.0.3", - "babel-jest": "~28.1.3", + "@babel/core": "~7.20.0", + "@babel/preset-env": "^7.20.0", + "@babel/runtime": "~7.20.0", + "@react-native-community/eslint-config": "3.2.0", + "@tsconfig/react-native": "^2.0.2", + "@types/jest": "^29.2.1", + "@types/react": "^18.0.24", + "@types/react-test-renderer": "^18.0.0", + "babel-jest": "~29.2.1", + "babel-plugin-module-resolver": "^4.1.0", "eslint": "~8.21.0", "eslint-plugin-prettier": "~4.2.1", - "jest": "27.2.0", - "metro-react-native-babel-preset": "^0.72.3", - "babel-plugin-module-resolver": "^4.1.0", + "husky": "^8.0.0", + "jest": "29.2.1", + "lint-staged": "~12.5.0", + "metro-react-native-babel-preset": "^0.73.9", "mocker-api": "~2.9.5", "prettier": "^2.8.0", - "lint-staged": "~12.5.0", - "husky": "^8.0.0", - "react-test-renderer": "18.1.0" + "react-test-renderer": "18.2.0", + "typescript": "4.8.4" }, "lint-staged": { "*.{js,jsx}": [ diff --git a/HelloWorld/src/hooks/users.js b/HelloWorld/src/hooks/users.js index bb32d918..24a4470f 100644 --- a/HelloWorld/src/hooks/users.js +++ b/HelloWorld/src/hooks/users.js @@ -3,7 +3,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; import {userLogin, userAuth} from '../services/users'; import {useQuery, useMutation} from 'react-query'; import Global from '../global'; - +import conf from '../config'; // 登录 export const login = ({config = {}, update, formData, remember}) => { const mutation = useMutation({ diff --git a/template/README.md b/template/README.md index 1310ef6c..2b7bdcae 100644 --- a/template/README.md +++ b/template/README.md @@ -160,14 +160,14 @@ As always, thanks to our amazing contributors! ... - - panbibi - xyf 逍遥 + + + panbibi Made with [contributors](https://github.com/jaywcjlove/github-action-contributors). diff --git a/template/template/Gemfile b/template/template/Gemfile index 5efda89f..1142b1b2 100644 --- a/template/template/Gemfile +++ b/template/template/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '2.7.5' +ruby '>= 2.6.10' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods', '>= 1.11.3' diff --git a/template/template/_buckconfig b/template/template/_buckconfig deleted file mode 100644 index 934256cb..00000000 --- a/template/template/_buckconfig +++ /dev/null @@ -1,6 +0,0 @@ - -[android] - target = Google Inc.:Google APIs:23 - -[maven_repositories] - central = https://repo1.maven.org/maven2 diff --git a/template/template/_flowconfig b/template/template/_flowconfig deleted file mode 100644 index 3782e447..00000000 --- a/template/template/_flowconfig +++ /dev/null @@ -1,66 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore polyfills -node_modules/react-native/Libraries/polyfills/.* - -; Flow doesn't support platforms -.*/Libraries/Utilities/LoadingView.js - -.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ - -[untyped] -.*/node_modules/@react-native-community/cli/.*/.* - -[include] - -[libs] -node_modules/react-native/interface.js -node_modules/react-native/flow/ - -[options] -emoji=true - -exact_by_default=true - -format.bracket_spacing=false - -module.file_ext=.js -module.file_ext=.json -module.file_ext=.ios.js - -munge_underscores=true - -module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' -module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FlowFixMeProps -suppress_type=$FlowFixMeState - -[lints] -sketchy-null-number=warn -sketchy-null-mixed=warn -sketchy-number=warn -untyped-type-import=warn -nonstrict-import=warn -deprecated-type=warn -unsafe-getters-setters=warn -unnecessary-invariant=warn - -[strict] -deprecated-type -nonstrict-import -sketchy-null -unclear-type -unsafe-getters-setters -untyped-import -untyped-type-import - -[version] -^0.182.0 diff --git a/template/template/_gitignore b/template/template/_gitignore index 6f0aeb93..14814b11 100644 --- a/template/template/_gitignore +++ b/template/template/_gitignore @@ -31,17 +31,14 @@ local.properties *.iml *.hprof .cxx/ +*.keystore +!debug.keystore # node.js # node_modules/ npm-debug.log yarn-error.log -# BUCK -buck-out/ -\.buckd/ -*.keystore -!debug.keystore # fastlane # @@ -61,3 +58,7 @@ buck-out/ # Ruby / CocoaPods /ios/Pods/ /vendor/bundle/ + + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* diff --git a/template/template/_node-version b/template/template/_node-version index 19c7bdba..25bf17fc 100644 --- a/template/template/_node-version +++ b/template/template/_node-version @@ -1 +1 @@ -16 \ No newline at end of file +18 \ No newline at end of file diff --git a/template/template/_ruby-version b/template/template/_ruby-version deleted file mode 100644 index a603bb50..00000000 --- a/template/template/_ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.5 diff --git a/template/template/android/app/_BUCK b/template/template/android/app/_BUCK deleted file mode 100644 index 0e779048..00000000 --- a/template/template/android/app/_BUCK +++ /dev/null @@ -1,55 +0,0 @@ -# To learn about Buck see [Docs](https://buckbuild.com/). -# To run your application with Buck: -# - install Buck -# - `npm start` - to start the packager -# - `cd android` -# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` -# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck -# - `buck install -r android/app` - compile, install and run application -# - -load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") - -lib_deps = [] - -create_aar_targets(glob(["libs/*.aar"])) - -create_jar_targets(glob(["libs/*.jar"])) - -android_library( - name = "all-libs", - exported_deps = lib_deps, -) - -android_library( - name = "app-code", - srcs = glob([ - "src/main/java/**/*.java", - ]), - deps = [ - ":all-libs", - ":build_config", - ":res", - ], -) - -android_build_config( - name = "build_config", - package = "com.helloworld", -) - -android_resource( - name = "res", - package = "com.helloworld", - res = "src/main/res", -) - -android_binary( - name = "app", - keystore = "//android/keystores:debug", - manifest = "src/main/AndroidManifest.xml", - package_type = "debug", - deps = [ - ":app-code", - ], -) diff --git a/template/template/android/app/build.gradle b/template/template/android/app/build.gradle index 608db2ce..951be455 100644 --- a/template/template/android/app/build.gradle +++ b/template/template/android/app/build.gradle @@ -1,127 +1,79 @@ apply plugin: "com.android.application" -import com.android.build.OutputFile -import org.apache.tools.ant.taskdefs.condition.Os +apply plugin: "com.facebook.react" +import com.android.build.OutputFile /** - * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets - * and bundleReleaseJsAndAssets). - * These basically call `react-native bundle` with the correct arguments during the Android build - * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the - * bundle directly from the development server. Below you can see all the possible configurations - * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "../../node_modules/react-native/react.gradle"` line. - * - * project.ext.react = [ - * // the name of the generated asset file containing your JS bundle - * bundleAssetName: "index.android.bundle", - * - * // the entry file for bundle generation. If none specified and - * // "index.android.js" exists, it will be used. Otherwise "index.js" is - * // default. Can be overridden with ENTRY_FILE environment variable. - * entryFile: "index.android.js", - * - * // https://reactnative.dev/docs/performance#enable-the-ram-format - * bundleCommand: "ram-bundle", - * - * // whether to bundle JS and assets in debug mode - * bundleInDebug: false, - * - * // whether to bundle JS and assets in release mode - * bundleInRelease: true, - * - * // whether to bundle JS and assets in another build variant (if configured). - * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property can be in the following formats - * // 'bundleIn${productFlavor}${buildType}' - * // 'bundleIn${buildType}' - * // bundleInFreeDebug: true, - * // bundleInPaidRelease: true, - * // bundleInBeta: true, - * - * // whether to disable dev mode in custom build variants (by default only disabled in release) - * // for example: to disable dev mode in the staging build type (if configured) - * devDisabledInStaging: true, - * // The configuration property can be in the following formats - * // 'devDisabledIn${productFlavor}${buildType}' - * // 'devDisabledIn${buildType}' - * - * // the root of your project, i.e. where "package.json" lives - * root: "../../", - * - * // where to put the JS bundle asset in debug mode - * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", - * - * // where to put the JS bundle asset in release mode - * jsBundleDirRelease: "$buildDir/intermediates/assets/release", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in debug mode - * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in release mode - * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", - * - * // by default the gradle tasks are skipped if none of the JS files or assets change; this means - * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to - * // date; if you have any other folders that you want to ignore for performance reasons (gradle - * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ - * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"], - * - * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"], - * - * // supply additional arguments to the packager - * extraPackagerArgs: [] - * ] + * 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. */ - -project.ext.react = [ - enableHermes: true, // clean and rebuild if changing -] - -apply from: "../../node_modules/react-native/react.gradle" - +react { + /* Folders */ + // The root of your project, i.e. where "package.json" lives. Default is '..' + // 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 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") + /* Variants */ + // The list of variants to that are debuggable. For those we're going to + // skip the bundling of the JS bundle and the assets. By default is just 'debug'. + // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. + // debuggableVariants = ["liteDebug", "prodDebug"] + /* Bundling */ + // A list containing the node command and its flags. Default is just 'node'. + // nodeExecutableAndArgs = ["node"] + // + // The command to run when bundling. By default is 'bundle' + // bundleCommand = "ram-bundle" + // + // The path to the CLI configuration file. Default is empty. + // bundleConfig = file(../rn-cli.config.js) + // + // The name of the generated asset file containing your JS bundle + // bundleAssetName = "MyApplication.android.bundle" + // + // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' + // entryFile = file("../js/MyApplication.android.js") + // + // A list of extra flags to pass to the 'bundle' commands. + // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle + // extraPackagerArgs = [] + /* Hermes Commands */ + // The hermes compiler command to run. By default it is 'hermesc' + // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" + // + // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" + // hermesFlags = ["-O", "-output-source-map"] +} /** - * Set this to true to create two separate APKs instead of one: - * - An APK that only works on ARM devices - * - An APK that only works on x86 devices - * The advantage is the size of the APK is reduced by about 4MB. - * Upload all the APKs to the Play Store and people will download - * the correct one based on the CPU architecture of their device. + * 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 - /** - * Run Proguard to shrink the Java bytecode in release builds. + * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ def enableProguardInReleaseBuilds = false - /** - * The preferred build flavor of JavaScriptCore. + * The preferred build flavor of JavaScriptCore (JSC) * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that - * give correct results when using with locales other than en-US. Note that + * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' - -/** - * Whether to enable the Hermes VM. - * - * This should be set on project.ext.react and that value will be read here. If it is not set - * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode - * and the benefits of using Hermes will therefore be sharply reduced. - */ -def enableHermes = project.ext.react.get("enableHermes", false); - /** - * Architectures to build native code for. + * 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") @@ -132,6 +84,8 @@ android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion + + namespace "com.helloworld" defaultConfig { applicationId "com.helloworld" @@ -139,66 +93,6 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" - buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() - - if (isNewArchitectureEnabled()) { - // We configure the CMake build only if you decide to opt-in for the New Architecture. - externalNativeBuild { - cmake { - arguments "-DPROJECT_BUILD_DIR=$buildDir", - "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", - "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", - "-DNODE_MODULES_DIR=$rootDir/../node_modules", - "-DANDROID_STL=c++_shared" - } - } - if (!enableSeparateBuildPerCPUArchitecture) { - ndk { - abiFilters (*reactNativeArchitectures()) - } - } - } - } - - if (isNewArchitectureEnabled()) { - // We configure the NDK build only if you decide to opt-in for the New Architecture. - externalNativeBuild { - cmake { - path "$projectDir/src/main/jni/CMakeLists.txt" - } - } - def reactAndroidProjectDir = project(':ReactAndroid').projectDir - def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { - dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") - from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") - into("$buildDir/react-ndk/exported") - } - def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { - dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") - from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") - into("$buildDir/react-ndk/exported") - } - afterEvaluate { - // If you wish to add a custom TurboModule or component locally, - // you should uncomment this line. - // preBuild.dependsOn("generateCodegenArtifactsFromSchema") - preDebugBuild.dependsOn(packageReactNdkDebugLibs) - preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) - - // Due to a bug inside AGP, we have to explicitly set a dependency - // between configureCMakeDebug* tasks and the preBuild tasks. - // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 - configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) - configureCMakeDebug.dependsOn(preDebugBuild) - reactNativeArchitectures().each { architecture -> - tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { - dependsOn("preDebugBuild") - } - tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { - dependsOn("preReleaseBuild") - } - } - } } splits { @@ -248,65 +142,24 @@ android { } dependencies { - implementation fileTree(dir: "libs", include: ["*.jar"]) - - //noinspection GradleDynamicVersion - implementation "com.facebook.react:react-native:+" // From node_modules - - implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" - - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { - exclude group:'com.facebook.fbjni' - } + // 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") + debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") 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' - } + debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") - if (enableHermes) { - //noinspection GradleDynamicVersion - implementation("com.facebook.react:hermes-engine:+") { // From node_modules - exclude group:'com.facebook.fbjni' - } + debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") + if (hermesEnabled.toBoolean()) { + implementation("com.facebook.react:hermes-android") } else { implementation jscFlavor } } -if (isNewArchitectureEnabled()) { - // If new architecture is enabled, we let you build RN from source - // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. - // This will be applied to all the imported transtitive dependency. - configurations.all { - resolutionStrategy.dependencySubstitution { - substitute(module("com.facebook.react:react-native")) - .using(project(":ReactAndroid")) - .because("On New Architecture we're building React Native from source") - substitute(module("com.facebook.react:hermes-engine")) - .using(project(":ReactAndroid:hermes-engine")) - .because("On New Architecture we're building Hermes from source") - } - } -} - -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.implementation - into 'libs' -} - apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) -def isNewArchitectureEnabled() { - // To opt-in for the New Architecture, you can either: - // - Set `newArchEnabled` to true inside the `gradle.properties` file - // - Invoke gradle with `-newArchEnabled=true` - // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` - return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" -} diff --git a/template/template/android/app/build_defs.bzl b/template/template/android/app/build_defs.bzl deleted file mode 100644 index fff270f8..00000000 --- a/template/template/android/app/build_defs.bzl +++ /dev/null @@ -1,19 +0,0 @@ -"""Helper definitions to glob .aar and .jar targets""" - -def create_aar_targets(aarfiles): - for aarfile in aarfiles: - name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] - lib_deps.append(":" + name) - android_prebuilt_aar( - name = name, - aar = aarfile, - ) - -def create_jar_targets(jarfiles): - for jarfile in jarfiles: - name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] - lib_deps.append(":" + name) - prebuilt_jar( - name = name, - binary_jar = jarfile, - ) diff --git a/template/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/template/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java index 8ed784fe..35c64dbe 100644 --- a/template/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java +++ b/template/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java @@ -17,7 +17,7 @@ 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.react.ReactFlipperPlugin; + import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; import com.facebook.react.ReactInstanceEventListener; import com.facebook.react.ReactInstanceManager; @@ -25,13 +25,18 @@ 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 ReactFlipperPlugin()); + client.addPlugin(new DatabasesFlipperPlugin(context)); client.addPlugin(new SharedPreferencesFlipperPlugin(context)); client.addPlugin(CrashReporterPlugin.getInstance()); diff --git a/template/template/android/app/src/main/AndroidManifest.xml b/template/template/android/app/src/main/AndroidManifest.xml index 7ba57ca1..4122f36a 100644 --- a/template/template/android/app/src/main/AndroidManifest.xml +++ b/template/template/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/template/template/android/app/src/main/java/com/helloworld/MainActivity.java b/template/template/android/app/src/main/java/com/helloworld/MainActivity.java index 405d80a8..ba373903 100644 --- a/template/template/android/app/src/main/java/com/helloworld/MainActivity.java +++ b/template/template/android/app/src/main/java/com/helloworld/MainActivity.java @@ -2,7 +2,8 @@ import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.ReactRootView; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactActivityDelegate; public class MainActivity extends ReactActivity { @@ -16,33 +17,19 @@ protected String getMainComponentName() { } /** - * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and - * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer - * (Paper). + * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link + * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React + * (aka React 18) with two boolean flags. */ @Override protected ReactActivityDelegate createReactActivityDelegate() { - return new MainActivityDelegate(this, getMainComponentName()); - } - - public static class MainActivityDelegate extends ReactActivityDelegate { - public MainActivityDelegate(ReactActivity activity, String mainComponentName) { - super(activity, mainComponentName); - } - - @Override - protected ReactRootView createRootView() { - ReactRootView reactRootView = new ReactRootView(getContext()); - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); - return reactRootView; - } - - @Override - protected boolean isConcurrentRootEnabled() { - // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). - // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } + return new DefaultReactActivityDelegate( + this, + getMainComponentName(), + // If you opted-in for the New Architecture, we enable the Fabric Renderer. + DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled + // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). + DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled + ); } } diff --git a/template/template/android/app/src/main/java/com/helloworld/MainApplication.java b/template/template/android/app/src/main/java/com/helloworld/MainApplication.java index eedd1929..58e06c16 100644 --- a/template/template/android/app/src/main/java/com/helloworld/MainApplication.java +++ b/template/template/android/app/src/main/java/com/helloworld/MainApplication.java @@ -1,22 +1,21 @@ package com.helloworld; 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.react.config.ReactFeatureFlags; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactNativeHost; import com.facebook.soloader.SoLoader; -import com.helloworld.newarchitecture.MainApplicationReactNativeHost; -import java.lang.reflect.InvocationTargetException; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = - new ReactNativeHost(this) { + new DefaultReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; @@ -35,57 +34,27 @@ protected List getPackages() { protected String getJSMainModuleName() { return "index"; } + @Override + protected boolean isNewArchEnabled() { + return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; + } + @Override + protected Boolean isHermesEnabled() { + return BuildConfig.IS_HERMES_ENABLED; + } }; - - private final ReactNativeHost mNewArchitectureNativeHost = - new MainApplicationReactNativeHost(this); - @Override public ReactNativeHost getReactNativeHost() { - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - return mNewArchitectureNativeHost; - } else { - return mReactNativeHost; - } + return mReactNativeHost; } - @Override public void onCreate() { super.onCreate(); - // If you opted-in for the New Architecture, we enable the TurboModule system - ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; SoLoader.init(this, /* native exopackage */ false); - initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - } - - /** - * Loads Flipper in React Native templates. Call this in the onCreate method with something like - * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); - * - * @param context - * @param reactInstanceManager - */ - 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.helloworld.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(); - } + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + // If you opted-in for the New Architecture, we load the native entry point for this app. + DefaultNewArchitectureEntryPoint.load(); } + ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } -} +} \ No newline at end of file diff --git a/template/template/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/template/template/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java deleted file mode 100644 index 55473c3f..00000000 --- a/template/template/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.helloworld.newarchitecture; - -import android.app.Application; -import androidx.annotation.NonNull; -import com.facebook.react.PackageList; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.ReactPackageTurboModuleManagerDelegate; -import com.facebook.react.bridge.JSIModulePackage; -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.ReactApplicationContext; -import com.facebook.react.bridge.UIManager; -import com.facebook.react.fabric.ComponentFactory; -import com.facebook.react.fabric.CoreComponentsRegistry; -import com.facebook.react.fabric.FabricJSIModuleProvider; -import com.facebook.react.fabric.ReactNativeConfig; -import com.facebook.react.uimanager.ViewManagerRegistry; -import com.helloworld.BuildConfig; -import com.helloworld.newarchitecture.components.MainComponentsRegistry; -import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; -import java.util.ArrayList; -import java.util.List; - -/** - * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both - * TurboModule delegates and the Fabric Renderer. - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -public class MainApplicationReactNativeHost extends ReactNativeHost { - public MainApplicationReactNativeHost(Application application) { - super(application); - } - - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: - // packages.add(new TurboReactPackage() { ... }); - // If you have custom Fabric Components, their ViewManagers should also be loaded here - // inside a ReactPackage. - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - - @NonNull - @Override - protected ReactPackageTurboModuleManagerDelegate.Builder - getReactPackageTurboModuleManagerDelegateBuilder() { - // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary - // for the new architecture and to use TurboModules correctly. - return new MainApplicationTurboModuleManagerDelegate.Builder(); - } - - @Override - protected JSIModulePackage getJSIModulePackage() { - return new JSIModulePackage() { - @Override - public List getJSIModules( - final ReactApplicationContext reactApplicationContext, - final JavaScriptContextHolder jsContext) { - final List specs = new ArrayList<>(); - - // Here we provide a new JSIModuleSpec that will be responsible of providing the - // custom Fabric Components. - specs.add( - new JSIModuleSpec() { - @Override - public JSIModuleType getJSIModuleType() { - return JSIModuleType.UIManager; - } - - @Override - public JSIModuleProvider getJSIModuleProvider() { - final ComponentFactory componentFactory = new ComponentFactory(); - CoreComponentsRegistry.register(componentFactory); - - // Here we register a Components Registry. - // The one that is generated with the template contains no components - // and just provides you the one from React Native core. - MainComponentsRegistry.register(componentFactory); - - final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); - - ViewManagerRegistry viewManagerRegistry = - new ViewManagerRegistry( - reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); - - return new FabricJSIModuleProvider( - reactApplicationContext, - componentFactory, - ReactNativeConfig.DEFAULT_CONFIG, - viewManagerRegistry); - } - }); - return specs; - } - }; - } -} diff --git a/template/template/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/template/template/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java deleted file mode 100644 index c74d0cca..00000000 --- a/template/template/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.helloworld.newarchitecture.components; - -import com.facebook.jni.HybridData; -import com.facebook.proguard.annotations.DoNotStrip; -import com.facebook.react.fabric.ComponentFactory; -import com.facebook.soloader.SoLoader; - -/** - * Class responsible to load the custom Fabric Components. This class has native methods and needs a - * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ - * folder for you). - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -@DoNotStrip -public class MainComponentsRegistry { - static { - SoLoader.loadLibrary("fabricjni"); - } - - @DoNotStrip private final HybridData mHybridData; - - @DoNotStrip - private native HybridData initHybrid(ComponentFactory componentFactory); - - @DoNotStrip - private MainComponentsRegistry(ComponentFactory componentFactory) { - mHybridData = initHybrid(componentFactory); - } - - @DoNotStrip - public static MainComponentsRegistry register(ComponentFactory componentFactory) { - return new MainComponentsRegistry(componentFactory); - } -} diff --git a/template/template/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/template/template/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java deleted file mode 100644 index 8593b3bb..00000000 --- a/template/template/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.helloworld.newarchitecture.modules; - -import com.facebook.jni.HybridData; -import com.facebook.react.ReactPackage; -import com.facebook.react.ReactPackageTurboModuleManagerDelegate; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.soloader.SoLoader; -import java.util.List; - -/** - * Class responsible to load the TurboModules. This class has native methods and needs a - * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ - * folder for you). - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -public class MainApplicationTurboModuleManagerDelegate - extends ReactPackageTurboModuleManagerDelegate { - - private static volatile boolean sIsSoLibraryLoaded; - - protected MainApplicationTurboModuleManagerDelegate( - ReactApplicationContext reactApplicationContext, List packages) { - super(reactApplicationContext, packages); - } - - protected native HybridData initHybrid(); - - native boolean canCreateTurboModule(String moduleName); - - public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { - protected MainApplicationTurboModuleManagerDelegate build( - ReactApplicationContext context, List packages) { - return new MainApplicationTurboModuleManagerDelegate(context, packages); - } - } - - @Override - protected synchronized void maybeLoadOtherSoLibraries() { - if (!sIsSoLibraryLoaded) { - // If you change the name of your application .so file in the Android.mk file, - // make sure you update the name here as well. - SoLoader.loadLibrary("helloworld_appmodules"); - sIsSoLibraryLoaded = true; - } - } -} diff --git a/template/template/android/app/src/main/jni/CMakeLists.txt b/template/template/android/app/src/main/jni/CMakeLists.txt deleted file mode 100644 index 91afb1b2..00000000 --- a/template/template/android/app/src/main/jni/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -# Define the library name here. -project(helloworld_appmodules) -# This file includes all the necessary to let you build your application with the New Architecture. -include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) \ No newline at end of file diff --git a/template/template/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/template/template/android/app/src/main/jni/MainApplicationModuleProvider.cpp deleted file mode 100644 index 340b97c7..00000000 --- a/template/template/android/app/src/main/jni/MainApplicationModuleProvider.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "MainApplicationModuleProvider.h" - -#include -#include - -namespace facebook { -namespace react { - -std::shared_ptr MainApplicationModuleProvider( - const std::string &moduleName, - const JavaTurboModule::InitParams ¶ms) { - // Here you can provide your own module provider for TurboModules coming from - // either your application or from external libraries. The approach to follow - // is similar to the following (for a library called `samplelibrary`: - // - // auto module = samplelibrary_ModuleProvider(moduleName, params); - // if (module != nullptr) { - // return module; - // } - // return rncore_ModuleProvider(moduleName, params); - - // Module providers autolinked by RN CLI - auto rncli_module = rncli_ModuleProvider(moduleName, params); - if (rncli_module != nullptr) { - return rncli_module; - } - return rncore_ModuleProvider(moduleName, params); -} - -} // namespace react -} // namespace facebook diff --git a/template/template/android/app/src/main/jni/MainApplicationModuleProvider.h b/template/template/android/app/src/main/jni/MainApplicationModuleProvider.h deleted file mode 100644 index b38ccf53..00000000 --- a/template/template/android/app/src/main/jni/MainApplicationModuleProvider.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include - -#include - -namespace facebook { -namespace react { - -std::shared_ptr MainApplicationModuleProvider( - const std::string &moduleName, - const JavaTurboModule::InitParams ¶ms); - -} // namespace react -} // namespace facebook diff --git a/template/template/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/template/template/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp deleted file mode 100644 index 5fd688c5..00000000 --- a/template/template/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "MainApplicationTurboModuleManagerDelegate.h" -#include "MainApplicationModuleProvider.h" - -namespace facebook { -namespace react { - -jni::local_ref -MainApplicationTurboModuleManagerDelegate::initHybrid( - jni::alias_ref) { - return makeCxxInstance(); -} - -void MainApplicationTurboModuleManagerDelegate::registerNatives() { - registerHybrid({ - makeNativeMethod( - "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), - makeNativeMethod( - "canCreateTurboModule", - MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), - }); -} - -std::shared_ptr -MainApplicationTurboModuleManagerDelegate::getTurboModule( - const std::string &name, - const std::shared_ptr &jsInvoker) { - // Not implemented yet: provide pure-C++ NativeModules here. - return nullptr; -} - -std::shared_ptr -MainApplicationTurboModuleManagerDelegate::getTurboModule( - const std::string &name, - const JavaTurboModule::InitParams ¶ms) { - return MainApplicationModuleProvider(name, params); -} - -bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( - const std::string &name) { - return getTurboModule(name, nullptr) != nullptr || - getTurboModule(name, {.moduleName = name}) != nullptr; -} - -} // namespace react -} // namespace facebook diff --git a/template/template/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/template/template/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h deleted file mode 100644 index 9ee38a81..00000000 --- a/template/template/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include - -#include -#include - -namespace facebook { -namespace react { - -class MainApplicationTurboModuleManagerDelegate - : public jni::HybridClass< - MainApplicationTurboModuleManagerDelegate, - TurboModuleManagerDelegate> { - public: - // Adapt it to the package you used for your Java class. - static constexpr auto kJavaDescriptor = - "Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; - - static jni::local_ref initHybrid(jni::alias_ref); - - static void registerNatives(); - - std::shared_ptr getTurboModule( - const std::string &name, - const std::shared_ptr &jsInvoker) override; - std::shared_ptr getTurboModule( - const std::string &name, - const JavaTurboModule::InitParams ¶ms) override; - - /** - * Test-only method. Allows user to verify whether a TurboModule can be - * created by instances of this class. - */ - bool canCreateTurboModule(const std::string &name); -}; - -} // namespace react -} // namespace facebook diff --git a/template/template/android/app/src/main/jni/MainComponentsRegistry.cpp b/template/template/android/app/src/main/jni/MainComponentsRegistry.cpp deleted file mode 100644 index a27a0e92..00000000 --- a/template/template/android/app/src/main/jni/MainComponentsRegistry.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "MainComponentsRegistry.h" - -#include -#include -#include -#include -#include - -namespace facebook { -namespace react { - -MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} - -std::shared_ptr -MainComponentsRegistry::sharedProviderRegistry() { - auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); - - // Autolinked providers registered by RN CLI - rncli_registerProviders(providerRegistry); - - // Custom Fabric Components go here. You can register custom - // components coming from your App or from 3rd party libraries here. - // - // providerRegistry->add(concreteComponentDescriptorProvider< - // AocViewerComponentDescriptor>()); - return providerRegistry; -} - -jni::local_ref -MainComponentsRegistry::initHybrid( - jni::alias_ref, - ComponentFactory *delegate) { - auto instance = makeCxxInstance(delegate); - - auto buildRegistryFunction = - [](EventDispatcher::Weak const &eventDispatcher, - ContextContainer::Shared const &contextContainer) - -> ComponentDescriptorRegistry::Shared { - auto registry = MainComponentsRegistry::sharedProviderRegistry() - ->createComponentDescriptorRegistry( - {eventDispatcher, contextContainer}); - - auto mutableRegistry = - std::const_pointer_cast(registry); - - mutableRegistry->setFallbackComponentDescriptor( - std::make_shared( - ComponentDescriptorParameters{ - eventDispatcher, contextContainer, nullptr})); - - return registry; - }; - - delegate->buildRegistryFunction = buildRegistryFunction; - return instance; -} - -void MainComponentsRegistry::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), - }); -} - -} // namespace react -} // namespace facebook diff --git a/template/template/android/app/src/main/jni/MainComponentsRegistry.h b/template/template/android/app/src/main/jni/MainComponentsRegistry.h deleted file mode 100644 index d61cbffa..00000000 --- a/template/template/android/app/src/main/jni/MainComponentsRegistry.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace facebook { -namespace react { - -class MainComponentsRegistry - : public facebook::jni::HybridClass { - public: - // Adapt it to the package you used for your Java class. - constexpr static auto kJavaDescriptor = - "Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;"; - - static void registerNatives(); - - MainComponentsRegistry(ComponentFactory *delegate); - - private: - static std::shared_ptr - sharedProviderRegistry(); - - static jni::local_ref initHybrid( - jni::alias_ref, - ComponentFactory *delegate); -}; - -} // namespace react -} // namespace facebook diff --git a/template/template/android/app/src/main/jni/OnLoad.cpp b/template/template/android/app/src/main/jni/OnLoad.cpp deleted file mode 100644 index c569b6e8..00000000 --- a/template/template/android/app/src/main/jni/OnLoad.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "MainApplicationTurboModuleManagerDelegate.h" -#include "MainComponentsRegistry.h" - -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { - return facebook::jni::initialize(vm, [] { - facebook::react::MainApplicationTurboModuleManagerDelegate:: - registerNatives(); - facebook::react::MainComponentsRegistry::registerNatives(); - }); -} diff --git a/template/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/template/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java new file mode 100644 index 00000000..6eda9233 --- /dev/null +++ b/template/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java @@ -0,0 +1,18 @@ +/** + * 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.helloworld; +import android.content.Context; +import com.facebook.react.ReactInstanceManager; +/** + * Class responsible of loading Flipper inside your React Native application. This is the release + * flavor of it so it's empty as we don't want to load Flipper. + */ +public class ReactNativeFlipper { + public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { + // Do nothing as we don't want to initialize Flipper on Release. + } +} \ No newline at end of file diff --git a/template/template/android/build.gradle b/template/template/android/build.gradle index 8569fee3..03d326c9 100644 --- a/template/template/android/build.gradle +++ b/template/template/android/build.gradle @@ -2,50 +2,20 @@ buildscript { ext { - buildToolsVersion = "31.0.0" + buildToolsVersion = "33.0.0" minSdkVersion = 21 - compileSdkVersion = 31 - targetSdkVersion = 31 + compileSdkVersion = 33 + targetSdkVersion = 33 - if (System.properties['os.arch'] == "aarch64") { - // For M1 Users we need to use the NDK 24 which added support for aarch64 - ndkVersion = "24.0.8215888" - } else { - // Otherwise we default to the side-by-side NDK version from AGP. - ndkVersion = "21.4.7075529" - } + // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. + ndkVersion = "23.1.7779620" } repositories { google() mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:7.2.1") + classpath("com.android.tools.build:gradle:7.3.1") classpath("com.facebook.react:react-native-gradle-plugin") - classpath("de.undercouch:gradle-download-task:5.0.1") - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url("$rootDir/../node_modules/react-native/android") - } - maven { - // Android JSC is installed from npm - url("$rootDir/../node_modules/jsc-android/dist") - } - mavenCentral { - // We don't want to fetch react-native from Maven Central as there are - // older versions over there. - content { - excludeGroup "com.facebook.react" - } - } - google() - maven { url 'https://www.jitpack.io' } } } diff --git a/template/template/android/gradle.properties b/template/template/android/gradle.properties index fa4feae5..29f547ac 100644 --- a/template/template/android/gradle.properties +++ b/template/template/android/gradle.properties @@ -38,3 +38,9 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 # to write custom TurboModules/Fabric components OR use libraries that # are providing them. newArchEnabled=false + + +# Use this property to enable or disable the Hermes JS engine. +# If set to false, you will be using JSC instead. +hermesEnabled=true + diff --git a/template/template/android/settings.gradle b/template/template/android/settings.gradle index bd838b9c..fef5db28 100644 --- a/template/template/android/settings.gradle +++ b/template/template/android/settings.gradle @@ -3,9 +3,3 @@ apply from: file("../node_modules/@react-native-community/cli-platform-android/n include ':app' includeBuild('../node_modules/react-native-gradle-plugin') -if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { - include(":ReactAndroid") - project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') - include(":ReactAndroid:hermes-engine") - project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') -} diff --git a/template/template/ios/.xcode.env b/template/template/ios/.xcode.env new file mode 100644 index 00000000..772b339b --- /dev/null +++ b/template/template/ios/.xcode.env @@ -0,0 +1 @@ +export NODE_BINARY=$(command -v node) diff --git a/template/template/ios/HelloWorld.xcodeproj/project.pbxproj b/template/template/ios/HelloWorld.xcodeproj/project.pbxproj index afccc265..86c03507 100644 --- a/template/template/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/template/template/ios/HelloWorld.xcodeproj/project.pbxproj @@ -493,6 +493,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -519,6 +520,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/template/template/ios/HelloWorld/AppDelegate.h b/template/template/ios/HelloWorld/AppDelegate.h index ef1de86a..6788ef1c 100644 --- a/template/template/ios/HelloWorld/AppDelegate.h +++ b/template/template/ios/HelloWorld/AppDelegate.h @@ -1,8 +1,4 @@ -#import +#import #import - -@interface AppDelegate : UIResponder - -@property (nonatomic, strong) UIWindow *window; - +@interface AppDelegate : RCTAppDelegate @end diff --git a/template/template/ios/HelloWorld/AppDelegate.mm b/template/template/ios/HelloWorld/AppDelegate.mm index 28475b9c..8d96bb44 100644 --- a/template/template/ios/HelloWorld/AppDelegate.mm +++ b/template/template/ios/HelloWorld/AppDelegate.mm @@ -1,85 +1,18 @@ #import "AppDelegate.h" -#import #import -#import -#import -#if RCT_NEW_ARCH_ENABLED -#import -#import -#import -#import -#import -#import -#import - -static NSString *const kRNConcurrentRoot = @"concurrentRoot"; - -@interface AppDelegate () { - RCTTurboModuleManager *_turboModuleManager; - RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; - std::shared_ptr _reactNativeConfig; - facebook::react::ContextContainer::Shared _contextContainer; -} -@end -#endif @implementation AppDelegate - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - RCTAppSetupPrepareApp(application); - - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - -#if RCT_NEW_ARCH_ENABLED - _contextContainer = std::make_shared(); - _reactNativeConfig = std::make_shared(); - _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); - _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; - bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; -#endif - - NSDictionary *initProps = [self prepareInitialProps]; - UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"HelloWorld", initProps); - - if (@available(iOS 13.0, *)) { - rootView.backgroundColor = [UIColor systemBackgroundColor]; - } else { - rootView.backgroundColor = [UIColor whiteColor]; - } - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. -/// -/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html -/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). -/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. -- (BOOL)concurrentRootEnabled -{ - // Switch this bool to turn on and off the concurrent root - return true; -} - -- (NSDictionary *)prepareInitialProps -{ - NSMutableDictionary *initProps = [NSMutableDictionary new]; - -#ifdef RCT_NEW_ARCH_ENABLED - initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); -#endif - - return initProps; + self.moduleName = @"HelloWorld"; + // You can add your custom initial props in the dictionary below. + // They will be passed down to the ViewController used by React Native. + self.initialProps = @{}; + return [super application:application didFinishLaunchingWithOptions:launchOptions]; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge @@ -90,44 +23,13 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } - -#if RCT_NEW_ARCH_ENABLED - -#pragma mark - RCTCxxBridgeDelegate - -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge -{ - _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge - delegate:self - jsInvoker:bridge.jsCallInvoker]; - return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); -} - -#pragma mark RCTTurboModuleManagerDelegate - -- (Class)getModuleClassFromName:(const char *)name -{ - return RCTCoreModulesClassProvider(name); -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - jsInvoker:(std::shared_ptr)jsInvoker -{ - return nullptr; -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - initParams: - (const facebook::react::ObjCTurboModule::InitParams &)params -{ - return nullptr; -} - -- (id)getModuleInstanceFromClass:(Class)moduleClass +/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. +/// +/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html +/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). +/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`. +- (BOOL)concurrentRootEnabled { - return RCTAppSetupDefaultModuleFromClass(moduleClass); + return true; } - -#endif - @end diff --git a/template/template/ios/HelloWorld/Info.plist b/template/template/ios/HelloWorld/Info.plist index 257f1ad4..1f24ac77 100644 --- a/template/template/ios/HelloWorld/Info.plist +++ b/template/template/ios/HelloWorld/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/template/template/ios/Podfile b/template/template/ios/Podfile index 308477ed..db479991 100644 --- a/template/template/ios/Podfile +++ b/template/template/ios/Podfile @@ -1,9 +1,23 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '12.4' -install! 'cocoapods', :deterministic_uuids => false - +platform :ios, min_ios_version_supported +prepare_react_native_project! +# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. +# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded +# +# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` +# ```js +# module.exports = { +# dependencies: { +# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), +# ``` +flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled +linkage = ENV['USE_FRAMEWORKS'] +if linkage != nil + Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green + use_frameworks! :linkage => linkage.to_sym +end target 'HelloWorld' do config = use_native_modules! @@ -21,7 +35,7 @@ target 'HelloWorld' do # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. - :flipper_configuration => FlipperConfiguration.enabled, + :flipper_configuration => flipper_config, # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) diff --git a/template/template/ios/Podfile.lock b/template/template/ios/Podfile.lock index a94ef7a9..f1d667a6 100644 --- a/template/template/ios/Podfile.lock +++ b/template/template/ios/Podfile.lock @@ -2,14 +2,14 @@ PODS: - boost (1.76.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) - - FBLazyVector (0.70.6) - - FBReactNativeSpec (0.70.6): + - FBLazyVector (0.71.7) + - FBReactNativeSpec (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.70.6) - - RCTTypeSafety (= 0.70.6) - - React-Core (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) + - RCTRequired (= 0.71.7) + - RCTTypeSafety (= 0.71.7) + - React-Core (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) - Flipper (0.125.0): - Flipper-Folly (~> 2.6) - Flipper-RSocket (~> 1.4) @@ -86,203 +86,216 @@ PODS: - DoubleConversion - fmt (~> 6.2.1) - glog - - RCTRequired (0.70.6) - - RCTTypeSafety (0.70.6): - - FBLazyVector (= 0.70.6) - - RCTRequired (= 0.70.6) - - React-Core (= 0.70.6) - - React (0.70.6): - - React-Core (= 0.70.6) - - React-Core/DevSupport (= 0.70.6) - - React-Core/RCTWebSocket (= 0.70.6) - - React-RCTActionSheet (= 0.70.6) - - React-RCTAnimation (= 0.70.6) - - React-RCTBlob (= 0.70.6) - - React-RCTImage (= 0.70.6) - - React-RCTLinking (= 0.70.6) - - React-RCTNetwork (= 0.70.6) - - React-RCTSettings (= 0.70.6) - - React-RCTText (= 0.70.6) - - React-RCTVibration (= 0.70.6) - - React-bridging (0.70.6): - - RCT-Folly (= 2021.07.22.00) - - React-jsi (= 0.70.6) - - React-callinvoker (0.70.6) - - React-Codegen (0.70.6): - - FBReactNativeSpec (= 0.70.6) - - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.70.6) - - RCTTypeSafety (= 0.70.6) - - React-Core (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-Core (0.70.6): + - RCTRequired (0.71.7) + - RCTTypeSafety (0.71.7): + - FBLazyVector (= 0.71.7) + - RCTRequired (= 0.71.7) + - React-Core (= 0.71.7) + - React (0.71.7): + - React-Core (= 0.71.7) + - React-Core/DevSupport (= 0.71.7) + - React-Core/RCTWebSocket (= 0.71.7) + - React-RCTActionSheet (= 0.71.7) + - React-RCTAnimation (= 0.71.7) + - React-RCTBlob (= 0.71.7) + - React-RCTImage (= 0.71.7) + - React-RCTLinking (= 0.71.7) + - React-RCTNetwork (= 0.71.7) + - React-RCTSettings (= 0.71.7) + - React-RCTText (= 0.71.7) + - React-RCTVibration (= 0.71.7) + - React-callinvoker (0.71.7) + - React-Codegen (0.71.7): + - FBReactNativeSpec + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - React-jsc + - React-jsi + - React-jsiexecutor + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - React-Core (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-Core/Default (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/CoreModulesHeaders (0.70.6): + - React-Core/CoreModulesHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/Default (0.70.6): + - React-Core/Default (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/DevSupport (0.70.6): + - React-Core/DevSupport (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.6) - - React-Core/RCTWebSocket (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-jsinspector (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-Core/Default (= 0.71.7) + - React-Core/RCTWebSocket (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-jsinspector (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTActionSheetHeaders (0.70.6): + - React-Core/RCTActionSheetHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTAnimationHeaders (0.70.6): + - React-Core/RCTAnimationHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTBlobHeaders (0.70.6): + - React-Core/RCTBlobHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTImageHeaders (0.70.6): + - React-Core/RCTImageHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTLinkingHeaders (0.70.6): + - React-Core/RCTLinkingHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTNetworkHeaders (0.70.6): + - React-Core/RCTNetworkHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTSettingsHeaders (0.70.6): + - React-Core/RCTSettingsHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTTextHeaders (0.70.6): + - React-Core/RCTTextHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTVibrationHeaders (0.70.6): + - React-Core/RCTVibrationHeaders (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-Core/RCTWebSocket (0.70.6): + - React-Core/RCTWebSocket (0.71.7): - glog - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsiexecutor (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-Core/Default (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsc + - React-jsi (= 0.71.7) + - React-jsiexecutor (= 0.71.7) + - React-perflogger (= 0.71.7) - Yoga - - React-CoreModules (0.70.6): - - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/CoreModulesHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - React-RCTImage (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-cxxreact (0.70.6): - - boost (= 1.76.0) - - DoubleConversion - - glog + - React-CoreModules (0.71.7): - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.70.6) - - React-jsi (= 0.70.6) - - React-jsinspector (= 0.70.6) - - React-logger (= 0.70.6) - - React-perflogger (= 0.70.6) - - React-runtimeexecutor (= 0.70.6) - - React-jsi (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/CoreModulesHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - React-RCTBlob + - React-RCTImage (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-cxxreact (0.71.7): - boost (= 1.76.0) - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-jsi/Default (= 0.70.6) - - React-jsi/Default (0.70.6): + - React-callinvoker (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsinspector (= 0.71.7) + - React-logger (= 0.71.7) + - React-perflogger (= 0.71.7) + - React-runtimeexecutor (= 0.71.7) + - React-jsc (0.71.7): + - React-jsc/Fabric (= 0.71.7) + - React-jsi (= 0.71.7) + - React-jsc/Fabric (0.71.7): + - React-jsi (= 0.71.7) + - React-jsi (0.71.7): - boost (= 1.76.0) - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-jsiexecutor (0.70.6): + - React-jsiexecutor (0.71.7): - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-perflogger (= 0.70.6) - - React-jsinspector (0.70.6) - - React-logger (0.70.6): + - React-cxxreact (= 0.71.7) + - React-jsi (= 0.71.7) + - React-perflogger (= 0.71.7) + - React-jsinspector (0.71.7) + - React-logger (0.71.7): - glog - react-native-safe-area-context (4.3.4): - RCT-Folly @@ -290,81 +303,96 @@ PODS: - RCTTypeSafety - React-Core - ReactCommon/turbomodule/core - - React-perflogger (0.70.6) - - React-RCTActionSheet (0.70.6): - - React-Core/RCTActionSheetHeaders (= 0.70.6) - - React-RCTAnimation (0.70.6): + - React-perflogger (0.71.7) + - React-RCTActionSheet (0.71.7): + - React-Core/RCTActionSheetHeaders (= 0.71.7) + - React-RCTAnimation (0.71.7): + - RCT-Folly (= 2021.07.22.00) + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTAnimationHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTAppDelegate (0.71.7): + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - ReactCommon/turbomodule/core + - React-RCTBlob (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTAnimationHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTBlob (0.70.6): + - React-Codegen (= 0.71.7) + - React-Core/RCTBlobHeaders (= 0.71.7) + - React-Core/RCTWebSocket (= 0.71.7) + - React-jsi (= 0.71.7) + - React-RCTNetwork (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTImage (0.71.7): - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.70.6) - - React-Core/RCTBlobHeaders (= 0.70.6) - - React-Core/RCTWebSocket (= 0.70.6) - - React-jsi (= 0.70.6) - - React-RCTNetwork (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTImage (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTImageHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - React-RCTNetwork (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTLinking (0.71.7): + - React-Codegen (= 0.71.7) + - React-Core/RCTLinkingHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTNetwork (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTImageHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - React-RCTNetwork (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTLinking (0.70.6): - - React-Codegen (= 0.70.6) - - React-Core/RCTLinkingHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTNetwork (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTNetworkHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTSettings (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTNetworkHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTSettings (0.70.6): + - RCTTypeSafety (= 0.71.7) + - React-Codegen (= 0.71.7) + - React-Core/RCTSettingsHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-RCTText (0.71.7): + - React-Core/RCTTextHeaders (= 0.71.7) + - React-RCTVibration (0.71.7): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.6) - - React-Codegen (= 0.70.6) - - React-Core/RCTSettingsHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-RCTText (0.70.6): - - React-Core/RCTTextHeaders (= 0.70.6) - - React-RCTVibration (0.70.6): + - React-Codegen (= 0.71.7) + - React-Core/RCTVibrationHeaders (= 0.71.7) + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/core (= 0.71.7) + - React-runtimeexecutor (0.71.7): + - React-jsi (= 0.71.7) + - ReactCommon/turbomodule/bridging (0.71.7): + - DoubleConversion + - glog - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.70.6) - - React-Core/RCTVibrationHeaders (= 0.70.6) - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (= 0.70.6) - - React-runtimeexecutor (0.70.6): - - React-jsi (= 0.70.6) - - ReactCommon/turbomodule/core (0.70.6): + - React-callinvoker (= 0.71.7) + - React-Core (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsi (= 0.71.7) + - React-logger (= 0.71.7) + - React-perflogger (= 0.71.7) + - ReactCommon/turbomodule/core (0.71.7): - DoubleConversion - glog - RCT-Folly (= 2021.07.22.00) - - React-bridging (= 0.70.6) - - React-callinvoker (= 0.70.6) - - React-Core (= 0.70.6) - - React-cxxreact (= 0.70.6) - - React-jsi (= 0.70.6) - - React-logger (= 0.70.6) - - React-perflogger (= 0.70.6) + - React-callinvoker (= 0.71.7) + - React-Core (= 0.71.7) + - React-cxxreact (= 0.71.7) + - React-jsi (= 0.71.7) + - React-logger (= 0.71.7) + - React-perflogger (= 0.71.7) - RNCAsyncStorage (1.17.12): - React-Core - RNCMaskedView (0.1.11): - React - RNDeviceInfo (10.0.2): - React-Core - - RNGestureHandler (2.5.0): + - RNGestureHandler (2.8.0): - React-Core - - RNReanimated (2.9.1): + - RNReanimated (3.0.2): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -433,7 +461,6 @@ DEPENDENCIES: - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - React (from `../node_modules/react-native/`) - - React-bridging (from `../node_modules/react-native/ReactCommon`) - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) - React-Codegen (from `build/generated/ios`) - React-Core (from `../node_modules/react-native/`) @@ -441,6 +468,7 @@ DEPENDENCIES: - React-Core/RCTWebSocket (from `../node_modules/react-native/`) - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) + - React-jsc (from `../node_modules/react-native/ReactCommon/jsc`) - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) @@ -449,6 +477,7 @@ DEPENDENCIES: - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) + - React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`) - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) @@ -504,8 +533,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/TypeSafety" React: :path: "../node_modules/react-native/" - React-bridging: - :path: "../node_modules/react-native/ReactCommon" React-callinvoker: :path: "../node_modules/react-native/ReactCommon/callinvoker" React-Codegen: @@ -516,6 +543,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/React/CoreModules" React-cxxreact: :path: "../node_modules/react-native/ReactCommon/cxxreact" + React-jsc: + :path: "../node_modules/react-native/ReactCommon/jsc" React-jsi: :path: "../node_modules/react-native/ReactCommon/jsi" React-jsiexecutor: @@ -532,6 +561,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/ActionSheetIOS" React-RCTAnimation: :path: "../node_modules/react-native/Libraries/NativeAnimation" + React-RCTAppDelegate: + :path: "../node_modules/react-native/Libraries/AppDelegate" React-RCTBlob: :path: "../node_modules/react-native/Libraries/Blob" React-RCTImage: @@ -568,11 +599,11 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: a7c83b31436843459a1961bfd74b96033dc77234 + boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - FBLazyVector: 48289402952f4f7a4e235de70a9a590aa0b79ef4 - FBReactNativeSpec: dd1186fd05255e3457baa2f4ca65e94c2cd1e3ac + FBLazyVector: a89a0525bc7ca174675045c2b492b5280d5a2470 + FBReactNativeSpec: 7714e6bc1e9ea23df6c4cb42f0b2fd9c6a3a559c Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 @@ -586,44 +617,45 @@ SPEC CHECKSUMS: glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda - RCTRequired: e1866f61af7049eb3d8e08e8b133abd38bc1ca7a - RCTTypeSafety: 27c2ac1b00609a432ced1ae701247593f07f901e - React: bb3e06418d2cc48a84f9666a576c7b38e89cd7db - React-bridging: 572502ec59c9de30309afdc4932e278214288913 - React-callinvoker: 6b708b79c69f3359d42f1abb4663f620dbd4dadf - React-Codegen: 74e1cd7cee692a8b983c18df3274b5e749de07c8 - React-Core: b587d0a624f9611b0e032505f3d6f25e8daa2bee - React-CoreModules: c6ff48b985e7aa622e82ca51c2c353c7803eb04e - React-cxxreact: ade3d9e63c599afdead3c35f8a8bd12b3da6730b - React-jsi: 5a3952e0c6d57460ad9ee2c905025b4c28f71087 - React-jsiexecutor: b4a65947391c658450151275aa406f2b8263178f - React-jsinspector: 60769e5a0a6d4b32294a2456077f59d0266f9a8b - React-logger: 1623c216abaa88974afce404dc8f479406bbc3a0 + RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 + RCTRequired: 5a4a30ac20c86eeadd6844a9328f78d4168cf9b2 + RCTTypeSafety: 279fc5861a89f0f37db3a585f27f971485b4b734 + React: 88307a9be3bd0e71a6822271cf28b84a587fb97f + React-callinvoker: 35fb980c454104ebe82f0afb9826830089248e08 + React-Codegen: b12a629b42278c1ea34b58e5a33c24a2100fdd3e + React-Core: 321babf8fcfc49b81505896bc43fc8288865d465 + React-CoreModules: c2b7db313b04d9b71954ffd55d0c2e46bc40e9fb + React-cxxreact: d93d501dc91ff5db1e645f92e2ff5d2f1349049b + React-jsc: a2ee2ef9564e9157980fa81e587797e97b582f36 + React-jsi: 22ecc03690968d82c6103ba2818ce7aefa2da59e + React-jsiexecutor: e722e6f755992c2c33ff8a4eb6833e5a55cd8296 + React-jsinspector: 9885f6f94d231b95a739ef7bb50536fb87ce7539 + React-logger: 3f8ebad1be1bf3299d1ab6d7f971802d7395c7ef react-native-safe-area-context: dfe5aa13bee37a0c7e8059d14f72ffc076d120e9 - React-perflogger: 8c79399b0500a30ee8152d0f9f11beae7fc36595 - React-RCTActionSheet: 7316773acabb374642b926c19aef1c115df5c466 - React-RCTAnimation: 5341e288375451297057391227f691d9b2326c3d - React-RCTBlob: b0615fc2daf2b5684ade8fadcab659f16f6f0efa - React-RCTImage: 6487b9600f268ecedcaa86114d97954d31ad4750 - React-RCTLinking: c8018ae9ebfefcec3839d690d4725f8d15e4e4b3 - React-RCTNetwork: 8aa63578741e0fe1205c28d7d4b40dbfdabce8a8 - React-RCTSettings: d00c15ad369cd62242a4dfcc6f277912b4a84ed3 - React-RCTText: f532e5ca52681ecaecea452b3ad7a5b630f50d75 - React-RCTVibration: c75ceef7aa60a33b2d5731ebe5800ddde40cefc4 - React-runtimeexecutor: 15437b576139df27635400de0599d9844f1ab817 - ReactCommon: 349be31adeecffc7986a0de875d7fb0dcf4e251c + React-perflogger: 2d505bbe298e3b7bacdd9e542b15535be07220f6 + React-RCTActionSheet: 0e96e4560bd733c9b37efbf68f5b1a47615892fb + React-RCTAnimation: fd138e26f120371c87e406745a27535e2c8a04ef + React-RCTAppDelegate: 0b535af4d6912d86d7ac57ab689c19643151c2e7 + React-RCTBlob: 830e421bccb2959254af0c0c66deb5d13ddd6674 + React-RCTImage: 92b0966e7c1cadda889e961c474397ad5180e194 + React-RCTLinking: b80f8d0c6e94c54294b0048def51f57eaa9a27af + React-RCTNetwork: 491b0c65ac22edbd6695d12d084b4943103b009b + React-RCTSettings: 97af3e8abe0023349ec015910df3bda1a0380117 + React-RCTText: 33c85753bd714d527d2ae538dc56ec24c6783d84 + React-RCTVibration: 08f132cad9896458776f37c112e71d60aef1c6ae + React-runtimeexecutor: c5c89f8f543842dd864b63ded1b0bbb9c9445328 + ReactCommon: 7efec56db1e74f34e24beadcdda6942829d19c4c RNCAsyncStorage: 09fc8595e6d6f6d5abf16b23a56b257d9c6b7c5b RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489 RNDeviceInfo: 0a7c1d2532aa7691f9b9925a27e43af006db4dae - RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50 - RNReanimated: 24508aef58348323f891abd6616debf39173f1b9 + RNGestureHandler: 62232ba8f562f7dea5ba1b3383494eb5bf97a4d3 + RNReanimated: f0dd6b881808e635ef0673f89642937d6c141314 RNScreens: 4a1af06327774490d97342c00aee0c2bafb497b7 RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315 SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: 99caf8d5ab45e9d637ee6e0174ec16fbbb01bcfc + Yoga: d56980c8914db0b51692f55533409e844b66133c YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 33d7a51a8f4559dfbd8f66e2a02d13bc02f7faa3 +PODFILE CHECKSUM: ff8e7e7ff253f1fda3b145dc56e111c6716a93d2 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/template/template/package.json b/template/template/package.json index 14f14a81..cdb9e4bf 100644 --- a/template/template/package.json +++ b/template/template/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "android": "react-native run-android", - "ios": "react-native run-ios", + "ios": "react-native run-ios --simulator 'iPhone 14'", "start": "react-native start --reset-cache", "test": "jest", "api": "mocker ./mocker", @@ -26,15 +26,15 @@ "@rematch/loading": "2.1.2", "@uiw/formatter": "~1.3.3", "@uiw/react-native": "^4.0.2", - "react": "18.1.0", - "react-native": "0.70.6", + "react": "18.2.0", + "react-native": "0.71.7", "react-native-device-info": "~10.0.2", - "react-native-gesture-handler": "~2.5.0", - "react-native-reanimated": "~2.9.1", + "react-native-gesture-handler": "2.8.0", + "react-native-reanimated": "~3.0.0", "react-native-safe-area-context": "~4.3.1", "react-native-screens": "~3.15.0", "react-native-svg": "13.9.0", - "react-redux": "7.2.6", + "react-redux": "8.0.5", "redux": "4.1.2", "react-query": "~3.39.2", "@kkt/doc": "^1.0.0", @@ -42,20 +42,26 @@ "@shopify/restyle": "2.4.2" }, "devDependencies": { - "@babel/core": "~7.18.9", - "@babel/runtime": "~7.18.9", - "@react-native-community/eslint-config": "3.0.3", - "babel-jest": "~28.1.3", + "@babel/core": "~7.20.0", + "@babel/preset-env": "^7.20.0", + "@babel/runtime": "~7.20.0", + "@react-native-community/eslint-config": "3.2.0", + "@tsconfig/react-native": "^2.0.2", + "@types/jest": "^29.2.1", + "@types/react": "^18.0.24", + "@types/react-test-renderer": "^18.0.0", + "babel-jest": "~29.2.1", + "babel-plugin-module-resolver": "^4.1.0", "eslint": "~8.21.0", "eslint-plugin-prettier": "~4.2.1", - "jest": "27.2.0", - "metro-react-native-babel-preset": "^0.72.3", - "babel-plugin-module-resolver": "^4.1.0", "mocker-api": "~2.9.5", "prettier": "^2.8.0", + "jest": "29.2.1", + "metro-react-native-babel-preset": "^0.73.9", "lint-staged": "~12.5.0", "husky": "^8.0.0", - "react-test-renderer": "18.1.0" + "react-test-renderer": "18.2.0", + "typescript": "4.8.4" }, "lint-staged": { "*.{js,jsx}": [ diff --git a/template/template/src/hooks/users.js b/template/template/src/hooks/users.js index b422753e..6ba400b1 100644 --- a/template/template/src/hooks/users.js +++ b/template/template/src/hooks/users.js @@ -1,8 +1,9 @@ -import { Alert } from 'react-native'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import { userLogin, userAuth } from '../services/users'; -import { useQuery, useMutation } from 'react-query' -import Global from '../global'; +import { Alert } from "react-native"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { userLogin, userAuth } from "../services/users"; +import { useQuery, useMutation } from "react-query"; +import Global from "../global"; +import conf from "../config"; // 登录 export const useLogin = ({ config = {}, update, formData, remember }) => { @@ -10,38 +11,38 @@ export const useLogin = ({ config = {}, update, formData, remember }) => { mutationFn: userLogin, onSuccess: async (data) => { if (data?.token && data?.data) { - await AsyncStorage.setItem('token', data.token); + await AsyncStorage.setItem("token", data.token); if (remember) { - await AsyncStorage.setItem('cachLoginName', formData.loginName); - await AsyncStorage.setItem('cachPassword', formData.password); + await AsyncStorage.setItem("cachLoginName", formData.loginName); + await AsyncStorage.setItem("cachPassword", formData.password); } - await AsyncStorage.setItem('userData', JSON.stringify(data.data)); + await AsyncStorage.setItem("userData", JSON.stringify(data.data)); update({ token: data.token, userData: data.data }); if (Global.navigation) { - Global.navigation.replace('Tab'); + Global.navigation.replace("Tab"); } } else if (data && data.message) { Alert.alert(`Login failed - ${data.error}`, data.message); } }, - ...config - }) - return mutation -} + ...config, + }); + return mutation; +}; // 验证token export const useAuthToken = ({ token, update }) => { const mutation = useMutation({ mutationFn: userAuth, onMutate: async () => { - let host = await AsyncStorage.getItem('apihost'); + let host = await AsyncStorage.getItem("apihost"); if (!host && conf.hosts[0]) { - await AsyncStorage.setItem('apihost', JSON.stringify(conf.hosts[0])); + await AsyncStorage.setItem("apihost", JSON.stringify(conf.hosts[0])); await update({ apihost: conf.hosts[0] }); } if (!token) { - await AsyncStorage.removeItem('userData'); - await AsyncStorage.removeItem('token'); + await AsyncStorage.removeItem("userData"); + await AsyncStorage.removeItem("token"); } }, onSuccess: async (data) => { @@ -50,18 +51,17 @@ export const useAuthToken = ({ token, update }) => { } else { await update({ authState: true, token: null }); } - } - }) - return mutation -} + }, + }); + return mutation; +}; // 退出 export const logout = ({ update }) => { - AsyncStorage.removeItem('token'); - AsyncStorage.removeItem('userData'); + AsyncStorage.removeItem("token"); + AsyncStorage.removeItem("userData"); update({ token: null, userData: null }); if (Global.navigation) { - Global.navigation.navigate?.('SignIn'); + Global.navigation.navigate?.("SignIn"); } -} - +};