Skip to content

Commit 4d00f52

Browse files
feat: upgrade to react-native 0.85.0 with RNTA 5.3.2 (#732)
* feat: upgrade to react-native 0.85.0 with RNTA 5.3.2 * Update iOS pods for React Native 0.85 * Fix SafeAreaView crash on React Native 0.85 * Update CI Node version for React Native 0.85 * Shorten Windows Android CI build path * Enable long paths for Windows Android CI * Shorten Windows CMake object paths * Use short RNTA path for Windows Android CI --------- Co-authored-by: Melissa Vallee <melissa@appandflow.com>
1 parent 2bf305a commit 4d00f52

16 files changed

Lines changed: 2806 additions & 2830 deletions

File tree

.github/scripts/build-android.cmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
@echo off
22
setlocal
3-
rem subst the workspace to a short drive to avoid Windows MAX_PATH in
3+
rem subst the example app to a short drive to avoid Windows MAX_PATH in
44
rem CMake-generated object file names from autolinked codegen.
5-
subst W: "%GITHUB_WORKSPACE%" || exit /b 1
6-
cd /D W:\example\android || exit /b 1
5+
subst W: "%GITHUB_WORKSPACE%\example" || exit /b 1
6+
robocopy W:\node_modules\react-native-test-app W:\r /MIR /NFL /NDL /NJH /NJS /NP
7+
if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL%
8+
cd /D W:\android || exit /b 1
79
call gradlew.bat assembleDebug -PnewArchEnabled=%1

.github/workflows/android-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13-
- name: Use Node.js 20.x
13+
- name: Use Node.js 22.13.0
1414
uses: actions/setup-node@v4
1515
with:
16-
node-version: 20.x
16+
node-version: 22.13.0
1717
- uses: actions/setup-java@v2
1818
with:
1919
distribution: 'temurin'

.github/workflows/android.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
shell: bash
2929
steps:
3030
- uses: actions/checkout@v4
31-
- name: Use Node.js 20.x
31+
- name: Use Node.js 22.13.0
3232
uses: actions/setup-node@v4
3333
with:
34-
node-version: 20.x
34+
node-version: 22.13.0
3535
- uses: actions/setup-java@v2
3636
with:
3737
distribution: 'temurin'
@@ -62,10 +62,10 @@ jobs:
6262
shell: bash
6363
steps:
6464
- uses: actions/checkout@v4
65-
- name: Use Node.js 20.x
65+
- name: Use Node.js 22.13.0
6666
uses: actions/setup-node@v1
6767
with:
68-
node-version: 20.x
68+
node-version: 22.13.0
6969
- uses: actions/setup-java@v2
7070
with:
7171
distribution: 'temurin'

.github/workflows/docs-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
WORKING_DIRECTORY: docs
2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Use Node.js 20.x
23+
- name: Use Node.js 22.13.0
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 20.x
26+
node-version: 22.13.0
2727
- name: Install docs deps
2828
working-directory: ${{ env.WORKING_DIRECTORY }}
2929
run: yarn install

.github/workflows/ios.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
runs-on: macos-latest
2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Use Node.js 20.x
23+
- name: Use Node.js 22.13.0
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 20.x
26+
node-version: 22.13.0
2727
- uses: ruby/setup-ruby@v1
2828
with:
2929
ruby-version: 3.2
@@ -44,10 +44,10 @@ jobs:
4444
runs-on: macos-latest
4545
steps:
4646
- uses: actions/checkout@v4
47-
- name: Use Node.js 20.x
47+
- name: Use Node.js 22.13.0
4848
uses: actions/setup-node@v1
4949
with:
50-
node-version: 20.x
50+
node-version: 22.13.0
5151
- uses: ruby/setup-ruby@v1
5252
with:
5353
ruby-version: 3.2

.github/workflows/js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
10-
- name: Use Node.js 20.x
10+
- name: Use Node.js 22.13.0
1111
uses: actions/setup-node@v4
1212
with:
13-
node-version: 20.x
13+
node-version: 22.13.0
1414
- name: Restore yarn workspaces
1515
id: yarn-cache
1616
uses: actions/cache@v3

common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,27 @@ void RNCSafeAreaViewShadowNode::adjustLayoutWithState() {
9999
stateData.insets.bottom,
100100
bottom.value().unwrapOrDefault(0)));
101101

