second-state / rustwasmc

Tool for building Rust functions for Node.js. Combine the performance of Rust, safety and portability of WebAssembly, and ease of use of JavaScript.
https://www.secondstate.io/articles/rustwasmc/
Apache License 2.0
130 stars 10 forks source link

File for definition types not generated #4

Closed eliorivero closed 4 years ago

eliorivero commented 4 years ago

Hi, I see that they were intentionally removed in

https://github.com/second-state/ssvmup/commit/b761c8b6c39c9c4cc67bd5475861835fcb7cd152#diff-3b7d580454f5224e58f3687e4eb6568fR102

Is there any way to generate them?

Thanks!

juntao commented 4 years ago

We can certainly add them back. Maybe add a command line switch for ssvmup. The reason we removed them is that we want a minimum set of files for simple use cases.

Can you describe why you need those files? The use case will help inform us how to best handle this. Thanks.

eliorivero commented 4 years ago

I guess it's not needed after all. I wanted to have them for VS Code but th JSDocs are fine anyway. I compared how the code hinting looks for a JS file that only has JSDocs:

Screen Shot 2020-07-20 at 10 36 18

and one that has JSDocs and also *.dt.s (generated using wasm-pack):

Screen Shot 2020-07-20 at 10 37 22

There's almost no difference, except for the const in one that is property in the one with *.dt.s.

juntao commented 4 years ago

Thank you. This is good to know.