Skip to content

fix(mobile): move to Expo SDK 58 and React Native 0.88 - #92

Open
lxup wants to merge 2 commits into
mainfrom
chore/expo-58
Open

lxup wants to merge 2 commits into
mainfrom
chore/expo-58

Conversation

@lxup

@lxup lxup commented Nov 2, 2026

Copy link
Copy Markdown
Member

Description

Moves the mobile app from Expo SDK 57 to SDK 58, which brings React Native 0.86.2 to 0.88.1 and React 19.2.3 to 19.3.0.

The dependency half is driven from Expo's official SDK 58 matrix but applied to the root catalog rather than with expo install --fix. Every one of the 349 root dependencies is a catalog: reference, so letting the CLI pin resolved versions inside apps/mobile/package.json would have declared them in two places and broken a convention the repo applies without a single exception. expo install --check and expo-doctor then verify the outcome, which is the same data the CLI would have used.

The code half is the Expo Router navigation rework, plus the mechanical fallout of React Native 0.88's stricter type surface.

Changes

  • 65 catalog entries aligned on the SDK 58 matrix, including six that only the root declared (@expo/metro-runtime, expo-asset, expo-build-properties, expo-dev-client, @expo/dom-webview, @expo/fingerprint).
  • react and react-dom to 19.3.0 for the whole monorepo rather than letting mobile diverge from web, notify and ui.
  • @sentry/react-native 7 to 8.28.0. Usage is narrow (init, captureException, addBreadcrumb, captureMessage, wrap) and all of it is stable across the major.
  • react-native-nitro-modules 0.35.10 to 0.37.1 and react-native-mmkv to 4.3.2. Nitro was pinned by its own catalog range: ^0.35.0 on a 0.x version means >=0.35.0 <0.36.0. Its C++ compiles against React Native's internals, so on 0.88 it failed to install its JSI bindings and took MMKV down with it, which in turn made every route importing MMKV look like it was missing a default export.
  • initialRouteName is removed from navigators: eight layouts now export unstable_settings.anchor. The shared (home,search,collection,feed) layout gets one anchor per segment, and its former branch on user is dropped because Stack.Protected already decides whether feed and collection/(tabs) are registered.
  • Screen no longer accepts initialParams; the two screens under user/[username]/(follow) already read username from the URL.
  • The four hand-rolled top-tab navigators drop createMaterialTopTabNavigator and withLayoutContext for the ready-made TopTabs, and SegmentedControlTabBar moves from navigation to emitter plus navigateToTab.
  • expo-router/unstable-native-tabs becomes expo-router/native-tabs, and ios.enableSceneSupport is removed since SDK 58 includes scene support.
  • Mechanical type fixes: StyleSheet.NamedStyles and ViewToken are gone from the type surface, 17 onPress={form.handleSubmit(x)} handlers no longer satisfy the stricter press signature, and AndroidImportance is imported by name so import/namespace stops failing to follow expo-notifications' ESM re-export chain.
  • The Strict TypeScript API is deferred behind the react-native-legacy-deep-imports condition in the mobile tsconfig. See Impact.

Impact

  • nx run-many -t typecheck lint test --all passes on 18 projects, and expo-doctor reports 20/20 with no skipped dependency checks.
  • A native rebuild is required. Nitro compiles C++ against React Native, so expo prebuild --clean followed by a device build is what actually proves this upgrade. Nothing here has been validated at runtime.
  • The Expo fingerprint changes, so the next release takes the native build path rather than an OTA. That is the honest outcome of changing the native dependency set.
  • Android release builds now enable R8 by default. Libraries that rely on reflection (RevenueCat, Sentry, MapLibre, the Amazon Appstore SDK) may need keep rules, and this only shows up on a release build. The opt-out is android.enableMinifyInReleaseBuilds: false via expo-build-properties.
  • react-native-gesture-handler moves from 2.32 to 3.3.0, a major that sits under the bottom sheets and navigation gestures. It is the version the SDK 58 matrix mandates, and it is the most likely source of a runtime regression.
  • 52 of the 62 type errors this upgrade surfaced come from the Strict TypeScript API being the new default, and they are deferred, not fixed. Two reasons: an SDK upgrade and a repo-wide type-API migration are separate changes, and one of the 52 is not ours to fix -- @react-native-segmented-control/segmented-control declares Constructor<NativeMethods> and NativeMethods no longer exists in 0.88's types, with 2.5.7 the last published version. types_DEPRECATED will be removed in a later React Native release, so this is explicit debt with a follow-up owed.

