#TauRPC - A typesafe IPC layer for Tauri applications

8 messages · Page 1 of 1 (latest)

midnight salmon
#

Hey there! I have created a plugin that allows you to use Tauri's command and event system with TypeScript types. In my opinion, the existing invoke() API doesn't give me the best experience since there is no type-safety. This project generates the corresponding TS types for your API to use on the frontend.

GitHub Repo: https://github.com/MatsDK/TauRPC

This is a project that I am actively working on. So, feedback or features that could improve the project are always welcome.

GitHub

Typesafe IPC layer for Tauri applications. Contribute to MatsDK/TauRPC development by creating an account on GitHub.

random spruce
midnight salmon
#

I haven't, thanks for sharing. I am currenty using ts-rs for generating the types, but specta seems like a more elegant solution.

random spruce
#

Ohhh didn't notice you're using ts-rs under the hood, interesting

#

Also I saw you mentioned nested router stuff, would it still follow the same trait-based approach or something like https://www.rspc.dev/ ?

midnight salmon
#

I haven't thought much about this yet, but it seems with the way it's currently setup that it would be the easiest to merge different routers(trait implementations) with a path prefix. So maybe something like https://www.rspc.dev/server/router#merging-routers seems possible.

The best way to build typesafe APIs between Rust and Typescript.

#

The idea is to call these nested methods with a proxy-like client like trpc client on the frontend.

random spruce
#

Makes sense, I think rspc will get a proxy-based client eventually but it's too much work atm