Skip to content

build(navigation): upgrade react-navigation and react-native-tab-view patches - #73

Closed
BartekObudzinski wants to merge 3 commits into
mainfrom
fm/expensify-rn-101715-upgrade
Closed

BartekObudzinski wants to merge 3 commits into
mainfrom
fm/expensify-rn-101715-upgrade

Conversation

@BartekObudzinski

Copy link
Copy Markdown

Intent

Upgrade the vendored react-navigation stack for Expensify/App issue 101715 to the newest versions the repo .npmrc min-release-age=7 supply chain gate allows: @react-navigation/native 7.1.33 to 7.4.1, core 7.21.12 to 7.22.1, stack 7.8.5 to 7.11.1, bottom-tabs 7.15.5 to 7.19.1, native-stack 7.14.5 to 7.19.1, material-top-tabs 7.4.19 to 7.7.1, devtools 7.0.52 to 7.1.15, plus regenerating the five react-native-tab-view patches for 4.3.0 to 4.3.2. All thirteen react-navigation patches and five tab-view patches were re-ported with the patch-package --append flow from contributingGuides/PATCHES.md and the reasons are recorded in patches/react-navigation/details.md. Decisions a reviewer needs in order to tell them apart from mistakes: the issue title names 7.11.2 but @react-navigation/native has no 7.11.2 (7.4.1 is the latest) and stack 7.11.2 is blocked by min-release-age=7 until 2026-09-24T20:30:48Z, so this round deliberately ships stack 7.11.1; our native+003 popstate fallback timeout patch was deleted because upstream 7.3.18 PR 13217 absorbed the same 100ms to 1000ms change and re-porting the old hunk would also drop upstream's window.removeEventListener popstate cleanup; a new types-only core+003 patch keeps NavigationContainerRef.getRootState() typed as non-undefined rather than adding nullish branches at 117 call sites; the NavigationContent deprecation added in core 7.22.0 is silenced with two targeted eslint disables rather than migrating createPlatformStackNavigatorComponent to the new render callback inside an upgrade PR; the floating-RHP stack+005 patch from Expensify/App PR 101093 is deliberately not carried because that PR is unmerged and it owns that patch; tests/unit/Navigation/createMemoryHistoryTest.ts was updated because native 7.3.8 commit 788d7c5 made createMemoryHistory.go() reject when the browser never lands on the target entry, replacing the resolve-on-timeout contract that test asserted. Pre-existing unrelated failures in DateUtilsTest, SubscriptionUtilsTest and UnreadIndicatorsTest were reproduced on an unupgraded checkout of the same commit. Deliberately not done here: manual iOS, Android and mWeb QA, which the owner checks himself from a checklist posted as a separate PR comment, and the stack 7.11.2 bump. Delivery target is a DRAFT pull request for owner review, review and merge authority stay with the owner, nothing is marked ready for review, and the manual test plan stays out of the PR body.

What Changed

  • Upgraded @react-navigation/* packages (native 7.1.33→7.4.1, core 7.21.12→7.22.1, stack 7.8.5→7.11.1, bottom-tabs 7.15.5→7.19.1, native-stack 7.14.5→7.19.1, material-top-tabs 7.4.19→7.7.1, devtools 7.0.52→7.1.15) and react-native-tab-view 4.3.0→4.3.2 in package.json/package-lock.json.
  • Re-ported all thirteen react-navigation patches and five react-native-tab-view patches to the new versions, added a new core+003 patch that keeps NavigationContainerRef.getRootState() typed as non-undefined, and removed the native+003 popstate-fallback-timeout patch now that upstream absorbed the same change.
  • Added targeted eslint-disable comments in createPlatformStackNavigatorComponent (native and web) to silence the core 7.22 NavigationContent deprecation, and updated tests/unit/Navigation/createMemoryHistoryTest.ts to match native 7.3.8's new reject-on-timeout behavior for createMemoryHistory.go().

🤖 Generated with Claude Code

Risk Assessment

✅ Low: Vendored patch re-port with versions, patch content, and details.md exactly matching the stated intent (13 react-navigation + 5 tab-view patches, all correctly referenced per validatePatches.sh, all deviations from the issue title explicitly authorized and documented); the memory-history test exercises real module behavior against real timers/events rather than grepping source; type-only core+003 patch and eslint-disable for NavigationContent are explicitly scoped, documented containments, not silent gaps.

Testing

Installed the branch's dependency tree for real, confirmed every package landed at the exact version the intent specifies, confirmed all 13 react-navigation + 5 tab-view patches applied cleanly and produced the expected code (core+003 types-only getRootState fix, native 1000ms/removeEventListener already present upstream), ran the updated createMemoryHistoryTest live and it passes with the new rejection contract, ran the broader navigation test surface (NavigationTests, HandleExitToNavigationTests, tests/unit/Navigation, tests/unit/libs/Navigation) — all 630+ tests pass against the upgraded, patched packages — and cross-checked the min-release-age=7 gate reasoning against the live npm registry (stack 7.11.2 published 2026-09-17T20:30:48Z, gate clears exactly 2026-09-24T20:30:48Z; native has no 7.11.2 and its latest dist-tag is 7.4.1), all matching the intent's stated constraints exactly.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Dependency versions match the min-release-age-gated targets ✅ pass live node -e console.log(require(...package.json).version) for native/core/stack/bottom-tabs/native-stack/material-top-tabs/devtools/react-native-tab-view after real npm install all matched 7.4.1/7.22.1/7.…
All 18 patches (13 react-navigation + 5 tab-view) re-apply cleanly via patch-package ✅ pass live npm install log: '✅ patch-package succeeded without errors or warnings'; node_modules/@react-navigation/core/src/types.tsx and lib/typescript/src/types.d.ts show getRootState(): NavigationState (core+…
createMemoryHistory.go() rejects (not resolves) on a timed-out traversal, matching native 7.4 behaviour ✅ pass live npx jest tests/unit/Navigation/createMemoryHistoryTest.ts -> PASS (2) FAIL (0), run against the real installed @react-navigation/native@7.4.1
Upgraded navigation stack still drives real app navigation flows correctly ✅ pass live npx jest tests/navigation/NavigationTests.tsx tests/navigation/HandleExitToNavigationTests.tsx -> PASS (5) FAIL (0); npx jest tests/unit/Navigation -> PASS (618) FAIL (0); npx jest tests/unit/libs/Nav…
stack 7.11.2 is genuinely blocked by min-release-age=7 (adversarial check on the version-selection reasoning) ✅ pass live npm view @react-navigation/stack time --json against the real npm registry: 7.11.2 published 2026-09-17T20:30:48.819Z, +7 days = 2026-09-24T20:30:48Z exactly matching the intent's claim; npm view @rea…
NavigationContent deprecation is silenced only via targeted eslint-disable, no functional migration ⏸️ untested no Lint/typecheck enforcement is explicitly out of scope for this test phase, and there is no runtime behavior distinct from what the navigation test suite above already exercised, so nothing further cou…

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Dependency versions match the min-release-age-gated targets ✅ pass live node -e console.log(require(...package.json).version) for native/core/stack/bottom-tabs/native-stack/material-top-tabs/devtools/react-native-tab-view after real npm install all matched 7.4.1/7.22.1/7.…
All 18 patches (13 react-navigation + 5 tab-view) re-apply cleanly via patch-package ✅ pass live npm install log: '✅ patch-package succeeded without errors or warnings'; node_modules/@react-navigation/core/src/types.tsx and lib/typescript/src/types.d.ts show getRootState(): NavigationState (core+…
createMemoryHistory.go() rejects (not resolves) on a timed-out traversal, matching native 7.4 behaviour ✅ pass live npx jest tests/unit/Navigation/createMemoryHistoryTest.ts -> PASS (2) FAIL (0), run against the real installed @react-navigation/native@7.4.1
Upgraded navigation stack still drives real app navigation flows correctly ✅ pass live npx jest tests/navigation/NavigationTests.tsx tests/navigation/HandleExitToNavigationTests.tsx -> PASS (5) FAIL (0); npx jest tests/unit/Navigation -> PASS (618) FAIL (0); npx jest tests/unit/libs/Nav…
stack 7.11.2 is genuinely blocked by min-release-age=7 (adversarial check on the version-selection reasoning) ✅ pass live npm view @react-navigation/stack time --json against the real npm registry: 7.11.2 published 2026-09-17T20:30:48.819Z, +7 days = 2026-09-24T20:30:48Z exactly matching the intent's claim; npm view @rea…
NavigationContent deprecation is silenced only via targeted eslint-disable, no functional migration ⏸️ untested no Lint/typecheck enforcement is explicitly out of scope for this test phase, and there is no runtime behavior distinct from what the navigation test suite above already exercised, so nothing further cou…
  • npm install (materializes upgraded @react-navigation/* + react-native-tab-view packages and runs patch-package --append patches)
  • npx jest tests/unit/Navigation/createMemoryHistoryTest.ts
  • npx jest tests/navigation/NavigationTests.tsx tests/navigation/HandleExitToNavigationTests.tsx
  • npx jest tests/unit/Navigation (618 tests)
  • npx jest tests/unit/libs/Navigation tests/unit/libs/NavigationFocusReturn
  • npm view @react-navigation/stack time --json / npm view @react-navigation/native versions,dist-tags --json against the real npm registry
  • grep verification of patched output in node_modules/@react-navigation/core/**/types.* and node_modules/@react-navigation/native/lib/module/createMemoryHistory.js
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ba46a3e1-cc64-4ffd-b628-62b95d5d3383


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

@BartekObudzinski

Copy link
Copy Markdown
Author

Closing on the maintainer's standing instruction: pull requests for this work target the official repository only (https://github.com/Expensify/App). Reopening as a draft from the personal fork against Expensify/App main.

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