Skip to content

Expo SDK 57へアップグレード - #6658

Merged
TinyKitten merged 2 commits into
devfrom
feature/expo-57
Aug 12, 2026
Merged

TinyKitten merged 2 commits into
devfrom
feature/expo-57

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

概要

Expo SDK 55 から 57 へアップグレードし、React Native 0.86 で削除された API や関連ライブラリのメジャー更新へ追従する。SDK 57 自体は 56 からの破壊的変更が無いため、実質的な移行コストは SDK 56(Hermes v1 の既定化、iOS 最低 16.4、expo/fetch のグローバル化など)に対するものが中心。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

依存の更新

  • expo 55.0.26 → 57.0.12、react-native 0.83.6 → 0.86.2、react 19.2.0 → 19.2.3
  • react-native-worklets 0.7.4 → 0.10.1。react-native-reanimated 4.5.1 の peer が 0.10.x であり、devDependencies に旧版が取り残されていると npm install が解決に失敗する
  • jest-expo / babel-preset-expo / @react-native/js-polyfills / @react-native/metro-config を 57・0.86 系へ
  • react-native-view-shot 4.0.3 → 5.1.0

RN 0.86 の破壊的変更への追従

  • StyleSheet.absoluteFillObject が型・実装ともに削除されたため StyleSheet.absoluteFill へ置換(5 ファイル 7 箇所)。absoluteFill は登録済みスタイル ID から素のオブジェクトへ変わったため、従来どおりスプレッドできる
  • react-native-view-shot v5 で ViewShot が forwardRef 化されたため、ref の型を v5 が公開する ViewShotRef へ変更
  • expo-battery に追加された Android 専用の BatteryState.NOT_CHARGING をテレメトリ側 enum へマップ。給電中だが充電が停止している状態(充電上限 80% など)で、対応する値が無いため unknown に寄せている

patch-package

  • expo+55.0.26.patch を削除。expo/fetch のストリーム二重 close ガードは、expo 57 本体が bodyStreamClosed フラグと desiredSize チェックでより厳重に実装済みのため不要になった
  • expo-speech / expo-task-manager のパッチを 57 の版数で再生成
  • あわせて expo-speech パッチの既存不具合を修正。Log.d(PATCH_LOG_TAG, ...) を追加しているのに import android.util.Log と PATCH_LOG_TAG の定義がどちらも無く、適用後の Kotlin がコンパイルできない状態だった(ネイティブTTSの音質向上とAndroidで英語が日本語音声で合成される問題の修正 #6457 以降 dev に存在)

TypeScript 6

  • SDK 57 が要求する TypeScript 6.0.3 へ更新
  • tsconfig.json の typeRoots を削除。src/@types は @types 形式のパッケージ群ではなく素の .d.ts 群のため指定しても効果が無く、既定の node_modules/@types 探索を潰していた。代わりに types: ["jest"] を明示することで TS 6 でも Jest のグローバル型が解決される
  • TS 7 で廃止される baseUrl を削除し、paths を ${configDir} 基準へ移行

リグレッションリスクと緩和策

  • Hermes v1 × reanimated のメモリ増加: SDK 56 で Hermes v1 が既定になり、react-native-reanimated を import するだけでメモリ使用量が 25〜30% 増える回帰が Expo 側で既知(SDK 57 時点でも未解消)。本アプリは走行中に位置情報を毎秒更新する長時間セッションのため影響を受けうる。実機計測で悪化が確認された場合は expo-build-properties の useHermesV1: false で退避する
  • iOS 最低版数の引き上げ: 15.1 → 16.4 となり iOS 15 端末が対象外になる
  • expo/fetch のグローバル化: SDK 56 で globalThis.fetch の既定実装が expo/fetch に置き換わる。ユニットテストは全通過しているが、AI エージェントのストリーミング経路は実機での確認が望ましい
  • Android ネイティブ: TTS(expo-speech)とバックグラウンド位置情報(expo-task-manager)はパッチ再生成の影響を受けるため、実機での動作確認が必要

テスト

ローカルで以下を実行し、すべて成功を確認(Jest: 218 suites / 2303 tests、expo-doctor: 19/19 checks passed)。

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • 改善
    • アプリ基盤を最新化し、安定性と互換性を向上しました。
    • 音声指定時の検索精度と地域・言語のフォールバックを改善しました。
    • Androidでバックグラウンド処理が失敗するケースを修正しました。
    • 充電していない状態をテレメトリで正しく記録できるようにしました。
    • 縦向き・横向き画面やオーバーレイ表示のレイアウトを改善しました。
    • 開発時の型チェックとテスト環境の安定性を向上しました。

@TinyKitten TinyKitten self-assigned this Aug 12, 2026
@github-actions github-actions Bot added the react label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c8f91f57-b0ad-4ff5-8e60-4a8565017198

📥 Commits

Reviewing files that changed from the base of the PR and between 4fce9bc and deaa9af.

📒 Files selected for processing (2)
  • src/hooks/useTelemetrySender.enabled.test.tsx
  • tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • tsconfig.json

📝 Walkthrough

Walkthrough

Expo関連依存関係を55系から57系へ更新しました。React Native 0.86系に対応し、Androidパッチ、スタイル指定、ref型、テレメトリ、TypeScript設定を調整しました。

Changes

Expo 57移行

Layer / File(s) Summary
依存関係の更新
package.json
Expo、React、React Native、および関連ツールを更新しました。
Androidパッチの調整
patches/expo-speech+57.0.1.patch, patches/expo-task-manager+57.0.9.patch
expo-speech は指定音声を優先し、言語ロケールへフォールバックします。expo-task-manager はAPI 28以降で最小遅延と期限を設定します。
React Native互換性の調整
src/components/ChevronYamanote.tsx, src/components/DevOverlay.tsx, src/components/Permitted.tsx, src/components/WalkthroughOverlay.tsx, src/hooks/useTelemetrySender.ts, src/hooks/useTelemetrySender.enabled.test.tsx, src/screens/Main.tsx
絶対配置スタイルを更新しました。ViewShotRef をref型に使用しました。NOT_CHARGING をunknownへ変換し、テストを追加しました。
TypeScript解決設定の更新
tsconfig.json
パス解決を${configDir}基準へ変更し、Jest型定義を明示しました。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: android

Poem

うさぎが跳ねて、Expoは57
音声は指定の声を探す
見つからなければ言語へ戻る
JobInfoは期限を持つ
画面と型も新しく整う 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed タイトルはExpo SDK 55から57へのアップグレードという変更の主目的を簡潔かつ明確に示しています。
Description check ✅ Passed 概要、変更内容、テスト結果、関連情報を記載しており、テンプレートの必須項目をほぼ満たしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/expo-57

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/hooks/useTelemetrySender.ts`:
- Around line 40-43: Update the expo-battery mock in the useTelemetrySender
tests to include BatteryState.NOT_CHARGING, then add coverage for
getBatteryStateAsync() returning that value and verify the telemetry payload
maps batteryState to 'unknown'.

In `@tsconfig.json`:
- Line 15: Update the types array in tsconfig.json to include both "jest" and
"node", enabling Node.js typings for process.env usage in app.config.ts and
utils/codegen.ts.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 296a2ee5-877b-4127-90e9-61408b914c1c

📥 Commits

Reviewing files that changed from the base of the PR and between 9576694 and 4fce9bc.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • package.json
  • patches/expo+55.0.26.patch
  • patches/expo-speech+57.0.1.patch
  • patches/expo-task-manager+57.0.9.patch
  • src/components/ChevronYamanote.tsx
  • src/components/DevOverlay.tsx
  • src/components/Permitted.tsx
  • src/components/WalkthroughOverlay.tsx
  • src/hooks/useTelemetrySender.ts
  • src/screens/Main.tsx
  • tsconfig.json
💤 Files with no reviewable changes (1)
  • patches/expo+55.0.26.patch

Comment thread src/hooks/useTelemetrySender.ts Resolved
Comment thread tsconfig.json Resolved
@TinyKitten

Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 2 file(s) based on 2 CodeRabbit feedback item(s).

Files modified:

  • src/hooks/useTelemetrySender.enabled.test.tsx
  • tsconfig.json

Commit: deaa9afa7

  • expo-battery モックの BatteryState に NOT_CHARGING を追加し、getBatteryStateAsync() がこの値を返す場合に送信 payload の batteryState が 'unknown' になることを検証するテストを追加
  • tsconfig.json の types に "node" を追加。@types/node は他パッケージの型参照経由で既にプログラムへ読み込まれていて typecheck は通っていたが、暗黙の推移的取り込みへの依存を断つため明示化

検証: npm run lint / npm run typecheck / npm test(218 suites / 2304 tests)すべて成功。

The latest autofix changes are on the feature/expo-57 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant