JonasKruckenberg / tauri-sys

Bindings to the Tauri API for projects using wasm-bindgen
Apache License 2.0
84 stars 21 forks source link

Tauri 2 compat ? #54

Open jrouaix opened 2 months ago

jrouaix commented 2 months ago

Hello, we are trying to use this crate with Tauri 2, the command invoke seems to work. Now the event part ... fail. Do you think about maintaining these binding to Tauri 2 ?

(saying that with all due respect for the hard work you provided, and thankfull. I shamefully do not feel myself skilled enough to help, nor have time to give on this quest, and only can apologize for that :pray: )

jrouaix commented 2 months ago

Perhaps it will part of https://github.com/tauri-apps/tauri-bindgen goals ?

bicarlsen commented 3 days ago

I spoke with some on the Tauri team and tauri-bindgen is mostly meant for internal tooling, and doesn't yet support v2.

I've started working on the v2 api here: https://github.com/bicarlsen/tauri-sys. I'll probably only implement things as I need them, but am happy to accept PRs.

@JonasKruckenberg Because the v1 and v2 apis are so different, I'm not sure what the best organizational method for the crate is. Options I can think of are:

  1. Separate v1 and v2 with feature flags. Could get a bit messy because we then need two flags for the apis, but a user will only ever need one version. e.g. event-v1 and event-v2. This would also be a breaking change.
  2. Separate v1 and v2 at a certain version. e.g. All versions 0.1.x are for the v1 api and 0.2.x is for the v2 api. Comes with all the obvious pitfalls related to the semantic meaning of the versioning. Could be confusing for users in the future, but seems nicest for greenfield projects once Tauri v2 is main. (This is what I did in my fork)
  3. Make a new crate for the v2 api.
madeofpendletonwool commented 2 days ago

Hi @bicarlsen, thanks for starting this! There's for sure a need for this project to continue especially as wasm gets better and better. I maintain an app that uses the fs and tauri features and am eager for v2 support. I'd be happy to help you with development and assist with building those out. I'll go ahead and give it a fork and get to work!

jrouaix commented 2 days ago

I wonder if this shouldn't be part of the tauri's team burden to provide a rust api. But in the same time, Tauri2 heavily rely on plugins JS injection ? So we are now talking about making

m'I right ? (sounds like a clusterf... of problems ahead)

Don't they rely on the ".wit" contract definitions ? Perhaps be could leverage on this api specs and generate JS/TS/Rust/... from this ?

bicarlsen commented 2 days ago

@jrouaix You are correct, but as I said above the tauri-bindgen project isn't ready for v2 and has been dormant for quite some time according to those I spoke with on the Tauri team. This crate is meant to act as a stopgap for the moment until something more robust can be created.

Always happy to hear suggestions on other options.

In terms of it being the Tauri team's burden, from what I understand many (all?) of those working on the project don't get paid for it, and I'm sure this isn't at the top of their priority list for the v2 release (otherwise they would have implemented it). So given that they haven't done it yet, it's nice that we can build it ourselves until they release something official.

JonasKruckenberg commented 1 day ago

Hey guys, so first off awesome initiative!

As you have probably noticed I don't have the time to maintain these Tauri related tools as much as I used too, though revisiting tauri-bindgen is on my backlog (depending on a few internal factors at work)

that being said, I'd be happy @bicarlsen to make you coowner of this repo and make your endeavor "official" (as much as that is a thing at least) I think the best strategy while v1 is still widely used is to have separate branches for v1 and v2.

The goal of the tauri-bindgen project btw is to make that maintenance burden as small as possible bc i do believe Rust bindings is something that should be officially supported

madeofpendletonwool commented 1 day ago

That's great! I love the idea of this picking back up. I'll make a fork of this repo directly then and pr directly into it. Yay for open source!

bicarlsen commented 1 day ago

@JonasKruckenberg Yeah, I'd be happy to help out :)