-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Rewrite to functional component #26079
Rewrite to functional component #26079
Conversation
@abdulrahuman5196 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] |
FWIW I think we should close this PR and the associated issue. We have a |
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, I was a little quick to close this – can we please refactor this to separate the LocaleContextProvider
from the withLocalize
HOC and put them in separate files?
We can and should implement LocaleContextProvider
as a functional component, but we don't need to worry about migrating the withLocalize
HOC unless it's trivial to do so. Long-term we should look to remove withLocalize
from the codebase entirely once everything has been converted to functional components.
I believe this PR was raised to address this issue -> #16222 Assigned @MaciejSWM and everyone else involved in this review, but in the future please confirm with someone first so we can avoid duplicate assignment. Thanks for the PR and excited for the changes! |
I split to separate file. Ready for review @roryabraham |
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, will wait for C+ review 👍🏼
@abdulrahuman5196 if you could test this one that would be great 🙇🏼 |
Code looks fine to me as well. @MaciejSWM In author's checklist,
|
Thanks @abdulrahuman5196, I made all the adjustments and all is ready for re-review! |
bump for re-review @abdulrahuman5196 |
Hi, It seems we have merge conflicts on this PR. Let me know once that is fixed. I will take this issue as priority. |
…ejs-to-function-component
@abdulrahuman5196 Maciej is OOO this week, @WoLewicki will take over the PR. |
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.
Also, I was thinking that the createLocaleContext
should be called LocaleContextProvider
, because that's the component that we're creating in the file
OK I updated the PR, could you recheck it @roryabraham @abdulrahuman5196 ? |
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.
Code looks good, waiting for C+ to test and approve
@abdulrahuman5196 friendly bump for review 🙂 |
Sorry for delay, came back from OOO. Will complete review today |
Reviewing now |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-27.at.7.12.09.PM.mp4Mobile Web - Chromeaz_recorder_20230927_191854.mp4Mobile Web - SafariScreen.Recording.2023-09-27.at.7.16.27.PM.mp4DesktopScreen.Recording.2023-09-27.at.7.24.58.PM.mp4iOSScreen.Recording.2023-09-27.at.7.20.26.PM.mp4AndroidScreen.Recording.2023-09-27.at.8.08.49.PM.mp4 |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @roryabraham
🎀 👀 🎀
C+ Reviewed
✋ 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/roryabraham in version: 1.3.76-0 🚀
|
@roryabraham @abdulrahuman5196 can you please help with this step?
|
@kavimuru seems like just regression tests should be fine here, because the component is used in many places. Make sure to test that changing the locale updates the language in the UI correctly, then feel free to check this off |
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.3.77-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.77-7 🚀
|
Details
Fixed Issues
$ #16222
PROPOSAL: #16222 (comment)
Tests
withLocalize
is used 'everywhere' so if everything is working correctly, it means the migration went well.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 methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Screen.Recording.2023-09-12.at.10.08.27.mov
Desktop
Screen.Recording.2023-09-12.at.11.03.23.mov
iOS
Screen.Recording.2023-09-12.at.11.24.23.mov
Android
Screen.Recording.2023-09-12.at.10.56.57.mov
Chrome
Safari
Screen.Recording.2023-09-12.at.11.28.44.mov