-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cycle dependencies in metro console #53852
base: main
Are you sure you want to change the base?
Fix cycle dependencies in metro console #53852
Conversation
…to fix/attempt-to-fix-cycular-dependecies-1
…Mode, Session, API, Reauthentication, extractPolicyIDFromQuery, Navigation
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments, but it sounds really good!
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
Hi @eVoloshchak, will you be able to take a look at that PR ? |
@kubabutkiewicz, sure thing, will take a look at the PR in a couple of hours |
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
@eVoloshchak I am working on fixing eslint problems |
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
@eVoloshchak I think its ready to check, I needed to make changes to satisfy new way of defaulting IDs |
@@ -1,6 +1,6 @@ | |||
type ResolveDuplicatesParams = { | |||
/** The ID of the transaction that we want to keep */ | |||
transactionID: string; | |||
transactionID: string | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that the api call can be called without valid transactionID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked it and looks fine when I am passing undefined I am getting same error from API when passing empty string, which say that there are missing information to proceed
src/libs/DistanceRequestUtils.ts
Outdated
const policy = PolicyUtils.getPolicy(report?.policyID ?? parentReport?.policyID ?? '-1'); | ||
let customUnitRateID: string = CONST.CUSTOM_UNITS.FAKE_P2P_ID; | ||
const policy = getPolicy(report?.policyID ?? parentReport?.policyID); | ||
let customUnitRateID: string | undefined = CONST.CUSTOM_UNITS.FAKE_P2P_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, maybe we should default the value to CONST.CUSTOM_UNITS.FAKE_P2P_ID
instead of letting it be undefined?
@@ -20,4 +20,5 @@ const linkingConfig: LinkingOptions<RootStackParamList> = { | |||
config, | |||
}; | |||
|
|||
export default linkingConfig; | |||
// eslint-disable-next-line import/prefer-default-export |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that we have started to ignore this rule in many places. Is it still relevant, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah Fabio asked me same question but there are places where its still relevant I think
Considering the size of the PR and that it's refactoring, I think we can skip defaulting IDs updates here, if they appear again. |
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
…to fix/attempt-to-fix-cycular-dependecies-1
@eVoloshchak I will be OOO from 23.12 - 2.01 I will try to sometimes look at that PR and resolve conflicts but I think it will be good to not merge it until I come back since its touching a lot of places. |
Absolutely agree with this. The warnings are not user-facing, there is no urgency in making this change, let's not risk it while everyone is on holidays |
…to fix/attempt-to-fix-cycular-dependecies-1
Explanation of Change
This PR is for fixing multiple occurrences of cycle dependencies warnings in the metro console.
Here is a proposal that I made in the open source channel
This is the first part of this effort, which is make change in metro config to load modules only when they are needed and change imports types to named imports in files which are causing cycles. In next PR I will create an eslint rule to enforce new import style.
There are still 2 warnings in the metro console for cycle dependencies but they are about
CONST.ts
file. Currently I dont know yet how we can fix it without changing export and import types of this file so there would be needed changes in a lot of places in the app so I will do it also separately since its already a huge PR.Tests: I think in that case there is no way to write some specific units tests for that change.
Fixed Issues
$ #53417
Tests
There is no change in specific flow, we should run some smoke tests to check if app is running properly in our most sensitive places
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
There is no change in specific flow, we should run some smoke tests to check if app is running properly in our most sensitive places
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Before:Before.Video.mp4
After:
Android: mWeb Chrome
iOS: Native
Before:
Before.Video.mp4
After:
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop