Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minification removing wasmbindgen getters #761

Open
dt665m opened this issue Apr 7, 2024 · 3 comments
Open

Minification removing wasmbindgen getters #761

dt665m opened this issue Apr 7, 2024 · 3 comments
Labels
disposition:close The tagged item can probably be closed

Comments

@dt665m
Copy link

dt665m commented Apr 7, 2024

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

@ctron
Copy link
Collaborator

ctron commented Apr 10, 2024

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.

@dt665m
Copy link
Author

dt665m commented Apr 12, 2024

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.

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.

@ctron
Copy link
Collaborator

ctron commented Apr 23, 2024

I am leaning towards closing this one, as it not directly a trunk issue, and the minification defaults will change in 0.20.0.

@ctron ctron added the disposition:close The tagged item can probably be closed label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition:close The tagged item can probably be closed
Projects
None yet
Development

No branches or pull requests

2 participants