5 ms·
No, performance and fidelity are definitely better with the canvas renderers, especially skwasm. Flutter is very inspired by React, but instead of React which d
by _bent 2y ago
No, performance and fidelity are definitely better with the canvas renderers, especially skwasm.
Flutter is very inspired by React, but instead of React which does tree diffing to minimize rebuilds, Flutter tries to make rebuilds as cheap as possible instead - for example through its single pass layout algorithm.
The issue is that this doesn't map well to the DOM.
You can't rebuild cheaply on the DOM because you'd be constantly updating the DOM. And you don't profit from your simpler layout, because you have to implement it in JavaScript and use absolute positioning on all DOM Elements to lay them out.
I do agree that this all absolutely sucks for websites, but if you're building an App that is supposed to run in the browser like Rive or Figma, where you're going to override all click handlers anyways, or where where what you're rendering would be too much for the DOM, Flutter Web is pretty ok.
- dleeftink 2y agoI'm sure this is tried (I've done it myself), but a hybrid approach would take best of both worlds; heavy rendering on a canvas, the rest as SVG/DOM elements. Even this relation can be inverted: to speed up SVG interactions, I pre-render complex path and text elements at a sufficient resolution, which are shown during transitions/user interactions, but replaced with the SVG original elements once the render loop settles down again.
- charrondev 2y agoI went and loaded up the flutter web demo on my iPhone 15 Pro https://flutter.github.io/samples/web/material_3_demo/ https://flutter.github.io/samples/web/material_3_demo/ In addition to the pitfalls mentioned like being unable to select text, every interaction including scrolling is noticeably laggy and dropping frames.
- Philpax 2y agoWow, you weren't kidding: same phone and it feels like I'm using a 15-year-old Android. That's rough.
- johnisgood 2y ago> unable to select text Because of this alone I would not use.
- johnecheck 2y agoIt's just not the default. As the developer, it's trivial to make text selectable.
- johnisgood 2y agoI meant it as an user.
- johnecheck 2y agoFair. If that's the deciding factor on whether you use a computer program, that's your prerogative. I assume, then, that every app on your phone allows you to select every bit of text in it?
- deleted 2y ago[deleted]
- johnecheck 2y agoCool. Was hoping to discuss the different expectations we have for a program obtained through a web browser than one obtained through an app store, but I guess downvoting is easier. ¯\_(ツ)_/¯
- tabinno 2y agoIf the developer has decided you are not allowed to, then you can’t really blame the tool he’s using…
- johnisgood 2y agoI do not blame the tool, but I will avoid using it as long as I am unable to select text. Additionally, see: https://news.ycombinator.com/item?id=43215065 https://news.ycombinator.com/item?id=43215065
- tabinno 2y agoYou should not blame your lack of knowledge on the tool.