Skip to content

Commit

Permalink
⬆️ - Upgrade React Native to v0.76.6 (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
guytepper authored Jan 17, 2025
1 parent 7d7b1e0 commit 52d8aae
Show file tree
Hide file tree
Showing 15 changed files with 3,438 additions and 4,280 deletions.
3 changes: 2 additions & 1 deletion android/app/src/main/java/com/betterrail/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
Expand Down Expand Up @@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import org.apache.tools.ant.taskdefs.condition.Os

buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
if (findProperty('android.kotlinVersion')) {
kotlinVersion = findProperty('android.kotlinVersion')
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# 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
newArchEnabled=true

android.kotlinVersion=1.9.24
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -85,7 +87,8 @@ done
APP_BASE_NAME=${0##*/}

# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
Expand Down
8 changes: 3 additions & 5 deletions app/navigators/main-navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
* You'll likely spend most of your time in this file.
*/
import React from "react"
import { StackScreenProps, TransitionPresets } from "@react-navigation/stack"
import { createStackNavigator, TransitionPresets, type StackScreenProps } from "@react-navigation/stack"
import { PlannerScreen, SelectStationScreen, RouteListScreen, RouteDetailsScreen } from "../screens"
import { createSharedElementStackNavigator } from "react-navigation-shared-element"
import { color, typography } from "../theme"
import { RouteItem } from "../services/api"
import type { RouteItem } from "../services/api"
import { Platform } from "react-native"

/**
Expand Down Expand Up @@ -38,7 +37,7 @@ export type RouteListScreenProps = StackScreenProps<PrimaryParamList, "routeList
export type RouteDetailsScreenProps = StackScreenProps<PrimaryParamList, "routeDetails">

// Documentation: https://reactnavigation.org/docs/stack-navigator/
const Stack = createSharedElementStackNavigator<PrimaryParamList>()
const Stack = createStackNavigator<PrimaryParamList>()

export function MainNavigator() {
return (
Expand Down Expand Up @@ -71,7 +70,6 @@ export function MainNavigator() {
name="routeDetails"
component={RouteDetailsScreen}
options={{ headerTransparent: true, headerTintColor: "lightgrey", ...TransitionPresets.SlideFromRightIOS }}
sharedElements={() => Platform.select({ ios: ["route-header"], android: [] })}
/>
</Stack.Navigator>
)
Expand Down
17 changes: 7 additions & 10 deletions app/screens/route-details/route-details-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, { useEffect, useMemo, useRef, useState } from "react"
import { Platform, View, ViewStyle } from "react-native"
import { observer } from "mobx-react-lite"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { SharedElement } from "react-navigation-shared-element"
import { ScrollView } from "react-native-gesture-handler"
import Animated, { FadeInDown, FadeOutDown } from "react-native-reanimated"
import { format } from "date-fns"
Expand Down Expand Up @@ -90,15 +89,13 @@ export const RouteDetailsScreen = observer(function RouteDetailsScreen({ route }
statusBarBackgroundColor="transparent"
translucent
>
<SharedElement id="route-header">
<RouteDetailsHeader
routeItem={routeItem}
originId={route.params.originId}
destinationId={route.params.destinationId}
screenName={route.name}
style={{ paddingHorizontal: spacing[3], marginBottom: spacing[3] }}
/>
</SharedElement>
<RouteDetailsHeader
routeItem={routeItem}
originId={route.params.originId}
destinationId={route.params.destinationId}
screenName={route.name}
style={{ paddingHorizontal: spacing[3], marginBottom: spacing[3] }}
/>

<ScrollView
contentContainerStyle={{ paddingTop: spacing[4], paddingBottom: 80 + insets.bottom }}
Expand Down
15 changes: 6 additions & 9 deletions app/screens/route-list/route-list-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { View, ActivityIndicator, ViewStyle, Dimensions } from "react-native"
import { FlashList } from "@shopify/flash-list"
import { observer } from "mobx-react-lite"
import { useNetInfo } from "@react-native-community/netinfo"
import { SharedElement } from "react-navigation-shared-element"
import { useQuery } from "react-query"
import { closestIndexTo } from "date-fns"
import { RouteListScreenProps } from "../../navigators/main-navigator"
Expand Down Expand Up @@ -122,14 +121,12 @@ export const RouteListScreen = observer(function RouteListScreen({ navigation, r
statusBarBackgroundColor="transparent"
translucent
>
<SharedElement id="route-header">
<RouteDetailsHeader
screenName="routeList"
originId={route.params.originId}
destinationId={route.params.destinationId}
style={{ paddingHorizontal: spacing[3], marginBottom: spacing[3] }}
/>
</SharedElement>
<RouteDetailsHeader
screenName="routeList"
originId={route.params.originId}
destinationId={route.params.destinationId}
style={{ paddingHorizontal: spacing[3], marginBottom: spacing[3] }}
/>

{!isInternetReachable && !trains.data && <RouteListError errorType="no-internet" />}

Expand Down
34 changes: 18 additions & 16 deletions ios/BetterRail.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesSwift/Promises_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/RCT-Folly_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG/RNSVGFilters.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/abseil/xcprivacy.bundle",
Expand Down Expand Up @@ -1008,6 +1009,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Promises_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCT-Folly_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNSVGFilters.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/xcprivacy.bundle",
Expand Down Expand Up @@ -1328,12 +1330,12 @@
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = BetterRail/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1370,12 +1372,12 @@
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX;
INFOPLIST_FILE = BetterRail/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1458,7 +1460,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD = "";
LDPLUSPLUS = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -1539,7 +1541,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD = "";
LDPLUSPLUS = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -1591,7 +1593,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1640,7 +1642,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = "il.co.better-rail.watchkitapp.BetterRailWidget";
Expand Down Expand Up @@ -1692,7 +1694,7 @@
"@executable_path/Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1749,7 +1751,7 @@
"@executable_path/Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = "il.co.better-rail.watchkitapp";
Expand Down Expand Up @@ -1792,7 +1794,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1837,7 +1839,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = "il.co.better-rail.BetterRailWidget";
Expand Down Expand Up @@ -1869,13 +1871,13 @@
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = StationIntent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -1912,13 +1914,13 @@
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = StationIntent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.3.5;
MARKETING_VERSION = 2.4.0;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = "il.co.better-rail.StationIntent";
Expand Down
3 changes: 2 additions & 1 deletion ios/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ gem "fastlane"

# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
28 changes: 26 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require File.join(File.dirname(`cd #{pod_folder} && node --print "require.resolv
require File.join(File.dirname(`cd #{pod_folder} && node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`cd #{pod_folder} && node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")

platform :ios, '13.4'
platform :ios, '15.1'
install! 'cocoapods', :deterministic_uuids => false

production = ENV["PRODUCTION"] == "1"
Expand Down Expand Up @@ -61,5 +61,29 @@ target 'BetterRail' do
end
end
end

# Modify RCT-Folly Portability.h to disable coroutines
# Delete after upgrading to React Native 0.77: https://github.com/facebook/folly/issues/2297#issuecomment-2557356051
Dir.glob(installer.sandbox.root + "RCT-Folly/folly/Portability.h") do |file|
begin
# First try to make the file writable
system "chmod +w #{file}"

contents = File.read(file)
modified_contents = contents.gsub(/#define FOLLY_HAS_COROUTINES 1/, '#define FOLLY_HAS_COROUTINES 0')

# Try writing with elevated privileges if needed
if !File.writable?(file)
system "sudo chmod +w #{file}"
end

File.write(file, modified_contents)

# Optionally restore original permissions
system "chmod -w #{file}"
rescue => e
Pod::UI.warn "Failed to modify Portability.h: #{e.message}"
end
end
end
end
end
Loading

0 comments on commit 52d8aae

Please sign in to comment.