Skip to content

Commit 46ca0fa

Browse files
authored
chore(deps)!: use non-legacy Expo FS in Resource Fetcher, bump SDK version to 56 in demo apps (#1222)
## Description This PR bumps Expo SDK to 56 across all demo apps using Expo. It also refactors the Expo Resource Fetcher to use the aforementioned version. For users using <56, a /legacy import for ExpoResourceFetcher is still available. ### Introduces a breaking change? - [x] Yes - [ ] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [x] Other (chores, tests, code style improvements etc.) ### Tested on - [x] iOS - [x] Android ### Testing instructions - In an app on Expo SDK <56 (e.g. SDK 54/55), install this package and import { ExpoResourceFetcher } from 'react-native-executorch-expo-resource-fetcher'. Confirm it throws RnExecutorchError with code ResourceFetcherFileSystemApiUnavailable (0xbc) and a message pointing at the /legacy entry point — not the cryptic File.createDownloadTask is not a function. - In the same old-SDK app, switch the import to react-native-executorch-expo-resource-fetcher/legacy and confirm fetch, pause/resume/cancel, deleteResources, and listDownloadedFiles all still work. - In an app on Expo SDK 56+, import from the default entry point and confirm the guard does not fire and downloads work end-to-end. - Run yarn install at the repo root and confirm no new peer-dep warnings on the SDK-56 demo apps under apps/. ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. -->
1 parent 9b9ec3e commit 46ca0fa

40 files changed

Lines changed: 2236 additions & 2233 deletions

File tree

‎apps/computer-vision/ScreenWrapper.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useIsFocused } from '@react-navigation/native';
1+
import { useIsFocused } from 'expo-router';
22
import { PropsWithChildren } from 'react';
33

44
export default function ScreenWrapper({ children }: PropsWithChildren) {

‎apps/computer-vision/app/_layout.tsx‎

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ import { ExpoResourceFetcher } from 'react-native-executorch-expo-resource-fetch
44

55
import ColorPalette from '../colors';
66
import React, { useState } from 'react';
7-
import { Text, StyleSheet, View, TouchableOpacity } from 'react-native';
7+
import {
8+
Text,
9+
StyleSheet,
10+
View,
11+
TouchableOpacity,
12+
type ColorValue,
13+
} from 'react-native';
814

915
import {
10-
DrawerContentComponentProps,
16+
type DrawerContentComponentProps,
1117
DrawerContentScrollView,
1218
DrawerItemList,
13-
} from '@react-navigation/drawer';
14-
import { DrawerActions } from '@react-navigation/native';
19+
} from 'expo-router/build/react-navigation/drawer';
20+
import { DrawerActions } from 'expo-router/build/react-navigation/routers';
1521
import { useNavigation } from 'expo-router';
1622
import Svg, { Rect } from 'react-native-svg';
1723
import { GeneratingContext } from '../context';
@@ -20,38 +26,18 @@ initExecutorch({
2026
resourceFetcher: ExpoResourceFetcher,
2127
});
2228

23-
function HamburgerIcon({ tintColor }: { tintColor?: string }) {
29+
function HamburgerIcon({ tintColor }: { tintColor?: ColorValue }) {
2430
const navigation = useNavigation();
31+
const fill = typeof tintColor === 'string' ? tintColor : '#000';
2532
return (
2633
<TouchableOpacity
2734
onPress={() => navigation.dispatch(DrawerActions.toggleDrawer())}
2835
style={styles.hamburger}
2936
>
3037
<Svg width={24} height={24} viewBox="0 0 24 24">
31-
<Rect
32-
x={2}
33-
y={4}
34-
width={20}
35-
height={2}
36-
rx={1}
37-
fill={tintColor ?? '#000'}
38-
/>
39-
<Rect
40-
x={2}
41-
y={11}
42-
width={20}
43-
height={2}
44-
rx={1}
45-
fill={tintColor ?? '#000'}
46-
/>
47-
<Rect
48-
x={2}
49-
y={18}
50-
width={20}
51-
height={2}
52-
rx={1}
53-
fill={tintColor ?? '#000'}
54-
/>
38+
<Rect x={2} y={4} width={20} height={2} rx={1} fill={fill} />
39+
<Rect x={2} y={11} width={20} height={2} rx={1} fill={fill} />
40+
<Rect x={2} y={18} width={20} height={2} rx={1} fill={fill} />
5541
</Svg>
5642
</TouchableOpacity>
5743
);

‎apps/computer-vision/app/text_to_image/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const styles = StyleSheet.create({
227227
width: '100%',
228228
},
229229
overlay: {
230-
...StyleSheet.absoluteFillObject,
230+
...StyleSheet.absoluteFill,
231231
backgroundColor: 'rgba(0,0,0,0.1)',
232232
zIndex: 1,
233233
},

‎apps/computer-vision/app/vision_camera/index.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
View,
99
} from 'react-native';
1010
import { useSafeAreaInsets } from 'react-native-safe-area-context';
11-
import { useIsFocused } from '@react-navigation/native';
11+
import { useIsFocused } from 'expo-router';
1212
import {
1313
Camera,
1414
useCameraDevices,
@@ -453,7 +453,7 @@ const styles = StyleSheet.create({
453453
},
454454
buttonText: { color: 'white', fontSize: 15, fontWeight: '600' },
455455
loadingOverlay: {
456-
...StyleSheet.absoluteFillObject,
456+
...StyleSheet.absoluteFill,
457457
backgroundColor: 'rgba(0,0,0,0.6)',
458458
justifyContent: 'center',
459459
alignItems: 'center',

‎apps/computer-vision/babel.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module.exports = function (api) {
22
api.cache(true);
33
return {
44
presets: ['babel-preset-expo'],
5-
plugins: ['react-native-reanimated/plugin'],
5+
plugins: ['react-native-worklets/plugin'],
66
};
77
};

‎apps/computer-vision/components/ImageWithMasks.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const styles = StyleSheet.create({
238238
height: '100%',
239239
},
240240
overlay: {
241-
...StyleSheet.absoluteFillObject,
241+
...StyleSheet.absoluteFill,
242242
},
243243
canvas: {
244244
width: '100%',

‎apps/computer-vision/components/vision_camera/tasks/ClassificationTask.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default function ClassificationTask({
106106

107107
const styles = StyleSheet.create({
108108
overlay: {
109-
...StyleSheet.absoluteFillObject,
109+
...StyleSheet.absoluteFill,
110110
justifyContent: 'center',
111111
alignItems: 'center',
112112
},

‎apps/computer-vision/package.json‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@
1111
"lint": "eslint . --ext .ts,.tsx --fix"
1212
},
1313
"dependencies": {
14-
"@expo/log-box": "~55.0.10",
15-
"@react-native/metro-config": "^0.83.0",
14+
"@expo/log-box": "~56.0.12",
15+
"@expo/vector-icons": "^15.0.2",
16+
"@react-native/metro-config": "^0.85.3",
1617
"@react-navigation/drawer": "^7.9.4",
1718
"@react-navigation/native": "^7.2.2",
1819
"@shopify/react-native-skia": "2.6.2",
19-
"expo": "^55.0.13",
20-
"expo-build-properties": "~55.0.13",
21-
"expo-constants": "^55.0.16",
22-
"expo-font": "~55.0.6",
23-
"expo-linking": "~55.0.12",
24-
"expo-router": "~55.0.11",
25-
"expo-status-bar": "~55.0.5",
26-
"metro-config": "^0.83.0",
27-
"react": "19.2.5",
28-
"react-native": "0.83.4",
20+
"expo": "~56.0.9",
21+
"expo-build-properties": "~56.0.17",
22+
"expo-constants": "~56.0.17",
23+
"expo-font": "~56.0.5",
24+
"expo-linking": "~56.0.13",
25+
"expo-router": "~56.2.9",
26+
"expo-status-bar": "~56.0.4",
27+
"metro-config": "^0.84.0",
28+
"react": "19.2.3",
29+
"react-native": "0.85.3",
2930
"react-native-device-info": "^15.0.2",
3031
"react-native-executorch": "workspace:*",
3132
"react-native-executorch-expo-resource-fetcher": "workspace:*",
@@ -34,20 +35,20 @@
3435
"react-native-loading-spinner-overlay": "^3.0.1",
3536
"react-native-nitro-image": "0.13.1",
3637
"react-native-nitro-modules": "0.35.4",
37-
"react-native-reanimated": "~4.3.0",
38+
"react-native-reanimated": "4.3.1",
3839
"react-native-safe-area-context": "~5.7.0",
39-
"react-native-screens": "~4.24.0",
40+
"react-native-screens": "~4.25.2",
4041
"react-native-svg": "15.15.4",
4142
"react-native-svg-transformer": "^1.5.3",
4243
"react-native-vision-camera": "^5.0.6",
4344
"react-native-vision-camera-worklets": "^5.0.6",
44-
"react-native-worklets": "0.8.1"
45+
"react-native-worklets": "0.8.3"
4546
},
4647
"devDependencies": {
4748
"@babel/core": "^7.29.0",
4849
"@types/react": "~19.2.0",
4950
"@types/react-refresh": "^0",
50-
"babel-preset-expo": "~55.0.16",
51+
"babel-preset-expo": "~56.0.14",
5152
"react-refresh": "^0.18.0"
5253
},
5354
"private": true

‎apps/llm/app/_layout.tsx‎

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,35 @@ import { initExecutorch } from 'react-native-executorch';
33
import { ExpoResourceFetcher } from 'react-native-executorch-expo-resource-fetcher';
44
import ColorPalette from '../colors';
55
import React, { useState } from 'react';
6-
import { Text, StyleSheet, View, TouchableOpacity } from 'react-native';
76
import {
8-
DrawerContentComponentProps,
7+
Text,
8+
StyleSheet,
9+
View,
10+
TouchableOpacity,
11+
type ColorValue,
12+
} from 'react-native';
13+
import {
14+
type DrawerContentComponentProps,
915
DrawerContentScrollView,
1016
DrawerItemList,
11-
} from '@react-navigation/drawer';
12-
import { DrawerActions } from '@react-navigation/native';
17+
} from 'expo-router/build/react-navigation/drawer';
18+
import { DrawerActions } from 'expo-router/build/react-navigation/routers';
1319
import { useNavigation } from 'expo-router';
1420
import Svg, { Rect } from 'react-native-svg';
1521
import { GeneratingContext } from '../context';
1622

17-
function HamburgerIcon({ tintColor }: { tintColor?: string }) {
23+
function HamburgerIcon({ tintColor }: { tintColor?: ColorValue }) {
1824
const navigation = useNavigation();
25+
const fill = typeof tintColor === 'string' ? tintColor : '#000';
1926
return (
2027
<TouchableOpacity
2128
onPress={() => navigation.dispatch(DrawerActions.toggleDrawer())}
2229
style={styles.hamburger}
2330
>
2431
<Svg width={24} height={24} viewBox="0 0 24 24">
25-
<Rect
26-
x={2}
27-
y={4}
28-
width={20}
29-
height={2}
30-
rx={1}
31-
fill={tintColor ?? '#000'}
32-
/>
33-
<Rect
34-
x={2}
35-
y={11}
36-
width={20}
37-
height={2}
38-
rx={1}
39-
fill={tintColor ?? '#000'}
40-
/>
41-
<Rect
42-
x={2}
43-
y={18}
44-
width={20}
45-
height={2}
46-
rx={1}
47-
fill={tintColor ?? '#000'}
48-
/>
32+
<Rect x={2} y={4} width={20} height={2} rx={1} fill={fill} />
33+
<Rect x={2} y={11} width={20} height={2} rx={1} fill={fill} />
34+
<Rect x={2} y={18} width={20} height={2} rx={1} fill={fill} />
4935
</Svg>
5036
</TouchableOpacity>
5137
);

‎apps/llm/app/llm/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { LLM_MODELS, LLMModelSources } from '../../components/llmModels';
1717
import PauseIcon from '../../assets/icons/pause_icon.svg';
1818
import ColorPalette from '../../colors';
1919
import Messages from '../../components/Messages';
20-
import { useIsFocused } from '@react-navigation/native';
20+
import { useIsFocused } from 'expo-router';
2121
import { useSafeAreaInsets } from 'react-native-safe-area-context';
2222
import { GeneratingContext } from '../../context';
2323
import Spinner from '../../components/Spinner';

0 commit comments

Comments
 (0)