7 ms·
I was hoping to see better HTML rendering. Using a single canvas to render web apps was my one turn off. Flutter is the right choice for many apps, but not for
by ipnon 4y ago
I was hoping to see better HTML rendering. Using a single canvas to render web apps was my one turn off. Flutter is the right choice for many apps, but not for apps primarily accessed over the Web.
- potatoman22 4y agoIMO it's most useful for more compute intensive web apps like an image editor.
- simulate-me 4y agoWhat’s wrong with using a single canvas? It can be faster. Google Docs and Figma, for example, use canvas rendering
- strix_varius 4y agoBoth Google docs and figma use canvases, but neither of them renders the whole app through a canvas. This is easy to verify - just open up dev tools and look at the DOM structure.
- slibhb 4y agoI just checked and Google Docs is not a single canvas. It uses a canvas for the text but all the tools and so on are good old html.
- mhoad 4y agoBelieve it’s a work in progress https://workspaceupdates.googleblog.com/2021/05/Google-Docs-Canvas-Based-Rendering-Update.html?m=1 https://workspaceupdates.googleblog.com/2021/05/Google-Docs-...
- dmitriid 4y ago> What’s wrong with using a single canvas You can't even select and copy text. And canvas is inaccessible to screen readers
- the_duke 4y agoFor accessibility they create a separate DOM tree just for screen readers.
- steve_adams_86 4y agoAre there declarative and performant ways to synchronize a canvas with a DOM tree? Maybe the answer here is obvious but this seems like quite a bit of overhead, both for developers and the browser.
- 10000truths 4y agoDo they need to be synchronized? I can’t imagine that a screen reader would be sensitive to millisecond-level discrepancies between canvas updates and DOM updates.
- steve_adams_86 4y agoI’m not concerned about the delay between updates, it’s the correctness of the DOM and the canvas and managing interactions between the two. I might be misunderstanding the problem (or lack thereof) because I haven’t dealt with accessibility and canvas. When it comes down to it, I have no idea how you’d indicate something is selected in the canvas and have a screen reader correctly read out the current selection from the DOM. Would DOM events communicate to the canvas how to modify state, functions to call, etc? How would you manage focus between the canvas element and the rest of the DOM? Apologies if I’m not making sense; maybe there’s a well known pattern people use for things like this. My understanding of accessibility relies heavily on the DOM behaving as a single document, and the idea of a sort of meta-document within it which coordinates pieces of the documents seems very complex and hard to get right.
- SemanticStrengh 4y agoat this point you'd better get rid of the canvas
- 4y ago
- kolanos 4y agoBoth are pretty disastrous accessibility-wise.
- SemanticStrengh 4y agono canvas are slower for UIs. The difference is between immediate vs retained mode rendering, and the later is order of magnitude more energy efficiency and is more performant, for well behaving not chaotically changing content.
- gitgud 4y agoAlthough it may render faster, it comes at a cost, as it completely circumvents what browsers are good at. Flutter is basically just painting pixels on a canvas manually, meaning no CSS, no text selection, no text wrapping, no responsive elements, no elements without JS enabled. Many accessibility tools rely on CSS and text in HTML in order to work too. It's a huge trade-off to make, and something to be aware of.
- LocalPCGuy 4y agoHeavy emphasis on HUGE tradeoff. Too much for most web apps, IMO.
- busymom0 4y agoCanvas has accessibility issues for screen readers as well as for SEO purposes.
- kevincox 4y agoBecause it destorys native browser features. For example find-in-page, hove to see where a link goes. Right click a link to bookmark, open in private window or copy the URL. If the page has anchors I can get a link to them. If I save or print the page it is an image rather than text (with all of the above features). Some of these can be reimplemented easily, some of them with effort, but some just aren't possible. Plus the exact behaviours depend on what browser you are using, so you can't reimplement them because you don't know how the user's browser behaves. For games or image editors this is probably fine. But for most apps this is a huge depredation in usability.
- LocalPCGuy 4y agoIt is not production ready for web and I don't have much hope it ever will be. I love it for mobile, even desktop apps. But I feel they chose the wrong direction at the beginning for web and it's just trying to dig back out of that hole since then.
- amelius 4y agoCouldn't they just embed Chrome, like Electron did?
- IceWreck 4y agoFor desktop and mobile, Flutter renders over OpenGL, why do they need to embed chrome ? The websites that are exported from Flutter use the HTML canvas (used for games, animation, etc) instead of trying to generate HTML. This means accessibility and SEO are on existent for those sites. GP is complaining about this.