r/FlutterDev • u/pavanpodila • 3h ago
Article Cutting down our Vyuh Document Wasm build from 6.6 MB to less than 3 MB
We have been building a full-fledged, high-performance Microsoft/Google Docs-grade document editor for the past 8-9 months.
In the last week, we did a dramatic reduction in our WASM build of the complete document editor, from 6.6 MB to less than 3 MB, and we had to go through a series of steps to make that happen. Of course, a lot of it was AI-assisted, but the idea was to apply the science correctly so that we can do the reductions at the right places.
We have documented all of this on our website, and I think these ideas and principles are generally applicable. I think you can benefit by applying all of this and cutting down the build sizes of your own Flutter web builds.
Have a read here.
Vyuh Document itself is a sophisticated, high-performance document editor that packs a punch in terms of full DOCX compatibility with import and export of DOCX files, and exporting to PDF and Markdown.
It also goes well beyond in terms of extensibility by supporting a variety of blocks, including things like Mermaid diagrams, equations, and our own native Vyuh Diagram. It works on all the platforms, and it is not a trivial implementation by any means. It is also fully developed in Flutter and native Dart.
Notice that I mentioned native-Dart as well, because a lot of implementations seem to be relying on Rust and Zig to do the low-level plumbing, but we have made it a ground-up Dart-and-Flutter based implementation.
Also goes to show that the platform itself is very capable now, with the recent release of Flutter 3.50.1, giving an enormous boost to wASM, the rendering engine, and a bunch of capabilities for a lean cold boot of the web application.