uniffi-rs icon indicating copy to clipboard operation
uniffi-rs copied to clipboard

Adding ADR on UniffiTag handling

Open bendk opened this issue 1 year ago • 2 comments

We've discussed this is various issues, most recently #1865. I think it's time that we have an ADR and discuss the question directly and by itself.

There's a lot more complex cases, for example structs/enums that contain fields with types from another crate. I don't think that affects the decision, but please tell me if I'm missing anything here.

bendk avatar Jan 06 '24 00:01 bendk

Pushed an edit to this that:

  • Uses Uuid and custom type handling as the example. I think this is closer to a real-world scenario.
  • Added an option for removing the tags altogether.

bendk avatar Jan 12 '24 21:01 bendk

I still think that Option 1 would be extremely annoying for larger projects consisting of multiple crates that don't need much or any bindings of independent external libraries.

Option 3 actually seems very interesting to me but involves a lot of extra work for reducing the boilerplate so I don't know how realistic it is short-term. If somebody wants to look more into boilerplate reduction for that option, I think #[serde(remote = "...")] could be an interesting case study.

Overall, especially because I don't have that much time to put into this, I (still) strongly prefer option 2.

jplatte avatar Jan 27 '24 13:01 jplatte