-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Allow minification to be toggled for wasm builds #171211
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider removing the --minify flag in favor of the new ones? Thoughts, @kevmoo?
I think what I'm suggesting here is to rename Kevin's --minify flag to --minify-js (which is what it was actually doing), and introduce a new --minify-wasm.
My main concern was removing the flag if people are using it in a config somewhere. Perhaps we could start the process to remove the flag in a follow-up? |
The flag is recent and I wouldn't expect many people are using it. It also hasn't made it to a stable release yet. |
|
We should look to see when I put in |
|
Oh nice, I didn't realize it was new. I've gone ahead and removed it then. Thanks! |
mdebbar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good to me.
| const WasmCompilerConfig({ | ||
| super.optimizationLevel, | ||
| this.stripWasm = true, | ||
| this.minify = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set this to false or null for flutter run here:
flutter/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart
Lines 432 to 436 in 5b6b621
| return WasmCompilerConfig( | |
| optimizationLevel: 0, | |
| stripWasm: false, | |
| renderer: debuggingOptions.webRenderer, | |
| ); |
?
|
WAIT! Please double check when i added that flag! It's been a minute! Okay? |
|
WONDERFUL! Just wanted to be sure. Thanks, @mdebbar ! |
packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart
Outdated
Show resolved
Hide resolved
kenzieschmoll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple comments but lgtm
|
Thanks everyone! |
cd91249 to
bf04174
Compare
Provides extra minification controls for web builds. Updates the existing `--minify` flag to pass its value to both JS and wasm (instead of just JS). Also adds two new flags `--minify-js` and `--minify-wasm` which toggle minification for just one of the web targets. While JS minification has a huge impact on code size, wasm minification has a much smaller effect on the program's size. Since minification can obfuscate useful info (like errors) one may want to turn off minification for wasm but leave it on for JS. The plan is to temporarily use `--no-minify-wasm` for devtools to help debug some exceptions being seen. --------- Co-authored-by: Nate Biggs <natebiggs@google.com>
Provides extra minification controls for web builds. Updates the existing `--minify` flag to pass its value to both JS and wasm (instead of just JS). Also adds two new flags `--minify-js` and `--minify-wasm` which toggle minification for just one of the web targets. While JS minification has a huge impact on code size, wasm minification has a much smaller effect on the program's size. Since minification can obfuscate useful info (like errors) one may want to turn off minification for wasm but leave it on for JS. The plan is to temporarily use `--no-minify-wasm` for devtools to help debug some exceptions being seen. --------- Co-authored-by: Nate Biggs <natebiggs@google.com>
Provides extra minification controls for web builds. Updates the existing
--minifyflag to pass its value to both JS and wasm (instead of just JS).Also adds two new flags
--minify-jsand--minify-wasmwhich toggle minification for just one of the web targets. While JS minification has a huge impact on code size, wasm minification has a much smaller effect on the program's size. Since minification can obfuscate useful info (like errors) one may want to turn off minification for wasm but leave it on for JS.The plan is to temporarily use
--no-minify-wasmfor devtools to help debug some exceptions being seen.