Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Backpack RN upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
olliecurtis committed Dec 1, 2023
1 parent e3d015a commit 72c8302
Show file tree
Hide file tree
Showing 75 changed files with 6,457 additions and 5,627 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Backpack changelog

# 24.0.0

- Upgrade to React Native 0.70.9

# 23.0.0 - 2023-03-09

**Breaking:**
Expand Down
3 changes: 2 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: "com.android.application"
apply plugin: 'kotlin-android'

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
Expand Down Expand Up @@ -73,7 +74,7 @@ import com.android.build.OutputFile
* ]
*/

project.ext.react = [ entryFile: "index.android.js" ]
project.ext.react = [ entryFile: "index.android.js", enableHermes: false ]
apply from: "../../node_modules/react-native/react.gradle"

/**
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Binary file modified android/app/src/main/assets/fonts/BpkIcon.ttf
Binary file not shown.
Binary file modified android/app/src/main/assets/fonts/BpkIcon.woff
Binary file not shown.
Binary file modified android/app/src/main/assets/fonts/BpkIconIOS.ttf
Binary file not shown.
Binary file modified android/app/src/main/assets/fonts/BpkIconIOS.woff
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package net.skyscanner.backpack
import android.content.res.Configuration
import android.os.Bundle
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.facebook.react.modules.i18nmanager.I18nUtil

class MainActivity : ReactActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.airbnb.android.react.maps.MapsPackage
import com.facebook.react.ReactApplication
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.shell.MainReactPackage
import com.facebook.soloader.SoLoader
import com.jakewharton.threetenabp.AndroidThreeTen
Expand Down Expand Up @@ -44,7 +45,7 @@ class MainApplication : Application(), ReactApplication {
}

override fun getReactNativeHost(): ReactNativeHost {
return mReactNativeHost
return mReactNativeHost;
}

override fun onCreate() {
Expand Down
21 changes: 18 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.kezong:fat-aar:1.3.6'
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -27,12 +29,17 @@ ext {
playServicesVersion = "17.0.0"
androidMapsUtilsVersion = "xxx"
threetenabpVersion = "1.4.0"
ndkVersion = "20.0.5948944"
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}

allprojects {
repositories {
mavenLocal()
google()
mavenCentral()

Expand All @@ -45,6 +52,14 @@ allprojects {
url("$rootDir/../node_modules/jsc-android/dist")
}

mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}

if (rootProject.ext.internalBuild || isUseRelative()) {

// Get the credentials for internal builds
Expand Down
19 changes: 17 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand All @@ -20,3 +20,18 @@
SKYSCANNER_ARTIFACTORY_MAVEN_URL=https://artifactory.skyscannertools.net/artifactory/infrastructure-maven
android.enableJetifier=true
android.useAndroidX=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.125.0

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
2 changes: 1 addition & 1 deletion android/gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

##############################################################################
##
Expand Down
8 changes: 7 additions & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ project(':react-native-linear-gradient').projectDir = new File(rootProject.proje
include ':react-native-maps:lib'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')


includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}

29 changes: 27 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ platform :ios, '14.0'
use_frameworks!

target 'Backpack Native' do

use_react_native!(
# :path => '../node_modules/react-native',
:hermes_enabled => false,
)

# All these libraries below have been removed from the Xcode project file and now live in the Podfile. Cocoapods handles the linking now. Here you can add more libraries with native modules.
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector", :modular_headers => true
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec", :modular_headers => true
pod 'boost', :podspec => '../node_modules/react-native/third-party-podspecs/boost.podspec', :modular_headers => false
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired", :modular_headers => true
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety", :modular_headers => true
pod 'React', :path => '../node_modules/react-native/', :modular_headers => false
Expand All @@ -26,10 +33,12 @@ target 'Backpack Native' do
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => false
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration', :modular_headers => false
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/', :modular_headers => true
# pod 'React-bridging', :path => '../node_modules/react-native/ReactCommon/React-bridging.podspec', :modular_headers => false
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact', :modular_headers => false
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => false
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor', :modular_headers => false
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector', :modular_headers => false
pod 'React-logger', :path => '../node_modules/react-native/ReactCommon/logger', :modular_headers => false
pod 'React-perflogger', :path => '../node_modules/react-native/ReactCommon/reactperflogger', :modular_headers => false
pod 'React-runtimeexecutor', :path => '../node_modules/react-native/ReactCommon/runtimeexecutor', :modular_headers => false
pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker", :modular_headers => false
Expand All @@ -38,7 +47,8 @@ target 'Backpack Native' do
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec', :modular_headers => false
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec', :modular_headers => false

# pod 'React-Codegen', :path => 'build/generated/ios', :modular_headers => false

# RN Bridging Pods
pod 'Backpack', :modular_headers => true
pod 'BackpackReactNative', path: '../node_modules/backpack-react-native/ios/BackpackReactNative', :modular_headers => false
Expand All @@ -52,8 +62,23 @@ target 'Backpack Native' do

use_native_modules!

# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
# :hermes_enabled => false,
# :fabric_enabled => flags[:fabric_enabled],
# # An absolute path to your application root.
# :app_path => "#{Pod::Config.instance.installation_root}/.."

post_install do |installer|
react_native_post_install(installer)
# react_native_post_install(installer)
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
# __apply_Xcode_12_5_M1_post_install_workaround(installer)

# Solution from https://github.com/facebook/react-native/issues/31034#issuecomment-812564390
# Works around an issue in FBReactNativeSpec where "Generate Specs" should be before "Headers" but isn't
Expand Down
Loading

0 comments on commit 72c8302

Please sign in to comment.