-
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
[TS migration] Migrate 'FullscreenLoadingIndicator.js' component to TypeScript #29988
[TS migration] Migrate 'FullscreenLoadingIndicator.js' component to TypeScript #29988
Conversation
</View> | ||
); | ||
} | ||
|
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.
We should always define displayName:
FullScreenLoadingIndicator.displayName = 'FullScreenLoadingIndicator'; |
import themeColors from '../styles/themes/default'; | ||
|
||
type FullScreenLoadingIndicatorProps = { | ||
style: Record<string, unknown> | Array<Record<string, unknown>>; |
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 would consider more accurate type here:
style: Record<string, unknown> | Array<Record<string, unknown>>; | |
style: StyleProp<ViewStyle> |
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.
@MaciejSWM Please update the PR title to [TS migration] Migrate 'FullscreenLoadingIndicator.js' component to TypeScript
, we should have this one tested by QA.
Co-authored-by: Fábio Henriques <[email protected]>
@cubuspl42 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] |
|
||
function FullScreenLoadingIndicator({style}: FullScreenLoadingIndicatorProps) { | ||
return ( | ||
<View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading, style]}> |
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, so passing a style
array here just works? Was the old logic unnecessary?
const additionalStyles = _.isArray(props.style) ? props.style : [props.style];
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.
@MaciejSWM Let's ensure this change was intended
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.
Turns out it works just fine. It's not only correct Typescript, but it also works when I test it with all the combinations of style
:
http://localhost:8082/settings/profile/display-name
In DisplayNamePage.js
(I renamed it to .tsx
to highlight any errors, but none showed up):
{!props.isLoadingApp ? (
<>
<View style={{ height: '20%' }}>
{/* No style */}
<FullScreenLoadingIndicator />
</View>
<View style={{ height: '20%' }}>
{/* Empty array style */}
<FullScreenLoadingIndicator style={[]} />
</View>
<View style={{ height: '20%' }}>
{/* Just one style */}
<FullScreenLoadingIndicator style={styles.backgroundPurple} />
</View>
<View style={{ height: '20%' }}>
{/* Array of styles */}
<FullScreenLoadingIndicator style={[styles.backgroundPurple, styles.backgroundGold]} />
</View>
</>
) : (
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.
Thanks for verifying this!
We are over 1000 commits behind Even if there are no Git conflicts on the textual level, such diversion can:
In the case of this specific PR, we would probably get only a textual conflict (as it deletes a file), but 1000 commits is still a lot. |
Reviewer Checklist
Screenshots/VideosWebFullscreenLoadingIndicator-ts-web.mp4Mobile Web - ChromeFullscreenLoadingIndicator-ts-android-web-compressed.mp4Mobile Web - SafariFullscreenLoadingIndicator-ts-ios-web.mp4DesktopiOSFullscreenLoadingIndicator-ts-ios.mp4AndroidFullscreenLoadingIndicator-ts-android-compressed.mp4 |
@cubuspl42 thanks for pointing out valid concerns. Branch is up to date now + I addressed your question about getting rid of |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25010 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
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.
Please write QA steps
@AndrewGable updated |
✋ 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/AndrewGable in version: 1.3.96-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
Details
Fixed Issues
$ #25010
PROPOSAL:
Tests
DisplayNamePage.js
add an early return:FullScreenLoadingIndicator
rendering a fullscreen spinnerOffline tests
Tests
QA Steps
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
Android: Native
Screen.Recording.2023-10-20.at.14.01.31.mov
Android: mWeb Chrome
Screen.Recording.2023-10-20.at.11.31.49.mov
iOS: Native
Screen.Recording.2023-10-20.at.11.27.27.mov
iOS: mWeb Safari
Screen.Recording.2023-10-20.at.11.30.43.mov
MacOS: Chrome / Safari
Screen.Recording.2023-10-20.at.11.30.15.mov
MacOS: Desktop
Screen.Recording.2023-10-20.at.11.24.08.mov