wasmerio / wasmer-js

Monorepo for Javascript WebAssembly packages by Wasmer
https://wasmerio.github.io/wasmer-js/
MIT License
898 stars 76 forks source link

[SDK-43] Re-work the build system and compiled artifacts for `@wasmer/sdk` #371

Open Michael-F-Bryan opened 7 months ago

Michael-F-Bryan commented 7 months ago

We currently allow users to import two different versions of the @wasmer/sdk package,

We also produce these versions of the package in 3 different module formats,

This causes quite a few usability problems.

The biggest one is that, out of the box, you can almost never get @wasmer/sdk to load the right wasmer_js_bg.wasm file because of bundler weirdness, so the package becomes unusable without a lot of hacking.

I think we should change it so the bundled version is the default and people can import @wasmer/sdk/slim if they want to use the thin version. That will also give us a chance to mess around with the "slim" version a bit more without pushing out releases that break the package for everyone.

We might also want to consider switching to vite and using their ?url imports rather than depending on rollup or assuming where the wasmer_js_bg.wasm file will be placed by the end user's bundler.

A good resource for doing this sort of thing is Recommendations when publishing a Wasm library

CC: @syrusakbary

SDK-43

linear[bot] commented 7 months ago

SDK-41 Re-work the build system and compiled artifacts for `@wasmer/sdk`