jhugman / uniffi-bindgen-react-native

A uniffi bindings generator for calling Rust from react-native
https://jhugman.github.io/uniffi-bindgen-react-native/
Other
50 stars 5 forks source link

Partial support for duplicated symbols #143

Closed jhugman closed 3 weeks ago

jhugman commented 4 weeks ago

 According to The Big O of Code Reviews, this is a O(n) change.

This PR partially fixes #68:

The second part to fix #68 is a little more involved, but is not yet worth it:

Instead of:

import { Crate1 } from "./crate1";
import crate1 from "./crate1";

const { FfiConverterTypeCrate1 } = crate1.converters;

// In use
type MyType = {
  scalar: Crate1,
  optional: Crate1 | undefined,
  list: Array<Crate1>,
}

// FfiConverterTypeCrate1 being used.
const lift = FfiConverterTypeCrate1.lift.bind(FfiConverterTypeCrate1);

The next part needs to generate code:

import * as crate1 from "./crate1";

// In use
type MyType = {
  scalar: crate1.Crate1,
  optional: crate1.Crate1 | undefined,
  list: Array<crate1.Crate1>,
}

// FfiConverterTypeCrate1 being used.
const lift = crate1.converters.FfiConverterTypeCrate1.lift.bind(crate1.converters.FfiConverterTypeCrate1);

I think I will file a new issue with this in, and close #68.

jhugman commented 2 weeks ago

Swift work seems to being tracked in this issue.