refactor: unify preload rpc and renderer service types - #181
Merged
Conversation
h4yfans
marked this pull request as ready for review
April 8, 2026 22:15
This file contains hidden or 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
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.
What
Unify desktop RPC ownership by introducing a dedicated
@memry/rpcpackage, generating the preload RPC bridge from that catalog, and switching the renderer tasks/notes/inbox services over to canonical RPC and contract types.Why
The preload layer, contracts, and renderer services were each maintaining overlapping transport and DTO definitions. This phase reduces duplication, makes the IPC boundary explicit in one place, and prepares the architecture reset work to build on generated RPC bindings instead of hand-maintained wrappers.
How
packages/rpcas the transport catalog for notes, tasks, inbox, and settings domains.apps/desktop/src/preload/generated-rpc.tsfrom the RPC catalog and wired desktop IPC generate/check scripts through it.window.apiextends the generated RPC surface instead of redeclaring those domains/events separately.window.apibacked by canonical@memry/rpc/@memry/contractstypes.Type
refactor— restructure without behavior changefeat— new featurefix— bug fixstyle— visual/UI onlyperf— performance improvementtest— adding or updating testschore— tooling, deps, configdocs— documentation onlyci— CI/CD changesTest plan
Manual checks run:
node --experimental-strip-types --experimental-transform-types --input-type=module -e "...import generated-rpc.ts and the rewritten service modules..."node --experimental-strip-types --experimental-transform-types --input-type=module - <<'NODE' ... createGeneratedRpcApi smoke checks for uploadAttachment/deleteAttachment/getPositions/importFiles/trackSuggestion/getStartupThemeSync ... NODEnode --experimental-strip-types --experimental-transform-types --input-type=module - <<'NODE' ... renderer service smoke checks with mocked window.api ... NODEgit diff --checkBlocked:
pnpm-based verification is not runnable in this worktree becausenode_modulesis missing; the earlier attempt failed before tests withCannot find module 'better-sqlite3/package.json'.Checklist