-
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
[No QA] [TS migration] Migrate 'Link.js' lib to TypeScript #28257
[No QA] [TS migration] Migrate 'Link.js' lib to TypeScript #28257
Conversation
|
||
const params = _.compact([authTokenParam, emailParam]).join('&'); | ||
const paramsArray = [authTokenParam, emailParam]; | ||
const params = paramsArray.filter(Boolean).join('&'); |
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 love this pattern, congrats @kubabutkiewicz 🔥
src/libs/actions/Link.ts
Outdated
}); | ||
|
||
let currentUserEmail; | ||
let currentUserEmail: string; |
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.
let currentUserEmail: string; | |
let currentUserEmail: string | undefined; |
I would be more safe if we specify that this variable can be undefined, because it's only populated in the callback of Onyx, so before that happens it's undefined and we should consider this possibility.
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.
Or if we only care about the string
type, maybe we can default it to ''
? Wdyt?
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.
It is an option too, @kubabutkiewicz We can change this one to:
let currentUserEmail = '';
@@ -10,29 +8,23 @@ import * as Url from '../Url'; | |||
let isNetworkOffline = false; |
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.
let isNetworkOffline = false; | |
let isNetworkOffline: boolean | undefined = false; |
Same.
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 here it would stay false
before this callback fires 🤔
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.
You are right @adhorodyski! Sorry @kubabutkiewicz , but could you revert this 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.
One change (I think) and one clarification, looks good otherwise!
Can you also add some testing steps please just so I can double check? Thanks!
@dangrous Added testing steps , answered and make this one change :) |
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.
Cool, looks good! @fabioh8010 do you mind filling out the checklist so we can get this merged? Thank you!
@dangrous This one must be filled by SWM engineers as part of our cross-review strategy, they will review it soon. |
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
@dangrous Just so you know, TS process was changed recently and now C+ are responsible for the reviewer checklist. |
Got it, let me see if I can grab one for this! |
Hi @dangrous @aimane-chnaif are you able to review this and do reviewer check list? |
On it now. Was reviewing yesterday |
Code looks good. Can you update QA Steps like this?
|
const paramsArray = [authTokenParam, emailParam]; | ||
const params = paramsArray.filter(Boolean).join('&'); |
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: I don't see the need of introducing new variable
const paramsArray = [authTokenParam, emailParam]; | |
const params = paramsArray.filter(Boolean).join('&'); | |
const params = [authTokenParam, emailParam].filter(Boolean).join('&'); |
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.
Any feedback?
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.
bump, though not blocker
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.
for me it was looking more clear when did that, should I revert that?
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.
That's fine
Apply this to Test step as well. And add numbers 1. 2. 3. |
@aimane-chnaif can you look again? |
@aimane-chnaif Hi, are you able to look at this PR ? |
reviewing today |
@kubabutkiewicz I got lint error after pulling main ![]() |
…s-migration/Link-lib
@aimane-chnaif PR updated |
@kubabutkiewicz please also fix lint |
@aimane-chnaif fixed. |
@aimane-chnaif do you have time to re-review today? |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.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 🎉
🎯 @aimane-chnaif, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #30783. |
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.
Just one comment - looks great otherwise!
@@ -42,18 +34,11 @@ function buildOldDotURL(url, shortLivedAuthToken) { | |||
}); | |||
} | |||
|
|||
/** | |||
* @param {String} url | |||
* @param {Boolean} shouldSkipCustomSafariLogic When true, we will use `Linking.openURL` even if the browser is Safari. |
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.
Can we leave this note in? It might be useful for the future!
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.
Added @dangrous 😄
✋ 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/dangrous in version: 1.3.96-6 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.98-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.98-5 🚀
|
Details
Fixed Issues
$ 24912
Tests
Offline 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
Web
web.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4