Skip to content

Commit 4b4e781

Browse files
authored
feat!: drop old architecture (#435)
1 parent 704daf6 commit 4b4e781

19 files changed

+74
-732
lines changed

.changeset/breezy-camels-lead.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'react-native-bottom-tabs': major
3+
'@bottom-tabs/expo-template': major
4+
'@bottom-tabs/react-navigation': major
5+
---
6+
7+
feat!: drop old architecture

.github/workflows/ci.yml

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -108,64 +108,6 @@ jobs:
108108
run: |
109109
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
110110
111-
build-android-newarch:
112-
runs-on: ubuntu-latest
113-
env:
114-
TURBO_CACHE_DIR: .turbo/android-newarch
115-
steps:
116-
- name: Checkout
117-
uses: actions/checkout@v4
118-
119-
- name: Setup
120-
uses: ./.github/actions/setup
121-
122-
- name: Build package
123-
run: yarn build
124-
125-
- name: Cache turborepo for Android new arch
126-
uses: actions/cache@v4
127-
with:
128-
path: ${{ env.TURBO_CACHE_DIR }}
129-
key: ${{ runner.os }}-turborepo-android-newarch-${{ hashFiles('yarn.lock') }}
130-
restore-keys: |
131-
${{ runner.os }}-turborepo-android-newarch-
132-
133-
- name: Check turborepo cache for Android new arch
134-
run: |
135-
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")
136-
137-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
138-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
139-
fi
140-
141-
- name: Install JDK
142-
if: env.turbo_cache_hit != 1
143-
uses: actions/setup-java@v4
144-
with:
145-
distribution: 'zulu'
146-
java-version: '17'
147-
148-
- name: Finalize Android SDK
149-
if: env.turbo_cache_hit != 1
150-
run: |
151-
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
152-
153-
- name: Cache Gradle
154-
if: env.turbo_cache_hit != 1
155-
uses: actions/cache@v4
156-
with:
157-
path: |
158-
~/.gradle/wrapper
159-
~/.gradle/caches
160-
key: ${{ runner.os }}-gradle-newarch-${{ hashFiles('apps/example/android/gradle/wrapper/gradle-wrapper.properties') }}
161-
restore-keys: |
162-
${{ runner.os }}-gradle-newarch-
163-
164-
- name: Build example for Android new arch
165-
env:
166-
JAVA_OPTS: '-XX:MaxHeapSize=6g'
167-
run: |
168-
yarn turbo run build:android:fabric --cache-dir="${{ env.TURBO_CACHE_DIR }}"
169111
170112
build-ios:
171113
runs-on: macos-15
@@ -197,49 +139,6 @@ jobs:
197139
echo "turbo_cache_hit=1" >> $GITHUB_ENV
198140
fi
199141
200-
- name: Install cocoapods and plugins
201-
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
202-
run: |
203-
gem install cocoapods-swift-modular-headers
204-
cd apps/example
205-
pod install --project-directory=ios
206-
env:
207-
NO_FLIPPER: 1
208-
209-
- name: Build example for iOS
210-
run: |
211-
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
212-
213-
build-ios-newarch:
214-
runs-on: macos-15
215-
env:
216-
TURBO_CACHE_DIR: .turbo/ios-newarch
217-
steps:
218-
- name: Checkout
219-
uses: actions/checkout@v4
220-
221-
- name: Setup
222-
uses: ./.github/actions/setup
223-
224-
- name: Build package
225-
run: yarn build
226-
227-
- name: Cache turborepo for iOS
228-
uses: actions/cache@v4
229-
with:
230-
path: ${{ env.TURBO_CACHE_DIR }}
231-
key: ${{ runner.os }}-turborepo-ios-newarch-${{ hashFiles('yarn.lock') }}
232-
restore-keys: |
233-
${{ runner.os }}-turborepo-ios-
234-
235-
- name: Check turborepo cache for iOS
236-
run: |
237-
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")
238-
239-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
240-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
241-
fi
242-
243142
- name: Install cocoapods and plugins
244143
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
245144
run: |
@@ -253,3 +152,4 @@ jobs:
253152
- name: Build example for iOS
254153
run: |
255154
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
155+

CONTRIBUTING.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,7 @@ cd -
4848
yarn ios
4949
```
5050

51-
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:
52-
53-
1. For Android, run:
54-
55-
```sh
56-
cd apps/example
57-
ORG_GRADLE_PROJECT_newArchEnabled=false yarn android
58-
```
59-
60-
2. For iOS, run:
61-
62-
```sh
63-
cd apps/example/ios
64-
RCT_NEW_ARCH_ENABLED=0 pod install
65-
cd -
66-
yarn example ios
67-
```
68-
69-
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:
70-
71-
```sh
72-
yarn clean
73-
```
51+
The example is configured to build with the new architecture (Fabric) by default.
7452

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

apps/example/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",
7-
"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",
8-
"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\"",
7+
"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\"",
98
"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",
109
"ios": "react-native run-ios",
1110
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"typecheck": "turbo run typecheck",
1515
"build": "turbo run build",
1616
"build:android": "turbo run build:android",
17-
"build:android:fabric": "turbo run build:android:fabric",
1817
"build:ios": "turbo run build:ios",
1918
"build:macos": "turbo run build:macos",
2019
"version-packages": "changeset version && yarn install --no-immutable",

packages/react-native-bottom-tabs/android/build.gradle

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buildscript {
1515
}
1616

1717
def isNewArchitectureEnabled() {
18-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
18+
return true
1919
}
2020

2121
apply plugin: "com.android.library"
@@ -84,16 +84,11 @@ android {
8484

8585
sourceSets {
8686
main {
87-
if (isNewArchitectureEnabled()) {
88-
java.srcDirs += [
89-
"src/newarch",
90-
// Codegen specs
91-
"generated/java",
92-
"generated/jni"
93-
]
94-
} else {
95-
java.srcDirs += ["src/oldarch"]
96-
}
87+
java.srcDirs += [
88+
// Codegen specs
89+
"generated/java",
90+
"generated/jni"
91+
]
9792
}
9893
}
9994
}

packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabViewImpl.kt

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)