102-
yoga::Style adjustedStyle = getConcreteProps().yogaStyle;
102+
auto &currentStyle = yogaNode_.style();
103103
if (props.mode == RNCSafeAreaViewMode::Padding) {
104-
adjustedStyle.setPadding(Edge::Top, top);
105-
adjustedStyle.setPadding(Edge::Left, left);
106-
adjustedStyle.setPadding(Edge::Right, right);
107-
adjustedStyle.setPadding(Edge::Bottom, bottom);
108-
} else {
109-
adjustedStyle.setMargin(Edge::Top, top);
110-
adjustedStyle.setMargin(Edge::Left, left);
111-
adjustedStyle.setMargin(Edge::Right, right);
112-
adjustedStyle.setMargin(Edge::Bottom, bottom);
113-
}
114-
115-
auto currentStyle = yogaNode_.style();
116-
if (adjustedStyle.padding(Edge::Top) != currentStyle.padding(Edge::Top) ||
117-
adjustedStyle.padding(Edge::Left) != currentStyle.padding(Edge::Left) ||
118-
adjustedStyle.padding(Edge::Right) != currentStyle.padding(Edge::Right) ||
119-
adjustedStyle.padding(Edge::Bottom) !=
120-
currentStyle.padding(Edge::Bottom) ||
121-
adjustedStyle.margin(Edge::Top) != currentStyle.margin(Edge::Top) ||
122-
adjustedStyle.margin(Edge::Left) != currentStyle.margin(Edge::Left) ||
123-
adjustedStyle.margin(Edge::Right) != currentStyle.margin(Edge::Right) ||
124-
adjustedStyle.margin(Edge::Bottom) != currentStyle.margin(Edge::Bottom)) {
125-
yogaNode_.setStyle(adjustedStyle);
104+
if (currentStyle.padding(Edge::Top) != top ||
105+
currentStyle.padding(Edge::Left) != left ||
106+
currentStyle.padding(Edge::Right) != right ||
107+
currentStyle.padding(Edge::Bottom) != bottom) {
108+
currentStyle.setPadding(Edge::Top, top);
109+
currentStyle.setPadding(Edge::Left, left);
110+
currentStyle.setPadding(Edge::Right, right);
111+
currentStyle.setPadding(Edge::Bottom, bottom);
112+
yogaNode_.setDirty(true);
113+
}
114+
} else if (
115+
currentStyle.margin(Edge::Top) != top ||
116+
currentStyle.margin(Edge::Left) != left ||
117+
currentStyle.margin(Edge::Right) != right ||
118+
currentStyle.margin(Edge::Bottom) != bottom) {
119+
currentStyle.setMargin(Edge::Top, top);
120+
currentStyle.setMargin(Edge::Left, left);
121+
currentStyle.setMargin(Edge::Right, right);
122+
currentStyle.setMargin(Edge::Bottom, bottom);
126123
yogaNode_.setDirty(true);
127124
}
128125
}

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ allprojects {
4242
}
4343
}
4444

45-
rootProject.ext.set("react.compileSdkVersion", 35)
46-
rootProject.ext.set("react.targetSdkVersion", 35)
45+
rootProject.ext.set("react.compileSdkVersion", 36)
46+
rootProject.ext.set("react.targetSdkVersion", 36)

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/android/settings.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ apply(from: {
1919
throw new GradleException("Could not find `react-native-test-app`");
2020
}())
2121
applyTestAppSettings(settings)
22+
23+
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
24+
def shortTestAppAndroidDir = file("../r")
25+
if (shortTestAppAndroidDir.exists()) {
26+
project(":app").projectDir = file("${shortTestAppAndroidDir}/android/app")
27+
project(":support").projectDir = file("${shortTestAppAndroidDir}/android/support")
28+
}
29+
}

0 commit comments

Comments
 (0)