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

[wasm-bindgen-typescript] complete TypeScript parsing #234

Closed
spastorino opened this issue Jun 6, 2018 · 1 comment · Fixed by #1899
Closed

[wasm-bindgen-typescript] complete TypeScript parsing #234

spastorino opened this issue Jun 6, 2018 · 1 comment · Fixed by #1899
Labels
frontend:typescript Issues related to the typescript frontned to wasm-bindgen

Comments

@spastorino
Copy link
Contributor

spastorino commented Jun 6, 2018

wasm-bindgen-typescript just landed #228.

It will need to cover all the different constructions that TypeScript supports. In particular, this fa8961e#diff-7837f9f1900f30ff96bd2bbfe07a3f4eR30

The json format returned by api-extractor (the one that needs to be parsed) is defined in https://github.com/Microsoft/web-build-tools/blob/master/apps/api-extractor/src/api/api-json.schema.json

You can see a lot of examples of how this is accomplished with serde in this file fa8961e#diff-7837f9f1900f30ff96bd2bbfe07a3f4e

Feel free to ping me on twitter, IRC, email (spastorino everywhere) and I can provide more help to tackle this.

@spastorino spastorino added the frontend:typescript Issues related to the typescript frontned to wasm-bindgen label Jun 6, 2018
@spastorino spastorino changed the title [wasm-bindgen-typescript] typescript: complete TypeScript parsing [wasm-bindgen-typescript] complete TypeScript parsing Jun 6, 2018
@ctaggart
Copy link
Contributor

This looks cool. I helped write https://www.npmjs.com/package/ts2fable which generated F# Fable code based on the TypeScript. It gets pretty complicated. The approach I took was:

  • manually create the binding to the typescript.ts api
  • use the TypeScript API to read in the TypeScript definitions and generate bindings

After some work, I was able to generate binding for the TypeScript API itself and then we kept adding support for more and more language features and libraries.

It is a different approach that could work. Curious what you think. Another benefit is that you could also generate TypeScript code (and therefore JavaScript too) from Rust if you had access to its API.

alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Dec 4, 2019
This was added quite some time ago but never ended up progressing, so
let's delete it.

Closes rustwasm#234
Closes rustwasm#237
Closes rustwasm#238
Closes rustwasm#239
Closes rustwasm#240
alexcrichton added a commit that referenced this issue Dec 4, 2019
This was added quite some time ago but never ended up progressing, so
let's delete it.

Closes #234
Closes #237
Closes #238
Closes #239
Closes #240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend:typescript Issues related to the typescript frontned to wasm-bindgen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants