-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add binding docstrings #512
base: main
Are you sure you want to change the base?
Conversation
651e063
to
b0883a9
Compare
@@ -17,7 +17,8 @@ breez-sdk-liquid = { path = "../core" } | |||
log = { workspace = true } | |||
uniffi = { workspace = true, features = [ "bindgen-tests", "cli" ] } | |||
# Bindgen used by KMP, version has to match the one supported by KMP | |||
uniffi_bindgen = "0.25.2" | |||
uniffi_bindgen = { workspace = true } | |||
uniffi_bindgen_kmp = { version = "0.25.2", package = "uniffi_bindgen" } |
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.
With the new uniffi_bindgen_kmp
, is the uniffi_bindgen_kotlin_multiplatform
below still necessary?
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.
I had to split the use of uniffi_bindgen
because of compatibility issues, so uniffi_bindgen_kmp
is uniffi_bindgen
0.25.2 for use with uniffi_bindgen_kotlin_multiplatform
.
I will play around a bit more to see if I can get them to use the same uniffi_bindgen
.
// BEGIN sdk-common mirror imports | ||
// These are structs defined in sdk-common, which we want to make available in this project's UDL bindings | ||
|
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.
Could these lines be preserved? They would make life easier in the future when dealing with mirror structs.
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.
These comments where breaking uniffi when followed by a docstring e.g.
// BEGIN sdk-common mirror imports
// These are structs defined in sdk-common, which we want to make available in this project's UDL bindings
/// Wrapper for a BOLT11 LN invoice
dictionary LNInvoice {
I'm not sure why, I can remove the LNInvoice docstring if its important.
Is this an improvement if I comment the end of the block? 6caddd9
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.
@@ -242,13 +388,21 @@ dictionary CurrencyInfo { | |||
sequence<LocaleOverrides> locale_overrides; | |||
}; | |||
|
|||
// END sdk-common mirror imports |
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.
Same as above.
For example:
// END sdk-common mirror imports
// --------------------------------------------------------
// BEGIN sdk-common wrappers
// ...
Related to breez/breez-sdk-greenlight#781 |
This PR is to support including docstrings defined in the Uniffi UDL file to be included in bindings that are generated from it.
There is a lot of changes to the boilerplate code on upgrading the React Native codegen to 0.25.0, we also have to bring in changes to the Swift and Kotlin codegen. You can find the meat & potatoes of the changes here:
Adding these changes also enables docstings to be used in C#, Go, Kotlin, Python & Swift generated bindings.
For example
Adding to the UDL file:
Generates jsdocs: