Initial draft of adding TypeScript types#181
Merged
ianthetechie merged 11 commits intostadiamaps:mainfrom Oct 8, 2024
Merged
Conversation
Contributor
|
tsify might be another option to look into. |
eea95c0 to
f983a71
Compare
Contributor
Author
|
Force pushed to use the latest main branch HEAD as a base. The originial edits of this PR remain unchanged. |
Contributor
|
Thanks! I'l ltry to get back to this one within the next week :) |
Contributor
|
I'm marking this ready for review, as I think I've got it to the point where it seems to 1) work, and 2) is producing verifiably useful improvements! There are definitely still some more TODOs in terms of type mapping to TS, but as web isn't a core focus area for any of the core devs, I think we can merge this sooner to start getting the benefits and improve TS defs gradually over time (I can open an issue if you guys agree). |
ianthetechie
approved these changes
Oct 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This draft PR is based on the other PR I have now.
This draft is incomplete and and further discussion is needed.
In the latest commit of this PR/branch, the crate
ts-rsis used to generate TypeScript type declarations from serde macros. Upstream git repo is used instead of the crates.io releases due to some features not yet available in the releases. (see Aleph-Alpha/ts-rs#316)The generated type declarations are not yet well integrated with wasm-pack artifacts, and function types still use
any. Additionally, to generate the type declarations, you need to runcargo testbefore runningwasm-pack.