-
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] Create centralized types for API params #34542
[TS migration] Create centralized types for API params #34542
Conversation
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, like that similar approach that we have in ONYXKEYS 😄
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.
Nice job! 🚀
@s77rt Have a look at this Pr once you find some time. We need to be careful for any regressions. Please check manually every API.write and API.read, that new values in |
@s77rt Done! |
@s77rt Kind bump |
Missing commands: WRITE:
Those commands are coming from js files. Are we planning to write types for those api endpoints once we need to? i.e. when we migrate the js files to ts |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
I don't think that's necessary since we are still sending the same data (any non-data errors should be caught by typescript) |
Yes, that's the plan. |
@roryabraham Back to you (before merging let's sync main, please ping me on slack) |
@s77rt I think that is crucial to check every command in |
@blazejkustra I did check the commands names. In the previous comment I meant to refer to the command parameters. |
Thank you! We should be good then, I also run some regexes and scripts to check that names are indeed the 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.
ok, played with this a bit and it all seems to make sense and work as expected. Thanks @blazejkustra
As a reviewer, I did kind of regret conceding to do this in one big PR. I'm a bit more nervous merging this and not as confident that we didn't miss some small mistake somewhere. In the future let's try to take the time to break things up better.
Pretty sure the reassure failure is a red herring / not caused by this PR. |
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
✋ 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.4.33-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.4.33-5 🚀
|
Details
Currently, we're defining a type for API params before each use of that API endpoint. This could lead to inconsistent application of API params and might make it difficult to know the params (and associated types) accepted by each API endpoint.
This PR aims to fix it, define all commands and it's parameters in one global place.
Fixed Issues
$ #33965
PROPOSAL: N/A
Tests
src/libs/API/types.ts
, and compare it with what was used inAPI.write
andAPI.read
beforeOffline tests
N/A
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
android.webm
Android: mWeb Chrome
android-web.webm
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov