Well, the feature are same as rollup-plugin-rust.
Unlike rollup-plugin-rust, there is no main dependencies for this project. I actually want to make rust-native-wasm-loader as the main dependencies just like rollup-plugin-rust but I can't do that because Jest only support synchronous transformation and doesn't have intention to support asynchronous transformation. This is why I rewrote some functions of cargo.js in rust-native-wasm-loader to became synchronous one (see cargo.ts file).
CI and Build tools
Linter and Static type-checker
Since I had bad experience with Flow because it keep eating my RAM unpolitely 😂, I use Typescript as replacement. Typescript has their own linter called TSLint which mean I don't need ESLint that I setup in rollup-plugin-rust.
The test framework I used for this project is of course Jest running on Nodejs v8 or higher. The reason the minimum Nodejs is not v6 because the WebAssembly support begins in Nodejs v8. For the approach, I implement 2 kinds of test: unit-tests and smoke-tests. The unit-tests use Jest which automatically confirms that the generated code can be run in Nodejs ≥8.x. The smoke-tests itself written as example-stencil-rust (linked as git submodule) which automatically confirm that it can be used in the real project. There is weird setup for the unit-tests itself because I want to test the edge case just like how ts-jest approach it. I rely the test-cases pretty much on the fixtures which cause the number the test cases are pretty minimum. At this moment the test-cases are only one but it testing 6 fixtures 🤔.
- cargo-cli-wrapper : Since most functions inside cargo.js in rust-native-wasm-loader are asynchronous functions while Jest don't support asynchronous transformation, I need to create wrapper that export both synchronous and asynchronous function (pretty much like fs-extra). Maybe I can make the function much simpler and have additional features and controls.
- Seems I need to get in touch with the maintainer of rust-native-wasm-loader after the
cargo-cli-wrapperwas released and see if he also want to maintain or use it.
How to contribute?
Just DM's me, make a Github issue or writes a comment below if interested. For guidelines, see Contributing section (contribution is always welcome so don't be afraid to make mistakes 🙂).
Reminder for myself! When you want to place comment of some code refences from Github, use copy permalink instead of copy line. This is what I found in most ts-jest codebase 😂
Parting words: by the way, where can I get
supported by utopian.iobadges 😅