Skip to content

Commit 61fa569

Browse files
antonisclaude
andauthored
chore(samples): Upgrade Expo sample to SDK 54 (#5587)
* chore(samples): Upgrade Expo sample to SDK 54 Updates the Expo sample application to use Expo SDK 54, which includes React Native 0.81.5 and React 19.1. Changes: - Upgrade Expo SDK from 53 to 54 - Upgrade React Native from 0.79.2 to 0.81.5 - Upgrade React from 19.0.0 to 19.1.0 - Update all Expo packages to SDK 54 compatible versions - Fix ExternalLink component for expo-router 6.x compatibility (removed deprecated hrefAttrs) Note: The native ios/android folders are gitignored as they are generated by expo prebuild. For local development in this monorepo, add this to ios/Podfile after running prebuild: ENV['REACT_NATIVE_NODE_MODULES_DIR'] = File.join(__dir__, '..', 'node_modules', 'react-native') This ensures the Sentry SDK detects the correct React Native version (0.81.5) instead of the version in packages/core/node_modules. Resolves #5568 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix(ci): Set REACT_NATIVE_NODE_MODULES_DIR for Expo SDK 54 builds Expo SDK 54 upgraded to React Native 0.81, which uses the new Hermes profiling API. In the monorepo, the Sentry SDK's podspec was detecting RN 0.80 (from packages/core/node_modules) instead of 0.81 (from samples/expo/node_modules), causing it to use the old Hermes API which was removed in RN 0.81. Setting REACT_NATIVE_NODE_MODULES_DIR ensures the podspec detects the correct React Native version during CI builds. This only affects the CI build - no changes to the core SDK. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * chore(deps): Update tar to 7.5.7 to fix security vulnerability Fixes high severity vulnerability in tar 7.5.6: - CVE: Arbitrary File Creation/Overwrite via Hardlink Path Traversal Added resolution to force tar@^7.5.7 which includes the security patch. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix(ci): Increase Gradle memory for Expo SDK 54 Android builds Expo SDK 54 has larger codebase that causes OutOfMemoryError: Metaspace during lint analysis. Increased Gradle JVM memory settings: - Heap: 4GB (from default 2GB) - Metaspace: 1GB (from default ~256MB) Fixes: OutOfMemoryError during lintVitalAnalyzeRelease task Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 8415e4d commit 61fa569

5 files changed

Lines changed: 2587 additions & 534 deletions

File tree

.github/workflows/sample-application-expo.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
6262
with:
6363
package-manager-cache: false
64-
node-version: 18
64+
node-version: 20
6565
cache: 'yarn'
6666
cache-dependency-path: yarn.lock
6767

@@ -106,12 +106,17 @@ jobs:
106106
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
107107
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic
108108
echo "ENABLE_PROD=$ENABLE_PROD"
109+
# Monorepo fix: Point Sentry SDK to correct React Native version (0.81 vs 0.80)
110+
export REACT_NATIVE_NODE_MODULES_DIR="$(cd ../node_modules/react-native && pwd)"
109111
PRODUCTION=$ENABLE_PROD pod install
110112
cat Podfile.lock | grep $RN_SENTRY_POD_NAME
111113
112114
- name: Build Android App
113115
if: ${{ matrix.platform == 'android' }}
114116
working-directory: samples/expo/android
117+
env:
118+
# Increase memory for Expo SDK 54 lint tasks
119+
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g"
115120
run: |
116121
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
117122
echo "Building $CONFIG"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
"resolutions": {
6262
"appium-chromedriver@npm:5.6.73/@xmldom/xmldom": "0.8.10",
6363
"form-data": "4.0.4",
64-
"tar-fs": "^3.1.1"
64+
"tar-fs": "^3.1.1",
65+
"tar": "^7.5.7"
6566
},
6667
"version": "0.0.0",
6768
"name": "sentry-react-native",

samples/expo/components/ExternalLink.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ export function ExternalLink(
88
) {
99
return (
1010
<Link
11-
hrefAttrs={{
12-
// On web, launch the link in a new tab.
13-
target: '_blank',
14-
}}
11+
target="_blank"
1512
{...props}
16-
// @ts-expect-error: External URLs are not typed.
1713
href={props.href}
1814
onPress={e => {
1915
if (Platform.OS !== 'web') {

samples/expo/package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@
2424
"dependencies": {
2525
"@sentry/core": "10.38.0",
2626
"@sentry/react-native": "7.11.0",
27-
"@types/react": "~19.0.10",
28-
"expo": "^53.0.0",
29-
"expo-constants": "~17.1.5",
30-
"expo-dev-client": "~5.1.8",
31-
"expo-image-picker": "~16.1.4",
32-
"expo-linking": "~7.1.4",
33-
"expo-router": "~5.0.5",
34-
"expo-status-bar": "~2.2.3",
35-
"expo-updates": "~0.28.12",
36-
"expo-web-browser": "~14.1.6",
37-
"react": "19.0.0",
38-
"react-dom": "19.0.0",
39-
"react-native": "0.79.2",
40-
"react-native-gesture-handler": "~2.24.0",
41-
"react-native-safe-area-context": "5.4.0",
42-
"react-native-screens": "~4.10.0",
43-
"react-native-web": "^0.20.0",
44-
"typescript": "~5.8.3"
27+
"@types/react": "~19.1.10",
28+
"expo": "^54.0.0",
29+
"expo-constants": "~18.0.13",
30+
"expo-dev-client": "~6.0.20",
31+
"expo-image-picker": "~17.0.10",
32+
"expo-linking": "~8.0.11",
33+
"expo-router": "~6.0.22",
34+
"expo-status-bar": "~3.0.9",
35+
"expo-updates": "~29.0.16",
36+
"expo-web-browser": "~15.0.10",
37+
"react": "19.1.0",
38+
"react-dom": "19.1.0",
39+
"react-native": "0.81.5",
40+
"react-native-gesture-handler": "~2.28.0",
41+
"react-native-safe-area-context": "~5.6.0",
42+
"react-native-screens": "~4.16.0",
43+
"react-native-web": "^0.21.0",
44+
"typescript": "~5.9.2"
4545
},
4646
"devDependencies": {
4747
"@babel/core": "^7.26.0",
@@ -52,7 +52,7 @@
5252
"@typescript-eslint/eslint-plugin": "^8.50.0",
5353
"@typescript-eslint/parser": "^8.50.0",
5454
"eslint": "^8.57.0",
55-
"eslint-config-expo": "^7.1.2",
55+
"eslint-config-expo": "~10.0.0",
5656
"eslint-import-resolver-typescript": "^4.4.4",
5757
"eslint-plugin-import": "^2.32.0",
5858
"eslint-plugin-jest": "^29.5.0",

0 commit comments

Comments
 (0)