-
Notifications
You must be signed in to change notification settings - Fork 253
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
extract ABI primitives into near-abi-rs #889
Conversation
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.
A couple of nitpicks, looks good otherwise. Thanks for cleaning up the visitor pattern. That was originally written when we considered applying the ABI macro to mod
sections instead of impl
sections.
near-sdk/Cargo.toml
Outdated
[dependencies.near-abi] | ||
git = "https://github.com/near/near-abi-rs" | ||
branch = "miraclx/init" | ||
features = ["__chunked-entries"] | ||
optional = true |
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.
Everything seems fine, just want to make sure this doesn't come in until it points at a release (so blocked on near/near-abi-rs#1)
/// ``` | ||
/// will produce this struct: | ||
/// ```ignore | ||
/// near_sdk::__private::AbiFunction { | ||
/// name: "f3".to_string(), | ||
/// doc: Some(" I am a function.".to_string()), |
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.
Curious why the initial space isn't removed from these comments. I know unrelated, just wondering if an issue should be opened up. cc @itegulov
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.
The initial space comes from here:
/// I am a function
^
I left all original indentation intentionally as it is not clear on what exactly should be deleted. schemars actually tried doing some heuristics here, but they later realized that it does not suit all use cases and can even mess up markdown (see GREsau/schemars#38 (comment)). Specifically, here trimming all lines can mess with code indentation in ```
blocks. So I feel like post-processing should be left to the user depending on their use case as it is easy to remove unwanted stuff but impossible to deduce what stuff has already been removed by us.
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.
yeah, my assumption would be that just the first space would be trimmed, don't have opinions of any other line. Seems like that first space will always exist and might be a strange side-effect for those consuming it. Not blocking
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.
Hmm, I guess that is fair. I assumed that since Rust keeps this leading space when passing it to macros, you could technically do ///this is doc
, but yeah I would not be opposed to trimming it.
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'll just open an issue, and we can do it in a separate PR or close it if we don't want to do it. Super minor and opinionated
@austinabell anything blocking from your side? The near-abi dependency now points to a git rev which should be good enough IMO |
I can't do another pre-release until this points to a released version. We can do this in two-steps, where the SDK is left in an intermediate stage, or just release it and point to that (even if a pre-release). I'll leave that call to @miraclx |
Yeah, work on this PR is pretty much done. We can merge this right away and then wait for |
near/near-abi-rs#1