Tomek Czajecki @tchayen.com · May 5

I don't know how I survived this long recompiling WASM binary after every change but I finally wrote a mini Vite plugin for HMR. Now when I change anything and save the file, WASM module is automatically compiled and reloaded.

7 likes 2 replies

?

Replies

Andri Óskarsson · May 5

That's really cool. What are the advantages of using Zig for web pages like this?

Tomek Czajecki · May 5

I have a 'wasm' command declared in package.json which compiles the binary and places it in web/bin. Plugin is listening for changes in zig/ and runs that command. Finally handleHotUpdate() notices that a *.wasm file changed and sends HMR to the browser.