Closed jhugman closed 1 month ago
So change looks good.
I think if there are situations where we NEED the object and the interface is insufficient, we should probably keep them as separate names (prefix I, suffix Type, something like that).
If we can always just refer to them through the interface, then I think the same name is fine (though by no means required, feels like the internet is of two minds as to whether doing the same name thing is cool or bad)
I've kept the Interface
split here because I couldn't implement the interface without ts wanting me to extend it.
When defining a new class, uniffi-bindgen-react-native routinely generates an interface.
By convention, we're calling this
FooInterface
.When a method on a
FooInterface
returns another object, or accepts an object as an argument— sayBar
— prior to this commit, both theFooInterface
and the concreteFoo
type would use the concreteBar
.This changes this, to use the interface name.
This makes it easy for creating mocks and dummy interfaces.
Question:
I notice that the
type
and theclass
namespaces seem to be disjoint, so this is valid:Should I make these the same names? If keeping them different, what should they be?
If they are different, and we want to keep this commit, then other questions need to be thought about:
FfiConverter
which now accepts an interface, but can only handle a concrete type? Does it really matter, given that it will only cause a failing test?/cc @zzorba WDYT?