Skip to content

chore: Update expo-sdk to 52 #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/turbo-demo-expo-example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"minSdkVersion": 26
},
"ios": {
"deploymentTarget": "14.0"
"deploymentTarget": "15.6"
}
}
]
Expand Down
36 changes: 17 additions & 19 deletions examples/turbo-demo-expo-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,27 @@
"lint:check": "eslint ."
},
"dependencies": {
"@react-navigation/bottom-tabs": "^6.5.19",
"@react-navigation/material-top-tabs": "^6.6.12",
"@react-navigation/native": "^6.1.16",
"@react-navigation/native-stack": "^6.9.25",
"expo": "^50.0.1",
"expo-build-properties": "~0.11.1",
"expo-dev-client": "~3.3.6",
"expo-splash-screen": "~0.26.3",
"expo-status-bar": "~1.11.1",
"expo-updates": "~0.24.8",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.73.4",
"react-native-pager-view": "6.2.3",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-tab-view": "^3.5.2",
"@react-navigation/bottom-tabs": "^7.3.3",
"@react-navigation/native": "^7.0.19",
"@react-navigation/native-stack": "^7.3.3",
"expo": "^52.0.41",
"expo-build-properties": "~0.13.2",
"expo-dev-client": "5.0.15",
"expo-splash-screen": "0.29.22",
"expo-status-bar": "2.0.1",
"expo-updates": "~0.27.4",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.7",
"react-native-pager-view": "6.5.1",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.4.0",
"react-native-turbo": "file:../../packages/turbo",
"react-native-web": "~0.19.6",
"react-native-web": "~0.19.13",
"react-native-web-screen": "file:../../packages/navigation"
},
"devDependencies": {
"@babel/core": "^7.19.3"
"@babel/core": "^7.26.10"
},
"name": "example",
"version": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/turbo-demo-expo-example/src/WebView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const WebView: React.FC<Props> = ({ navigation, ...props }) => {

const onVisitProposal = useCallback(
({ action: actionType, url }: VisitProposal) => navigateTo(url, actionType),
[navigation]
[navigateTo]
);

const onLoad = useCallback(
Expand Down
4 changes: 2 additions & 2 deletions packages/navigation/src/hooks/useWebviewNavigate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import {
useNavigation,
useRoute,
CommonActions,
LinkingContext,
} from '@react-navigation/native';
import LinkingContext from '@react-navigation/native/src/LinkingContext';
Comment on lines +14 to -15
Copy link
Contributor

@pfeiffer pfeiffer Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we still want to support v6 (which I think we should), do we need to do a custom export here as well similar to extractPathFromURL? The exports have changed between v6 and v7.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that before and LinkingContext export changed in v7, but in both v6 and v7 it can be simply imported from '@react-navigation/native', so there's no need for a custom export

import extractPathFromURL from '@react-navigation/native/src/extractPathFromURL';
import * as React from 'react';
import type { Action } from 'react-native-turbo';

import { extractPathFromURL } from '../utils/extractPathFromURL';
import { isDeepEqual, type ComparableObject } from '../utils/isEqual';

type ActionPayloadParams = {
Expand Down
10 changes: 10 additions & 0 deletions packages/navigation/src/utils/extractPathFromURL.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as extractPathFromURLLib from '@react-navigation/native/src/extractPathFromURL';

// extractPathFromURL export changes between v6 and v7 of @react-navigation/native
export const extractPathFromURL: (
prefixes: string[],
url: string
) => string | undefined =
// @ts-ignore different export type for react-navigation v7
// eslint-disable-next-line import/namespace
extractPathFromURLLib.default || extractPathFromURLLib.extractPathFromURL;
7 changes: 6 additions & 1 deletion packages/navigation/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"extends": "../../tsconfig.json",
"references": [{ "path": "../turbo" }],
"compilerOptions": {
"outDir": "./lib/typescript"
"outDir": "./lib/typescript",
"paths": {
"@react-navigation/native/*": [
"../../node_modules/@react-navigation/native/*"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RNFileChooserDelegate(private val reactContext: ReactApplicationContext) {
val packageManager: PackageManager = reactContext.packageManager
val packageName: String = reactContext.packageName
try {
val requestedPermissions: Array<String> =
val requestedPermissions: Array<String>? =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
packageManager.getPackageInfo(
packageName, PackageManager.PackageInfoFlags.of(PackageManager.GET_PERMISSIONS.toLong())
Expand All @@ -50,7 +50,10 @@ class RNFileChooserDelegate(private val reactContext: ReactApplicationContext) {
).requestedPermissions
}

if (listOf(*requestedPermissions).contains(Manifest.permission.CAMERA) && reactContext.currentActivity != null && ContextCompat.checkSelfPermission(
if (requestedPermissions!= null
&& listOf(*requestedPermissions).contains(Manifest.permission.CAMERA)
&& reactContext.currentActivity != null
&& ContextCompat.checkSelfPermission(
reactContext.currentActivity!!, Manifest.permission.CAMERA
) != PackageManager.PERMISSION_GRANTED
) {
Expand Down
1 change: 1 addition & 0 deletions packages/turbo/ios/RNSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import WebKit

@objc(RNSessionManager)
class RNSessionManager: NSObject {
Expand Down
1 change: 1 addition & 0 deletions packages/turbo/ios/RNSessionSubscriber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//
// Created by Bartłomiej Fryz on 23/01/2023.
//
import WebKit

protocol RNSessionSubscriber {

Expand Down
1 change: 1 addition & 0 deletions packages/turbo/ios/RNVisitableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import WebKit

let REFRESH_SCRIPT = "typeof Turbo.session.refresh === 'function'" +
"? Turbo.session.refresh(document.baseURI)" + // Turbo 8+
Expand Down
8 changes: 4 additions & 4 deletions packages/turbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
"devDependencies": {
"@react-navigation/core": "^6.0.0",
"@react-navigation/native": "^6.0.0",
"react-native-safe-area-context": "^4.3.0",
"react-native-screens": "^3.13.0"
"react-native-safe-area-context": "5.2.0",
"react-native-screens": "^4.10.0"
},
"peerDependencies": {
"@react-navigation/core": ">=6.0.0",
"@react-navigation/native": ">=6.0.0",
"react": "*",
"react-native": "*",
"react-native-safe-area-context": "^4.3.0",
"react-native-screens": "^3.13.0"
"react-native-safe-area-context": "5.2.0",
"react-native-screens": "^4.10.0"
},
"files": [
"src",
Expand Down
Loading