oscartbeaumont / tauri-specta

Completely typesafe Tauri commands
MIT License
291 stars 27 forks source link

New Command System #12

Closed Brendonovich closed 2 months ago

Brendonovich commented 1 year ago

Tauri will be retiring the macro-based command system at some point https://github.com/tauri-apps/tauri/issues/3256

Brendonovich commented 1 year ago

This poses a significant problem compared to the current approach, and the only solutions I can think of are:

  1. We provides a wrapper around the command builder that is specta-aware,
  2. We require specifying commands a second time in either a macro or function like happens now, or
  3. This is retired and becomes the specta feature of Tauri, which brings its own challenges in enforcing conditional trait requirements since cmd_* should only require SpectaFunction if the specta feature is enabled.

If approach 3 is taken then Tauri would need to conditionally compile multiple versions of cmd_* (which could result in a combinatoric explosion if more features were added to Tauri) or use proc macros to generate different implementations of cmd_* based on what features are enabled.

Alternatively we could just not support the new command system and push people to use rspc, Tauri will be building basically the same thing - only thing missing from rspc is one time commands.

oscartbeaumont commented 2 months ago

I'm closing this because Tauri are getting close to release and I don't think this is happening anymore.