jsonnull / electron-trpc

Build type-safe Electron inter-process communication using tRPC
https://electron-trpc.dev/
MIT License
269 stars 27 forks source link

TRPC 11.x.x (next) introduces breaking changes that will break electron-trpc #184

Open mat-sz opened 9 months ago

mat-sz commented 9 months ago

One of the breaking changes involves transformers, the error manifests itself on client side as:

Uncaught TypeError: Cannot read properties of undefined (reading 'serialize')

With this line being at fault: https://github.com/jsonnull/electron-trpc/blob/784bbb0cf45b0304c9f55bd9827a51c8dd3a5b6a/packages/electron-trpc/src/renderer/ipcLink.ts#L97

I've forked the repository and resolved the compatibility issues with the next version of TRPC: https://github.com/mat-sz/trpc-electron/commit/994bd4132850aedf5031ab402131bcfffa80825e

Since this is an unstable version of TRPC, I'm not submitting this as a pull request. If you'd like me to submit that in the future when 11.x.x becomes stable, please let me know; otherwise I'll continue maintaining this as a fork.

jsonnull commented 6 months ago

Hey, thanks so much for doing this! ❤️

I'm happy to accept your changes if you'd like to open a PR. Otherwise, I'll catch up with the latest TRPC in this repo soon.

mat-sz commented 6 months ago

@jsonnull Hey, thanks for getting back to me, I'll create a PR tomorrow with all of those changes.

mat-sz commented 6 months ago

@jsonnull Created a PR - #194

theorib commented 2 months ago

Just bumping this issue if that's ok. I know there's a PR already and adding support for TRPC v11+ and thus React Query v5 would be really welcome indeed :) I'm happy to help and test!

dsaltares commented 2 months ago

This PR worked for me with no issues. It'd be great if it could be merged. For now, I just copied the files locally and applied the patch. Otherwise, I would use this fantastic package!

nonua commented 1 month ago

I was going mad not understanding where this issue came from, I was able to make my app work by installing trpc packages back to version 10 and react-query to version 4 🥲

theorib commented 1 month ago

I was going mad not understanding where this issue came from, I was able to make my app work by installing trpc packages back to version 10 and react-query to version 4 🥲

Mean while until this PR is merged, @mat-sz has created his own npm package trpc-electron which addresses this issue. It's working well for me with TRPC v11 and React Query v5.