Test Plan

  • nx run-many -t typecheck lint test --all passes
  • npx expo-doctor reports 20/20
  • expo prebuild --clean succeeds, then a debug device build installs and launches
  • No Failed to install Nitro error at startup, and no route reported as missing a default export
  • Persisted state survives a restart: UI store, explore store and the react-query cache all read back through MMKV
  • The four top-tab screens work: collection, feed, user follow, settings data -- tab switching, swipe disabled where configured, and the segmented control labels
  • Deep linking into a stack lands with the anchor route below it, for each of the four shared segments
  • Push notifications still register and display on Android, including the default channel importance
  • Sentry receives an event from a deliberate captureException
  • Google Sign-In completes on both platforms
  • An Android release build succeeds with R8 enabled, and the app launches
  • An iOS build succeeds, with the scene lifecycle generated by prebuild

lxup added 2 commits November 3, 2026 00:27
Driven from Expo's official SDK 58 matrix, applied to the root catalog rather
than with `expo install --fix`: every one of the 349 root dependencies is a
`catalog:` reference, so letting the CLI pin versions in apps/mobile would have
written them twice and broken a convention the repo applies without exception.
`expo install --check` and `expo-doctor` then confirm the result (20/20).

React and react-dom move to 19.3.0 for the whole monorepo instead of diverging
mobile from web, notify and ui -- keeping one React version is what the catalog
is for.

Router migrations, all from the official SDK 57 to 58 guide:

- `initialRouteName` is removed; eight layouts now export
  `unstable_settings.anchor`. The shared `(home,search,collection,feed)` layout
  gets one anchor per segment, and its former branch on `user` is dropped:
  `Stack.Protected` already decides whether `feed` and `collection/(tabs)` are
  registered at all, so there is nothing left to anchor to.
- `Screen` no longer accepts `initialParams`; the two screens under
  `user/[username]/(follow)` already read `username` from the URL.
- The four hand-rolled top-tab navigators drop `createMaterialTopTabNavigator`
  plus `withLayoutContext` for the ready-made `TopTabs`.
- `MaterialTopTabBarProps` replaces `navigation` with `emitter` and
  `navigateToTab`.

React Native 0.88 ships the Strict TypeScript API as the default, which
accounts for 52 of the 62 type errors the upgrade surfaced. Those are deferred
behind the `react-native-legacy-deep-imports` condition in the mobile tsconfig,
for two reasons: an SDK upgrade and a repo-wide type-API migration are separate
changes, and one of the 52 is not ours to fix -- @react-native-segmented-control
declares `Constructor<NativeMethods>`, and `NativeMethods` no longer exists in
0.88's types, with 2.5.7 the last published version. `types_DEPRECATED` will go
away in a later React Native, so this is explicit debt, not a resolution.

Nitro was pinned to 0.35.10 by its own catalog range: `^0.35.0` on a 0.x version
means `>=0.35.0 <0.36.0`. Its C++ compiles against React Native's internals, so
it failed to install its JSI bindings on 0.88 and took MMKV down with it. Both
now match what the other SDK 58 apps in this org run on 0.88.

The remaining fixes are mechanical: `StyleSheet.NamedStyles` and `ViewToken` are
gone from the type surface, 17 `onPress={form.handleSubmit(x)}` handlers no
longer satisfy the stricter press signature, and `AndroidImportance` is imported
by name so `import/namespace` stops failing to follow expo-notifications' ESM
re-export chain.

Requires a native rebuild: `expo prebuild --clean` then a device build. The
fingerprint changes, so the next release takes the native build path rather
than an OTA.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant