-
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
Enable Modern Drawer in react-navigation #11550
Conversation
Hey, I noticed you changed some webpack configuration files. This can break production builds. Did you remember to run a production build locally to verify they still work? |
This comment was marked as resolved.
This comment was marked as resolved.
Making pretty good progress with this PR. Though hitting a bit of a snag with the Android changes. Though the initial animation happens now with much less delay it seems like the To prove this, I tried wrapping the methods that Without XRecorder_03102022_164410.mp4With the XRecorder_03102022_165249.mp4I'll keep looking into it tomorrow, but it seems like it would be useful to move these specific updates into the |
Hey @marcaaron, great progress! I was assigned to look into upgrading to reanimated v3 in an effort toward enabling fabric. I am not sure if one of your goals was to bump to REA v3 as well, however, I already created a PR for that, that is based on yours: The most important commit is this one where I removed legacy setup code: This could be very well also incorporated into your PR? |
Nice one! This was not a focus on my PR so I think we can HOLD the other one and wait for these changes perhaps. Or we can wait and see what happens with the force flag stuff in this Slack thread). I'm not sure when this will be ready to merge - I think I have to figure out some solution to the problems introduced when the |
Ok, so looking into the issue @NikkiWines found and kind of confused about how this code is intended to work: App/src/pages/home/ReportScreen.js Lines 212 to 213 in 44c75aa
Unsure what situation we have were there is a I was confused about this here -> https://github.com/Expensify/App/pull/10452/files#r983731454 as well and seems like it is getting resolved here. |
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.
Overall this seems to work great
babel.config.js
Outdated
@@ -12,6 +12,8 @@ const defaultPlugins = [ | |||
// source code transformation as we do not use class property assignment. | |||
'transform-class-properties', | |||
|
|||
'@babel/plugin-proposal-export-namespace-from', |
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.
Would be good to leave a comment noting why this babel plugin is needed
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 was following this here -> https://docs.swmansion.com/react-native-reanimated/docs/next/fundamentals/web-support
But now realizing that is for the "next" version so maybe it's not needed.
src/pages/home/ReportScreen.js
Outdated
@@ -121,7 +122,9 @@ class ReportScreen extends React.Component { | |||
} | |||
|
|||
componentDidUpdate(prevProps) { | |||
if (this.props.route.params.reportID === prevProps.route.params.reportID) { | |||
const previousReportID = prevProps.route.params.reportID; |
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.
NAB this change isn't really needed imo
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.
yep, agree - I think I only changed it to help log some values.
src/pages/home/ReportScreen.js
Outdated
> | ||
{/* The isTransitioning variable here is necessary so that when we are retrieving the next report data | ||
from Onyx the ReportActionsView will remount completely */} | ||
{(this.shouldShowLoader() || isTransitioning) |
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.
+1 just move the check into shouldShowLoader
Ah so fun stuff - white screen is resolved now and there is a way to fix it h/t to @vladamx. I don't know why it didn't work when I tried it before but it works now. The result with a fake header component is pretty nice too. 2022-10-13_13-20-02.mp4 |
Updated some things. |
Re-tested, but only changed the videos for Android and iOS since there is more or less no visual difference for web, desktop, etc. |
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.
Only one tiny comment
src/pages/home/ReportScreen.js
Outdated
return ( | ||
<Freeze | ||
freeze={this.props.isSmallScreenWidth && this.props.isDrawerOpen} | ||
placeholder={( | ||
<ScreenWrapper | ||
style={[styles.appContent, styles.flex1, {marginTop: this.state.viewportOffsetTop}]} |
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.
Flex1 is a duplicate here – BaseScreenWrapper
already has that style:
styles.flex1, |
style={[styles.appContent, styles.flex1, {marginTop: this.state.viewportOffsetTop}]} | |
style={[styles.appContent, {marginTop: this.state.viewportOffsetTop}]} |
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 have verified the author checklist is complete (all boxes are checked off).
- I verified the correct issue is linked in the
### Fixed Issues
section above - I verified testing steps are clear and they cover the changes made in this PR
- I verified the steps for local testing are in the
Tests
section - I verified the steps for Staging and/or Production testing are in the
QA steps
section - I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
- I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
- I verified the steps for local testing are in the
- I checked that screenshots or videos are included for tests on all platforms
- I included screenshots or videos for tests on all platforms
- I verified tests pass on all platforms & I tested again on:
- iOS / native
- Android / native
- iOS / Safari
- Android / Chrome
- MacOS / Chrome
- MacOS / Desktop
- If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
- I verified proper code patterns were followed (see Reviewing the code)
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
toggleReport
and notonIconClick
). - I verified that comments were added to code that is not self explanatory
- I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
- I verified any copy / text shown in the product was added in all
src/languages/*
files - I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
- I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
- I verified the JSDocs style guidelines (in
STYLE.md
) were followed
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
- If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- I verified that this PR follows the guidelines as stated in the Review Guidelines
- I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like
Avatar
, I verified the components usingAvatar
have been tested & I retested again) - I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
- If a new component is created I verified that:
- A similar component doesn't exist in the codebase
- All props are defined accurately and each prop has a
/** comment above it */
- The file is named correctly
- The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
- The only data being stored in the state is data necessary for rendering and nothing else
- For Class Components, any internal methods passed to components event handlers are bound to
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor) - Any internal methods bound to
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
) - All JSX used for rendering exists in the render method
- The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
- If a new CSS style is added I verified that:
- A similar style doesn't already exist
- The style can't be created with an existing StyleUtils function (i.e.
StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)
- If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like
Avatar
is modified, I verified thatAvatar
is working as expected in all cases) - If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.
iOSRPReplay_Final1665707270.MP4iOS ChromeRPReplay_Final1665708134.MP4iOS SafariRPReplay_Final1665708285.MP4Androidscreen-20221013-175703_2.mp4Android Chromescreen-20221013-174746_2.mp4Desktop ChromeScreen.Recording.2022-10-13.at.5.43.19.PM.movmacOS DesktopScreen.Recording.2022-10-13.at.5.59.51.PM.mov |
🚀 Deployed to staging by @roryabraham in version: 1.2.15-2 🚀
|
Yo! Coming from here, this looks like the most likely PR in the deploy checklist to cause this regression:
Will leave the DB label off for now until we get a gut check. |
There is another regression with TextInputs. I opened an issue and PR at Description of regression here: https://expensify.slack.com/archives/C035J5C9FAP/p1665727193558759 |
Yeah, this seems to be confirmed now @trjExpensify |
🚀 Deployed to production by @yuwenmemon in version: 1.2.15-3 🚀
|
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; | |||
import {Platform, View} from 'react-native'; | |||
import lodashGet from 'lodash/get'; | |||
import _ from 'underscore'; | |||
import {Freeze} from 'react-freeze'; |
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.
@marcaaron why react-freeze
isn't added to package.json ?
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.
the dependency exists in other packages we are using so it's in node modules.
return !getReportID(this.props.route) || isLoadingInitialReportActions || !this.props.report.reportID; | ||
|
||
// This is necessary so that when we are retrieving the next report data from Onyx the ReportActionsView will remount completely | ||
const isTransitioning = this.props.report && this.props.report.reportID !== reportIDFromPath; |
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.
@marcaaron I know it's been a long time, but any chance you can help explain how the reportID
from route params could be different than the reportID
from the report
that came from withOnyx
? Since the key passed to withOnyx
uses the reportID
from the route
param, I'd think that they could never be different. Trying to wrap my head around 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.
😅
I want to say something like:
- the route changes
- triggers a re-render
- start fetching the report from Onyx
- the report takes a long time to return
- during that time this component will be "transitioning"
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 that explanation makes sense because if the props change then withOnyx
callbacks won't necessarily return the report right away, but I'd have to do some debugging to see if it's still possible with all the changes since then.
Details
react-navigation
react-freeze
to prevent rendering issues caused by the upgrade (explained here)Fixed Issues
$ #11426
$ #11479
Tests
PR Review Checklist
PR Author Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.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)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** 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)QA Steps (Web/Desktop)
QA Steps (iOS/Android/mWeb)
Screenshots
Web
2022-10-11_11-49-05.mp4
Mobile Web - Chrome
2022-10-11_12-33-39.mp4
Mobile Web - Safari
2022-10-13_13-24-30.mp4
Desktop
2022-10-11_12-03-28.mp4
iOS
2022-10-13_13-20-02.mp4
Android
2022-10-13_13-35-35.mp4