Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/breezy-camels-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'react-native-bottom-tabs': major
'@bottom-tabs/expo-template': major
'@bottom-tabs/react-navigation': major
---

feat!: drop old architecture
102 changes: 1 addition & 101 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,64 +108,6 @@ jobs:
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-android-newarch:
runs-on: ubuntu-latest
env:
TURBO_CACHE_DIR: .turbo/android-newarch
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn build

- name: Cache turborepo for Android new arch
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-newarch-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-newarch-

- name: Check turborepo cache for Android new arch
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android:fabric --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android:fabric').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v4
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-newarch-${{ hashFiles('apps/example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-newarch-

- name: Build example for Android new arch
env:
JAVA_OPTS: '-XX:MaxHeapSize=6g'
run: |
yarn turbo run build:android:fabric --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios:
runs-on: macos-15
Expand Down Expand Up @@ -197,49 +139,6 @@ jobs:
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install cocoapods and plugins
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
gem install cocoapods-swift-modular-headers
cd apps/example
pod install --project-directory=ios
env:
NO_FLIPPER: 1

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios-newarch:
runs-on: macos-15
env:
TURBO_CACHE_DIR: .turbo/ios-newarch
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn build

- name: Cache turborepo for iOS
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-newarch-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install cocoapods and plugins
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
Expand All @@ -253,3 +152,4 @@ jobs:
- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

24 changes: 1 addition & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,7 @@ cd -
yarn ios
```

By default, the example is configured to build with the new architecture. To run the example with the old architecture, you can do the following:

1. For Android, run:

```sh
cd apps/example
ORG_GRADLE_PROJECT_newArchEnabled=false yarn android
```

2. For iOS, run:

```sh
cd apps/example/ios
RCT_NEW_ARCH_ENABLED=0 pod install
cd -
yarn example ios
```

If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders:

```sh
yarn clean
```
The example is configured to build with the new architecture (Fabric) by default.

To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:

Expand Down
3 changes: 1 addition & 2 deletions apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"private": true,
"scripts": {
"android": "react-native run-android",
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
"build:android:fabric": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist && react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a -PnewArchEnabled=true\"",
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist && react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a -PnewArchEnabled=true\"",
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist",
"ios": "react-native run-ios",
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"typecheck": "turbo run typecheck",
"build": "turbo run build",
"build:android": "turbo run build:android",
"build:android:fabric": "turbo run build:android:fabric",
"build:ios": "turbo run build:ios",
"build:macos": "turbo run build:macos",
"version-packages": "changeset version && yarn install --no-immutable",
Expand Down
17 changes: 6 additions & 11 deletions packages/react-native-bottom-tabs/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
return true
}

apply plugin: "com.android.library"
Expand Down Expand Up @@ -84,16 +84,11 @@ android {

sourceSets {
main {
if (isNewArchitectureEnabled()) {
java.srcDirs += [
"src/newarch",
// Codegen specs
"generated/java",
"generated/jni"
]
} else {
java.srcDirs += ["src/oldarch"]
}
java.srcDirs += [
// Codegen specs
"generated/java",
"generated/jni"
]
}
}
}
Expand Down

This file was deleted.

Loading
Loading