3 ms·
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
by tshaddox 6y ago
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.
- baybal2 6y agoGtk tried the same with broadway. It went nowhere.
- agumonkey 6y agoWell they made libreoffice run in canvas IIRC, which is quite somewhere :D But yeah it's not grabbing market share that's for sure.
- timsneath 6y agoWe 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-stable-milestone-d6b84e83b425 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.
- Hixie 6y agoWe 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.
- ComputerGuru 6y agoReally 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.
- Hixie 6y agoI would have had much less of a problem with Flash if it had been a runtime built with web technologies like that.
- shawnz 6y ago> 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.
- Hixie 6y ago> 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.
- oblio 6y agoWell, good luck maintaining all of that 10 years from now. I can bet on the web being around, well developed and maintained in 2031.
- Hixie 6y ago