You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typescriptify-golang-structs: Probably the most popular choice. The downside of this package is that it relies on reflection rather than parsing, which means that certain things can't be kept such as comments without adding a bunch of tags to your structs. The CLI generates a Go file which is then executed and reflected on, and its library requires you to manually specify all types that should be converted.
Security Considerations
n/a
Scaling Considerations
n/a
Test Plan
Needs to work in CI and dev workflow
Upgrade Considerations
n/a
The text was updated successfully, but these errors were encountered:
Reusing mature go->ts tools seems more feasible than building go->patterns tooling. But if we can build patterns one way or another and then generate types from such patterns (#6160), we should be able to test that the types generated from go and the types generated from patterns match reasonably well.
What is the Problem Being Solved?
Golang defines structure that the JS bridge receives, but they aren't typed on the JS side.
E.g. https://github.com/Agoric/agoric-sdk/blob/0af17b23935ff210d0e4f69e8f7d2f4079d09689/golang/cosmos/x/swingset/keeper/proposal.go#L9-L27
The lack of a type leads to re-implementing them: https://github.com/Agoric/agoric-sdk/blob/master/packages/vats/src/core/chain-behaviors.js#L60-L68
In that case it's a one-off. #8544 defines them more centrally, but still manually by adapting the Golang source.
Description of the Design
Generate the types automatically from the Golang source.
Perhaps using https://github.com/gzuidhof/tygo
An alternative,
Security Considerations
n/a
Scaling Considerations
n/a
Test Plan
Needs to work in CI and dev workflow
Upgrade Considerations
n/a
The text was updated successfully, but these errors were encountered: