You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should look into creating a single module on the foreign side that holds all shared functionality: RustBuffer, Future handling code, etc. There would be a couple advantages to this:
Smaller bindings
Simplifies compatibility issues with external types. With our current system, we create a separate RustBuffer class for each module, which makes using an external type weird since it each module uses a different RustBuffer.
Simplifies global callback registration, for example the foreign executor callback that we used to have.
The text was updated successfully, but these errors were encountered:
In our setup, instead of running uniffi in a single step at the very end of the compilation process, we run it directly on the intermediate rlibs of each uniffi library. The current issues we've seen with this approach are:
uniffi will always re-generate bindings for all upstream uniffi libraries at every step; and
each module has its own RustBuffer/Primitive/Future handling code.
For 1., we only extract the generated module of the current uniffi library and ignore the rest.
For 2., it's unclear to us at this point if these duplicate implementations increase the final binary size, or if the foreign language's compiler and/or linker allow for deduplication. We will eventually need to investigate this, as we've found that splitting a single uniffi library into two different libraries with the same surface API increased our binary size significantly.
We should look into creating a single module on the foreign side that holds all shared functionality: RustBuffer, Future handling code, etc. There would be a couple advantages to this:
RustBuffer
class for each module, which makes using an external type weird since it each module uses a differentRustBuffer
.The text was updated successfully, but these errors were encountered: