-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce mls-rs-uniffi #82
Conversation
0051fe8
to
eed3186
Compare
To add more context to the sync build problems, the following code shows the issue and one not too satisfying solution. @stefunctional maybe you have ideas how to improve?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Martin! This will be super helpful. I had a couple of small comments.
fMeow/maybe-async-rs#24 should help with the interoperability between |
Thanks @stefunctional, that sounds great! I'll take a look! |
One question that I had as I prepared this PR: the code here started out as a wrapper around mls-rs which was called mls-lite. The goal of mls-lite was to further simplify the mls-rs API to just the bits needed for a messaging app. That was the "-lite" part of the name. At the same time, mls-lite was using UniFFI to expose an API for Kotlin/Swift/... apps. This is where the "-uniffi" part in this PR comes from 🙂 Are people here okay with mixing those two concerns? One concern of mine is that I also would like to use the API here for Wasm somehow. There is an issue open for this: mozilla/uniffi-rs#1424, but I believe the state is still experimental at best. So "-uniffi" suffix might be wrong for my Wasm plans. @mulmarta, you suggested moving the Thoughts on the above? |
This worked beautifully, I can now compile both with and without |
eed3186
to
3fd22c5
Compare
This version contains fMeow/maybe-async-rs#24, which should make it possible to combine UniFFI and maybe-async.
3fd22c5
to
5f9238b
Compare
Another thing @mgeisler there seems to be no way to |
This new create is a thin wrapper around mls-rs which exposes a subset of it’s interface using a [UniFFI-compatible][1] API. We will expand this over the next few weeks to be a full API usable by messaging apps on different platforms. [1]: https://mozilla.github.io/uniffi-rs/
5f9238b
to
8497736
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #82 +/- ##
==========================================
- Coverage 91.46% 90.73% -0.74%
==========================================
Files 168 169 +1
Lines 30306 30548 +242
==========================================
- Hits 27719 27717 -2
- Misses 2587 2831 +244 ☔ View full report in Codecov by Sentry. |
Issues:
Addresses #81.
Description of changes:
This new create is a thin wrapper around mls-rs which exposes a subset of it’s interface using a UniFFI-compatible API.
We will expand this over the next few weeks to be a full API usable by messaging apps on different platforms.
Call-outs:
The code currently only works withmls_build_async
, but this should be fixable in the future. From talking to @mulmarta, there should be a way to use traits to handle both cases.Is the name
mls-rs-uniffi
good? I hope to use the same API for Wasm laber, see #82 (comment) below.Testing:
I've mostly looked at the auto-generated Kotlin code to see that it has a useful shape. You can generate Kotlin code with:
The generate file is in
target/uniffi/mls_rs_uniffi/mls_rs_uniffi.kt
. If you install dokka, then you can generate API docs using adokka.json
file that looks like this:I would love to check it in if someone knows how to get rid of the absolute paths 😄
I expect us to add/remove things from the API in the next few weeks.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.