TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Flutter Web: A Fractal of Bad Design (2020)

90 点作者 phil294大约 2 年前

20 条评论

nathaniel_green大约 2 年前
As a Flutter dev, this article is a good summary of some of the reasons I urge people not to choose Flutter if they&#x27;re mainly aiming to target the web.<p>At the company I work at we currently target 5 platforms across our internal and user-facing apps, (Android, iOS, Linux, Windows, Web), and Web is the one that consistently seems to cause the most issues. Performance is a big one of them, I&#x27;ve done about 8 years of webdev now and there is a noticable performance difference between using a canvas-drawn UI in Flutter and the usual React-based equivalent.<p>We&#x27;ve mostly stuck to using it for internal applications, as well as for a small portion of our user-base that prefer to access our user-facing mobile app via a desktop. It also serves as a decent backup deployment target if you need to push a hotfix for some users and can&#x27;t wait for the App Store review to go through.<p>It doesn&#x27;t seem like the Semantic HTML issue will ever be solved too, the Flutter team did mention in the latest conference that they&#x27;re aiming it more to be used for web apps than websites.<p>For the other platforms however it works great, and I&#x27;d definitely recommend it for anyone looking to make a cross-platform app that doesn&#x27;t need to rely heavily on working on web.
评论 #35829799 未加载
评论 #35830285 未加载
评论 #35829874 未加载
abraxas大约 2 年前
I take an almost opposite view. I think there is actually an issue of trying to use a document model as a basis for an interactive user interface. In that sense flutter is actually an improvement over things like React. The whole idea of representing UI interactions by changes to a document model is absurd. We have had decades of experience building UI toolkits that target interactive interfaces. Then it all went in the garbage because it all had to go &quot;on the web&quot;.
评论 #35829621 未加载
评论 #35829762 未加载
评论 #35829720 未加载
评论 #35829626 未加载
评论 #35829683 未加载
评论 #35829646 未加载
hexer303大约 2 年前
&quot;I haven’t looked at Flutter for other platforms than web so I cannot comment on it other than that the general principle of Flutter is a terrible idea.&quot;<p>The author completely missed the point of Flutter. It is a mobile-first platform positioned as an alternative to ReactNative. Its main goal was to provide a way to build cross-platform iOS&#x2F;Android mobile apps with a minimal performance trade-off. For example, its code is compiled into native machine code for iOS, Android, and desktop. Its apps tend to be more lightweight and feel snappier. Unlike ReactNative they do their own rendering so that you can have pixel-perfect consistency across platforms.<p>Flutter&#x27;s web and desktop support is more of an experiment and a convenience for those who want to port their existing mobile apps to web and desktop.<p>ReactNative was targeted for web developers who want to port their existing apps to mobile, Flutter&#x27;s web support is the reverse of that.
评论 #35829840 未加载
评论 #35829964 未加载
phil294大约 2 年前
Previously also here, three years ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24962504" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24962504</a><p>Unfortunately, the malicious state of Flutter web has not changed.
preommr大约 2 年前
I can&#x27;t think of a single framework or software technology that took off after 5 years of unpopularity. Let alone in web where the pace of development is much faster.
评论 #35830277 未加载
评论 #35829903 未加载
评论 #35832568 未加载
pritambarhate大约 2 年前
Flutter Web will be used mostly to develop web applications and not web sites. So I think their approach &quot;can&quot; work as long as they can provide first class accessibility support and make sure that their custom rendering doesn&#x27;t drain battery.<p>Though at our company we have adopted Flutter for mobile in a big way, I am still waiting it out for at least 2 years to see where Flutter web goes.
评论 #35829777 未加载
Ocha大约 2 年前
I learned my lesson with AngularJS (v1) not to use Google’s frameworks for web dev ever again.
评论 #35829530 未加载
eimrine大约 2 年前
I am seing a &quot;Fractal of bad design&quot; statement second time in my life, first one was a famous article about PHP [1] (is flagged here but very upvoted on some other resources).<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28085142" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28085142</a>
评论 #35829795 未加载
评论 #35829701 未加载
评论 #35829730 未加载
mkl95大约 2 年前
This is what happens when the main criteria to hire your devs is stuff like whiteboard coding and encyclopedic knowledge of algorithms. You end up with a bunch of really smart people who don&#x27;t care about users.
SilasX大约 2 年前
&gt;The semantic structure of a document matters because that’s how machines, not humans, understand the web. A div with an onClick handler doesn’t look like a link or a button to a screen reader, search engine crawler, or accessibility extension, it looks like a div.<p>&gt;Most importantly, semantic HTML is key for accessibility and other tools that let a user experience the web as they wish.<p>This! So much this! Web UIs like Flutter increasingly break the ability of extensions to make sites more usable.<p>But I read later and find the author is having a seemingly less degraded experience than I am with our favorite tool for browsing the web, Vimium:<p>&gt;I use the browser extension Vimium to navigate the web, it’s an amazingly powerful tool that relies on, you guessed it, semantic HTML. Does it work on pages built with Flutter Web? Fuck no. It doesn’t work because it tries to find things that are semantically clickable, like button or a elements, of which, as we have established, Flutter Web generates none. Vimium works on almost all websites I use because most developers, thankfully, don’t just stick onClick handlers on divs.<p>I&#x27;ve found that <i>many</i> elements on the web don&#x27;t get picked up by Vimium, even well outside the Flutter ecosystem. Heck, even HN search (via Algolia[1]), despite the minimalism, doesn&#x27;t let Vimium detect the option dropdowns as clickable. (The Stories&#x2F;Popular&#x2F;All Time UIs.)<p>[1] <a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;</a>
评论 #35833996 未加载
barankilic大约 2 年前
&gt; the general principle of Flutter is a terrible idea.<p>I think Flutter is a good idea with bad execution. Maybe due to the lack of resources or effort put into it or maybe due to the management, I don&#x27;t know.<p>The only thing that is cross-platform right now is the web and it is based on graphics engines (Skia in the case of Chrome). My idea of Flutter is that it is being web (i.e. cross-platform) without being a browser (i.e. overhead of being browser). However, in practice, I couldn&#x27;t observe a good performance from Flutter when I tried it.<p>Right now, a lot of apps are developed using Electron (aka Chrome). Flutter is the equivalent of Electron for mobile without the extra layer of having a browser. With the advent of frameworks using WebView (WebGPU is also becoming popular) such as Tauri, we may need less Electron and Flutter.<p>&gt; Flutter Web in particular is fundamentally flawed and needs to be rebuilt from the ground up if it has any hopes of being viable tech that generates semantic, accessible, and modern web experiences.<p>I don&#x27;t know the exact technology of Flutter Web, but I think Flutter Web doesn&#x27;t makes sense because it is running a renderer (Flutter) inside a renderer (browser).
creichenbach大约 2 年前
A few years back I looked around what options exist for building a cross-plattform app. It should support mobile platforms (at least Android and iOS) as well as the web, properly.<p>The problem with cross-platform frameworks is that they either focus on a good mobile experience, and web becomes an afterthought, or vice versa, meaning mobile basically embeds a browser. Flutter is one of former; back then the web variant was in alpha and basically just a canvas that couldn&#x27;t even adjust aspect ratio. Since web had priority for our project (accessability, reactive scaling, etc.), this was a no-go.<p>We ended up going with Ionic (which is basically Cordova with some components on top). The web experience is tweakable to a low level, and the mobile experience is acceptably good, even if not perfect. And we get to cover 3 platforms with the effort of building for ~1.2 apps (there is some platform-specific work involved still).<p>I&#x27;m not even sure if cross-platform is at all solvable in a perfect way, since the UI patterns between mobile and web are just too different.
评论 #35831036 未加载
RcouF1uZ4gsC大约 2 年前
A the emphasis on Semantic HTML makes me think the author is missing the point of Flutter Web.<p>The goal of Flutter Web is to make an app that runs in a web browser instead of on a phone or on the desktop. It is not trying to be an html document. iOS and Android and Windows and Mac apps don&#x27;t have &quot;semantic controls&quot;.
评论 #35829691 未加载
评论 #35829735 未加载
account-5大约 2 年前
If you&#x27;re going to design an app that you want to run in a browser, not a website but an app, why wouldn&#x27;t you make use of canvas? Especially if you&#x27;re designing a language that compiles to native code on as many platforms as possible.<p>I do get the accessibility issue with it but to me it seems that&#x27;s been sacrificed for ease of development. A trade-off. Genuine question, is there a way to make canvas accessible or is it designed inaccessible? Or is flutter using it in an unintended way?<p>I&#x27;m certainly a happy user of dart&#x2F;flutter. I&#x27;m not targeting the web. I would never use it for a real website but I definitely would for an app though if I was moving anything into the web.
GlacierFox大约 2 年前
Directly from the flutter documentation:<p>&gt;&gt;&gt; <i>What scenarios are ideal for Flutter on the web? Not every web page makes sense in Flutter, but we think Flutter is particularly suited for app-centric experiences:<p>Progressive Web Apps Single Page Apps Existing Flutter mobile apps At this time, Flutter is not suitable for static websites with text-rich flow-based content. For example, blog articles benefit from the document-centric model that the web is built around, rather than the app-centric services that a UI framework like Flutter can deliver. However, you can use Flutter to embed interactive experiences into these websites.</i>
spankalee大约 2 年前
This doesn&#x27;t even get into one of the worst parts of Flutter Web, which is that is has to ship its own renderer and Skia, causing Flutter Web apps to require at least a ~2.5Mb download.<p>Flutter was a much better idea when the project was named Razer and its goal was to create a fast subset of the web that could run in the Razer runtime or on the standard web<i>. Once they ditched documents, JS, and chose graphics primitives that the web couldn&#x27;t support, the project really painted itself into a corner wrt the web.<p></i>I think this would be an awesome goal for Servo these days.
评论 #35830209 未加载
foul大约 2 年前
&gt;Flutter works by throwing away the native UI toolkits provided by the platform and rendering everything from scratch using OpenGL et al.<p>Flutter leverages GTK3 heavily on Linux. Isn&#x27;t that the case for other desktop OSes, like, it calls OpenGL&#x2F;metal or something on Win and Mac? It seems to me that this statement is true only for web and mobile targets, maybe not even there though.
taeric大约 2 年前
Oh wow. I had thought the claim that they were not producing any semantic web elements was almost certainly exaggerated. That said, for the number of things that are on <a href="https:&#x2F;&#x2F;gallery.flutter.dev&#x2F;#&#x2F;reply" rel="nofollow">https:&#x2F;&#x2F;gallery.flutter.dev&#x2F;#&#x2F;reply</a>, there are a surprisingly low number of elements. Wow.
评论 #35830762 未加载
nfriedly大约 2 年前
Honestly, I don&#x27;t recommend Flutter for mobile either. I&#x27;ve heard it joking referred to as &quot;the other F-word&quot; because of the performance and compatibility issues it leads to.
评论 #35832616 未加载
mike_hearn大约 2 年前
Flutter is a pretty nice framework and has a lot of fans, but the web version indeed has issues. The web wants to be the high level framework and doesn&#x27;t provide low level APIs, Flutter wants to be the high level framework and tries to do that on top of the wrong abstraction level, the result isn&#x27;t ideal.<p>There are a few ways to tackle this:<p>1. Try to improve Flutter Web.<p>2. Try to improve browsers, so people can use non-HTML frameworks without compromise.<p>3. Escape the browser.<p>It doesn&#x27;t seem likely that (1) or (2) are going to yield much fruit. Flutter already works well on mobile and has picked up a surprisingly large proportion of mobile apps in the app stores. The obvious path is therefore to do the same on the big screen and distribute as desktop apps. The UX can be better than you&#x27;d think, especially as internet connections get faster.<p>This approach solves a lot of the problems the article complains about. Desktop apps can export proper accessibility trees, do keyboard focus properly, they can start really fast and so on (and flutter apps do start fast).<p>I talked about this path and why it&#x27;s getting easier on the It&#x27;s All Widgets podcast [1]. We&#x27;ve added support for Flutter apps to Conveyor [2] so the packaging and deployment aspect is now much better for people who choose to use it. But there&#x27;s still work to do, to make all that work really well:<p>• Flutter Desktop has some native code to start and load the VM, which you&#x27;re expected to customize and compile. That&#x27;s a pity because the actual code is all Dart bytecode, so this complicates compilation without much justification. It could be made to work the same way as Electron or the JVM where you have pre-made binaries.<p>• Signing. Conveyor can sign for any OS from any OS so the technical pain goes away, and you can also do self-signing. But &quot;proper&quot; signing is not ideal.<p>• Sandboxing.<p>You could have a browser-like thing that provides sandboxing, caching and so on whilst exposing low level APIs, whilst doing a much better job of being &#x27;semantic&#x27; than the web ever did. Actually I wrote up a proposal for such a system [3] and sent it to Ian Hickson who runs Flutter, but as he observed, the problem is incentives. Developers generally don&#x27;t pay for platforms outside of cloud services and game engines, so, nobody is incentivized to build out the infrastructure to solve those problems. For as long as that&#x27;s the case, people will try to hack the browser into submission.<p>[1] <a href="https:&#x2F;&#x2F;itsallwidgets.com&#x2F;podcast&#x2F;episodes&#x2F;46&#x2F;mike-hearn" rel="nofollow">https:&#x2F;&#x2F;itsallwidgets.com&#x2F;podcast&#x2F;episodes&#x2F;46&#x2F;mike-hearn</a><p>[2] <a href="https:&#x2F;&#x2F;hydraulic.software&#x2F;blog&#x2F;10-flutter.html" rel="nofollow">https:&#x2F;&#x2F;hydraulic.software&#x2F;blog&#x2F;10-flutter.html</a><p>[3] <a href="https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;1oDBw4fWyRNug3_f5mXWdlgDI4J5AbxVWKEeYr6hscT8&#x2F;edit?usp=sharing" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;1oDBw4fWyRNug3_f5mXWdlgDI...</a>