Skip to content

Commit 6303535

Browse files
authored
add support for new architecture (#315)
* add support for new architecture * update bob config and exports * update babel config * bump package version
1 parent 08189f8 commit 6303535

25 files changed

+17905
-159
lines changed

.circleci/config.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ setup_env_file: &setup_env_file
1616
executors:
1717
default:
1818
docker:
19-
- image: cimg/node:22.2.0
19+
- image: cimg/node:22.14.0
2020
working_directory: ~/project
2121

2222
orbs:
@@ -37,7 +37,6 @@ run_on_release: &run_on_release
3737
branches:
3838
ignore: /.*/
3939

40-
4140
commands:
4241
attach_project:
4342
steps:
@@ -50,13 +49,14 @@ jobs:
5049
steps:
5150
- checkout
5251
- attach_project
52+
- node/install:
53+
node-version: 22.14.0
5354

5455
- run:
5556
name: Install dependencies
5657
command: |
5758
corepack enable
58-
yarn install --cwd example --ignore-engines
59-
yarn install --ignore-engines
59+
yarn install
6060
- save_cache:
6161
key: dependencies-{{ checksum "package.json" }}
6262
paths: node_modules
@@ -115,13 +115,7 @@ jobs:
115115
tag: default
116116
working_directory: ~/project
117117
steps:
118-
- checkout:
119-
path: ~/project
120-
- node/install:
121-
node-version: 18.17.0
122-
123-
- attach_workspace:
124-
at: ~/project
118+
- attach_project
125119

126120
- <<: *setup_env_file
127121

@@ -132,7 +126,7 @@ jobs:
132126
- run:
133127
working_directory: example/test
134128
name: Build android
135-
command: npm run build:android
129+
command: yarn run build:android
136130

137131
- android/create-avd:
138132
avd-name: Android_29
@@ -152,7 +146,7 @@ jobs:
152146
- run:
153147
working_directory: example/test
154148
name: Run UI Tests
155-
command: npm run test:android
149+
command: yarn run test:android
156150

157151
- store_artifacts:
158152
path: ~/.maestro/tests
@@ -162,9 +156,7 @@ jobs:
162156
ios-e2e-test:
163157
<<: *macos_config
164158
steps:
165-
- checkout
166-
- attach_workspace:
167-
at: ~/project
159+
- attach_project
168160

169161
- <<: *setup_env_file
170162

@@ -189,7 +181,7 @@ jobs:
189181
- run:
190182
working_directory: example/test
191183
name: Build
192-
command: npm run build:ios
184+
command: yarn run build:ios
193185

194186
- run:
195187
name: Create and boot iPhone 15 simulator
@@ -206,7 +198,7 @@ jobs:
206198
- run:
207199
working_directory: example/test
208200
name: Run UI Tests
209-
command: npm run test:ios
201+
command: yarn run test:ios
210202

211203
- store_artifacts:
212204
path: ~/.maestro/tests
@@ -229,13 +221,12 @@ jobs:
229221
- run:
230222
name: Install dependencies
231223
command: |
232-
yarn install --ignore-engines
224+
yarn install
233225
234226
- run:
235227
name: Publish the package
236228
command: npm publish
237229

238-
239230
workflows:
240231
version: 2.1
241232
build-and-test:

.gitignore

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@ project.xcworkspace
3131

3232
# Android/IJ
3333
#
34+
.classpath
35+
.cxx
3436
.idea
3537
.gradle
38+
.project
39+
.settings
3640
local.properties
3741
android.iml
3842

43+
# Ruby
44+
example/vendor/
45+
3946
# Cocoapods
4047
#
4148
example/ios/Pods
@@ -46,9 +53,17 @@ node_modules/
4653
npm-debug.log
4754
yarn-debug.log
4855
yarn-error.log
49-
yarn.lock
5056
package-lock.json
5157

58+
# Yarn
59+
.yarn/*
60+
!.yarn/patches
61+
!.yarn/plugins
62+
!.yarn/releases
63+
!.yarn/sdks
64+
!.yarn/versions
65+
66+
5267
# BUCK
5368
buck-out/
5469
\.buckd/
@@ -68,3 +83,8 @@ google-services.json
6883
/.bundle/
6984
/vendor/bundle
7085
/lib/bundler/man/
86+
87+
88+
# React Native Codegen
89+
ios/generated
90+
android/generated

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
22.14.0

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.6.1.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc

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

.yarnrc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
3+
4+
plugins:
5+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6+
spec: "@yarnpkg/plugin-interactive-tools"
7+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8+
spec: "@yarnpkg/plugin-workspace-tools"
9+
10+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

android/build.gradle

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@ buildscript {
2020

2121
dependencies {
2222
classpath("com.android.tools.build:gradle:8.6.1")
23-
classpath("com.facebook.react:react-native-gradle-plugin")
2423
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
2524
}
2625
}
2726
}
2827

2928
apply plugin: 'com.android.library'
3029

30+
def isNewArchitectureEnabled() {
31+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
32+
}
33+
34+
if (isNewArchitectureEnabled()) {
35+
apply plugin: "com.facebook.react"
36+
}
37+
3138
def safeExtGet(prop, fallback) {
3239
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3340
}
@@ -53,6 +60,18 @@ android {
5360
lintOptions {
5461
disable 'GradleCompatible'
5562
}
63+
buildFeatures {
64+
buildConfig true
65+
}
66+
sourceSets {
67+
main {
68+
if (isNewArchitectureEnabled()) {
69+
java.srcDirs += ["src/newarch"]
70+
} else {
71+
java.srcDirs += ["src/oldarch"]
72+
}
73+
}
74+
}
5675
}
5776

5877
repositories {

0 commit comments

Comments
 (0)