trunk
trunk copied to clipboard
Minification removing wasmbindgen getters
Describe the Bug
This issue was first filed at wasm-bindgen here. It seems like someone there found that the minifier that trunk uses is removing some of the getter JS emitted by WasmBindgen in Release mode.
Steps to Reproduce
- wasm-bindgen 0.2.92
- I'm using OSX Sonoma on Apple Silicon and Chrome 123.x
- clone this minimal repro
- install trunk
cargo install --locked trunk - serve with
trunk serve - open browser at
localhost:8080. Observe console log of "hello world" - serve with
trunk serve --release - open browser at
localhost:8080. Observe console log of "function...."
Expected Behavior
Debug and Release should be the same
Actual Behavior
Differing results in Debug and Release. See this comment
As trunk only calls minify-js, I think you would need to raise an issue with them: https://github.com/wilsonzlin/minify-js
With trunk, you can disable minification in release builds, using data-no-minify on assets or --no-minification globally.
As trunk only calls
minify-js, I think you would need to raise an issue with them: https://github.com/wilsonzlin/minify-jsWith trunk, you can disable minification in release builds, using
data-no-minifyon assets or--no-minificationglobally.
Agreed, I have also made an issue over there. However, the issue being here is still valuable as maybe a discussion can be had to disable minification by default when building for release. It seems like this isn't the only issue with minification. There is at least #750 and #758 on the first page besides this one. Perhaps it can also be documented somewhere that debug and release may have dragons because of unstable minification since it is enabled automatically.
I am leaning towards closing this one, as it not directly a trunk issue, and the minification defaults will change in 0.20.0.