Upgrade to Pro — share decks privately, control downloads, hide ads and more …

1年半放置したExpo製アプリを最新化してみた

 1年半放置したExpo製アプリを最新化してみた

Avatar for Yohei Iino

Yohei Iino

March 06, 2025
Tweet

More Decks by Yohei Iino

Other Decks in Technology

Transcript

  1. あらすじ② 技術スタック Expo Expoとは? React Nativeを使用したアプリ開発を支える代表的なエコシステム Expo SDKを使用することで、本来必要な開発をかなり省略できる 省略できる開発の例 公式がBuild環境のサーバーを提供

    テストアプリの配布機能をサポート Push通知等のプラットフォーム固有の開発をExpo側で抽象化して提供 etc… 現在はReact Nativeの公式でもExpoを使用した開発を推奨している
  2. 🤮 ローカルでビルドが出来なくなる Expo SDK 48 → 52までの間でEAS Buildの対応が必須になった 元々あったExpo Goベースの開発はあくまでデバッグ用という立ち位置になり、ネイティブ周りの機能を修

    正したアプリはビルドできなくなった Expo SDK 48の時点で本番ビルドはEAS Buildに移行済みだったが、EAS Buildで実行してもエラーになり、 ローカルでもビルドできない そもそもデバッグできない状態になり、詰みの状態が発生
  3. 😭 Expoの一部ライブラリが非推奨になる Expo SDK 48 → 52までの間でexpo-auth-sessionの expo-auth-session/providers/google が非推 奨になった

    具体的には、以前まではExpo更新のライブラリのみGoogleログインが可能だったが、出来なくなり代替で @react-native-google-signin/google-signinの使用が必須になった その他の一部ライブラリでも廃止、仕様変更が発生がしていた ` `
  4. 🤔 ディレクトリ構造のトレンドが変わる 以前はフロントエンドのディレクトリ構造はAtomic Designが流行っていた 現状のトレンドは以下 Feature Sliced Design Screaming Architecture(日本だとFeature型と呼ばれている事が多い)

    トレンドが変わった理由 Atomic Designの定義が複雑でチーム開発でうまく回せないケースが多い 後からの開発でコンポーネントの機能拡張した際に、ディレクトリ構造が変わる可能性があり、長期の 開発では管理が難しくなる 各画面との依存関係がわかりにくい等々
  5. 🤔 Lint、Formatterのトレンドが変わる 以前はESLintとPrettierを使っていた 現在はBiomeがトレンド トレンドが変わった理由 長期の開発をしていくとESLint & Prettierの設定の複雑になっていくケースが発生しやすい ESLint &

    Prettierを使用するとPCに負荷がかかり開発に支障が出るケースがある よりシンプル且つ、一括管理できるBiomeの方が採用されるようになった
  6. 最新化後の構成 Expo SDK: 48 → 52 ナビゲーションライブラリ: react-navigation → expo-router

    ディレクトリ構造: Atomic Design → Feature型 Lint、Formatter: ESLint、Prettier → Biome パッケージマネージャ: yarn → pnpm ※まだReact19まで猶予があるので、Recoilの移行は一旦後回し ▪ リポジトリ 更新前: リンク 更新後: リンク
  7. ディレクトリ構造① ▪ 以前のディレクトリ構造 . ├── assets └── src ├── components

    │ ├── atoms │ ├── molecules │ ├── organisms │ ├── pages │ └── templates ├── containers ├── hooks ├── img ├── lib ├── queries └─ store
  8. ディレクトリ構造① ▪ 以前のディレクトリ構造 └── src ├── components │ ├── atoms

    │ ├── molecules │ ├── organisms │ ├── pages │ └── templates ├── containers ├── hooks ├── img ├── lib ├── queries └─ store . ├── assets
  9. ディレクトリ構造① ▪ 以前のディレクトリ構造 ├── components │ ├── atoms │ ├──

    molecules │ ├── organisms │ ├── pages │ └── templates . ├── assets └── src ├── containers ├── hooks ├── img ├── lib ├── queries └─ store
  10. ディレクトリ構造② ▪ 現在のディレクトリ構造 . ├── app │ └── (app) │

    └── search ├── assets │ ├── fonts │ └── img ├── components │ ├── elements │ └── layouts ├── containers ├── features │ ├── home │ │ └── components │ └── search │ ├── components │ └── hooks ├── hooks ├── lib ├── queries └── store
  11. ディレクトリ構造② ▪ 現在のディレクトリ構造 ├── app │ └── (app) │ └──

    search . ├── assets │ ├── fonts │ └── img ├── components │ ├── elements │ └── layouts ├── containers ├── features │ ├── home │ │ └── components │ └── search │ ├── components │ └── hooks ├── hooks ├── lib ├── queries └── store
  12. ディレクトリ構造② ▪ 現在のディレクトリ構造 ├── components │ ├── elements │ └──

    layouts . ├── app │ └── (app) │ └── search ├── assets │ ├── fonts │ └── img ├── containers ├── features │ ├── home │ │ └── components │ └── search │ ├── components │ └── hooks ├── hooks ├── lib ├── queries └── store
  13. ディレクトリ構造② ▪ 現在のディレクトリ構造 ├── features │ ├── home │ │

    └── components │ └── search │ ├── components │ └── hooks . ├── app │ └── (app) │ └── search ├── assets │ ├── fonts │ └── img ├── components │ ├── elements │ └── layouts ├── containers ├── hooks ├── lib ├── queries └── store