DEV Community

Discussion on: Parcel and Rust: A WASM Romcom

Collapse
 
jonknapp profile image
Jonathan Knapp

Thanks for the post! I went through a similar experience getting my wasm/Rust app started; having a desire to cut back on the number of npm dependencies needed to run/build a primarily wasm application.

In the end, I went with a home-rolled setup using nginx (in Docker) and a Procfile to run cargo watch and wasm-pack. Getting the perks of hot reloading/ease of use with a Parcel/Webpack setup is the direction I would point others in though.

Interestingly, the number of dependencies that need to be installed to build a Parcel app is larger than a barebones webpack app. That led me to snowpack, but it seems to be right in the middle of a v2 transition and the docs for writing plugins are not there yet. I'm interested to see where it goes though as I'm a fan of fewer moving parts/pieces.

Collapse
 
alexeales profile image
Alex Eales

Glad you like the post! I think I was going down the same path as you with Docker at one point but hastily escaped that rabbit hole but sounds like you found a nice solution with it!

That is a interesting investigation I forgot to look into, I would expect that this is due to Parcel coming pre-bundled with a few plugins and dependencies out of the box than barebones WebPack, something for me to consider in the future!

I had never heard of snowpack before seeing this but sounds and looks really interesting I will have to give this a look for a project I'm about to start! :)

Collapse
 
jonknapp profile image
Jonathan Knapp

The code's at github.com/CoffeeAndCode/remnant-c... if you're interested, but I would not recommend it's current state. It currently lints/tests before building which is way too long to wait for new wasm builds. Also, for a better Docker solution I'd package more of the build/web server into a single Docker container for ease of installation.

I believe you're right on the install size differences. Parcel is trying to make a better dev experience which doesn't include finding an array of packages to install then digging through docs on how to use them.

Snowpack seems interesting, but make sure it fits your end goals before investing too much. It's goals are a bit different than the other packagers out there.

Thanks again!