[No QA] Fix import/no-cycle - part 2 - #99768
Conversation
1ee2cdc to
89e2748
Compare
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
89e2748 to
6293fd3
Compare
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-09-04.at.02.33.39.mov |
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.73-0 🚀
|
|
🤖 No help site changes are required for this PR. I did not create a docs PR. This PR only moves code between modules to break four Why I concluded no docs update is neededI reviewed all 13 changed files. Every change is one of three kinds: 1. Import path updates (6 files) — the same symbol, imported from the module that defines it instead of a barrel:
2. Functions moved verbatim into new leaf modules (3 new files) — 3. One test mock path update — Checks that came back empty:
The areas this PR touches (accounting connections such as QuickBooks Online, NetSuite and Certinia; multi-factor authentication; GPS distance requests; custom emoji rendering) do have help site articles under Since no help site changes are needed, there is no docs PR to link, review, or mark |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.73-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Break four independent import cycles by extracting leaf modules and context hooks. No logic changes, already guarded with tests, ts and lint.
Breaks four circular imports. They are independent of each other, and each one is its own small cluster of 2
to 7 mutually dependent modules that dissolves completely when a single import moves.
Oxlint's
import/no-cyclereports these; ESLint's copy of the same rule reports 0 because its resolver neverresolves our
@libs/...style aliases, so it never builds a module graph. This is prep work for the Oxlintmigration, where the rule becomes a blocking check.
components/Text.tsx<->libs/EmojiUtils.tsxcontainsCustomEmojiandcontainsOnlyCustomEmojimove to a new leaflibs/CustomEmojiUtils.ts.EmojiUtilsre-exports them, so its other consumers are untouched.libs/GPSDraftDetailsUtils.ts<->libs/actions/GPSDraftDetails.tsaddressFromGpsPoint,coordinatesToStringandcalculateTrimmedEndPointmove to a new leaflibs/GPSPointUtils.ts.GPSDraftDetailsUtilsre-exports them.config<->Context(7 files)ChangePIN.tsximportsuseMultifactorAuthenticationStatefrom the module that defines it instead of theContextbarrel, matching whatAuthenticationMethodDescription.tsxalready does.utils<->AccountingContext(6 files)createContextcalls and their hooks move toAccountingContext/contexts.ts. The three integration flow components read the hook from there.index.tsxre-exports it, so the pages are untouched.No function body changes, no Onyx write moves, no new side effects: the three new modules are pure functions
and two
createContextcalls.createContextis still called exactly once per context.One test edit:
BaseConnectToQuickbooksOnlineFlow.test.tsxmocks the accounting context, so itsjest.mockpath follows the component's import. Numbers counted already with PR1: #99670
import/no-cyclefindingsFixed Issues
$ #99650
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-08-31.at.13.52.26.mov