Repository navigation
[No QA][TS migration] Update Typescript guidelines: 'satisfies' keyword + module augmentation - #25862
Conversation
|
@arosiclair 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] |
|
wow I didn't know about And I also love the example you created for |
Reviewer Checklist
Screenshots/VideosWebN/A Mobile Web - ChromeN/A Mobile Web - SafariN/A DesktopN/A iOSN/A AndroidN/A |
|
✋ 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/hayata-suenaga in version: 1.3.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.58-5 🚀
|
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.59-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.59-5 🚀
|
Details
Module augmentation:
global.d.tsfile was moved in this PR. I also needed to augmentatereact-native-key-commandlibrary in that PR as it's written in javascript. I tried to do it inglobal.d.tsfile as specified in the guidelines, but it wasn't working. Once I movedreact-native-onyxandreact-native-key-commandmodule augmentation to separate files it started to work. Changed guidelines accordingly.The
satisfiesOperatorThis operator was introduced in TS 4.9, it is quite handy. We decided to use it for some files (example). Here more on this in the TS documentation. We were lacking a proper example in the guidelines.
Fixed Issues
$ N/A
PROPOSAL: N/A
Tests
N/A
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
N/A