r/programming • • May 07 '19

Flutter for Web (technical preview)

https://flutter.dev/web
24 Upvotes

42 comments sorted by

View all comments

19

u/dwighthouse May 08 '19

We’ve come full circle, I see.

3

u/MachoAlpha May 08 '19

How many of these "native" frameworks do we have already? I was never interest in web development but lately I've tried to learn something new and chose the web (the biggest platform ever). Seriously how come we are still using JavaScript ? And why are we compiling everything to JavaScript ? And why web assembly still needs JavaScript ?

These UI toolkits, frameworks (angular react Vue ... And whatever) will always output 1MB of JavaScript for a simple hello world.

-1

u/Darkglow666 May 08 '19

Even if web frameworks really did produce 1MB of code for "Hello, World" (they don't), it would still be short-sighted to complain about it. The framework code only has to be included once, no matter how big your app gets. So you may end up with a big toy app, but with a real app, that framework code saves you from writing all kinds of code, so as the app grows, things even right out.

Furthermore, Dart has a fantastic compiler that does aggressive tree-shaking, making sure only code that gets used is included in a build.

1

u/virtualistic May 08 '19

(disclaimer: I work on Flutter for web)

I'm not sure what your application's size constraints are, but FWIW, Flutter for web "hello world" app start with ~150KB gzipped when compiled in release mode. We haven't done any code size optimizations yet (focused on rendering correctness, feature completeness, and performance). We get this size purely from dart2js's dead code elimination capabilities. Obviously, the more widgets you use, and the more application logic you write, the bigger the JS bundle (for example, the Gallery sample app, which uses nearly every widget in Flutter's toolkit, is ~500KB).