Skip to content
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

Coverall2 and Rondpoint working with WASM! #191

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jhugman
Copy link
Owner

@jhugman jhugman commented Dec 18, 2024

This PR adds:

  • lowlevel structures
    • RustBuffers,
    • Floats and
    • c_void Void Pointers.
  • high level mechanisms to do in a browser context:
    • encoding and decoding strings, using TextEncoder and TextDecoder.
    • tie Objects into the Garbage Collector with a FinalizationRegistry.

This is in service of getting the rondpoint fixture running.

Several things to note here:

error: rondpointpm::Optionneur is a private type

Structs which derive the uniffi::Object currently need to have visibility pub. If they're not, then errors like: error: rondpointpm::Optionneur is a private type are shown.

This is due to uniffi-rs generating a public C ABI which uses the private struct as part of its trait bounds. This feels like it's a Rust bug (I hate saying that).

Next steps:

  • File an issue:
    • uniffi-rs could generate a simpler ABI which didn't contain the private type.
    • uniffi-rs could prevent non-pub structs
  • Document: uniffi-bindgen-react-native should add this to a trouble-shooting page.

Additing a procmacro version of rondpoint and coverall2

This is due to mozilla/uniffi-rs#2329 not yet being release.

Since we have now released to CocoaPods and npm, I can build against uniffi-main. This is o k a y for a little project like this, but I do worry about that a chem-spill requiring a rapid fix and release may get messy.

Default attribute values not seeming to work in proc-macro uniffi::Record

I don't seem to be able to get default attributes working for records going: as in the typescript isn't getting generated. If this is a bug, this is almost certainly a uniffi-rs bug. Will file.

@jhugman jhugman requested a review from zzorba December 18, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant