Skip to content

Commit 503a925

Browse files
authored
Support for RN 0.82 (#8188)
* Support for RN 0.82 * Updated react version * Update Buildkite pipeline scripts for React Native 0.82 support * Fix missing newline at end of package.json files in root and playground directories * Buildkite jobs * Update gradle wrapper * Update gradle wrapper * Fixed lint issue * Refactor SimpleViewController and SimpleView for improved mock behavior in tests - Updated SimpleView to extend FrameLayout instead of ReactView, avoiding React surface rendering in tests. - Enhanced method implementations in SimpleView to return appropriate values and added no-op comments for clarity. - Cleaned up formatting in SimpleViewController for better readability. - Removed unnecessary blank lines in TestApplication and added a newline in index.js for consistency. * Added comments
1 parent cecaa13 commit 503a925

File tree

16 files changed

+1092
-492
lines changed

16 files changed

+1092
-492
lines changed

.buildkite/jobs/pipeline.android_rn_80.yml

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

.buildkite/jobs/pipeline.android_rn_81.yml renamed to .buildkite/jobs/pipeline.android_rn_82.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
- label: ":android: Android (RN 0.81.5)"
1+
- label: ":android: Android (RN 0.82.1)"
22
env:
33
JAVA_HOME: /opt/openjdk/jdk-17.0.9.jdk/Contents/Home/
4-
REACT_NATIVE_VERSION: 0.81.5
4+
REACT_NATIVE_VERSION: 0.82.1
55
command:
66
- "nvm install"
77
- "./scripts/ci.android.sh"
8-
key: "android_rn_81"
8+
key: "android_rn_82"
99
timeout_in_minutes: 90
1010
artifact_paths: "/Users/builder/uibuilder/work/playground/artifacts/**/*"
1111

.buildkite/jobs/pipeline.ios_rn_80.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
- label: ":ios: iOS (RN 0.81.5)"
1+
- label: ":ios: iOS (RN 0.82.1)"
22
env:
3-
REACT_NATIVE_VERSION: 0.81.5
3+
REACT_NATIVE_VERSION: 0.82.1
44
command:
55
- "nvm install"
66
- "./scripts/ci.ios.sh"
7-
key: "ios_rn_81"
7+
key: "ios_rn_82"
88
timeout_in_minutes: 90
99
artifact_paths: "/Users/builder/uibuilder/work/playground/artifacts/**/*"
1010

.buildkite/pipeline.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ echo "steps:"
55
cat .buildkite/jobs/pipeline.release.yml
66
cat .buildkite/jobs/pipeline.android_rn_77.yml
77
cat .buildkite/jobs/pipeline.android_rn_78.yml
8-
cat .buildkite/jobs/pipeline.android_rn_80.yml
9-
cat .buildkite/jobs/pipeline.android_rn_81.yml
8+
cat .buildkite/jobs/pipeline.android_rn_82.yml
109
cat .buildkite/jobs/pipeline.ios_rn_77.yml
1110
cat .buildkite/jobs/pipeline.ios_rn_78.yml
12-
cat .buildkite/jobs/pipeline.ios_rn_80.yml
13-
cat .buildkite/jobs/pipeline.ios_rn_81.yml
11+
cat .buildkite/jobs/pipeline.ios_rn_82.yml
1412
cat .buildkite/jobs/pipeline.publish.yml
1513

1614

android/src/androidTest/assets/index.android.bundle

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

android/src/androidTest/java/com/reactnativenavigation/TestApplication.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import com.reactnativenavigation.react.NavigationReactNativeHost
99

1010
class TestApplication : NavigationApplication() {
1111

12-
1312
override val reactNativeHost: ReactNativeHost
1413
get() = object : NavigationReactNativeHost(this) {
1514
override fun getJSMainModuleName(): String {

android/src/androidTest/java/com/reactnativenavigation/mocks/SimpleViewController.java

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
import android.app.Activity;
66
import android.content.Context;
77
import android.view.MotionEvent;
8+
import android.view.ViewGroup;
9+
import android.widget.FrameLayout;
810

911
import androidx.annotation.NonNull;
1012

1113
import com.reactnativenavigation.options.Options;
12-
import com.reactnativenavigation.react.ReactView;
1314
import com.reactnativenavigation.viewcontrollers.child.ChildController;
1415
import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
1516
import com.reactnativenavigation.viewcontrollers.component.ComponentPresenterBase;
@@ -24,7 +25,8 @@ public SimpleViewController(Activity activity, ChildControllersRegistry childReg
2425
this(activity, childRegistry, id, new Presenter(activity, new Options()), options);
2526
}
2627

27-
public SimpleViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Presenter presenter, Options options) {
28+
public SimpleViewController(Activity activity, ChildControllersRegistry childRegistry, String id,
29+
Presenter presenter, Options options) {
2830
super(activity, childRegistry, id, presenter, options);
2931
}
3032

@@ -40,7 +42,8 @@ public void sendOnNavigationButtonPressed(String buttonId) {
4042

4143
@Override
4244
public void destroy() {
43-
if (!isDestroyed()) performOnParentController(parent -> parent.onChildDestroyed(this));
45+
if (!isDestroyed())
46+
performOnParentController(parent -> parent.onChildDestroyed(this));
4447
super.destroy();
4548
}
4649

@@ -58,18 +61,24 @@ public int getTopInset() {
5861

5962
@Override
6063
public void applyBottomInset() {
61-
if (view != null) presenter.applyBottomInset(view, getBottomInset());
64+
if (view != null)
65+
presenter.applyBottomInset(view, getBottomInset());
6266
}
6367

6468
@Override
6569
public String getCurrentComponentName() {
6670
return null;
6771
}
6872

69-
public static class SimpleView extends ReactView implements ReactComponent {
73+
/**
74+
* A simple mock view that implements ReactComponent without actually using
75+
* React Native.
76+
* This avoids triggering React surface rendering in instrumented tests.
77+
*/
78+
public static class SimpleView extends FrameLayout implements ReactComponent {
7079

7180
public SimpleView(@NonNull Context context) {
72-
super(context, "compId", "compName");
81+
super(context);
7382
}
7483

7584
@Override
@@ -79,22 +88,22 @@ public boolean isRendered() {
7988

8089
@Override
8190
public boolean isReady() {
82-
return false;
91+
return true;
8392
}
8493

8594
@Override
86-
public ReactView asView() {
95+
public ViewGroup asView() {
8796
return this;
8897
}
8998

9099
@Override
91100
public void destroy() {
92-
101+
// No-op for mock
93102
}
94103

95104
@Override
96105
public void sendOnNavigationButtonPressed(String buttonId) {
97-
106+
// No-op for mock
98107
}
99108

100109
@Override
@@ -104,7 +113,7 @@ public ScrollEventListener getScrollEventListener() {
104113

105114
@Override
106115
public void dispatchTouchEventToJs(MotionEvent event) {
107-
116+
// No-op for mock
108117
}
109118
}
110119
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
/**
3+
* Minimal entry point for Android instrumented tests
4+
* This registers a no-op component to satisfy React Native's initialization.
5+
* Used only in Android instrumented application class.
6+
* Regenerate bundle when upgrading React Native:
7+
* npx react-native bundle --platform android --dev false \
8+
* --entry-file android/src/androidTest/js/index.js \
9+
* --bundle-output android/src/androidTest/assets/index.android.bundle \
10+
* --minify true
11+
*/
12+
import { AppRegistry } from 'react-native';
13+
AppRegistry.registerComponent('RNNTest', () => () => null);
14+

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,18 @@
9393
"@react-native-community/cli-platform-ios": "20.0.0",
9494
"@react-native-community/datetimepicker": "^8.2.0",
9595
"@react-native-community/netinfo": "^11.4.1",
96-
"@react-native/babel-preset": "0.81.5",
97-
"@react-native/eslint-config": "0.81.5",
98-
"@react-native/metro-config": "0.81.5",
99-
"@react-native/typescript-config": "0.81.5",
96+
"@react-native/babel-preset": "0.82.1",
97+
"@react-native/eslint-config": "0.82.1",
98+
"@react-native/metro-config": "0.82.1",
99+
"@react-native/typescript-config": "0.82.1",
100100
"@testing-library/jest-native": "^5.4.2",
101101
"@testing-library/react-native": "^13.0.1",
102102
"@types/hoist-non-react-statics": "^3.3.6",
103103
"@types/jasmine": "3.5.10",
104104
"@types/jest": "^29.5.13",
105105
"@types/lodash": "^4.17.20",
106106
"@types/prop-types": "^15.7.14",
107-
"@types/react": "^19.1.0",
107+
"@types/react": "^19.1.1",
108108
"@types/react-test-renderer": "^19.1.0",
109109
"@typescript-eslint/eslint-plugin": "8.21.0",
110110
"@typescript-eslint/parser": "8.21.0",
@@ -124,15 +124,15 @@
124124
"pixelmatch": "^5.2.1",
125125
"pngjs": "^6.0.0",
126126
"prettier": "2.8.8",
127-
"react": "19.1.0",
128-
"react-native": "0.81.5",
127+
"react": "19.1.1",
128+
"react-native": "0.82.1",
129129
"react-native-builder-bob": "^0.40.13",
130130
"react-native-fast-image": "^8.6.3",
131-
"react-native-gesture-handler": "^2.22.1",
131+
"react-native-gesture-handler": "^2.29.1",
132132
"react-native-reanimated": "4.1.5",
133133
"react-native-worklets": "0.5.0",
134134
"react-redux": "9.1.2",
135-
"react-test-renderer": "19.1.0",
135+
"react-test-renderer": "19.1.1",
136136
"redux": "^5.0.1",
137137
"remx": "3.x.x",
138138
"semver": "5.x.x",

0 commit comments

Comments
 (0)