r/webdev • • May 07 '19

News Flutter for web (preview) is imminent (Google I/O 2019)

https://flutter.dev/web
50 Upvotes

18 comments sorted by

11

u/dryadofelysium May 07 '19

Make sure to watch the Google I/O developer keynote and especially the Flutter - Beyond Mobile session soon after in the livestream in about 10 hours!

And keep an eye out for: https://github.com/flutter/flutter_web :)

7

u/Baryn May 07 '19

That Dart still exists blows my mind. Not in a good way.

1

u/[deleted] May 07 '19

[removed] — view removed comment

12

u/Baryn May 07 '19

It's like a weird JavaScript from Universe B. To be clear, it's a fine language, but I don't think it adds anything meaningful to Web development, and its adoption hasn't exactly been gangbusters.

Flutter would certainly be more popular if it used JavaScript.

5

u/Hixie May 07 '19

(I'm the Flutter TL.)

We used JS for Flutter initially. We considered a lot of languages, including JS, and Dart was really the one that was the best fit for what we wanted to build, so that's what we ended up going with. I have to say, I've been very happy with it.

That said, I think it would definitely be possible to write something like Flutter using JS, and I would encourage people to do so.

2

u/Baryn May 07 '19

Thanks for your input. If you released a Flutter.js somewhere down the line, I would certainly be interested.

1

u/[deleted] May 08 '19

The transition is trivial - particularly if you already know Typescript.

1

u/Baryn May 08 '19

I don't want to transition. :)

1

u/DiscombobulatedSalt2 May 21 '19

It was a good choice. Dart is better than JS in a lot of ways as a developement tool.

I hope one day Dart supports also WebAssembly output for high performance stuff on the web. Not needed yet tho, or ready for it.

1

u/DiscombobulatedSalt2 May 21 '19

The language is perfectly fine, better than JS. You mean adoption wasn't stellar, that happens even to best products. But tech is good and stable for long time. Ecosystem, tooling and libraries obviously are richer in the nose/Js world right now, but a lot of stuff is not needed in Dart, and rest is just a matter of time. There are things in Dart than js will never have.

I wouldn't touch flutter if it was in JS. It would just be react native basically, with no real value.

0

u/[deleted] May 07 '19

[deleted]

0

u/Baryn May 07 '19

That's subjective

0

u/[deleted] May 07 '19

[deleted]

1

u/Baryn May 07 '19

Is it because of typing?

4

u/filleduchaos May 07 '19

No, it's not just because of typing, and honestly it amazes me that so many people seem to think that the only difference between languages is their typing discipline

Off the top of my head Javascript's inability to be ahead-of-time compiled (and thus reliance on JavaScriptCore) is an immediate performance dealbreaker, and the Dart VM has priorities that most JS implementations don't. Compile-time constants, operator overloading (for equality) and proper mixins aren't absolute requirements but the framework uses them so heavily that it most likely would be pretty awkward to write in JS. And so on.

2

u/LowB0b May 07 '19

I want to say it's because it never gained any popularity... Like nobody uses it, except at google (who also made the language). F.ex. google's angular framework also works with dart instead of typescript, but I have never really heard of anyone using angularDart. Their "default" documentation on angular.io is for typescript.

0

u/[deleted] May 07 '19

[deleted]

6

u/webdevnick22 May 08 '19

The angular devs must have wanted their framework to actually get used.

1

u/eggtart_prince May 08 '19

I don't feel this is necessary unless it offers something that the popular frameworks today isn't offering already. It just adds another required skill to an employer's job posting.

1

u/onestepNP May 18 '19 edited May 18 '19

What it offers is one codebase for cross platform development. On mobile, unlike React Native, flutter is compiled using C++ so it gives better native performance. It has AOT and JIT to enable hot reloading, and library support is actually nicer. For web, flutter is still in it's really early stages though, so time will tell. And it's also targeting desktop for all platforms. As of now, no other framework offers this.

1

u/DiscombobulatedSalt2 May 21 '19 edited May 21 '19

I was kind of excited when I saw the demo. Unfortunately it is very limited and not very web-like.

It uses A LOT of canvas and CSS transforms. A bit too much for my taste. Even icons are not translated to IMG elements but instead drawn into canvas by flutter engine. Text selection using native browser stuff is not possible. Element inspection is really hard because everything is hidden from a browser behind canvas draws. Half of the flutter built-in widgets doesn't really work (that is fixable tho). Keyboard navigation doesn't work. Even simple arrow keys don't work when navigating. Tooltips doesn't show on mouse hover. Accessibility is very limited, well non existent at the moment.

On tooling side the statefull code hot-reload isn't supported. It might be possible in the future, but I would say it is really tricky.

I real wish it was somehow smarter and gave up pixel perfect rendering on mobile and web, and instead made it more web like, with good user expirience and map more stuff to real HTML elements and CSS classes (maybe without animation support). In the future something similar to react hydration would be awesome , once Dart and flutter also catch up on server side.

Plus you need download ~5GB of software to start coding, and about 10GB of disk space for everything. It is a bit crazy. Snack.expo.io for react narive is amazing. I started coding in 2 minutes!

Flutter web looks to me more like Qt/QML. And I hate it.

Also I do not like statements from flutter Devs (or PR and docs), claiming that flutter is declarative and not imperative. No sorry, it is fully imperative and almost zero declarativeness, especially in terms of layout. It also isn't static, but fully dynamic. It isn't bad thing, but it can't be called declarative. Much better word to use is "intent-based".