feat: add ts-rs mapping to our jrpc #915
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
ts-rs
crate is very helpful but it has some downsides (bugs).If you want to generate new mappings. You have to run test with feature ts without integration test :
cargo test --workspace --exclude integration_tests export_bindings --features ts
. This will run only the ts-rs exporting. But there is a catch, some of the structs are export to wrong directory (dan_layer\bindigs
). You have to manually move them to the/bindings
folder. Don't forget to run prettier afterwards.Probably not all settings are exported to typescript correctly. We will fix once we start replacing the
any
s in the webui projects.Motivation and Context
It seems like you can change the
export_to
path to get it into the right directory. But then thets-rs
will panic (because the are expecting that each struct is on the same level.... Maybe in the future version it will work.Breaking Changes