This consolidates Rust build process for various codecs into a single top-level image that is built once and reused.
This ensures that we use same version of tools across codecs (now controlled from a single place), simplifies build configs and commands, speeds up common builds and reduces disk space taken by Docker images by reusing same one.
Additionally, this PR renames all codecs to squoosh-* to work around the https://github.com/rustwasm/wasm-pack/issues/829 (which has been already fixed on master of wasm-pack but not released in a while), as well as adds `publish = false` to Cargo.toml to avoid accidental publishing for now.
I'm planning to do similar for Emscripten in a separate PR, although abilities to share configs there are much more limited due to lack of package manager in C++.
This delegates loading of Wasm modules to Webpack itself, making wrapper code simpler.
Emscripten-generated modules are still using custom loading glue as they're not compatible with Webpack.
Nightly is no longer necessary for wee_alloc, so we don't need to rely on unstable versions of Rust anymore.
As a bonus, this reduces size of each Rust-related Docker image by >1 GB:
- `squoosh-rotate`: 2.94GB -> 1.87GB
- `squoosh-resize`: 3.09GB -> 2.02GB
- `squoosh-hqx`: 3.13GB -> 2.06GB
* Add sRGB -> RGB conversion before resize
* Add clamping for color space conversions
* Clip for demultiplication as well
* Fixing linear <-> srgb conversion
* Update benchmark
* Decouple srgb calculations
* Generate lookup tables
* Update src/codecs/resize/options.tsx
* Defaulting on, renaming, removing redundant state
* Implement alpha premultiplication
* Add benchmark to resize
* Only display "Premultiply alpha" if it's one of the rust resize types.
* Add comment about division by zero