-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
[Tech] Make IPC typing simpler & more expandable #3819
Open
CommandMC
wants to merge
12
commits into
main
Choose a base branch
from
feat/ipc-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+744
−1,156
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"new" here is a bit loose, as this inherits most of its type definition from the .d.ts file, just changing how TS views it. This replaces our old approach (overwriting electron's types) with a layer on top of the existing IPC. This should play nicer with IDE intellisense, and allows us to make changes to IPC very easily in the future (we can now for example move the `event` parameter to the end of the parameter list passed to the backend, or pass an abort controller to every handler) In the process of moving the actual type definitions, I've also corrected a few mistakes (which weren't caught before, as TS doesn't check .d.ts files)
CommandMC
added
pr:wip
WIP, don't merge.
pr:ready-for-review
Feature-complete, ready for the grind! :P
labels
Jun 13, 2024
CommandMC
requested review from
arielj,
flavioislima,
Etaash-mathamsetty,
Nocccer and
imLinguin
and removed request for
a team
June 13, 2024 10:53
CommandMC
force-pushed
the
feat/ipc-types
branch
from
June 13, 2024 15:17
60221f1
to
c133c2d
Compare
`removeApp` does the same thing as `uninstall`, so this can just be a handler invoker for `uninstall` This also removes `removeApp`
- This is where they should be (the preload should be as simple as possible) - This was hiding that the current `updateGame` handler was actually unused
The Frontend already filters this to only registered appNames Ideally this would be refactored to go in a Zustand store, but one thing at a time
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IPC type-checking has always been a bit of a hack job, this is a POC to improve it (for both us and our IDEs). Details are in the first commit message.
This will have issues right now, since I did not go through and convert everything to the new system (figured I'd get some opinions first).This should work fine, if the entire changelist is too overwhelming, you might want to only read until 6915bcb
Use the following Checklist if you have changed something on the Backend or Frontend: