Uglified and minified takes it down to around 480k.
Gzip takes that to 140k and Brotli compression to 100k.
That's a lot to bootstrap an app with, but it's not unreasonable, considering what most frameworks these days will start you with.
Uglified and minified takes it down to around 480k.
Gzip takes that to 140k and Brotli compression to 100k.
That's a lot to bootstrap an app with, but it's not unreasonable, considering what most frameworks these days will start you with.
You can see this in the flutter_web/examples/gallery example. [`webdev build` failed for me in examples/gallery, so I'd love to see what a successfully minified version of that example looks like — I'm currently deeply skeptical.]
Compared to React/Vue/Angular and friends, this appears to be a monstrous outlier.
If you write something like:
import 'package:flutter_web/animations.dart';
void main() => print('Hello, World!');
DDC would faithfully compile animations.dart as whole and ship that to your browser.dart2js would include 0 bytes of code from animations.dart into the output.
> `webdev build` failed for me in examples/gallery
Maybe file a bug?
Here is what I get for Gallery:
╭─~/s/f/f/e/gallery ⟨master ⟩ ⟨9s449ms⟩
╰─» flutter packages pub global run webdev build
...
Compiled 18,344,245 characters Dart to 1,914,077 characters JavaScript in 27.9 seconds
If I gzip the output I get around 500k.Gallery uses a lot of Flutter so this is in some sense upper boundary for framework overhead.
Also it is still early days - I can clearly see this pushed down.
> Current advanced prototypes already show JS parsing improvements of 30%-50% on all the most common frameworks, just by changing the format, and we believe that we can increase this improvement much further.
30% is more than a bit :).
And it doesn’t help the time spent on compiling, so it’s saved not a lot of not a lot. Doesn’t really solve the problem.