You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the wasm-pack executor directly runs wasm-pack, which requires to have wasm-pack installed globally. I think wasm-pack is available as an npm dependency, so it would be possible to run it with npx in the executor and avoid a global installation no ? Also, the npm dependency could be added by the wasm-pack generator.
Once the wasm package is generated by the executor, it is located in the dist folder and it can not be easily consumed from there by another js/ts app/lib of the repo. The easiest solution I found was to install the generated package as an npm dependencie. I don't know if it's a good practise, or if there is a more elegant solution. But if it appears to be a correct solution, maybe it could be added as an option to the wasm-pack executor ?
For now, I ended using nx-command to play arround the existing problems:
It's an easy fallback solution, but it would be awesome to have wasm-support with this plugin! I am willing to help and I can provide a pull request for the two enhencements if they're found to be relevant =)
The text was updated successfully, but these errors were encountered:
The whole wasm support wasnt finished, and definitely not tested properly. I want to finish support for it.
I'm holding off on finishing this until I refactor the plugin to work with project crystal in Nx. In essence, there's no executors, but we rather set up the commands behind the scenes like in the example you have with wasm-pack.
Currently I'm waiting for a new design/feature in Nx to provide multiple targets, so that projects can build with cargo, napi and wasm-pack, without having to specify it manually.
So hold off on making the PR yet, as the whole thing will change soon-ish.
I'll let you know when this is implemented with the refactor. 🙂
Hi everyone,
First, thanks for maintaining this package, it makes working with rust in nx really smooth =)
I tried to use the @monodon/rust nx plugin to work with wasm in an nx repository and I found some small bugs and maybe possible enhencements:
Bugs:
-p
parameter to provide the project root to the wasm-pack command. I think that PR fix(rust): wasm-pack arguments + fix libs/apps relative paths #22 fixes this.Enhancements:
wasm-pack
, which requires to havewasm-pack
installed globally. I think wasm-pack is available as an npm dependency, so it would be possible to run it withnpx
in the executor and avoid a global installation no ? Also, the npm dependency could be added by thewasm-pack
generator.For now, I ended using
nx-command
to play arround the existing problems:It's an easy fallback solution, but it would be awesome to have wasm-support with this plugin! I am willing to help and I can provide a pull request for the two enhencements if they're found to be relevant =)
The text was updated successfully, but these errors were encountered: