News for hackers. Stuff that matters.
Re:Compose for Web by slimsag on Tuesday May 04, 2021 @07:14PM (#27044028)
So with this, Flutter, and others it seems there is a drive to unify Web/Desktop/Mobile development (the mythical "truly-cross-platform UI")

If I understand the code samples here correctly, Compose for Web enables someone to write basically standard HTML/CSS components (in the "React" sense) and the hope is that higher level components wrapping the platform-specific components will be written:

> Use and build Compose widgets that work on Android, Desktop, and Web by utilizing Kotlin's expect-actual mechanisms to provide platform-specific implementations

While layout will be handled in-house (not via traditional HTML layouts?)

> Experiment with a set of layout primitives and APIs that mimic the features you already know from Compose for Desktop and Android

This seems a much nicer approach than Flutter's default ("we render everything in a canvas")

But can this really pan out? Layout being handled in-house, non-native UI elements on iOS/Android (from what I have read) are strong signals the "higher level components" approach doesn't work in practice

Re:Compose for Web by pier25 on Tuesday May 04, 2021 @08:05PM (#27044443)
> This seems a much nicer approach than Flutter's default ("we render everything in a canvas")

IMO Flutter should have used the DOM for web. Right now it's reimplementing (and shipping) tons of stuff that the browser already solves: layouts, styles, text editing, spellchecking, etc.

Re:Compose for Web by refulgentis on Tuesday May 04, 2021 @08:27PM (#27044590)
People sort of miss the point on that imho, as a Flutter dev I don't want compatibility with the DOM, I want my app to look and work the same on the web as it does on iOS as it does on Android
Re:Compose for Web by josephg on Tuesday May 04, 2021 @09:29PM (#27045061)
As a user of the web, I don't want webpages to work like a second rate android app.

I want my browser extensions to work. I want screen readers to be able to understand the webpage and read aria tags. I want to be able to copy+paste content. I want platform-native controls and input boxes, which support all of my OS's keyboard shortcuts for scrolling and moving the cursor around. I want the browser's dev tools to work, so I can delete unreadable color combinations and take a look at what fonts you're using. And use reader mode if I need to.

There's probably a shining hill on the other side of this mountain, where we have a nice cross-platform UI toolkit thats not electron. But there's an awful uncanny valley to cross along the way. In the valley nothing works quite right and apps are a bit ugly on every platform. The valley is a graveyard of good intentions and failed ambition. WxWindows. Java's Swing. In its own way, Qt. And Phonegap, and probably React Native, though that still has some life left in it. I hate using software in this place. Notion is dog slow. Java Spring apps were always ugly and weird. Apps made with Phonegap have halfbaked javascript replacements for iOS controls that look native but break when you try to use them like their native equivalents. Does Google Blogger still load so much GWT it needs a loading animation?

Maybe I'm letting my cynicism show. I hope Flutter succeeds. I worry that it won't, and its only legacy will be another wave of half broken apps that subtly break platform conventions.

Re:Compose for Web by robin_reala on Wednesday May 05, 2021 @01:34AM (#27046559)
You’re not letting your cynicism show. If for no other reason, the lack of accessibility makes Flutter a toy project rather than something you’d professionally use to built a site.
Re:Compose for Web by prox on Wednesday May 05, 2021 @04:20AM (#27047463)
It’s Flash all over again otherwise.
Re:Compose for Web by jeroenhd on Wednesday May 05, 2021 @01:38AM (#27046580)
As a user, the lack of compatibility with standard browser APIs is why I have such a bad experience with Flutter web apps and will avoid them when I can.

Flutter's rendering may be fast and efficient on native code, its performance sucks when I try to use it in my browser. A website bringing its own javascript-based DOM tree to my browser engine is just ludicrous.

Flutter for the web feels like a "we made an app, might as well create a web version of it because it's one click anyway" kind of solution in the same way Electron is a "we made a website, might as well make it an app" solution. Comfortable for developers, but terrible for end users, unless you're willing to give up most of the developer comfort to work out the performance issues.

Re:Compose for Web by refulgentis on Wednesday May 05, 2021 @07:06PM (#27057013)
sigh another thread I show up to next day and I got downvoted through the floor for a simple straightforward polite though. As someone using Flutter to great effect daily, without much chance to discuss it with other engineers, I'm really interested in this discussion, but I'm also really worried I can't have it here, I'm guessing it leaves people feeling like I'm attacking the open web or something

That's going to apply _again_ here: I really cannot visualize what you mean, beyond the comparison to Electron, which you nail. Flutter is "electron done right" for people like me building cross platform apps, it's a cross platform rendering engine, not a browser engine.

Presumably, this is immensely frustrating in your experience, but I really can't name a web app that uses Flutter - Flutter Web apps are/should be distributed like Electron apps. What's the Flutter Web app that frustrated you, I'm intensely curious, I didn't know people were trying to attempt that..

Re:Compose for Web by jeroenhd on Thursday May 06, 2021 @05:35AM (#27060919)
The latest web app I've been annoyed with to the point of just giving up has been FluffyChat, a Matrix client written in Flutter. The mobile app has been working fine, although somewhat unstable, and the desktop application didn't work at all (I believe desktop support is pretty much in alpha so I can forgive that). I've settled for trying the web app instead.

It works, but it feels off. It consumes loads of CPU, it's not close to the normal responsiveness of a real application and the whole feel is that of a video game UI, something alien to the rest of the system.

Putting Flutter Web into Electron honestly sounds like it would just produce slower Electron apps. One of the strengths of Flutter is that it can target multiple native systems with no code changes, so if you're going to provide a native download, just make a native executable and be done with it.

The state of Flutter Web is quite sad because it could easily become the de facto standard for web app development for platforms that would otherwise not allow your app (say, an app that wouldn't pass Apple's stringent requirements).

I don't blame the developers using Flutter to make apps for the shitty Flutter (and Flutter Web) performance, Google made the choice to drop all native components and render their own either through OpenGL or through a web canvas, and the usability problems that stem from that choice are Google's problem. Even after a few hours of messing around with Flutter, I could see its potential for app development. I'll still prefer a "real" native app any time, but I accept that not every dev shop has the resources to maintain separate code bases for the different platforms they support.

Re:Compose for Web by blacktriangle on Wednesday May 05, 2021 @08:09AM (#27048881)
If the success of the web has proven anything, it's that user comfort will win over developer comfort every time.
Re:Compose for Web by pier25 on Tuesday May 04, 2021 @08:52PM (#27044772)
My point is not about DOM compatibility, it's about unnecessarily bloating Flutter web apps.
Re:Compose for Web by refulgentis on Tuesday May 04, 2021 @09:05PM (#27044886)
I think Skia is on the order of a megabyte, it'd be nice to skip it, but it's even nicer to ship prototypes that work in the browser and look the same as the 'shipping' version. Changed the way my team works
Re:Compose for Web by matchbok on Tuesday May 04, 2021 @08:53PM (#27044786)
I guess, but most people don't care about that stuff. Which is why Flutter is dying :/
Re:Compose for Web by refulgentis on Tuesday May 04, 2021 @09:04PM (#27044880)
Flutter isn't dying, not even close, here to stay and increasing share
Re:Compose for Web by shubham_sinha on Tuesday May 04, 2021 @09:56PM (#27045266)
Flutter won't survive long. The whole point of cross platform dev is to pull better apps with limited resources. An app without backend is nothing. JS is web native language, it will always be easier to code Node JS backend than to code using Dart. 1 indie developer with one skill set can pull off an end to end app. Dart seems to be competing with Javascript only that too in client side dev, totally ignoring JAVA, Kotlin and Swift.
Re:Compose for Web by chimen on Wednesday May 05, 2021 @12:04AM (#27046055)
The point of a cross platform dev is to write the same app for all platforms using the same codebase. I'm happy to "totally ignore JAVA, Kotlin and Swift" doing that
Re:Compose for Web by ex3ndr on Tuesday May 04, 2021 @07:33PM (#27044187)
You really rarely see native components. Try to take a look at Telegram for iOS - there are zero built-in components: literally everything is rebuilt from scratch - navigation, buttons, toggles, all animations, etc.

"Non-native" is not always a bad thing.

Re:Compose for Web by CharlesW on Tuesday May 04, 2021 @08:17PM (#27044521)
> "Non-native" is not always a bad thing.

Setting aside the non-native look and the non-native feel, one reason it's almost always a bad thing in practice is because developers who re-invent everything rarely match the accessibility support of the native platform.

Re:Compose for Web by KronisLV on Wednesday May 05, 2021 @02:35AM (#27046850)
I believe that this applies not just to the front-end development, but also the back-end frameworks and libraries.

I've seen people attempt to create their own (oftentimes poorly documented and poorly tested, as well as poorly supported) web frameworks even in large projects far too often.

It seems that for any project that needs to be supported and maintained for years if not decades, the argument could be extended to: "Non-native and non-standard is usually a bad thing."

Of course, there's nothing wrong with using bleeding edge technology and writing your own frameworks and libraries, however that should only be done when and where it makes sense.

[dead]
Re:Compose for Web by ByteJockey on Tuesday May 04, 2021 @09:28PM (#27045047)
We're all lazy. That's why we got into this profession.
Re:Compose for Web by EvilEy3 on Friday May 07, 2021 @06:05AM (#27074217)
Non-native look and non-native toolkit is two different things. You don't need to look native to support accessibility, built-in i18n and L10n, to behave like other native looking applications. But you certainly need to be native to not stick out like a sore thumb.