News for hackers. Stuff that matters.
Re:Flutter 2 by dstaley on Wednesday March 03, 2021 @02:35PM (#26333239)
Flutter for Web feels like such a wild step backwards in terms of functionality that I'm not sure the benefits it brings are worth it. I just tried a few samples, and basic interactions like selecting text, saving images, and opening links in new tabs don't work. This is the result of rendering everything to a <canvas> element. I'm much more interested in a React Native style approach, which seems to provide a consistent set of components that work the same on mobile, desktop, and web.
Re:Flutter 2 by tshaddox on Wednesday March 03, 2021 @02:46PM (#26333388)
Yeah, I haven’t been following Flutter, but I’m surprised their approach to the web is just shipping their entire custom layout/drawing code in WebAssembly and drawing everything with canvas. I would have expected them to actually port their native UI components (buttons, links, text, etc.) to their corresponding native components on the web, and maybe ship a custom layout engine if CSS layouts aren’t flexible enough.
Re:Flutter 2 by timsneath on Wednesday March 03, 2021 @03:01PM (#26333609)
We actually have two distinct approaches: the CanvasKit/WebAssembly approach you mention for high-intensity graphics, and an HTML-based renderer for other apps. This article has more details: https://medium.com/flutter/flutter-web-support-hits-the-stab...

You're right -- we do render the controls, so that existing Flutter code (that might itself include custom styling or matrix transforms) just runs without change or surprise, but we integrate with the underlying browser support for things like text autofill and accessibility.

Re:Flutter 2 by Hixie on Wednesday March 03, 2021 @03:18PM (#26333832)
We actually did try that as our first approach, but it really didn't give you the flexibility that Flutter developers expect.

As the erstwhile editor of the HTML standard for ~10 years and the now TL of Flutter I must admit that it's weird to be creating a web framework that completely ignores all the HTML stuff I worked on before. :-)

That said, Flutter is different from Flash in some important ways. Flash used the NPAPI to "break out" of the web and was basically "native" code you could escape to, whereas Flutter really is using web APIs, like Wasm, ARIA, WebGL, JS, WebComponents, and so on, to create true web apps that just happen to not use much of the control set that HTML exposes.

I suspect that even outside of Flutter, the web in general is going to move towards this kind of framework in the coming years. It just gives you so much more control. It's basically how every other platform works -- pick your language, compile to machine code, don't need to be limited to what HTML and CSS (etc) enable.

Re:Flutter 2 by shawnz on Wednesday March 03, 2021 @03:42PM (#26334169)
> to create true web apps that just happen to not use much of the control set that HTML exposes.

That is exactly defeating the point. Flash apps were also "true web apps" that only happen to use the "limited control set" of just <embed>.

> It's basically how every other platform works

That's why there has never been a UI toolkit as successful as the web.

Re:Flutter 2 by Hixie on Wednesday March 03, 2021 @05:35PM (#26335780)
> Flash apps were also "true web apps"

Not really. They were not portable. NPAPI was not a web standard in any meaningful sense (hint: the first N stood for Netscape).

> That's why there has never been a UI toolkit as successful as the web.

The web's success in terms of active users and in terms of deployed content is astounding, certainly. I think I'm relatively well placed to understand why, and I don't think it's because the web restricted developers to one scripting language or one set of controls. I think it is very much _despite_ that.

Re:Flutter 2 by ComputerGuru on Wednesday March 03, 2021 @03:26PM (#26333927)
Really not fair to compare against flash in this way when wasm wasn’t available and npapi was the only option. That is additionally an implementation detail, Adobe could (theoretically) revive and port flash to wasm today without breaking the majority of applications.
Re:Flutter 2 by Hixie on Wednesday March 03, 2021 @05:32PM (#26335729)
I would have had much less of a problem with Flash if it had been a runtime built with web technologies like that.
Re:Flutter 2 by BystanderX on Wednesday March 03, 2021 @06:07PM (#26336126)
So this is already a pretty toasty section of comments so let me put this to you. If you've already answered this elsewhere, please let me know.

I would be surprised if someone heavily involved in the Web's development process for a long time didn't have some really sore spots about it.

That aside:

--

What do you think of the loss of opportunities for learning and customization that moving to an opaque system running "in" the web (flutter) implies?

How did you get into the Web? Was being able to easily inspect and change what was happening in apps you didn't have intentional source access for (web pages/apps) not key to that?

Have you gotten value from the ability to quickly use others' extensions of useragent behavior that seem highly unlikely to work with this approach? Or will they be able to?

Fairly loaded questions I guess, but realistic ones too, not just philosophical.

Re:Flutter 2 by munificent on Wednesday March 03, 2021 @10:33PM (#26338289)
> Was being able to easily inspect and change what was happening in apps you didn't have intentional source access for (web pages/apps) not key to that?

I got into web design/programming in the 90s, and the answer is basically no. Sure you could poke around a bit, but I never found it to be a revelation. I still had to buy books, read blogs, and do a ton of trial and error. Also, it was a never-ending game of trying to testing to see what each new browser release added or broke.

We are in infinitely better position today thanks to open source. The "View Source" of today is GitHub. Want to write a high-performance dynamically typed language VM? Here: https://github.com/v8/v8 Build an operating system? OK: https://github.com/torvalds/linux Build a database? Here you go: https://github.com/postgres/postgres

Re:Flutter 2 by Hixie on Wednesday March 03, 2021 @07:10PM (#26336788)
> What do you think of the loss of opportunities for learning and customization that moving to an opaque system running "in" the web (flutter) implies?

Not sure what you really mean. If you mean the loss of "View Source" then I think we lost that a long time ago for anything but the most trivial of pages.

I used to say that view source was why the web was successful, and maybe it did help at the start, but I think we sailed past the point where view source stopped being useful years ago. Everything now is minified, and sites are too complicated for anyone to pick out what's going on from the original source let alone the actual served source...

> How did you get into the Web? Was being able to easily inspect and change what was happening in apps you didn't have intentional source access for (web pages/apps) not key to that?

I'm a weird case, I got into the web by reading the standards. (Then I got annoyed the browsers didn't follow them, so I got into browser QA. Then I got annoyed that the standards weren't clear enough to allow test cases to be written, and I started editing the specs.)

> Have you gotten value from the ability to quickly use others' extensions of useragent behavior that seem highly unlikely to work with this approach? Or will they be able to?

I have not. A lot of people do like extensions though.

Other platforms have managed to get concepts like extensions, e.g. on Linux (well, X really) I can replace my window manager, on Windows I can install DLLs that add features to Windows Explorer, on Android the "share" button can share to a list of applications, etc. There's lots of examples.

Re:Flutter 2 by BystanderX on Wednesday March 03, 2021 @07:59PM (#26337210)
Thanks for your reply.

> Not sure what you really mean. [...] sites are too complicated for anyone to pick out what's going on from the original source let alone the actual served source...

I agree, View Source itself has become less and less useful. The Devtools in most browsers have kept up fairly well though. They provide a lot of methods to understand, debug, and modify behavior of whatever you're running using HTML/CSS/JS, even if not perfect.

Perhaps if Flutter became mainstream enough that there's theoretically nothing stopping this from eventually happening for it as well. That's an interesting thought.

--

I suppose that leaves my last question, and it leans away from what might be a practical view from your position: Do you think flutter pushing for major market share while also trying to replace the core part of the web (HTML/CSS/JS -> Canvas renderer/wasm) is a good thing for the web's health and future?

(That's a good bit more philosophical, but I hope in #CURRENTYEAR we're starting to see value asking long-term questions like that, especially from inside of the giant companies. I'll stick to one of those kinds of questions)

--

> I'm a weird case, I got into the web by reading the standards. (Then I got annoyed the browsers didn't follow them, so I got into browser QA. Then I got annoyed that the standards weren't clear enough to allow test cases to be written, and I started editing the specs.)

That is interesting, thanks for sharing that.

> I have not. A lot of people do like extensions though.

Also interesting, fair enough.

> Other platforms have managed to get concepts like extensions, e.g. on Linux (well, X really) I can replace my window manager, on Windows I can install DLLs that add features to Windows Explorer, on Android the "share" button can share to a list of applications, etc. There's lots of examples.

Perhaps a good new question is what kind of tooling is available or planned for users to interact with Flutter applications? Such as what Devtools provide, or an expansion to them directly.

As a developer, the Devtools are absolutely critical to my workflow and ability to learn from and often fix issues I have with other sites.

(It could be pointed out that native applications don't tend to have that functionality, so it shouldn't be expected.. but in this context we're talking about effectively removing it from the Web, which does)

Re:Flutter 2 by Hixie on Thursday March 04, 2021 @06:30PM (#26350021)
I mean, I try to use Devtools on other sites, but I haven't really had any real success with that for years. I don't know how many of the rest of the web's ~4 billion users try to use DevTools but I can't imagine it's anything close to a majority. Or even a large minority.

FWIW Flutter isn't trying to replace the web. We're trying to offer a way of writing web apps that aren't really possible today. For example, something like the Flutter Folio demo, which works on multiple platforms including web, was written in a few weeks. I cannot fathom how I would do that without Flutter.

Re:Flutter 2 by oblio on Wednesday March 03, 2021 @04:03PM (#26334504)
Well, good luck maintaining all of that 10 years from now. I can bet on the web being around, well developed and maintained in 2031.
Re:Flutter 2 by Hixie on Wednesday March 03, 2021 @05:30PM (#26335713)
I'm not really sure what you mean by "all of that". What I described _is_ the web.
Re:Flutter 2 by oblio on Wednesday March 03, 2021 @05:55PM (#26336001)
It's painting stuff in a canvas and not using the standard web controls.

It's the web in the sense that almost every UI toolkit also offers a canvas (for example Tk does this) and you can reimplement every control using it. That doesn't make your new toolkit in a toolkit Tk.

Re:Flutter 2 by Hixie on Wednesday March 03, 2021 @07:12PM (#26336810)
But why would an app that writes to a WebGL canvas be any harder to maintain than an app that uses HTML controls? If anything, it'd be likely to be easier to maintain -- we (the web standards community) are much more likely to change how a particular element is supposed to work than to change WebGL in an incompatible way.
Re:Flutter 2 by oblio on Thursday March 04, 2021 @01:43AM (#26339376)
The app? It won't be harder to maintain, yes.

But the framework? That will have to be updated when each OS the framework runs on changes.

The HTML controls are used by a ton of stuff, so they're quite likely to be updated. Your framework? I have to really, really trust you that you'll update them.

Look at how Motif or GTK or AWT or Swing or Tk widgets look on modern OSes. There's an entire graveyard of cross platform UI libraries out there.

Re:Flutter 2 by baybal2 on Wednesday March 03, 2021 @02:48PM (#26333404)
Gtk tried the same with broadway. It went nowhere.
Re:Flutter 2 by agumonkey on Wednesday March 03, 2021 @03:06PM (#26333671)
Well they made libreoffice run in canvas IIRC, which is quite somewhere :D

But yeah it's not grabbing market share that's for sure.

Re:Flutter 2 by axegon_ on Wednesday March 03, 2021 @02:54PM (#26333504)
Annoyingly yes. If flutter web behaved like a true web(whether that be through building html elements or through canvas), it would have been a breath of fresh air and for once not a cluttered codebase of 8000 npm modules, html templates and a ditch full of css and no idea of figuring out which is which and which comes from where. I can kind of see a market for it in a sense that I don't want to install a separate app to track my shipment from a specific courier and have a web which is easily accessible on my phone but those are very narrow niches and honestly I can't think of a business that would invest into something like that for nothing more than accessibility. Aside from that I strongly stand by the statement that flutter is the best option for cross-platform mobile apps by a very long shot.
Re:Flutter 2 by whymarrh on Wednesday March 03, 2021 @03:02PM (#26333624)
> This is the result of rendering everything to a <canvas> element.

If the accessibility story isn't rock-solid, frankly this is a non-starter for a lot of applications. Web apps suck in a lot of ways but regular HTML has pretty great accessibility properties.

Re:Flutter 2 by K0nserv on Wednesday March 03, 2021 @05:25PM (#26335640)
It is far from rock-solid. It's shockingly bad in fact.
Re:Flutter 2 by Spivak on Wednesday March 03, 2021 @02:51PM (#26333457)
I guess it's just the two ways of approaching a problem. Make native look like web or make web look like native. Both are kinda bad.

The labyrinthine rats nest of absolute hot garbage to beat a document rendering engine into a windowing toolkit with widgets is horrible. It's a testament to front-end devs that with enough effort you really can squeeze water from a stone.

And then imagine being so comfortable navigating that maze that you want your windowing toolkits to behave more like document rendering engines pretending to be windowing toolkits.

And you're like "why not just have a windowing toolkit for the web and sites can choose their rendering engine basically so all the SPAs get all the nice features of stack-based GUIs and document people get documents. Surely that would be less work!" And I think you're right but I doubt anyone would agree on a single toolkit so now you can just bundle your own compiled to wasm and rendered to canvas. Woooo.

Re:Flutter 2 by dhbradshaw on Wednesday March 03, 2021 @03:01PM (#26333608)
They were pretty clear about the intention here: make the web available as a platform for running mobile and desktop-style apps.

If you're trying to create a classical website, it's not the right tool. Use html and css. If you're trying to make a rich app, I'd bet on Flutter.

I'd be interested in seeing it become easier to make a combination of the two -- flutter apps embedded in classical websites.

Re:Flutter 2 by rbinv on Wednesday March 03, 2021 @03:03PM (#26333637)
> flutter apps embedded in classical websites.

Sounds like Java applets.

Re:Flutter 2 by mohaine on Wednesday March 03, 2021 @03:09PM (#26333714)
Which mostly died from JVM startup time (Think 30 + seconds). There was other issues as well (security and UI issues mostly) but if you knew what you were doing, Java applets were not bad for the time IF the JVM as already loaded.
Re:Flutter 2 by rexelhoff on Wednesday March 03, 2021 @03:03PM (#26333642)
Welp. We can kiss accessibility goodbye then, can't we?
Re:Flutter 2 by eseidelGoogle on Wednesday March 03, 2021 @03:10PM (#26333737)
[Flutter Eng. Dir. here]

Accessibility is actually a really big deal here on Flutter (Ian Hickson and I both worked on Accessibility in browsers for years). AX is something I feel we've done pretty well with on iOS and Android. Web is still pretty early days, but many AX features should work already. We have more AX work to do on web yet. We've not yet taken any Flutter Web apps through Google's accessibility testing processes similar to how we've done on the mobile side, but I expect we will soon.

Re:Flutter 2 by matchbok on Saturday March 06, 2021 @01:48AM (#26365700)
Translation: No. and flutter sucks.
Re:Flutter 2 by refulgentis on Wednesday March 03, 2021 @02:56PM (#26333540)
Things changed a lot, I observed the same symptoms as late as late 2020, I can't reproduce these issues now

In general Flutter for Web is _amazing_ if you want to deploy an app.

after seeing this thread, pretty clear to me its almost a perfect nerdsnipe - makes perfect sense if you're already building a Flutter codebase, sounds bonkers if you build web apps.

Re:Flutter 2 by dstaley on Wednesday March 03, 2021 @03:01PM (#26333605)
Check out Flutter Folio [1], built in partnership with Google. Right-click is actually disabled, so you can't even open the "Create account" link in a new tab, nor can I right click an input to autofill with my password manager. You can't inspect any image rendered to the canvas element. Furthermore, you also can't blur the form input (although that's probably application specific rather than Flutter's fault).

[1] https://www.flutterfolio.com/#/?

Re:Flutter 2 by yjbanov on Wednesday March 03, 2021 @03:20PM (#26333861)
(disclaimer: I work on the Flutter team)

The "Create account" link isn't popping up the right-click menu because it doesn't use the Link widget. You'd get the same thing in plain HTML if you used a <div> with a custom click event listener instead of <a>. It's a simple bug to fix; totally up to the app developer. I think issues like that will inevitably pop-up as we have developers coming to the web from other platforms, where "open in new tab" isn't part of the toolkit. Perhaps it's fixable via education and platform-specific guidelines.

We're aware of the input blur issue. I think the bug is in the TextEditable. You can write your own, of course, but since we offer it as part of the Flutter framework, it's on us to fix.

Re:Flutter 2 by capableweb on Wednesday March 03, 2021 @03:55PM (#26334378)
> You'd get the same thing in plain HTML if you used a <div> with a custom click event listener instead of <a>. It's a simple bug to fix; totally up to the app developer

This is the issue. Instead of having one codebase that works the same on all platforms (ios, android and web), you get (as a developer) the blame for not implementing things correctly across the different platforms.

Instead of a cross-platform development environment doing that for you.

Re:Flutter 2 by refulgentis on Wednesday March 03, 2021 @07:35PM (#26337028)
I have to be honest, not trolling at all, genuinely curious to me: I have the same opinion for the completely opposite reason! _without_ "Skia everywhere", Flutter for Web was annoying, because then there was this autogenerated CSS/JS and it might be _close_ to other Flutter platforms, but it often couldn't be 100% of what it was

I think its because we might be seeing it from two different points: i.e. you see Flutter Web using Skia is not consistent with _other websites and thus traditional webapps_, I see that Flutter Web using JS/HTML made it _not consistent with deployments of the same Flutter code to Android/iOS/Mac_

Definitely see that viewpoint and why it's problematic, would argue as an independent dev, would care much more about 100% self-consistency across my product line up for ease of support than whether people open the app in a web browser, you can right click on anything that looks like an image and download it.

Understand that viewpoint _also_ sounds like sacrilege, but as someone raised on iOS dev, reminds me of when Mac devs being upset over years as "iOS-isms" made their way to the desktop. I love that this approach is an example of solving hard problems over years, fixing a industry-wide yak shave that ended with you having 50 copies of chromium. solves the same problem Electron is solving with none of the downsides

Re:Flutter 2 by singhrac on Wednesday March 03, 2021 @03:46PM (#26334221)
> Perhaps it's fixable via education and platform-specific guidelines.

I think this is right, but I also think it should be clear to everyone (i.e. in the first tutorial) that not using a Link widget will make this work wrong for all sorts of accessibility and UX reasons. And the Link widget should work across platforms and implement the equivalent of page history correctly.

Maybe it's worth writing down somewhere what the equivalent of each tag from HTML is; what is the canonical way to create an h2, input, textarea, button, a, img, etc.

Re:Flutter 2 by capableweb on Wednesday March 03, 2021 @03:03PM (#26333631)
> I can't reproduce these issues now

dstaley just said that those issues happen now. " I just tried a few samples, and ..."

I just tried the demos over at https://flutter.github.io/samples/#?platform=web and I concur, Flutter is utterly horrible for everything the web stands for. So not amazing and seems to actively make everything worse.

Re:Flutter 2 by yjbanov on Wednesday March 03, 2021 @03:28PM (#26333953)
(disclaimer: I work on the Flutter team)

We certainly don't think Flutter should replace HTML or other frameworks. We hope Flutter will work well for many use-cases, but the web is huge. There's room for multiple approaches. If it's not working for your use-case it's totally fine with us if you use something else. We welcome constructive feedback on what's not working so we know where to focus our efforts.

Re:Flutter 2 by capableweb on Wednesday March 03, 2021 @03:53PM (#26334348)
Thanks! A great first step would be to have a "web-native" renderer for your web version. Meaning that it'll use DOM elements that the browser to handle the rendering of. Would fix many of the current issues with your implementation.
Re:Flutter 2 by realusername on Wednesday March 03, 2021 @03:11PM (#26333742)
I have a large Flutter codebase and flutter web is still alpha quality in my opinion, there's way too much jank to make it work properly on a web platform.
Re:Flutter 2 by yjbanov on Wednesday March 03, 2021 @03:21PM (#26333870)
Have you tried --web-renderer=auto?
Re:Flutter 2 by agumonkey on Wednesday March 03, 2021 @03:05PM (#26333652)
Funny how two days ago some webdev website made a big article about flutter vs kotlin but didn't mention the UX side of it at all.
Re:Flutter 2 by fwip on Wednesday March 03, 2021 @02:48PM (#26333409)
The example spinner ( hhttps://flutter.dev/#dartpad-landing-page ) also looks pretty choppy on my Macbook Pro 16. I haven't tried on lower-specced devices, but it doesn't inspire a lot of confidence.
Re:Flutter 2 by timsneath on Wednesday March 03, 2021 @02:51PM (#26333450)
Yeah, that's running in development mode, since it's a scratchpad for live coding. Try something like https://flutterplasma.dev for an example of Flutter's web support when compiled in release mode.
Re:Flutter 2 by krasin on Wednesday March 03, 2021 @02:58PM (#26333559)
Thanks for the link. To confirm the point of copying text being broken: try doing that at https://flutterplasma.dev/ -- it kind of works, but not really, no.
Re:Flutter 2 by renewiltord on Wednesday March 03, 2021 @03:02PM (#26333628)
Ah fuck me. This is awful. You have to be precisely on the text to select it. I frequently offset my mouse a little to the left of the element to ensure I select the whole text. Even a little bit off to the left and nothing.

I love the idea, but this sounds like it's going to be unpleasant for me. Hopefully they figure out these UX things.

Re:Flutter 2 by vincnetas on Wednesday March 03, 2021 @03:38PM (#26334087)
Yeah, tiny differences that would nag the hell out of me. For example double clicking for selecting word is implemented, but triple clicking to select whole line is not implemented ;(
Re:Flutter 2 by kemayo on Wednesday March 03, 2021 @03:45PM (#26334218)
Ew, you can't select across lines of text, even.
Re:Flutter 2 by mkl on Wednesday March 03, 2021 @04:39PM (#26334987)
I don't think that shows off Flutter's web support. There are no interactive widgets or user interfaces (Flutter's primary purpose?), and the animations are less impressive than demos in DOS from ~30 years ago, e.g. https://en.wikipedia.org/wiki/Second_Reality
Re:Flutter 2 by aden1ne on Wednesday March 03, 2021 @03:47PM (#26334251)
This took about 30 seconds to load on a Galaxy S7 Edge (yes, I know, ancient technology in 2021) with Firefox. I briefly thought the tab had crashed.
Re:Flutter 2 by fwip on Wednesday March 03, 2021 @05:10PM (#26335409)
Thanks for the tip, but the compiled version exhibits the same juddering/choppiness for me, most noticeably in the rotations.
Re:Flutter 2 by hobofan on Wednesday March 03, 2021 @02:57PM (#26333557)
Yeah, that's still not great on a Macbook Air 2014. I'd even say that the spinner at the end looks even choppier.
Re:Flutter 2 by tmoravec on Wednesday March 03, 2021 @03:15PM (#26333784)
iPad Safari on 200/100Mbps connection.

* The page takes about 20s to load.

* After pressing Run, nothing happens for 10s, then Click me! text appears.

* On clicking the text, nothing happens.

* On clicking it a few times, the page crashes and reloads.

Re:Flutter 2 by vsmenon on Wednesday March 03, 2021 @04:53PM (#26335196)
[ disclaimer: I work on the Dart team. ]

As timsneath mentioned above, Dartpad is the dev environment. That means we ship the full Dart and Flutter SDK ahead of time as you can type/change anything in the code box. We also ship debug metadata to give better errors.

In production mode, we do a much more expensive compile to remove the parts of Dart, Flutter, and packages you don't use and to optimize/minify the rest.

It is working in Safari for me, but we've definitely appreciate bug reports if it's breaking for you (https://github.com/dart-lang/dart-pad in this case).

Re:Flutter 2 by AlphaSite on Wednesday March 03, 2021 @03:49PM (#26334283)
Also pinch to zoom is broken.
Re:Flutter 2 by AlphaSite on Wednesday March 03, 2021 @03:49PM (#26334277)
It break pinch to zoom in mobile safari, does anyone at google spend even a minute using anything but chrome?
Re:Flutter 2 by merrvk on Wednesday March 03, 2021 @03:09PM (#26333721)
Doesn’t seem to work at all for me on an iPad
Re:Flutter 2 by lucasmullens on Wednesday March 03, 2021 @02:43PM (#26333336)
Is that the CanvasKit renderer or the HTML renderer?
Re:Flutter 2 by dstaley on Wednesday March 03, 2021 @02:49PM (#26333433)
I hope it's CanvasKit because if those interactions are also broken in the HTML renderer that's even worse!
Re:Flutter 2 by yjbanov on Wednesday March 03, 2021 @03:30PM (#26333981)
(disclaimer: I work on the Flutter team)

There's no difference between CanvasKit and HTML as far as interactions are concerned. The differences are in pixels and performance. If there are issues with interactions, we'd like to hear about them. Please file issues on Github.

Re:Flutter 2 by merrvk on Wednesday March 03, 2021 @03:06PM (#26333676)
Yep, I’ve been really impressed with react native on the web so far. Our current code base deploys across Android, iOS, web and windows with minimal effort.