Skip to content

Commit

Permalink
Revert "Support RN 73 (#7844)"
Browse files Browse the repository at this point in the history
This reverts commit 0be34f9.
  • Loading branch information
gosha212 authored Feb 20, 2024
1 parent 889c88f commit 50b7040
Show file tree
Hide file tree
Showing 18 changed files with 136 additions and 108 deletions.
61 changes: 61 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
steps:
- block: ":rocket: Release!"
prompt: "Fill out the details for release"
if: 'build.message =~ /^release\$/i'
fields:
- text: "VERSION"
key: "version"
- text: "NPM_TAG"
key: "npm-tag"
default: 'null'
required: false
- text: "BUILD_DOCUMENTATION_VERSION"
key: "build-documentation-version"
default: 'null'
hint: 'Leave NULL if no version is specified'
- text: "REMOVE_DOCUMENTATION_VERSION"
key: "remove-documentation-version"
default: 'null'
hint: 'Leave NULL if no version is specified'

- label: ":android: Android"
command:
- "nvm install"
- "npm install"
- "npm run test-js"
- "npm run test-unit-android -- --release"
- "npm run test-e2e-android-multi -- --release --headless --verbose --ci"
key: "android_build"
timeout_in_minutes: 90
artifact_paths: "/Users/builder/work/artifacts/**/*"

- label: ":ios: iOS - Unit"
command:
- "nvm install"
- "npm install"
- "npm run test-unit-ios -- --release"
key: "ios_unit"
timeout_in_minutes: 90

- label: ":ios: iOS - E2E"
command:
- "nvm install"
- "npm install"
- "npm run test-snapshot-ios -- --release"
- "npm run test-e2e-ios -- --release --multi --ci"
key: "ios_e2e"
timeout_in_minutes: 90
artifact_paths: "/Users/builder/work/artifacts/**/*"

- label: ":package: Publish"
env:
if: "build.pull_request.id == null"
command:
- "nvm install"
- "npm install"
- "npm run release"
depends_on:
- "android_build"
- "ios_unit"
- "ios_e2e"
timeout_in_minutes: 90
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
16
10 changes: 2 additions & 8 deletions ReactNativeNavigation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@ Pod::Spec.new do |s|

s.module_name = 'ReactNativeNavigation'
s.default_subspec = 'Core'

s.subspec 'Core' do |ss|
s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
s.source_files = 'lib/ios/**/*.{h,m,mm,cpp}'
s.exclude_files = "lib/ios/ReactNativeNavigationTests/**/*.*", "lib/ios/OCMock/**/*.*"
end

if fabric_enabled
install_modules_dependencies(s)

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''

s.pod_target_xcconfig = {
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core"',
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
}

s.compiler_flags = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED'
s.requires_arc = true

Expand All @@ -50,7 +45,6 @@ Pod::Spec.new do |s|
s.dependency "React-runtimeexecutor"
s.dependency "React-rncore"
end

s.dependency 'React-Core'
s.dependency 'React-CoreModules'
s.dependency 'React-RCTImage'
Expand Down
24 changes: 12 additions & 12 deletions lib/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ def safeExtGetFallbackLowerBound(prop, fallback) {
Math.max(safeExtGet(prop,fallback),fallback)
}

def DEFAULT_COMPILE_SDK_VERSION = 34
def DEFAULT_COMPILE_SDK_VERSION = 33
def DEFAULT_MIN_SDK_VERSION = 21
def DEFAULT_TARGET_SDK_VERSION = 34
def DEFAULT_TARGET_SDK_VERSION = 33
def DEFAULT_KOTLIN_VERSION = "1.5.31"
def DEFAULT_KOTLIN_STDLIB = 'kotlin-stdlib-jdk8'
def kotlinVersion = safeExtGet("RNNKotlinVersion", DEFAULT_KOTLIN_VERSION)
def kotlinStdlib = safeExtGet('RNNKotlinStdlib',DEFAULT_KOTLIN_STDLIB )
def kotlinCoroutinesCore = safeExtGet('RNNKotlinCoroutinesCore', '1.5.2')
android {
compileSdkVersion safeExtGetFallbackLowerBound('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
buildToolsVersion = "34.0.0"
buildToolsVersion = "33.0.0"
defaultConfig {
minSdkVersion safeExtGetFallbackLowerBound('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGetFallbackLowerBound('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
Expand Down Expand Up @@ -56,17 +56,17 @@ android {
def repeatLength = output.length()
println '\n\n' + ('-' * repeatLength) + '\n' + output + '\n' + ('-' * repeatLength) + '\n'

println "see report at file://${t.reports.html.outputLocation}/index.html"
println "see report at file://${t.reports.html.destination}/index.html"
}
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
jvmTarget = JavaVersion.VERSION_1_8
}

flavorDimensions "RNN.reactNativeVersion"
Expand Down Expand Up @@ -172,14 +172,14 @@ List reactNativeVersionComponents(rnPackageJsonFile) {

dependencies {

implementation "androidx.core:core-ktx:1.6.1"
implementation "androidx.core:core-ktx:1.6.0"
implementation "org.jetbrains.kotlin:$kotlinStdlib:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesCore"
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation "androidx.constraintlayout:constraintlayout:2.0.4"

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.annotation:annotation:1.7.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'com.google.android.material:material:1.2.0-alpha03'

implementation 'com.github.wix-playground:ahbottomnavigation:3.3.0'
// implementation project(':AHBottomNavigation')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ open class ButtonPresenter(private val context: Context, private val button: But

class WixAccessibilityDelegateCompat: AccessibilityDelegateCompat(){
override fun onInitializeAccessibilityNodeInfo(
host: View,
info: AccessibilityNodeInfoCompat
host: View?,
info: AccessibilityNodeInfoCompat?
) {
super.onInitializeAccessibilityNodeInfo(host, info)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

import static org.assertj.core.api.Java6Assertions.*;

import com.reactnativenavigation.R;

public class EnvironmentTest extends BaseTest {
@Test
public void assertJ() {
Expand All @@ -35,7 +33,7 @@ public void supportDesign() {

@Test
public void androidR() {
assertThat(com.google.android.material.R.string.bottom_sheet_behavior).isNotZero();
assertThat(R.string.bottom_sheet_behavior).isNotZero();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Collections;
import java.util.List;


public class TestApplication extends Application implements ReactApplication {
private final ReactNativeHost host = new ReactNativeHost(this) {
@Override
Expand All @@ -26,7 +25,7 @@ protected List<ReactPackage> getPackages() {
@Override
public void onCreate() {
super.onCreate();
setTheme(androidx.appcompat.R.style.Theme_AppCompat);
setTheme(R.style.Theme_AppCompat);
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion lib/ios/RNNAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
#import "RCTLegacyInteropComponents.h"
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTLegacyViewManagerInteropComponentView.h>
#import <React/RCTRuntimeExecutorFromBridge.h>
#import <React/RCTSurfacePresenter.h>
#import <React/RCTSurfacePresenterStub.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
#import <ReactCommon/RCTTurboModuleManager.h>
#import <react/config/ReactNativeConfig.h>
Expand Down
4 changes: 2 additions & 2 deletions lib/ios/RNNReactView.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTSurfaceHostingProxyRootView.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#else
#import <React/RCTRootView.h>
#endif
Expand Down Expand Up @@ -32,7 +32,7 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);

#ifdef RCT_NEW_ARCH_ENABLED
@interface RNNReactView
: RCTSurfaceHostingProxyRootView <RCTRootViewDelegate, RNNComponentProtocol>
: RCTFabricSurfaceHostingProxyRootView <RCTRootViewDelegate, RNNComponentProtocol>
#else
@interface RNNReactView : RCTRootView <RCTRootViewDelegate, RNNComponentProtocol>
#endif
Expand Down
10 changes: 4 additions & 6 deletions lib/ios/RNNReactView.mm → lib/ios/RNNReactView.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#import "RNNReactView.h"
#import <React/RCTRootContentView.h>

#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTFabricSurface.h>
#endif

@implementation RNNReactView {
BOOL _isAppeared;
}
Expand All @@ -15,8 +11,10 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
eventEmitter:(RNNEventEmitter *)eventEmitter
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
RCTFabricSurface *surface = [[RCTFabricSurface alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode];
self = [super initWithBridge:bridge
moduleName:moduleName
initialProperties:initialProperties
sizeMeasureMode:sizeMeasureMode];
#else
- (instancetype)initWithBridge:(RCTBridge *)bridge
moduleName:(NSString *)moduleName
Expand Down
4 changes: 0 additions & 4 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const path = require('node:path');
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

const config = {
projectRoot: `${__dirname}`,
resolver: {
enableGlobalPackages: true,
},
watchFolders: [__dirname],
};

Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,14 @@
"@babel/plugin-proposal-export-namespace-from": "7.10.1",
"@babel/runtime": "7.22.6",
"@babel/types": "7.22.5",
"@babel/preset-env": "^7.22.9",
"@react-native/metro-config": "^0.73.2",
"@react-native/babel-preset": "^0.73.18",
"@react-native/typescript-config": "^0.73.1",
"@react-native/metro-config": "^0.73.0",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/datetimepicker": "^3.4.7",
"@react-native-community/eslint-config": "2.0.0",
"@react-native-community/netinfo": "^5.9.4",
"@testing-library/jest-native": "^5.4.2",
"@testing-library/react-native": "^12.0.1",
"@types/detox": "17.14.3",
"@types/hoist-non-react-statics": "^3.0.1",
"@types/jasmine": "3.5.10",
"@types/jest": "27.0.2",
Expand All @@ -97,7 +95,7 @@
"@typescript-eslint/parser": "4.33.0",
"babel-jest": "^27.0.0",
"clang-format": "^1.4.0",
"detox": "20.18.1",
"detox": "20.9.0",
"detox-testing-library-rnn-adapter": "^2.0.3",
"eslint": "7.32.0",
"eslint-config-prettier": "6.11.0",
Expand All @@ -112,10 +110,10 @@
"pngjs": "^6.0.0",
"prettier": "2.1.2",
"react": "18.2.0",
"react-native": "0.73.3",
"react-native": "0.72.3",
"react-native-fast-image": "^8.6.3",
"react-native-gesture-handler": "^2.10.1",
"react-native-reanimated": "3.6.2",
"react-native-reanimated": "3.4.1",
"react-native-ui-lib": "7.3.6",
"react-redux": "5.x.x",
"react-test-renderer": "18.2.0",
Expand Down
6 changes: 2 additions & 4 deletions playground/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ def jscFlavor = 'org.webkit:android-jsc:+'
android {
compileSdkVersion rootProject.ext.get("compileSdkVersion")

namespace "com.reactnativenavigation.playground"

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import com.reactnativenavigation.R;

public class FragmentComponent implements ExternalComponent {
private final FrameLayout content;
Expand Down
18 changes: 4 additions & 14 deletions playground/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

buildscript {
ext {
kotlinVersion = "1.8.10"
kotlinVersion = "1.7.10"
RNNKotlinVersion = kotlinVersion
detoxKotlinVersion = kotlinVersion
compileSdkVersion = 34
buildToolsVersion = "34.0.0"
compileSdkVersion = 33
buildToolsVersion = "33.0.0"
minSdkVersion = 21
targetSdkVersion = 34
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
Expand Down Expand Up @@ -36,13 +36,3 @@ allprojects {
}
}
}

subprojects {
afterEvaluate { p ->
if (p.hasProperty('android')) {
android {
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jul 28 13:48:47 IDT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit 50b7040

Please sign in to comment.