Skip to content
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

Initial draft of adding TypeScript types #181

Merged
merged 11 commits into from
Oct 8, 2024

Conversation

CatMe0w
Copy link
Collaborator

@CatMe0w CatMe0w commented Aug 12, 2024

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-rs is 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 run cargo test before running wasm-pack.

@ianthetechie ianthetechie self-requested a review August 12, 2024 16:57
@ianthetechie
Copy link
Contributor

tsify might be another option to look into.

@CatMe0w
Copy link
Collaborator Author

CatMe0w commented Aug 26, 2024

Force pushed to use the latest main branch HEAD as a base. The originial edits of this PR remain unchanged.

@ianthetechie
Copy link
Contributor

Thanks! I'l ltry to get back to this one within the next week :)

@ianthetechie ianthetechie marked this pull request as ready for review October 7, 2024 04:03
@ianthetechie
Copy link
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 ianthetechie merged commit 6b1d3cb into stadiamaps:main Oct 8, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants