-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Removing compose.ts #42069
Removing compose.ts #42069
Conversation
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Any updates here @abzokhattab? |
withPolicy, | ||
withNetwork(), | ||
)(WorkspaceRateAndUnitPage); | ||
export default withNetwork()( |
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 am not getting the use of withNetwork
here. @abzokhattab Can you please find out why this was introduced in the first place?
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 believe it's not needed since the network
object is not used anywhere
App/src/pages/workspace/reimburse/WorkspaceRateAndUnitPage/InitialPage.tsx
Lines 28 to 31 in 4400aca
type WorkspaceRateAndUnitPageBaseProps = WithPolicyProps & { | |
// eslint-disable-next-line react/no-unused-prop-types | |
network: OnyxEntry<Network>; | |
}; |
this change was introduced here but there is no reference for why it was introduced.
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.
since it not used anymore we should consider removing this
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.
Okay done
Any updates here? cc @abzokhattab @shubham1206agra Why is this PR still on Draft? Is it WIP or can we open to review? |
what kind of manual tests should I make here @shubham1206agra ? |
Kindly reminder on this @shubham1206agra |
@abzokhattab Can you please add tests and screenshots? |
@abzokhattab @shubham1206agra Whats the status of this PR? What can we do to get this moving faster? |
The PR is ready .. i will update the description today at the mean time please let me know if you have any comments on the changes made. thanks |
Thanks, please let us know once you update the description and add tests / screenshots |
@abzokhattab Please use |
![]() |
No, please use |
@shubham1206agra just curious, but what replace to |
There was an announcement for deprecation of withOnyx. |
Okay, i reverted the |
@shubham1206agra Let's test these components, shouldn't make any difference but watch out for any regressions 🚀 |
We can also consider adjusting contributing guides: ### Composition
Avoid the usage of `compose` function to compose HOCs in TypeScript files. Use nesting instead.
> Why? `compose` function doesn't work well with TypeScript when dealing with several HOCs being used in a component, many times resulting in wrong types and errors. Instead, nesting can be used to allow a seamless use of multiple HOCs and result in a correct return type of the compoment. Also, you can use [hooks instead of HOCs](#hooks-instead-of-hocs) whenever possible to minimize or even remove the need of HOCs in the component. |
should we remove the mentioned section ? |
@abzokhattab Yes, please remove that. |
okay i removed the |
@abzokhattab Please merge main |
Done |
Reviewer Checklist
Screenshots/VideosAndroid: NativeVIDEO-2024-06-14-21-20-29.mp4Android: mWeb ChromeVIDEO-2024-06-14-21-13-56.mp4iOS: NativeScreen.Recording.2024-06-14.at.8.32.57.PM.moviOS: mWeb SafariScreen.Recording.2024-06-14.at.8.27.19.PM.movMacOS: Chrome / SafariScreen.Recording.2024-06-14.at.7.48.17.PM.movMacOS: DesktopScreen.Recording.2024-06-14.at.9.28.55.PM-1.mov |
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.
LGTM!
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.
@abzokhattab one question
@@ -159,7 +157,5 @@ export default compose( | |||
workspaceRateAndUnit: { | |||
key: ONYXKEYS.WORKSPACE_RATE_AND_UNIT, | |||
}, | |||
}), | |||
withPolicy, | |||
withNetwork(), |
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.
Was this not needed in the page?
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.
Yes its not used anywhere as specified in the props types:
App/src/pages/workspace/reimburse/WorkspaceRateAndUnitPage/InitialPage.tsx
Lines 28 to 31 in 4400aca
type WorkspaceRateAndUnitPageBaseProps = WithPolicyProps & { | |
// eslint-disable-next-line react/no-unused-prop-types | |
network: OnyxEntry<Network>; | |
}; |
also i forgot to remove this type, i just removed it.
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.
actually, as i mentioned here #42069 (comment) the whole ( InitialPage
, RatePage
,UnitPage
) pages are not used anywhere so i am not sure if we should remove these components or not and if so should we do it in the same PR or in a new one.
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 think they will be removed in another project that deprecates anything related to Free policies
Thanks for all the hard work |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.84-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.84-3 🚀
|
Details
Fixed Issues
$ #39117
PROPOSAL: #39117 (comment)
Tests
LocaleContextProvider:
interact with app .. LocaleContextProvider is used in withLocalize and and withLocalize is used in AutoUpdateTime which updates the app time automatically.
MapView:
TestToolMenu:
this file is only used in Development.
Testing preferences
section is shown and no errors are shownwithReportAndReportActionOrNotFound:
withPolicyAndFullscreenLoading:
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
Screen.Recording.2024-06-11.at.2.33.52.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-06-11.at.2.42.05.PM.mov
iOS: Native
Screen.Recording.2024-06-11.at.2.29.39.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-06-11.at.2.42.05.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-06-11.at.2.38.28.PM.mov
MacOS: Desktop
Screen.Recording.2024-06-11.at.2.45.08.PM.mov