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

Test TypeScript output on CI #922

Closed
alexcrichton opened this issue Oct 3, 2018 · 5 comments
Closed

Test TypeScript output on CI #922

alexcrichton opened this issue Oct 3, 2018 · 5 comments
Labels
testing Testing of wasm-bindgen itself

Comments

@alexcrichton
Copy link
Contributor

There have been a number of TypeScript-related regressions recently like #917, and while we used to test TypeScript on CI we no longer do! We should figure out how to set up a dedicated builder focused on testing the TypeScript output of wasm-bindgen!

@emk
Copy link

emk commented Oct 3, 2018

A great idea!

The following issue contains some instructions on how to get async loading working with TypeScript and Webpack, which would allow testing the entire compilation process from end-to-end: rustwasm/rust-webpack-template#43

@emk
Copy link

emk commented Oct 3, 2018

And as mentioned in that issue, if you'd like, I can try to take a look at setting up an example TypeScript+Rust+Webpack project which can be built using npm run something sometime this coming weekend.

@alexcrichton
Copy link
Contributor Author

A nice idea! I think it's good to have a test like that but for this repository we can probably just stick to the vanilla typescript compiler and a sample project

I'd be wary of coupling to too many things outside of wasm bindgens control

@emk
Copy link

emk commented Oct 3, 2018

My recent experience is that if I just check run wasm-bindgen and tsc, there's still a really impressive number of ways that everything can silently produce broken output. (And it feels like I've hit most of them getting this to work.) In particular, the async module loading code requires cooperation from all 3 of wasm-bindgen, tsc's esnext support, and webpack, and it's easy for one tool to be silently out of alignment with the other 2.

In a perfect world, something would run webpack and make sure that everything all hooks up together. Basically, my goal here is to be able to upgrade wasm-bindgen and expect everything to still work. But there's an excellent argument to be made that this is an "integration" or "acceptance" test, and that as such, maybe it belongs in a new rust-webpack-typescript-template repository somewhere.

Still, I'd love for wasm-bindgen to "just work" with TypeScript. And I suspect that it may be hard to guarantee that without a good end-to-end test somewhere.

What would be the most useful way for me to approach this goal?

@alexcrichton
Copy link
Contributor Author

Oh well I think the priority here is getting something tested, so I'm fine getting that done however and then we can tweak it as necessary!

alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Mar 5, 2019
This commit starts to add some simple tests for our TypeScript output of
the wasm-bindgen CLI, currently just running `tsc` to make sure syntax
looks good and types are emitted as expected. This'll hopefully be able
to get expanded over time with bug reports as they come in as well as
ensure that we don't regress anything in egregious manners!

Closes rustwasm#922
alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Mar 5, 2019
This commit starts to add some simple tests for our TypeScript output of
the wasm-bindgen CLI, currently just running `tsc` to make sure syntax
looks good and types are emitted as expected. This'll hopefully be able
to get expanded over time with bug reports as they come in as well as
ensure that we don't regress anything in egregious manners!

Closes rustwasm#922
alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Mar 5, 2019
This commit starts to add some simple tests for our TypeScript output of
the wasm-bindgen CLI, currently just running `tsc` to make sure syntax
looks good and types are emitted as expected. This'll hopefully be able
to get expanded over time with bug reports as they come in as well as
ensure that we don't regress anything in egregious manners!

Closes rustwasm#922
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Testing of wasm-bindgen itself
Projects
None yet
Development

No branches or pull requests

2 participants