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

Remove the need for `[External]` and `typedef` UDL definitions

Open bendk opened this issue 11 months ago • 3 comments

We currently need these for a few reasons and I'm hoping to make them all obsolete.

  • To know which UniffiTag system to use. This won't be necessary after #1865.
  • To specify the bridge type for custom types. This is no longer needed now that #2150 is merged.
  • To know the FFI type when lowering. However, this can be determined using the proc-macro metadata and we're already translating all UDL definitions to proc-macro invocations.
  • To fill in required fields for the uniffi_meta types. We can avoid this by making uniffi_udl generate its own types, rather than the uniffi_meta types. We don't need to all of that data, we just need to enough to generate the proc-macro calls. One side benefit of this is that we could remove fields in uniffi_meta that only exist to support uniffi_udl (example)

The only downside I can see is that maybe the error messages will get worse if you misspell a type. I'm not too worried about this since I'm more and more convinced we should be pushing users away from UDL anyways.

bendk avatar Nov 09 '24 17:11 bendk