application-services icon indicating copy to clipboard operation
application-services copied to clipboard

Remove duplicate DeviceType enum from .udl files

Open mhammond opened this issue 3 years ago • 5 comments

This is the other half of #4397. I'm not sure how I feel about it - on one hand, killing the dupe from .udl files seems great! OTOH though, adding a new .udl file to sync15 that contains exactly 1 enum sounds a bit like overkill, and it doesn't look like it will be growing anything new any time soon. Another option might be to create a "common types" crate - but even then, the amount of sharing isn't that great (but stuff like Guid and JsonObject support could live there). But maybe that's even more overkill. Another option is to just wait for something to arrive organically and add it then?

Clearly not urgent though, so marking as a draft, but welcome all thoughts.

mhammond avatar Feb 23 '22 01:02 mhammond

doh - thread 'main' panicked at 'no support for external types yet' - IIUC, @bendk added support for kotlin recently, but swift doesn't yet have support, so this can't possibly land until it does.

mhammond avatar Feb 24 '22 01:02 mhammond

What if the shared/common crate also contained some functions? shutdown() and rc_log::log() would be good candidates. Maybe that makes it substantial enough to for a .udl file.

bendk avatar Feb 24 '22 14:02 bendk

What if the shared/common crate also contained some functions? shutdown() and rc_log::log() would be good candidates. Maybe that makes it substantial enough to for a .udl file.

Yeah - but where would it go? A new "utils" crate? That would lead to another odd situation where we have a crate just for the UDL and without any actual rust (other than the uniffi generated stuff)? (Not necessarily saying that's a problem, just that it seems slightly odd at first glance)

Didn't you have some use-case for a shared udl?

mhammond avatar Feb 24 '22 21:02 mhammond

It would be a crate for just the UDL. It does feel a bit odd, but I'd prefer it over having a bunch of small UDL files with 1 enum or 1 function.

bendk avatar Feb 25 '22 15:02 bendk

doh - thread 'main' panicked at 'no support for external types yet' - IIUC, @bendk added support for kotlin recently, but swift doesn't yet have support, so this can't possibly land until it does.

I couldn't find an issue for this, but I think it's still a limitation, so I opened https://github.com/mozilla/uniffi-rs/issues/1218

mhammond avatar Apr 21 '22 01:04 mhammond

Replaced by #5316

mhammond avatar Mar 27 '23 05:03 mhammond