From 686023c049660fbb6d0438d49b78c420aa0cf146 Mon Sep 17 00:00:00 2001 From: Igor Bejnarowicz Date: Thu, 28 Sep 2023 14:49:12 +0200 Subject: [PATCH 01/39] wip: unsuspicious changes --- .../actions/install-dependencies/action.yml | 21 +- .github/workflows/android.yml | 69 +- .github/workflows/ios.yml | 63 +- .github/workflows/main.yml | 19 +- .gitignore | 7 + .../event/PageSelectedEvent.kt | 4 + example/.buckconfig | 6 - example/.node-version | 1 + example/Gemfile | 5 +- example/Gemfile.lock | 12 +- example/_node-version | 1 - example/android/app/_BUCK | 55 - example/android/app/build.gradle | 275 +- .../android/app/src/main/AndroidManifest.xml | 3 +- .../com/pagerviewexample/MainActivity.java | 42 +- .../com/pagerviewexample/MainApplication.java | 71 +- .../MainApplicationReactNativeHost.java | 116 - .../components/MainComponentsRegistry.java | 36 - ...ApplicationTurboModuleManagerDelegate.java | 48 - .../android/app/src/main/jni/CMakeLists.txt | 7 - .../jni/MainApplicationModuleProvider.cpp | 32 - .../main/jni/MainApplicationModuleProvider.h | 16 - ...nApplicationTurboModuleManagerDelegate.cpp | 45 - ...ainApplicationTurboModuleManagerDelegate.h | 38 - .../src/main/jni/MainComponentsRegistry.cpp | 65 - .../app/src/main/jni/MainComponentsRegistry.h | 32 - example/android/app/src/main/jni/OnLoad.cpp | 11 - .../pagerviewexample/ReactNativeFlipper.java | 21 + example/android/build.gradle | 93 +- example/android/gradle.properties | 4 + example/android/settings.gradle | 7 - .../project.pbxproj | 100 +- example/ios/PagerViewExample/AppDelegate.h | 6 +- example/ios/PagerViewExample/AppDelegate.mm | 123 +- example/ios/Podfile | 25 +- example/ios/Podfile.lock | 537 +- example/package.json | 31 +- example/src/App.tsx | 102 +- example/src/BasicPagerViewExample.tsx | 9 +- example/src/KeyboardExample.tsx | 41 +- example/src/NestPagerView.tsx | 15 +- example/src/OnPageScrollExample.tsx | 29 +- example/src/OnPageSelectedExample.tsx | 14 +- example/src/PaginationDotsExample.tsx | 13 +- example/src/ReanimatedOnPageScrollExample.tsx | 7 +- example/src/ScrollViewInsideExample.tsx | 2 +- example/src/ScrollablePagerViewExample.tsx | 21 +- example/src/component/LikeCount.tsx | 16 +- .../NavigationPanel/ControlPanel.tsx | 24 +- .../component/NavigationPanel/LogsPanel.tsx | 1 - .../NavigationPanel/NavigationPanel.tsx | 41 +- example/src/component/ProgressBar.tsx | 9 +- example/src/hook/useNavigationPanel.ts | 12 +- example/src/tabView/CoverflowExample.tsx | 4 +- .../src/tabView/CustomIndicatorExample.tsx | 93 +- example/src/tabView/CustomTabBarExample.tsx | 122 +- example/src/tabView/TabBarIconExample.tsx | 56 +- example/yarn.lock | 4961 +++++++++++------ .../tc14_pager_basic_example.yaml.yaml | 20 + maestro-tests/test2.yaml | 3 + package.json | 11 +- scripts/run-maestro-tests.sh | 52 + src/PagerViewNativeComponent.ts | 3 +- src/index.tsx | 9 +- tsconfig.json | 3 +- yarn.lock | 4952 +++++++--------- 66 files changed, 6342 insertions(+), 6350 deletions(-) delete mode 100644 example/.buckconfig create mode 100644 example/.node-version delete mode 100644 example/_node-version delete mode 100644 example/android/app/_BUCK delete mode 100644 example/android/app/src/main/java/com/pagerviewexample/newarchitecture/MainApplicationReactNativeHost.java delete mode 100644 example/android/app/src/main/java/com/pagerviewexample/newarchitecture/components/MainComponentsRegistry.java delete mode 100644 example/android/app/src/main/java/com/pagerviewexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java delete mode 100644 example/android/app/src/main/jni/CMakeLists.txt delete mode 100644 example/android/app/src/main/jni/MainApplicationModuleProvider.cpp delete mode 100644 example/android/app/src/main/jni/MainApplicationModuleProvider.h delete mode 100644 example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp delete mode 100644 example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h delete mode 100644 example/android/app/src/main/jni/MainComponentsRegistry.cpp delete mode 100644 example/android/app/src/main/jni/MainComponentsRegistry.h delete mode 100644 example/android/app/src/main/jni/OnLoad.cpp create mode 100644 example/android/app/src/release/java/com/pagerviewexample/ReactNativeFlipper.java create mode 100644 maestro-tests/basic_example/tc14_pager_basic_example.yaml.yaml create mode 100644 maestro-tests/test2.yaml create mode 100644 scripts/run-maestro-tests.sh diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index a4d771d7..89ecb7e4 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -1,8 +1,8 @@ name: Install dependencies -description: "Installs and caches the dependencies" - +description: 'Installs and caches the dependencies' + runs: - using: "composite" + using: 'composite' steps: - name: Install dependencies shell: bash @@ -28,18 +28,3 @@ runs: shell: bash run: yarn install --frozen-lockfile working-directory: example - - - name: Cache fabric example node modules - id: cache-fabricexample-npm - uses: actions/cache@v3 - env: - cache-name: cached-fabric-npm-deps - with: - path: fabricexample/node_modules - key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }} - - - name: Install required fabric example dependencies on yarn.lock change - if: steps.cache-fabricexample-npm.outputs.cache-hit != 'true' - shell: bash - run: yarn install --frozen-lockfile - working-directory: fabricexample diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0d4de20d..d442f104 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -8,19 +8,17 @@ on: - '.github/workflows/android.yml' - 'android/**' - 'example/android/**' - - 'fabricexample/android/**' push: branches: - master - -concurrency: +concurrency: group: ${{ github.ref }}-android cancel-in-progress: true jobs: android-build: - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 - uses: ./.github/actions/install-dependencies @@ -42,51 +40,36 @@ jobs: - name: Install required example dependencies on yarn.lock change if: steps.cache-example-npm.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile - working-directory: example + run: yarn bootstrap-no-pods --frozen-lockfile - uses: actions/setup-java@v3 with: - distribution: "zulu" - java-version: "11" - - - name: Build Android - run: ./gradlew assembleDebug - working-directory: example/android - - android-build-fabric: - runs-on: ubuntu-latest - needs: android-build - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-dependencies + distribution: 'zulu' + java-version: '11' - - name: Pull dependencies + - name: Gradle cache uses: actions/cache@v3 with: - path: ./node_modules - key: ${{ hashFiles('./package.json') }} + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} - - name: Cache fabric example node modules - id: cache-fabricexample-npm - uses: actions/cache@v3 - env: - cache-name: cached-fabric-npm-deps - with: - path: fabricexample/node_modules - key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }} - - - name: Install required fabric example dependencies on yarn.lock change - if: steps.cache-fabricexample-npm.outputs.cache-hit != 'true' - shell: bash - run: yarn install --frozen-lockfile - working-directory: fabricexample + - name: Install Maestro CLI + run: export MAESTRO_VERSION=1.21.3; curl -Ls "https://get.maestro.mobile.dev" | bash - - uses: actions/setup-java@v3 - with: - distribution: "zulu" - java-version: "11" + - name: Add Maestro to path + run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH - - name: Build Android (Fabric) - run: ./gradlew assembleDebug -PreactNativeArchitectures=arm64-v8a - working-directory: fabricexample/android \ No newline at end of file + - name: Run Android Emulator and app + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 29 + arch: x86_64 + target: google_apis + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: | + yarn run-example-android + yarn test:e2e:android diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 5d043732..e5e7030f 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -8,9 +8,8 @@ on: - '.github/workflows/ios.yml' - 'ios/**' - 'example/ios/**' - - 'fabricexample/ios/**' - push: - branches: + push: + branches: - master concurrency: @@ -57,51 +56,19 @@ jobs: run: NO_FLIPPER=1 pod install working-directory: example/ios - - name: Build iOS - run: xcodebuild -scheme PagerViewExample -workspace PagerViewExample.xcworkspace -sdk iphonesimulator -configuration Debug COMPILER_INDEX_STORE_ENABLE=NO - working-directory: example/ios - - ios-build-fabric: - needs: ios-build - runs-on: macos-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-dependencies + - name: Install Maestro CLI + run: | + curl -Ls "https://get.maestro.mobile.dev" | bash + brew tap facebook/fb + brew install facebook/fb/idb-companion - - name: Pull dependencies - uses: actions/cache@v3 - with: - path: ./node_modules - key: ${{ hashFiles('./package.json') }} + - name: Add Maestro to path + run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH - - name: Cache fabric example node modules - id: cache-fabricexample-npm - uses: actions/cache@v3 - env: - cache-name: cached-fabric-npm-deps - with: - path: fabricexample/node_modules - key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }} - - - name: Install required fabric example dependencies on yarn.lock change - if: steps.cache-fabricexample-npm.outputs.cache-hit != 'true' - shell: bash - run: yarn install --frozen-lockfile - working-directory: fabricexample - - - name: Cache FabricExample Pods - id: cache-pods-fabric - uses: actions/cache@v3 - env: - cache-name: cached-ios-pods-deps-fabric - with: - path: fabricexample/ios/Pods - key: ${{ hashFiles('./fabricexample/ios/Podfile.lock') }} - - - name: Install FabricExample Pods - run: NO_FLIPPER=1 pod install - working-directory: fabricexample/ios + - name: Build iOS App + run: | + yarn run-example-ios - - name: Build iOS (Fabric) - run: xcodebuild -scheme FabricExample -workspace FabricExample.xcworkspace -sdk iphonesimulator -configuration Debug COMPILER_INDEX_STORE_ENABLE=NO - working-directory: fabricexample/ios + - name: Run tests + run: | + yarn test:e2e:ios diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 202500b2..6857b284 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,18 +10,18 @@ on: - master - next -concurrency: +concurrency: group: ${{ github.ref }}-js cancel-in-progress: true jobs: - install-dependencies: + install-dependencies: name: Install dependencies runs-on: ubuntu-latest - steps: + steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Install dependencies + - name: Install dependencies uses: ./.github/actions/install-dependencies verify-package-source: @@ -47,15 +47,6 @@ jobs: path: example/node_modules key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }} - - name: Pull fabric example node modules - id: cache-fabricexample-npm - uses: actions/cache@v3 - env: - cache-name: cached-fabric-npm-deps - with: - path: fabricexample/node_modules - key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }} - - name: Lint files run: yarn lint @@ -63,4 +54,4 @@ jobs: run: yarn typescript - name: Build package - run: yarn prepare \ No newline at end of file + run: yarn prepare diff --git a/.gitignore b/.gitignore index 31f6e926..138a6fac 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,10 @@ example/vendor fabricexample/ios/Pods fabricexample/vendor fabricexample/android/app/.cxx +.lefthookrc +lefthook.yml + + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* +.cxx diff --git a/android/src/main/java/com/reactnativepagerview/event/PageSelectedEvent.kt b/android/src/main/java/com/reactnativepagerview/event/PageSelectedEvent.kt index c980685c..e5adccc6 100644 --- a/android/src/main/java/com/reactnativepagerview/event/PageSelectedEvent.kt +++ b/android/src/main/java/com/reactnativepagerview/event/PageSelectedEvent.kt @@ -17,6 +17,10 @@ class PageSelectedEvent(viewTag: Int, private val mPosition: Int) : Event 1.11', '>= 1.11.2' +ruby '>= 2.6.10' +gem 'cocoapods', '>= 1.11.3' diff --git a/example/Gemfile.lock b/example/Gemfile.lock index f40a3379..01371166 100644 --- a/example/Gemfile.lock +++ b/example/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: CFPropertyList (3.0.5) rexml - activesupport (6.1.7) + activesupport (6.1.7.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -54,7 +54,7 @@ GEM netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) @@ -66,7 +66,7 @@ GEM i18n (1.12.0) concurrent-ruby (~> 1.0) json (2.6.2) - minitest (5.16.3) + minitest (5.18.0) molinillo (0.8.0) nanaimo (0.3.0) nap (1.1.0) @@ -76,7 +76,7 @@ GEM ruby-macho (2.5.1) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) @@ -85,13 +85,13 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.6.0) + zeitwerk (2.6.7) PLATFORMS ruby DEPENDENCIES - cocoapods (~> 1.11, >= 1.11.2) + cocoapods (>= 1.11.3) RUBY VERSION ruby 2.7.5p203 diff --git a/example/_node-version b/example/_node-version deleted file mode 100644 index b6a7d89c..00000000 --- a/example/_node-version +++ /dev/null @@ -1 +0,0 @@ -16 diff --git a/example/android/app/_BUCK b/example/android/app/_BUCK deleted file mode 100644 index f70837de..00000000 --- a/example/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.pagerviewexample", -) - -android_resource( - name = "res", - package = "com.pagerviewexample", - 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/example/android/app/build.gradle b/example/android/app/build.gradle index 0ffb6036..c59aef53 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,128 +1,87 @@ 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") @@ -134,72 +93,13 @@ android { compileSdkVersion rootProject.ext.compileSdkVersion + namespace "com.pagerviewexample" defaultConfig { applicationId "com.pagerviewexample" 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 { @@ -249,65 +149,22 @@ 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" + // The version of react-native is set by the React Native Gradle Plugin + implementation("com.facebook.react:react-android") - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { - exclude group:'com.facebook.fbjni' - } + 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" -} +apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) \ No newline at end of file diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 7989a946..4122f36a 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/example/android/app/src/main/java/com/pagerviewexample/MainActivity.java b/example/android/app/src/main/java/com/pagerviewexample/MainActivity.java index 512fed72..1a2683de 100644 --- a/example/android/app/src/main/java/com/pagerviewexample/MainActivity.java +++ b/example/android/app/src/main/java/com/pagerviewexample/MainActivity.java @@ -4,6 +4,12 @@ import com.facebook.react.ReactActivityDelegate; import com.facebook.react.ReactRootView; + +import com.facebook.react.ReactActivity; +import com.facebook.react.ReactActivityDelegate; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactActivityDelegate; + public class MainActivity extends ReactActivity { /** @@ -16,33 +22,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/example/android/app/src/main/java/com/pagerviewexample/MainApplication.java b/example/android/app/src/main/java/com/pagerviewexample/MainApplication.java index 2e42647d..adb0ef4e 100644 --- a/example/android/app/src/main/java/com/pagerviewexample/MainApplication.java +++ b/example/android/app/src/main/java/com/pagerviewexample/MainApplication.java @@ -9,14 +9,23 @@ import com.facebook.react.ReactPackage; import com.facebook.react.config.ReactFeatureFlags; import com.facebook.soloader.SoLoader; -import com.pagerviewexample.newarchitecture.MainApplicationReactNativeHost; import java.lang.reflect.InvocationTargetException; import java.util.List; +import android.app.Application; +import com.facebook.react.PackageList; +import com.facebook.react.ReactApplication; +import com.facebook.react.ReactNativeHost; +import com.facebook.react.ReactPackage; +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; +import com.facebook.react.defaults.DefaultReactNativeHost; +import com.facebook.soloader.SoLoader; +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 +44,31 @@ protected List getPackages() { protected String getJSMainModuleName() { return "index"; } - }; - private final ReactNativeHost mNewArchitectureNativeHost = - new MainApplicationReactNativeHost(this); + @Override + protected boolean isNewArchEnabled() { + return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; + } + + @Override + protected Boolean isHermesEnabled() { + return BuildConfig.IS_HERMES_ENABLED; + } + }; @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.pagerviewexample.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/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/MainApplicationReactNativeHost.java b/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/MainApplicationReactNativeHost.java deleted file mode 100644 index bf46d5ff..00000000 --- a/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/MainApplicationReactNativeHost.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.pagerviewexample.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.pagerviewexample.BuildConfig; -import com.pagerviewexample.newarchitecture.components.MainComponentsRegistry; -import com.pagerviewexample.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/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/components/MainComponentsRegistry.java b/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/components/MainComponentsRegistry.java deleted file mode 100644 index 81cb70a7..00000000 --- a/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/components/MainComponentsRegistry.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.pagerviewexample.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/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java deleted file mode 100644 index 78d91127..00000000 --- a/example/android/app/src/main/java/com/pagerviewexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.pagerviewexample.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("pagerviewexample_appmodules"); - sIsSoLibraryLoaded = true; - } - } -} diff --git a/example/android/app/src/main/jni/CMakeLists.txt b/example/android/app/src/main/jni/CMakeLists.txt deleted file mode 100644 index 83228599..00000000 --- a/example/android/app/src/main/jni/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.13) - -# Define the library name here. -project(pagerviewexample_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) diff --git a/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp deleted file mode 100644 index 26162dd8..00000000 --- a/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +++ /dev/null @@ -1,32 +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/example/android/app/src/main/jni/MainApplicationModuleProvider.h b/example/android/app/src/main/jni/MainApplicationModuleProvider.h deleted file mode 100644 index b38ccf53..00000000 --- a/example/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/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp deleted file mode 100644 index 5fd688c5..00000000 --- a/example/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/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h deleted file mode 100644 index 289dcd1f..00000000 --- a/example/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/pagerviewexample/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/example/android/app/src/main/jni/MainComponentsRegistry.cpp b/example/android/app/src/main/jni/MainComponentsRegistry.cpp deleted file mode 100644 index 54f598a4..00000000 --- a/example/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/example/android/app/src/main/jni/MainComponentsRegistry.h b/example/android/app/src/main/jni/MainComponentsRegistry.h deleted file mode 100644 index 3abe3c43..00000000 --- a/example/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/pagerviewexample/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/example/android/app/src/main/jni/OnLoad.cpp b/example/android/app/src/main/jni/OnLoad.cpp deleted file mode 100644 index c569b6e8..00000000 --- a/example/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/example/android/app/src/release/java/com/pagerviewexample/ReactNativeFlipper.java b/example/android/app/src/release/java/com/pagerviewexample/ReactNativeFlipper.java new file mode 100644 index 00000000..2b7984b5 --- /dev/null +++ b/example/android/app/src/release/java/com/pagerviewexample/ReactNativeFlipper.java @@ -0,0 +1,21 @@ +/** + * 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.pagerviewexample; + +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. + } +} + diff --git a/example/android/build.gradle b/example/android/build.gradle index 8569fee3..3366c098 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -2,50 +2,73 @@ 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() + maven { url 'https://www.jitpack.io' } } + 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' } - } -} +// buildscript { +// ext { +// buildToolsVersion = "31.0.0" +// minSdkVersion = 21 +// compileSdkVersion = 31 +// targetSdkVersion = 31 + +// 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" +// } +// } +// repositories { +// google() +// mavenCentral() +// } +// dependencies { +// classpath("com.android.tools.build:gradle:7.2.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/example/android/gradle.properties b/example/android/gradle.properties index bfd4b9dc..b56dd868 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -38,3 +38,7 @@ 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/example/android/settings.gradle b/example/android/settings.gradle index f2d5c9ca..91b1c53f 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -2,10 +2,3 @@ rootProject.name = 'PagerViewExample' 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/example/ios/PagerViewExample.xcodeproj/project.pbxproj b/example/ios/PagerViewExample.xcodeproj/project.pbxproj index d3e52a06..bb4e4502 100644 --- a/example/ios/PagerViewExample.xcodeproj/project.pbxproj +++ b/example/ios/PagerViewExample.xcodeproj/project.pbxproj @@ -12,8 +12,8 @@ 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-PagerViewExample-PagerViewExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-PagerViewExample-PagerViewExampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + 905E8BDEF2572BFD7FF05DB8 /* libPods-PagerViewExample-PagerViewExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9989AF6CB30264A80EADBCEF /* libPods-PagerViewExample-PagerViewExampleTests.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -36,14 +36,14 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = PagerViewExample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PagerViewExample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = PagerViewExample/main.m; sourceTree = ""; }; - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-PagerViewExample-PagerViewExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PagerViewExample-PagerViewExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3B4392A12AC88292D35C810B /* Pods-PagerViewExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagerViewExample.debug.xcconfig"; path = "Target Support Files/Pods-PagerViewExample/Pods-PagerViewExample.debug.xcconfig"; sourceTree = ""; }; 5709B34CF0A7D63546082F79 /* Pods-PagerViewExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagerViewExample.release.xcconfig"; path = "Target Support Files/Pods-PagerViewExample/Pods-PagerViewExample.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig"; sourceTree = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-PagerViewExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PagerViewExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6896ACA5D6FC3E6FB7A52D71 /* Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig"; path = "Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = PagerViewExample/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig"; path = "Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig"; sourceTree = ""; }; + 9989AF6CB30264A80EADBCEF /* libPods-PagerViewExample-PagerViewExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PagerViewExample-PagerViewExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + F3E40836A988A6538FF644BE /* Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -51,7 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7699B88040F8A987B510C191 /* libPods-PagerViewExample-PagerViewExampleTests.a in Frameworks */, + 905E8BDEF2572BFD7FF05DB8 /* libPods-PagerViewExample-PagerViewExampleTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -101,7 +101,7 @@ children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 5DCACB8F33CDC322A6C60F78 /* libPods-PagerViewExample.a */, - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-PagerViewExample-PagerViewExampleTests.a */, + 9989AF6CB30264A80EADBCEF /* libPods-PagerViewExample-PagerViewExampleTests.a */, ); name = Frameworks; sourceTree = ""; @@ -142,8 +142,8 @@ children = ( 3B4392A12AC88292D35C810B /* Pods-PagerViewExample.debug.xcconfig */, 5709B34CF0A7D63546082F79 /* Pods-PagerViewExample.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig */, + F3E40836A988A6538FF644BE /* Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig */, + 6896ACA5D6FC3E6FB7A52D71 /* Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -155,12 +155,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "PagerViewExampleTests" */; buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, + 9E21191383BEDE4C7BF8C89E /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, + 27F75E0EFD9AC18A32AAD879 /* [CP] Embed Pods Frameworks */, + 8A756BA9F9E3F4065DF16A77 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -283,29 +283,41 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PagerViewExample/Pods-PagerViewExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { + 27F75E0EFD9AC18A32AAD879 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PagerViewExample-PagerViewExampleTests-checkManifestLockResult.txt", + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 8A756BA9F9E3F4065DF16A77 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-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-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + 9E21191383BEDE4C7BF8C89E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -320,28 +332,33 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PagerViewExample-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-PagerViewExample-PagerViewExampleTests-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; }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-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-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-PagerViewExample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-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 */ = { @@ -361,23 +378,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PagerViewExample/Pods-PagerViewExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PagerViewExample-PagerViewExampleTests/Pods-PagerViewExample-PagerViewExampleTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -430,7 +430,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig */; + baseConfigurationReference = F3E40836A988A6538FF644BE /* Pods-PagerViewExample-PagerViewExampleTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -449,7 +449,7 @@ "-lc++", "$(inherited)", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.pagerviewexample; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PagerViewExample.app/PagerViewExample"; }; @@ -457,7 +457,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig */; + baseConfigurationReference = 6896ACA5D6FC3E6FB7A52D71 /* Pods-PagerViewExample-PagerViewExampleTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; @@ -473,7 +473,7 @@ "-lc++", "$(inherited)", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.pagerviewexample; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PagerViewExample.app/PagerViewExample"; }; @@ -497,7 +497,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.pagerviewexample; PRODUCT_NAME = PagerViewExample; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -522,7 +522,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.pagerviewexample; PRODUCT_NAME = PagerViewExample; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/example/ios/PagerViewExample/AppDelegate.h b/example/ios/PagerViewExample/AppDelegate.h index ef1de86a..5d280825 100644 --- a/example/ios/PagerViewExample/AppDelegate.h +++ b/example/ios/PagerViewExample/AppDelegate.h @@ -1,8 +1,6 @@ -#import +#import #import -@interface AppDelegate : UIResponder - -@property (nonatomic, strong) UIWindow *window; +@interface AppDelegate : RCTAppDelegate @end diff --git a/example/ios/PagerViewExample/AppDelegate.mm b/example/ios/PagerViewExample/AppDelegate.mm index 71ea0a88..cad9677a 100644 --- a/example/ios/PagerViewExample/AppDelegate.mm +++ b/example/ios/PagerViewExample/AppDelegate.mm @@ -1,85 +1,17 @@ #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, @"PagerViewExample", 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]; + self.moduleName = @"PagerViewExample"; + // 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 = @{}; -#ifdef RCT_NEW_ARCH_ENABLED - initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); -#endif - - return initProps; + return [super application:application didFinishLaunchingWithOptions:launchOptions]; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge @@ -91,43 +23,14 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge #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 +@end \ No newline at end of file diff --git a/example/ios/Podfile b/example/ios/Podfile index 082a27fb..826fe1d7 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,13 +1,26 @@ 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 - -ENV['RCT_NEW_ARCH_ENABLED'] = '0' - +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 'PagerViewExample' do config = use_native_modules! @@ -19,7 +32,7 @@ target 'PagerViewExample' do # Hermes is now enabled by default. Disable by setting this flag to false. # Upcoming versions of React Native may rely on get_default_flags(), but # we make it explicit here to aid in the React Native upgrade process. - :hermes_enabled => true, + :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], # Enables Flipper. # diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index fb2d0838..f2852afc 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2,14 +2,14 @@ PODS: - boost (1.76.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) - - FBLazyVector (0.70.5) - - FBReactNativeSpec (0.70.5): + - FBLazyVector (0.71.8) + - FBReactNativeSpec (0.71.8): - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.70.5) - - RCTTypeSafety (= 0.70.5) - - React-Core (= 0.70.5) - - React-jsi (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) + - RCTRequired (= 0.71.8) + - RCTTypeSafety (= 0.71.8) + - React-Core (= 0.71.8) + - React-jsi (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) - Flipper (0.125.0): - Flipper-Folly (~> 2.6) - Flipper-RSocket (~> 1.4) @@ -73,7 +73,9 @@ PODS: - FlipperKit/FlipperKitNetworkPlugin - fmt (6.2.1) - glog (0.3.5) - - hermes-engine (0.70.5) + - hermes-engine (0.71.8): + - hermes-engine/Pre-built (= 0.71.8) + - hermes-engine/Pre-built (0.71.8) - libevent (2.1.12) - OpenSSL-Universal (1.1.1100) - RCT-Folly (2021.07.22.00): @@ -93,290 +95,333 @@ PODS: - fmt (~> 6.2.1) - glog - libevent - - RCTRequired (0.70.5) - - RCTTypeSafety (0.70.5): - - FBLazyVector (= 0.70.5) - - RCTRequired (= 0.70.5) - - React-Core (= 0.70.5) - - React (0.70.5): - - React-Core (= 0.70.5) - - React-Core/DevSupport (= 0.70.5) - - React-Core/RCTWebSocket (= 0.70.5) - - React-RCTActionSheet (= 0.70.5) - - React-RCTAnimation (= 0.70.5) - - React-RCTBlob (= 0.70.5) - - React-RCTImage (= 0.70.5) - - React-RCTLinking (= 0.70.5) - - React-RCTNetwork (= 0.70.5) - - React-RCTSettings (= 0.70.5) - - React-RCTText (= 0.70.5) - - React-RCTVibration (= 0.70.5) - - React-bridging (0.70.5): - - RCT-Folly (= 2021.07.22.00) - - React-jsi (= 0.70.5) - - React-callinvoker (0.70.5) - - React-Codegen (0.70.5): - - FBReactNativeSpec (= 0.70.5) - - RCT-Folly (= 2021.07.22.00) - - RCTRequired (= 0.70.5) - - RCTTypeSafety (= 0.70.5) - - React-Core (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-Core (0.70.5): + - RCTRequired (0.71.8) + - RCTTypeSafety (0.71.8): + - FBLazyVector (= 0.71.8) + - RCTRequired (= 0.71.8) + - React-Core (= 0.71.8) + - React (0.71.8): + - React-Core (= 0.71.8) + - React-Core/DevSupport (= 0.71.8) + - React-Core/RCTWebSocket (= 0.71.8) + - React-RCTActionSheet (= 0.71.8) + - React-RCTAnimation (= 0.71.8) + - React-RCTBlob (= 0.71.8) + - React-RCTImage (= 0.71.8) + - React-RCTLinking (= 0.71.8) + - React-RCTNetwork (= 0.71.8) + - React-RCTSettings (= 0.71.8) + - React-RCTText (= 0.71.8) + - React-RCTVibration (= 0.71.8) + - React-callinvoker (0.71.8) + - React-Codegen (0.71.8): + - FBReactNativeSpec + - hermes-engine + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - React-jsi + - React-jsiexecutor + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - React-Core (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.5) - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-Core/Default (= 0.71.8) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/CoreModulesHeaders (0.70.5): + - React-Core/CoreModulesHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/Default (0.70.5): + - React-Core/Default (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/DevSupport (0.70.5): + - React-Core/DevSupport (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.5) - - React-Core/RCTWebSocket (= 0.70.5) - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-jsinspector (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-Core/Default (= 0.71.8) + - React-Core/RCTWebSocket (= 0.71.8) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-jsinspector (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTActionSheetHeaders (0.70.5): + - React-Core/RCTActionSheetHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTAnimationHeaders (0.70.5): + - React-Core/RCTAnimationHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTBlobHeaders (0.70.5): + - React-Core/RCTBlobHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTImageHeaders (0.70.5): + - React-Core/RCTImageHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTLinkingHeaders (0.70.5): + - React-Core/RCTLinkingHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTNetworkHeaders (0.70.5): + - React-Core/RCTNetworkHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTSettingsHeaders (0.70.5): + - React-Core/RCTSettingsHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTTextHeaders (0.70.5): + - React-Core/RCTTextHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTVibrationHeaders (0.70.5): + - React-Core/RCTVibrationHeaders (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-Core/RCTWebSocket (0.70.5): + - React-Core/RCTWebSocket (0.71.8): - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Core/Default (= 0.70.5) - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-Core/Default (= 0.71.8) + - React-cxxreact (= 0.71.8) + - React-hermes + - React-jsi (= 0.71.8) + - React-jsiexecutor (= 0.71.8) + - React-perflogger (= 0.71.8) - Yoga - - React-CoreModules (0.70.5): + - React-CoreModules (0.71.8): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.5) - - React-Codegen (= 0.70.5) - - React-Core/CoreModulesHeaders (= 0.70.5) - - React-jsi (= 0.70.5) - - React-RCTImage (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-cxxreact (0.70.5): + - RCTTypeSafety (= 0.71.8) + - React-Codegen (= 0.71.8) + - React-Core/CoreModulesHeaders (= 0.71.8) + - React-jsi (= 0.71.8) + - React-RCTBlob + - React-RCTImage (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-cxxreact (0.71.8): - boost (= 1.76.0) - DoubleConversion - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-callinvoker (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsinspector (= 0.70.5) - - React-logger (= 0.70.5) - - React-perflogger (= 0.70.5) - - React-runtimeexecutor (= 0.70.5) - - React-hermes (0.70.5): + - React-callinvoker (= 0.71.8) + - React-jsi (= 0.71.8) + - React-jsinspector (= 0.71.8) + - React-logger (= 0.71.8) + - React-perflogger (= 0.71.8) + - React-runtimeexecutor (= 0.71.8) + - React-hermes (0.71.8): - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2021.07.22.00) - RCT-Folly/Futures (= 2021.07.22.00) - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-jsiexecutor (= 0.70.5) - - React-jsinspector (= 0.70.5) - - React-perflogger (= 0.70.5) - - React-jsi (0.70.5): - - boost (= 1.76.0) - - DoubleConversion - - glog - - RCT-Folly (= 2021.07.22.00) - - React-jsi/Default (= 0.70.5) - - React-jsi/Default (0.70.5): + - React-cxxreact (= 0.71.8) + - React-jsi + - React-jsiexecutor (= 0.71.8) + - React-jsinspector (= 0.71.8) + - React-perflogger (= 0.71.8) + - React-jsi (0.71.8): - boost (= 1.76.0) - DoubleConversion - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-jsiexecutor (0.70.5): + - React-jsiexecutor (0.71.8): - DoubleConversion - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-perflogger (= 0.70.5) - - React-jsinspector (0.70.5) - - React-logger (0.70.5): + - React-cxxreact (= 0.71.8) + - React-jsi (= 0.71.8) + - React-perflogger (= 0.71.8) + - React-jsinspector (0.71.8) + - React-logger (0.71.8): - glog - react-native-pager-view (7.0.0-rc.0): - React-Core - react-native-safe-area-context (3.4.1): - React-Core - - React-perflogger (0.70.5) - - React-RCTActionSheet (0.70.5): - - React-Core/RCTActionSheetHeaders (= 0.70.5) - - React-RCTAnimation (0.70.5): + - React-perflogger (0.71.8) + - React-RCTActionSheet (0.71.8): + - React-Core/RCTActionSheetHeaders (= 0.71.8) + - React-RCTAnimation (0.71.8): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.5) - - React-Codegen (= 0.70.5) - - React-Core/RCTAnimationHeaders (= 0.70.5) - - React-jsi (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-RCTBlob (0.70.5): + - RCTTypeSafety (= 0.71.8) + - React-Codegen (= 0.71.8) + - React-Core/RCTAnimationHeaders (= 0.71.8) + - React-jsi (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-RCTAppDelegate (0.71.8): + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - ReactCommon/turbomodule/core + - React-RCTBlob (0.71.8): + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.70.5) - - React-Core/RCTBlobHeaders (= 0.70.5) - - React-Core/RCTWebSocket (= 0.70.5) - - React-jsi (= 0.70.5) - - React-RCTNetwork (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-RCTImage (0.70.5): + - React-Codegen (= 0.71.8) + - React-Core/RCTBlobHeaders (= 0.71.8) + - React-Core/RCTWebSocket (= 0.71.8) + - React-jsi (= 0.71.8) + - React-RCTNetwork (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-RCTImage (0.71.8): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.5) - - React-Codegen (= 0.70.5) - - React-Core/RCTImageHeaders (= 0.70.5) - - React-jsi (= 0.70.5) - - React-RCTNetwork (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-RCTLinking (0.70.5): - - React-Codegen (= 0.70.5) - - React-Core/RCTLinkingHeaders (= 0.70.5) - - React-jsi (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-RCTNetwork (0.70.5): + - RCTTypeSafety (= 0.71.8) + - React-Codegen (= 0.71.8) + - React-Core/RCTImageHeaders (= 0.71.8) + - React-jsi (= 0.71.8) + - React-RCTNetwork (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-RCTLinking (0.71.8): + - React-Codegen (= 0.71.8) + - React-Core/RCTLinkingHeaders (= 0.71.8) + - React-jsi (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-RCTNetwork (0.71.8): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.5) - - React-Codegen (= 0.70.5) - - React-Core/RCTNetworkHeaders (= 0.70.5) - - React-jsi (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-RCTSettings (0.70.5): + - RCTTypeSafety (= 0.71.8) + - React-Codegen (= 0.71.8) + - React-Core/RCTNetworkHeaders (= 0.71.8) + - React-jsi (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-RCTSettings (0.71.8): - RCT-Folly (= 2021.07.22.00) - - RCTTypeSafety (= 0.70.5) - - React-Codegen (= 0.70.5) - - React-Core/RCTSettingsHeaders (= 0.70.5) - - React-jsi (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-RCTText (0.70.5): - - React-Core/RCTTextHeaders (= 0.70.5) - - React-RCTVibration (0.70.5): + - RCTTypeSafety (= 0.71.8) + - React-Codegen (= 0.71.8) + - React-Core/RCTSettingsHeaders (= 0.71.8) + - React-jsi (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-RCTText (0.71.8): + - React-Core/RCTTextHeaders (= 0.71.8) + - React-RCTVibration (0.71.8): - RCT-Folly (= 2021.07.22.00) - - React-Codegen (= 0.70.5) - - React-Core/RCTVibrationHeaders (= 0.70.5) - - React-jsi (= 0.70.5) - - ReactCommon/turbomodule/core (= 0.70.5) - - React-runtimeexecutor (0.70.5): - - React-jsi (= 0.70.5) - - ReactCommon/turbomodule/core (0.70.5): + - React-Codegen (= 0.71.8) + - React-Core/RCTVibrationHeaders (= 0.71.8) + - React-jsi (= 0.71.8) + - ReactCommon/turbomodule/core (= 0.71.8) + - React-runtimeexecutor (0.71.8): + - React-jsi (= 0.71.8) + - ReactCommon/turbomodule/bridging (0.71.8): - DoubleConversion - glog + - hermes-engine - RCT-Folly (= 2021.07.22.00) - - React-bridging (= 0.70.5) - - React-callinvoker (= 0.70.5) - - React-Core (= 0.70.5) - - React-cxxreact (= 0.70.5) - - React-jsi (= 0.70.5) - - React-logger (= 0.70.5) - - React-perflogger (= 0.70.5) + - React-callinvoker (= 0.71.8) + - React-Core (= 0.71.8) + - React-cxxreact (= 0.71.8) + - React-jsi (= 0.71.8) + - React-logger (= 0.71.8) + - React-perflogger (= 0.71.8) + - ReactCommon/turbomodule/core (0.71.8): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2021.07.22.00) + - React-callinvoker (= 0.71.8) + - React-Core (= 0.71.8) + - React-cxxreact (= 0.71.8) + - React-jsi (= 0.71.8) + - React-logger (= 0.71.8) + - React-perflogger (= 0.71.8) - RNCMaskedView (0.1.11): - React - RNGestureHandler (1.10.3): - React-Core - - RNReanimated (2.12.0): + - RNReanimated (2.17.0): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -408,7 +453,7 @@ PODS: - React-RCTImage - RNSVG (12.4.4): - React-Core - - SocketRocket (0.6.0) + - SocketRocket (0.6.1) - Yoga (1.14.0) - YogaKit (1.18.1): - Yoga (~> 1.14) @@ -440,14 +485,13 @@ DEPENDENCIES: - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0) - FlipperKit/SKIOSNetworkPlugin (= 0.125.0) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - - hermes-engine (from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`) + - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - libevent (~> 2.1.12) - OpenSSL-Universal (= 1.1.1100) - RCT-Folly (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/`) @@ -465,6 +509,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`) @@ -511,7 +556,7 @@ EXTERNAL SOURCES: glog: :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" hermes-engine: - :podspec: "../node_modules/react-native/sdks/hermes/hermes-engine.podspec" + :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" RCT-Folly: :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" RCTRequired: @@ -520,8 +565,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: @@ -552,6 +595,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: @@ -584,11 +629,11 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: a7c83b31436843459a1961bfd74b96033dc77234 + boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - FBLazyVector: affa4ba1bfdaac110a789192f4d452b053a86624 - FBReactNativeSpec: fe8b5f1429cfe83a8d72dc8ed61dc7704cac8745 + FBLazyVector: f637f31eacba90d4fdeff3fa41608b8f361c173b + FBReactNativeSpec: 0d9a4f4de7ab614c49e98c00aedfd3bfbda33d59 Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 @@ -600,47 +645,47 @@ SPEC CHECKSUMS: FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b - hermes-engine: 7fe5fc6ef707b7fdcb161b63898ec500e285653d + hermes-engine: 47986d26692ae75ee7a17ab049caee8864f855de libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda - RCTRequired: 21229f84411088e5d8538f21212de49e46cc83e2 - RCTTypeSafety: 62eed57a32924b09edaaf170a548d1fc96223086 - React: f0254ccddeeef1defe66c6b1bb9133a4f040792b - React-bridging: e46911666b7ec19538a620a221d6396cd293d687 - React-callinvoker: 66b62e2c34546546b2f21ab0b7670346410a2b53 - React-Codegen: b6999435966df3bdf82afa3f319ba0d6f9a8532a - React-Core: dabbc9d1fe0a11d884e6ee1599789cf8eb1058a5 - React-CoreModules: 5b6b7668f156f73a56420df9ec68ca2ec8f2e818 - React-cxxreact: c7ca2baee46db22a30fce9e639277add3c3f6ad1 - React-hermes: c93e1d759ad5560dfea54d233013d7d2c725c286 - React-jsi: a565dcb49130ed20877a9bb1105ffeecbb93d02d - React-jsiexecutor: 31564fa6912459921568e8b0e49024285a4d584b - React-jsinspector: badd81696361249893a80477983e697aab3c1a34 - React-logger: fdda34dd285bdb0232e059b19d9606fa0ec3bb9c + RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 + RCTRequired: 8af6a32dfc2b65ec82193c2dee6e1011ff22ac2a + RCTTypeSafety: bee9dd161c175896c680d47ef1d9eaacf2b587f4 + React: d850475db9ba8006a8b875d79e1e0d6ac8a0f8b6 + React-callinvoker: 6a0c75475ddc17c9ed54e4ff0478074a18fd7ab5 + React-Codegen: 786571642e87add634e7f4d299c85314ec6cc158 + React-Core: 1adfab153f59e4f56e09b97a153089f466d7b8aa + React-CoreModules: 958d236715415d4ccdd5fa35c516cf0356637393 + React-cxxreact: 2e7a6283807ce8755c3d501735acd400bec3b5cd + React-hermes: 8102c3112ba32207c3052619be8cfae14bf99d84 + React-jsi: dd29264f041a587e91f994e4be97e86c127742b2 + React-jsiexecutor: 747911ab5921641b4ed7e4900065896597142125 + React-jsinspector: c712f9e3bb9ba4122d6b82b4f906448b8a281580 + React-logger: 342f358b8decfbf8f272367f4eacf4b6154061be react-native-pager-view: 563a43b511eea680f803ab4fb20bd7525fbde2cc react-native-safe-area-context: 9e40fb181dac02619414ba1294d6c2a807056ab9 - React-perflogger: e68d3795cf5d247a0379735cbac7309adf2fb931 - React-RCTActionSheet: 05452c3b281edb27850253db13ecd4c5a65bc247 - React-RCTAnimation: 578eebac706428e68466118e84aeacf3a282b4da - React-RCTBlob: f47a0aa61e7d1fb1a0e13da832b0da934939d71a - React-RCTImage: 60f54b66eed65d86b6dffaf4733d09161d44929d - React-RCTLinking: 91073205aeec4b29450ca79b709277319368ac9e - React-RCTNetwork: ca91f2c9465a7e335c8a5fae731fd7f10572213b - React-RCTSettings: 1a9a5d01337d55c18168c1abe0f4a589167d134a - React-RCTText: c591e8bd9347a294d8416357ca12d779afec01d5 - React-RCTVibration: 8e5c8c5d17af641f306d7380d8d0fe9b3c142c48 - React-runtimeexecutor: 7401c4a40f8728fd89df4a56104541b760876117 - ReactCommon: c9246996e73bf75a2c6c3ff15f1e16707cdc2da9 + React-perflogger: d21f182895de9d1b077f8a3cd00011095c8c9100 + React-RCTActionSheet: 0151f83ef92d2a7139bba7dfdbc8066632a6d47b + React-RCTAnimation: 5ec9c0705bb2297549c120fe6473aa3e4a01e215 + React-RCTAppDelegate: 9895fd1b6d1176d88c4b10ddc169b2e1300c91f0 + React-RCTBlob: f3634eb45b6e7480037655e1ca93d1136ac984dd + React-RCTImage: 3c12cb32dec49549ae62ed6cba4018db43841ffc + React-RCTLinking: 310e930ee335ef25481b4a173d9edb64b77895f9 + React-RCTNetwork: b6837841fe88303b0c04c1e3c01992b30f1f5498 + React-RCTSettings: 600d91fe25fa7c16b0ff891304082440f2904b89 + React-RCTText: a0a19f749088280c6def5397ed6211b811e7eef3 + React-RCTVibration: 43ffd976a25f6057a7cf95ea3648ba4e00287f89 + React-runtimeexecutor: 7c51ae9d4b3e9608a2366e39ccaa606aa551b9ed + ReactCommon: 85c98ab0a509e70bf5ee5d9715cf68dbf495b84c RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 - RNReanimated: 2a91e85fcd343f8af3c58d3425b99fdd285590a5 + RNReanimated: f186e85d9f28c9383d05ca39e11dd194f59093ec RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f RNSVG: ecd661f380a07ba690c9c5929c475a44f432d674 - SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: eca980a5771bf114c41a754098cd85e6e0d90ed7 + SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 + Yoga: 065f0b74dba4832d6e328238de46eb72c5de9556 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 7bb6ac2c486fd5b7d13ac3d8fc31d2174d38be56 +PODFILE CHECKSUM: 927f790f7f57352901e65ac63adf65761eedc12c COCOAPODS: 1.11.3 diff --git a/example/package.json b/example/package.json index ac4ef7bd..99796e0a 100644 --- a/example/package.json +++ b/example/package.json @@ -6,36 +6,39 @@ "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", - "pods": "pod-install --quiet", - "postinstall": "patch-package" + "pods": "pod-install --quiet" }, "dependencies": { "@react-native-community/masked-view": "^0.1.10", "@react-navigation/native": "~6.1.6", "@react-navigation/native-stack": "~6.9.12", "@react-navigation/stack": "~6.3.16", - "react": "18.1.0", - "react-native": "0.70.5", + "react": "18.2.0", + "react-native": "0.71.8", "react-native-animated-pagination-dots": "^0.1.73", "react-native-gesture-handler": "^1.9.0", - "react-native-reanimated": "2.12.0", + "react-native-reanimated": "2.17.0", "react-native-safe-area-context": "^3.1.9", "react-native-screens": "~3.20.0", "react-native-svg": "12.4.4", "react-native-tab-view": "^3.1.1" }, "resolutions": { - "@types/react": "17.0.21" + "@types/react": "18.0.29" }, "devDependencies": { - "@babel/core": "^7.12.9", - "@babel/runtime": "^7.12.5", - "@types/react-native": "0.70.0", - "@types/react-test-renderer": "^18.0.0", + "@babel/core": "^7.20.0", + "@babel/preset-env": "^7.20.0", + "@babel/runtime": "^7.20.0", + "@types/jest": "^29.2.1", + "@types/react": "^18.0.24", "babel-plugin-module-resolver": "^4.1.0", - "metro-react-native-babel-preset": "^0.72.1", - "patch-package": "^6.4.7", - "postinstall-postinstall": "^2.1.0", - "react-test-renderer": "18.1.0" + "@types/react-test-renderer": "^18.0.0", + "babel-jest": "^29.2.1", + "eslint": "^8.19.0", + "jest": "^29.2.1", + "metro-react-native-babel-preset": "0.73.9", + "prettier": "^2.4.1", + "react-test-renderer": "18.2.0" } } diff --git a/example/src/App.tsx b/example/src/App.tsx index 4a0cb0a0..16c0af4f 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -10,8 +10,8 @@ import { TouchableOpacity, Button, Alert, - DevSettings, I18nManager, + DevSettings, } from 'react-native'; import { NavigationContainer, useNavigation } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; @@ -32,6 +32,7 @@ import CustomTabBarExample from './tabView/CustomTabBarExample'; import CoverflowExample from './tabView/CoverflowExample'; import ReanimatedOnPageScrollExample from './ReanimatedOnPageScrollExample'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import { SafeAreaProvider } from 'react-native-safe-area-context'; const examples = [ { component: BasicPagerViewExample, name: 'Basic Example' }, @@ -71,6 +72,7 @@ function App() { {examples.map((example) => ( { //@ts-ignore @@ -92,56 +94,58 @@ export function Navigation() { const [mode, setMode] = React.useState<'native' | 'js'>('native'); const NavigationStack = mode === 'js' ? Stack : NativeStack; return ( - - - ( -