-
-
Notifications
You must be signed in to change notification settings - Fork 480
[Tech] Add types to all IPC functions #1901
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
Conversation
Co-authored-by: Ariel Juodziukynas <[email protected]>
We would've returned `true` otherwise, and that's not a valid return value for this function
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.
good stuff 👍🏽
I needed to dismiss my reviews since I am having some bugs like the GamePage is not working, it is throwing an error for both GOG and Legendary:
the same happens when clicking install on the game card. |
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 me know once the bugs are fixed so I can test it again 👍🏽
Looks like one of my next TODOs is "finally cutting down on the I renamed the |
97dc578
to
a1fa47a
Compare
I see, ok I will check again 👍🏽 |
Tried again and I still have the same issue. |
The ipcMain.on/handle callback function almost always has the same function type as the preload script function. In HeroicGamesLauncher/src/common/types.ts Lines 18 to 35 in a03347e
This way we only need to change the function signature in the preload script and still get fullstack type checking. What are your thoughts on this approach @CommandMC? |
Hm, I think I'm mostly getting how this works, but I'm not sure if I like how it works 😅 Thanks for the reminder though, I honestly totally missed that comment |
This also removes a seemingly incorrect `removeApp` call
@BrettCleary I've now implemented full-stack type checking my way. It's more compex and certainly less readable, but also has some benefits
The main drawback is that you now have to jump through one more hoop to add a new IPC function (adding it to Let me know what you think |
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, looks good now! :D
Since we're now doing IPC types differently, these are no longer needed and might cause confusion for new contributors
src/frontend/screens/Settings/components/DefaultInstallPath.tsx
Outdated
Show resolved
Hide resolved
hey, I left 2 comments, the |
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.
looks good!
This PR improves our IPC system by adding return types wherever possible and refining some already existent return & parameter types
It's one of the necessary steps to finally get full confidence over our variable typings, right in line after the general IPC rework in #1783
Some non-required, but "would be nice" TODOs:
Use the following Checklist if you have changed something on the Backend or Frontend: