Skip to content

Upgrade React Native 0.77 → 0.83, React 18 → 19, Expo SDK 52 → 55#2049

Open
transphorm wants to merge 73 commits into
devfrom
justin/upgrade-react-native-phase1
Open

Upgrade React Native 0.77 → 0.83, React 18 → 19, Expo SDK 52 → 55#2049
transphorm wants to merge 73 commits into
devfrom
justin/upgrade-react-native-phase1

Conversation

@transphorm
Copy link
Copy Markdown
Member

@transphorm transphorm commented May 5, 2026

Summary

  • Phase 1 of the React Native upgrade: bump RN 0.77.0 → 0.83.9, React 18.3 → 19.2, Expo SDK 52 → 55, and @react-native-community/cli 16 → 20 across the app workspace and root resolutions.
  • Enable the New Architecture on iOS (RCTNewArchEnabled=true in OpenPassport and NotificationService Info.plist) and add the React-runtimeexecutor header search paths required by RN 0.83.
  • Adapt app code and Jest setup for React 19 + RN 0.83: useRef initial values, RefObject<T | null>, typed cloneElement, mock the moved specs_DEPRECATED/* native modules, switch the lucide-icons mock to react/jsx-runtime, and add a lottie-react-native mock.
  • Downgrade the new react-hooks plugin rules (set-state-in-effect, preserve-manual-memoization, immutability, purity, refs) to warn while existing violations are cleaned up (tracked in SELF-2802); strip redundant Babel test-config plugins now that preset-env targets current Node.
  • Loosen mobile-sdk-alpha peerDeps to accept React 19 and RN up to <0.86; SDK is unchanged otherwise. Spec (specs/topics/RN-UPGRADE-CHECKLIST.md, RN-UPGRADE-PLAN.md) updated to record the SDK 55 fallback decision (Expo SDK 56 not yet GA on 2026-05-04).

Changes

React Native app (app/)

  • react, react-dom, react-native, @react-native/*, @react-native-community/cli, expo, expo-application, expo-camera, react-test-renderer, @types/react* bumped to RN 0.83 / React 19 / Expo SDK 55 lines.
  • iOS: enable New Arch via Info.plist; add React-runtimeexecutor header paths and Expo project script inputs/outputs in project.pbxproj; regenerate Podfile.lock.
  • tsconfig.json extends @react-native/typescript-config directly (path no longer needed).
  • jest.setup.js: update mocks for specs_DEPRECATED/modules/NativeDeviceInfo and NativeStatusBarManagerIOS; add lottie-react-native mock.
  • babel.config.test.cjs: drop the hand-rolled class/spread/optional-chaining/nullish-coalescing transforms — preset-env targeting current Node now handles them, and forcing them broke under hermes-parser after the upgrade (TODO: SELF-2803).
  • .eslintrc.cjs: temporarily downgrade new react-hooks rules to warn (TODO: SELF-2802).
  • Code: RefObject<ScrollViewType | null>, explicit useRef<number | undefined>(undefined), typed cloneElement props, and a WebViewScreen test fix tolerant of multiple console.error calls.

Root / workspace config

  • Root package.json resolutions/dependencies bumped to React 19 + @react-native-community/cli-server-api@^20.
  • Re-sorted package.json files (alphabetized scripts/deps).

SDK (packages/mobile-sdk-alpha)

  • peerDependencies widened: react: ^18.3.1 || ^19.0.0, react-native: >=0.76.0 <0.86.0. No source changes.

Specs

  • specs/topics/RN-UPGRADE-CHECKLIST.md and RN-UPGRADE-PLAN.md updated to record the Phase 1 decision: SDK 55 fallback path (SDK 56 is not GA on npm as of 2026-05-04). Pin targets filled in for RN 0.83.9.

Linear Issues

  • Related: SELF-2798 (RN upgrade), SELF-2802 (re-enable react-hooks rules), SELF-2803 (replace babel test-config subset with @react-native/babel-preset).

Test Plan

  • yarn lint && yarn types passes
  • yarn workspace @selfxyz/mobile-app test passes
  • yarn workspace @selfxyz/mobile-sdk-alpha test && yarn workspace @selfxyz/mobile-sdk-alpha types
  • iOS build (Self target) succeeds with New Arch enabled; passport NFC + camera flows smoke-tested
  • Android build succeeds; smoke test launch + scan
  • Push notifications still deliver via NotificationService extension

Native Consolidation Checklist

  • CONTRACTS.md reviewed — no unintended contract changes
  • Layer 1 bridge contract tests pass (cd app && yarn jest:run / yarn workspace @selfxyz/rn-sdk-test-app test)
  • Layer 3 builds pass (app iOS, RN test app iOS, RN test app Android)
  • Layer 4 manual smoke test signed off (if consolidation PR)
  • No new native business logic added (logic belongs in TypeScript)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Bumped core deps: React → 19.2.0, React Native → 0.83.9, Expo → 55.x; updated related packages and scripts
    • Enabled RN new architecture on Android; updated Android/iOS app startup wiring and build configs
    • Metro, Gradle, Pod install recovery, Hermes, and local preflight scripts improved
  • Bug Fixes & Tests

    • Updated Jest mocks and tests for React 19 compatibility; e2e flows clear state/keychain and adjust timeouts
  • Documentation

    • Updated RN upgrade plan and checklist (May 15, 2026)

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
self-webview-app Ignored Ignored Preview May 18, 2026 5:02pm

Request Review

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Monorepo-wide upgrade and infra PR: dependency/version bumps (React, RN, Expo), Android/iOS host refactors, Metro/Gradle/Pod/build-tooling updates, CI/test workflow expansions, Jest/mock updates, ESLint/Babel/TS typing tweaks, scripts/patches, and assorted small runtime fixes.

Changes

Monorepo upgrade and infra changes

Layer / File(s) Summary
Combined upgrade & infra edits
app/*, app/android/*, app/ios/*, packages/*, .github/workflows/*, specs/*, patches/*, app/scripts/*
All edits in this PR: React/React Native/Expo dependency upgrades and resolution pins, Android build/namespace and MainApplication host refactor, iOS AppDelegate refactor and Pod/Hermes fixes, Metro/CLI/react-native.config wiring changes, pod-install recovery script, new preflight workspace check, CI/workflow instrumentation and artifact expansion, Jest mocks and test adjustments, ESLint/Babel/TS config changes, patches to native packages, and minor TypeScript typing refinements.

Estimated code review effort:
🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: a major upgrade of React Native (0.77 → 0.83), React (18 → 19), and Expo SDK (52 → 55) across the repository, which is the core objective of this Phase 1 PR.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch justin/upgrade-react-native-phase1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@transphorm
Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e7fc20c9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/hooks/useKycLauncher.ts
@transphorm transphorm changed the title Justin/upgrade react native phase1 Upgrade React Native 0.77 → 0.83, React 18 → 19, Expo SDK 52 → 55 May 5, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 09491b40-87c2-4904-81b0-99a3f5ee403f

📥 Commits

Reviewing files that changed from the base of the PR and between d42ee8c and 7e7fc20.

⛔ Files ignored due to path filters (2)
  • app/ios/Podfile.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (32)
  • app/.eslintrc.cjs
  • app/babel.config.test.cjs
  • app/ios/NotificationService/Info.plist
  • app/ios/OpenPassport/Info.plist
  • app/ios/Self.xcodeproj/project.pbxproj
  • app/jest.setup.js
  • app/package.json
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/hooks/useKycLauncher.ts
  • app/src/hooks/useModal.ts
  • app/src/integrations/kyc/kycService.ts
  • app/src/providers/selfClientProvider.tsx
  • app/src/screens/dev/components/ErrorInjectionSelector.tsx
  • app/src/screens/dev/components/LogLevelSelector.tsx
  • app/src/screens/dev/components/ParameterSection.tsx
  • app/src/screens/documents/selection/LogoConfirmationScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/tests/src/integrations/kyc/kycService.test.ts
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tsconfig.json
  • contracts/package.json
  • package.json
  • packages/kmp-sdk-test-app/package.json
  • packages/mobile-sdk-alpha/package.json
  • packages/mobile-sdk-alpha/src/constants/analytics.ts
  • packages/mobile-sdk-alpha/src/proving/provingMachine.ts
  • packages/sdk-test-app/package.json
  • specs/projects/sdk/workstreams/analytics/SPEC.md
  • specs/projects/sdk/workstreams/analytics/plans/ANA-01-canonical-onboarding-funnel.md
  • specs/projects/sdk/workstreams/analytics/plans/ANA-11-canonical-funnel-bug-fixes.md
  • specs/topics/RN-UPGRADE-CHECKLIST.md
  • specs/topics/RN-UPGRADE-PLAN.md
💤 Files with no reviewable changes (1)
  • packages/mobile-sdk-alpha/src/constants/analytics.ts

Comment thread app/src/providers/selfClientProvider.tsx
Comment thread app/src/screens/dev/components/ParameterSection.tsx
Comment thread specs/topics/RN-UPGRADE-CHECKLIST.md
const BUNDLE_THRESHOLDS_MB = {
ios: 48,
android: 48,
ios: 52,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

temporarily bumping for now. will follow up with an optimization pass

@transphorm transphorm deployed to development May 18, 2026 17:02 — with GitHub Actions Active
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