From 604e9fb6ca8b6540fa3af184545fa702efca8e89 Mon Sep 17 00:00:00 2001 From: chmjkb Date: Thu, 7 May 2026 16:28:29 +0200 Subject: [PATCH 1/4] fix: use react-native-device-info for simulator detection --- apps/computer-vision/components/BottomBar.tsx | 9 ++++++--- apps/computer-vision/package.json | 2 +- yarn.lock | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/computer-vision/components/BottomBar.tsx b/apps/computer-vision/components/BottomBar.tsx index 0579e2adfd..322b100695 100644 --- a/apps/computer-vision/components/BottomBar.tsx +++ b/apps/computer-vision/components/BottomBar.tsx @@ -1,8 +1,9 @@ import ColorPalette from '../colors'; import FontAwesome from '@expo/vector-icons/FontAwesome'; -import Constants from 'expo-constants'; import { View, TouchableOpacity, StyleSheet, Text } from 'react-native'; +import { useRef } from 'react'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import DeviceInfo from 'react-native-device-info'; export const BottomBar = ({ handleCameraPress, @@ -18,6 +19,8 @@ export const BottomBar = ({ const { bottom } = useSafeAreaInsets(); const disabled = !hasImage || isGenerating; + const isDevice = useRef(!DeviceInfo.isEmulatorSync()); + return ( @@ -25,12 +28,12 @@ export const BottomBar = ({ Constants.isDevice && handleCameraPress(true)} + onPress={() => isDevice.current && handleCameraPress(true)} > diff --git a/apps/computer-vision/package.json b/apps/computer-vision/package.json index 9ad6123898..bcefdced1e 100644 --- a/apps/computer-vision/package.json +++ b/apps/computer-vision/package.json @@ -18,7 +18,6 @@ "@shopify/react-native-skia": "2.6.2", "expo": "^55.0.13", "expo-build-properties": "~55.0.13", - "expo-constants": "~55.0.13", "expo-font": "~55.0.6", "expo-linking": "~55.0.12", "expo-router": "~55.0.11", @@ -26,6 +25,7 @@ "metro-config": "^0.83.0", "react": "19.2.5", "react-native": "0.83.4", + "react-native-device-info": "^15.0.2", "react-native-executorch": "workspace:*", "react-native-executorch-expo-resource-fetcher": "workspace:*", "react-native-gesture-handler": "~2.31.1", diff --git a/yarn.lock b/yarn.lock index 9fa4a8e1bb..369471ca38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7894,6 +7894,7 @@ __metadata: metro-config: "npm:^0.83.0" react: "npm:19.2.5" react-native: "npm:0.83.4" + react-native-device-info: "npm:^15.0.2" react-native-executorch: "workspace:*" react-native-executorch-expo-resource-fetcher: "workspace:*" react-native-gesture-handler: "npm:~2.31.1" From c748c8b2b8b37d29544eff750eb33e00369b90be Mon Sep 17 00:00:00 2001 From: chmjkb Date: Fri, 8 May 2026 08:03:14 +0200 Subject: [PATCH 2/4] chore: remove unused expo-constants from llm and text embeddings app --- apps/llm/package.json | 1 - apps/text-embeddings/package.json | 1 - yarn.lock | 5 +---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/llm/package.json b/apps/llm/package.json index fe6dc23fec..666143ccb5 100644 --- a/apps/llm/package.json +++ b/apps/llm/package.json @@ -19,7 +19,6 @@ "expo-brightness": "~55.0.13", "expo-build-properties": "~55.0.13", "expo-calendar": "~55.0.14", - "expo-constants": "~55.0.13", "expo-document-picker": "~55.0.13", "expo-font": "~55.0.6", "expo-linking": "~55.0.12", diff --git a/apps/text-embeddings/package.json b/apps/text-embeddings/package.json index 132d8c804a..0c309cc2fa 100644 --- a/apps/text-embeddings/package.json +++ b/apps/text-embeddings/package.json @@ -17,7 +17,6 @@ "@react-navigation/native": "^7.2.2", "expo": "^55.0.13", "expo-build-properties": "~55.0.13", - "expo-constants": "~55.0.13", "expo-linking": "~55.0.12", "expo-router": "~55.0.11", "expo-status-bar": "~55.0.5", diff --git a/yarn.lock b/yarn.lock index 369471ca38..c6b3af15cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7886,7 +7886,6 @@ __metadata: babel-preset-expo: "npm:~55.0.16" expo: "npm:^55.0.13" expo-build-properties: "npm:~55.0.13" - expo-constants: "npm:~55.0.13" expo-font: "npm:~55.0.6" expo-linking: "npm:~55.0.12" expo-router: "npm:~55.0.11" @@ -9450,7 +9449,7 @@ __metadata: languageName: node linkType: hard -"expo-constants@npm:~55.0.13, expo-constants@npm:~55.0.15": +"expo-constants@npm:~55.0.15": version: 55.0.15 resolution: "expo-constants@npm:55.0.15" dependencies: @@ -12686,7 +12685,6 @@ __metadata: expo-brightness: "npm:~55.0.13" expo-build-properties: "npm:~55.0.13" expo-calendar: "npm:~55.0.14" - expo-constants: "npm:~55.0.13" expo-document-picker: "npm:~55.0.13" expo-font: "npm:~55.0.6" expo-linking: "npm:~55.0.12" @@ -17082,7 +17080,6 @@ __metadata: babel-preset-expo: "npm:~55.0.16" expo: "npm:^55.0.13" expo-build-properties: "npm:~55.0.13" - expo-constants: "npm:~55.0.13" expo-linking: "npm:~55.0.12" expo-router: "npm:~55.0.11" expo-status-bar: "npm:~55.0.5" From 01538a16f584af1340dad14a72b8435276fd14bd Mon Sep 17 00:00:00 2001 From: chmjkb Date: Fri, 8 May 2026 08:06:36 +0200 Subject: [PATCH 3/4] chore: remove redundant useref --- apps/computer-vision/components/BottomBar.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/computer-vision/components/BottomBar.tsx b/apps/computer-vision/components/BottomBar.tsx index 322b100695..0a554fc817 100644 --- a/apps/computer-vision/components/BottomBar.tsx +++ b/apps/computer-vision/components/BottomBar.tsx @@ -1,10 +1,11 @@ import ColorPalette from '../colors'; import FontAwesome from '@expo/vector-icons/FontAwesome'; import { View, TouchableOpacity, StyleSheet, Text } from 'react-native'; -import { useRef } from 'react'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import DeviceInfo from 'react-native-device-info'; +const isDevice = DeviceInfo.isEmulatorSync(); + export const BottomBar = ({ handleCameraPress, runForward, @@ -18,22 +19,17 @@ export const BottomBar = ({ }) => { const { bottom } = useSafeAreaInsets(); const disabled = !hasImage || isGenerating; - - const isDevice = useRef(!DeviceInfo.isEmulatorSync()); - return ( handleCameraPress(false)}> - isDevice.current && handleCameraPress(true)} - > + isDevice && handleCameraPress(true)}> From 0c1f15a602428bdd7be9ef93616a00d740ff1aad Mon Sep 17 00:00:00 2001 From: chmjkb Date: Fri, 8 May 2026 10:20:21 +0200 Subject: [PATCH 4/4] chore: fix peer deps of demo apps --- apps/computer-vision/package.json | 5 ++- apps/llm/package.json | 5 ++- apps/speech/package.json | 4 ++- apps/text-embeddings/package.json | 5 ++- yarn.lock | 53 ++++++++++++++++++++++++++++++- 5 files changed, 67 insertions(+), 5 deletions(-) diff --git a/apps/computer-vision/package.json b/apps/computer-vision/package.json index bcefdced1e..7d2291b67c 100644 --- a/apps/computer-vision/package.json +++ b/apps/computer-vision/package.json @@ -18,6 +18,7 @@ "@shopify/react-native-skia": "2.6.2", "expo": "^55.0.13", "expo-build-properties": "~55.0.13", + "expo-constants": "^55.0.16", "expo-font": "~55.0.6", "expo-linking": "~55.0.12", "expo-router": "~55.0.11", @@ -46,7 +47,9 @@ "@babel/core": "^7.29.0", "@types/pngjs": "^6.0.5", "@types/react": "~19.2.0", - "babel-preset-expo": "~55.0.16" + "@types/react-refresh": "^0", + "babel-preset-expo": "~55.0.16", + "react-refresh": "^0.18.0" }, "private": true } diff --git a/apps/llm/package.json b/apps/llm/package.json index 666143ccb5..8243a5eefe 100644 --- a/apps/llm/package.json +++ b/apps/llm/package.json @@ -19,6 +19,7 @@ "expo-brightness": "~55.0.13", "expo-build-properties": "~55.0.13", "expo-calendar": "~55.0.14", + "expo-constants": "^55.0.16", "expo-document-picker": "~55.0.13", "expo-font": "~55.0.6", "expo-linking": "~55.0.12", @@ -45,7 +46,9 @@ "devDependencies": { "@babel/core": "^7.29.0", "@types/react": "~19.2.14", - "babel-preset-expo": "~55.0.16" + "@types/react-refresh": "^0", + "babel-preset-expo": "~55.0.16", + "react-refresh": "^0.18.0" }, "private": true } diff --git a/apps/speech/package.json b/apps/speech/package.json index 93e07755dd..2beb2cc41d 100644 --- a/apps/speech/package.json +++ b/apps/speech/package.json @@ -33,7 +33,9 @@ "devDependencies": { "@babel/core": "^7.29.0", "@types/react": "~19.2.14", - "babel-preset-expo": "~55.0.16" + "@types/react-refresh": "^0", + "babel-preset-expo": "~55.0.16", + "react-refresh": "^0.18.0" }, "private": true } diff --git a/apps/text-embeddings/package.json b/apps/text-embeddings/package.json index 0c309cc2fa..41590d1e68 100644 --- a/apps/text-embeddings/package.json +++ b/apps/text-embeddings/package.json @@ -17,6 +17,7 @@ "@react-navigation/native": "^7.2.2", "expo": "^55.0.13", "expo-build-properties": "~55.0.13", + "expo-constants": "^55.0.16", "expo-linking": "~55.0.12", "expo-router": "~55.0.11", "expo-status-bar": "~55.0.5", @@ -35,7 +36,9 @@ "devDependencies": { "@babel/core": "^7.29.0", "@types/react": "~19.2.14", - "babel-preset-expo": "~55.0.16" + "@types/react-refresh": "^0", + "babel-preset-expo": "~55.0.16", + "react-refresh": "^0.18.0" }, "private": true } diff --git a/yarn.lock b/yarn.lock index c6b3af15cf..01213c7f87 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2715,6 +2715,17 @@ __metadata: languageName: node linkType: hard +"@expo/env@npm:~2.1.2": + version: 2.1.2 + resolution: "@expo/env@npm:2.1.2" + dependencies: + chalk: "npm:^4.0.0" + debug: "npm:^4.3.4" + getenv: "npm:^2.0.0" + checksum: 10/e127ae2449de94afc52e41c8a4254b21eb6df047ba24da8b0a3baa245840338dc1eb00c8447fed6059ead13dae8dddef4ce8ce44c44f4154a886007967f473af + languageName: node + linkType: hard + "@expo/fingerprint@npm:0.15.4": version: 0.15.4 resolution: "@expo/fingerprint@npm:0.15.4" @@ -5809,7 +5820,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.20.5": +"@types/babel__core@npm:*, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.20.5": version: 7.20.5 resolution: "@types/babel__core@npm:7.20.5" dependencies: @@ -5977,6 +5988,16 @@ __metadata: languageName: node linkType: hard +"@types/react-refresh@npm:^0": + version: 0.14.7 + resolution: "@types/react-refresh@npm:0.14.7" + dependencies: + "@types/babel__core": "npm:*" + csstype: "npm:^3.2.2" + checksum: 10/c4eca39a4e6991ad637044294045824784a048cbf84c8972361c686af7c17a32ffb11e3a24be519f7961a6690fce4a92a8007e2a060197dca43b0b66eff56bc6 + languageName: node + linkType: hard + "@types/react-test-renderer@npm:^19.1.0": version: 19.1.0 resolution: "@types/react-test-renderer@npm:19.1.0" @@ -7883,9 +7904,11 @@ __metadata: "@shopify/react-native-skia": "npm:2.6.2" "@types/pngjs": "npm:^6.0.5" "@types/react": "npm:~19.2.0" + "@types/react-refresh": "npm:^0" babel-preset-expo: "npm:~55.0.16" expo: "npm:^55.0.13" expo-build-properties: "npm:~55.0.13" + expo-constants: "npm:^55.0.16" expo-font: "npm:~55.0.6" expo-linking: "npm:~55.0.12" expo-router: "npm:~55.0.11" @@ -7909,6 +7932,7 @@ __metadata: react-native-vision-camera: "npm:^5.0.6" react-native-vision-camera-worklets: "npm:^5.0.6" react-native-worklets: "npm:0.8.1" + react-refresh: "npm:^0.18.0" languageName: unknown linkType: soft @@ -9436,6 +9460,18 @@ __metadata: languageName: node linkType: hard +"expo-constants@npm:^55.0.16": + version: 55.0.16 + resolution: "expo-constants@npm:55.0.16" + dependencies: + "@expo/env": "npm:~2.1.2" + peerDependencies: + expo: "*" + react-native: "*" + checksum: 10/80caf27dc74972b4a0245e2268be51748eb403622f30b9129c6838fa80740a88f31e4941f2f9c493fdd1cd0c8512b440dfc9cf78a26eb7ca92826c54cd4641b2 + languageName: node + linkType: hard + "expo-constants@npm:~18.0.11, expo-constants@npm:~18.0.12, expo-constants@npm:~18.0.13": version: 18.0.13 resolution: "expo-constants@npm:18.0.13" @@ -12680,11 +12716,13 @@ __metadata: "@react-navigation/drawer": "npm:^7.9.4" "@react-navigation/native": "npm:^7.2.2" "@types/react": "npm:~19.2.14" + "@types/react-refresh": "npm:^0" babel-preset-expo: "npm:~55.0.16" expo: "npm:^55.0.13" expo-brightness: "npm:~55.0.13" expo-build-properties: "npm:~55.0.13" expo-calendar: "npm:~55.0.14" + expo-constants: "npm:^55.0.16" expo-document-picker: "npm:~55.0.13" expo-font: "npm:~55.0.6" expo-linking: "npm:~55.0.12" @@ -12707,6 +12745,7 @@ __metadata: react-native-svg: "npm:15.15.4" react-native-svg-transformer: "npm:^1.5.3" react-native-worklets: "npm:0.8.1" + react-refresh: "npm:^0.18.0" languageName: unknown linkType: soft @@ -15762,6 +15801,13 @@ __metadata: languageName: node linkType: hard +"react-refresh@npm:^0.18.0": + version: 0.18.0 + resolution: "react-refresh@npm:0.18.0" + checksum: 10/504c331c19776bf8320c23bad7f80b3a28de03301ed7523b0dd21d3f02bf2b53bbdd5aa52469b187bc90f358614b2ba303c088a0765c95f4f0a68c43a7d67b1d + languageName: node + linkType: hard + "react-refresh@npm:^0.4.0": version: 0.4.3 resolution: "react-refresh@npm:0.4.3" @@ -16617,6 +16663,7 @@ __metadata: "@babel/core": "npm:^7.29.0" "@react-native/metro-config": "npm:^0.83.0" "@types/react": "npm:~19.2.14" + "@types/react-refresh": "npm:^0" babel-preset-expo: "npm:~55.0.16" buffer: "npm:^6.0.3" expo: "npm:^55.0.13" @@ -16635,6 +16682,7 @@ __metadata: react-native-svg: "npm:15.15.4" react-native-svg-transformer: "npm:^1.5.3" react-native-worklets: "npm:0.8.1" + react-refresh: "npm:^0.18.0" languageName: unknown linkType: soft @@ -17077,9 +17125,11 @@ __metadata: "@react-navigation/drawer": "npm:^7.9.4" "@react-navigation/native": "npm:^7.2.2" "@types/react": "npm:~19.2.14" + "@types/react-refresh": "npm:^0" babel-preset-expo: "npm:~55.0.16" expo: "npm:^55.0.13" expo-build-properties: "npm:~55.0.13" + expo-constants: "npm:^55.0.16" expo-linking: "npm:~55.0.12" expo-router: "npm:~55.0.11" expo-status-bar: "npm:~55.0.5" @@ -17094,6 +17144,7 @@ __metadata: react-native-screens: "npm:~4.24.0" react-native-svg: "npm:15.15.4" react-native-worklets: "npm:0.8.1" + react-refresh: "npm:^0.18.0" languageName: unknown linkType: soft