7 ms·
Wow. I always thought the argument in favor of using web technologies on the desktop was that cross-platform became easier. And yet here is an example of the mo
by johnfn 5y ago
Wow. I always thought the argument in favor of using web technologies on the desktop was that cross-platform became easier. And yet here is an example of the most unambiguously single-platform app I can possibly imagine, and under the hood it uses web - and React of all things! Crazy.
- ketzo 5y agoAs it turns out, React / CSS / the document-object-model are popular for more reasons than “it works on different computers.” Who knew!
- knome 5y agoI expect these additional reasons can largely be summed up as "I already know it from using it in the browser, so let's use that"
- dymk 5y agoYou'd probably be wrong! Let me introduce you to https://github.com/ocornut/imgui https://github.com/ocornut/imgui
- junon 5y agoWhich doesn't use React, CSS, or a DOM...? What's your point? ImGUI is imperative UI programming. DOMs are declarative.
- dymk 5y agoImGui makes UI programming declarative in structure the exact same way React makes UI programming declarative. React brings to the table is the general concept of immediate mode UI programming. So does ImGUI. Reaching for React doesn't mean it's the only thing the programmers knew, it means it's a general pattern that arises in UI programming.
- junon 5y agoNo, it absolutely does not. ImGUI is a completely, totally different model of GUI programming.
- inopinatus 5y agoI think it’s a little unfair that you’ve been so downvoted (at the time of writing), because the old phrase about hammers and nails is super applicable to software development, and the icloud team may very well know react better than cocoa.
- marcosdumay 5y agoActually, web pages are a very declarative GUI, with an amount of reflexivity and editability that should be on any declarative GUI framework, but normally isn't. Those properties open up the possibility of abstracting things and making very powerful libraries over it. There is nothing else as powerful out there. Yet, everybody stops at plain react. So whatever is the reason for the success, it's not that one I pointed.
- __del__ 5y agowho knew? it sneaked up on us. we spent decades wedging compatibility shims into gaping functionality holes, while heroic visionaries of the web as a platform toiled and bargained to bring us the tools we needed for modularity, performance, and a modicum of basic platform services. all while making sure <TD STYLE=FLOAT:RIGHT> continued to work.
- olliej 5y agoApple has been using web views for apps for more than a decade - recognizing that such an object is more generally usable than just "a browser" was a motivation for WebView (now WKWebView) existing as a platform API from the earliest days of WebKit being a thing that existed (The logical extreme being the original WebView API exposed an objc interface to the DOM)
- chrismorgan 5y agoAnd Windows pushed in this direction heavily back around 1999–2005, with things like https://en.wikipedia.org/wiki/HTML_Application https://en.wikipedia.org/wiki/HTML_Application and IE being used quite extensively in Windows Explorer in Windows XP and a couple of versions around it. (In fact, if it weren’t for the whole antitrust situation around the inclusion of IE, I suspect they would have gone even further in on web content on the desktop rather than letting it lie fallow for something like fifteen years.) There’s a reason you get system colours and fonts in CSS: they’ve been round since the ’90s. You certainly wouldn’t get such useful and flexible stuff being added now. There are very strong parallels in a lot of the progress that’s been happening in the past few years with what happened twenty years before. Probably the most obvious example is dark mode: computers had that twenty years before, then it got lost somewhere along the way, then it gets reinvented in an only slightly different form (both more and less useful: it’s far more restricted, to just one alternative theme rather than many, but for the web you can actually design for it in CSS alone this time). Cycles.
- olliej 5y agoMy recollection of using the old windows HTML control was that it was very useful outside of being a basic content view - obviously there was subsequent additions to the web that made some functionality in webkit available, but the WebView controls in my extremely limited experience seemed a much better fit for minor content views in apps. Of course that's all kind of moot because the important point is that there's a large different between a native app that uses a webview (or the windows/linux equivalent) to display some content, and a cut down browser view trying to act like a native application. Admittedly a number of the bugs in electron apps are a byproduct of their use of chromium which is very much a Mac-second engine and the actual API requires host apps to do much more work for system integration, which is a valid choice: it gives the host app much more flexibility in handling things. The down side is there are some things that apps shouldn't be trying to reimplement themselves.
- heavyset_go 5y agoI'd bet that the reason they're using React is because it's cheaper and easier to find front-end developers for the task.
- ketzo 5y agoI’ve been hearing this on HN and similar forums for what feels like years now: “Electron/web-based GUIs are only popular because it’s easy to find devs in those ecosystems” Have we considered asking why it’s so much easier to find React devs? Why such a huge, huge majority of UI development today takes place on the web? I’m a front end web developer. I’m very biased. But I’m a little tired of the narrative that “the right way to make a UI is to build it natively, but everyone wants to take the easy way out.” Perhaps the explanation is that native GUI frameworks simply haven’t kept up in terms of developer experience. And if you spend some time exploring them, I think that becomes very obvious very quickly.
- kitsunesoba 5y ago> Perhaps the explanation is that native GUI frameworks simply haven’t kept up in terms of developer experience. That depends on what one values, in my opinion. Whenever I start poking around with front end web stuff it makes me want to tear my hair out. Not because it isn't technically capable, but it all feels so slapdash, duct-taped, and chaotic compared to what I'm used to writing AppKit/UIKit, even if some aspects of the experience with front end web tech are nicer. Things are solidifying around React which helps, but for me at least, it's still a hard sell to trade away the positive aspects of native development just to get the positive aspects of front end web dev.
- rhodysurf 5y agoI’m guessing you haven’t tried building something serious with SwiftUI then. Because for me React is a million times more polished than SwiftUI. I was a native dev before I got into web stuff. The Apple APIs for native GUIs are so good, but they are extremely verbose, and with swift now they are closed source. It’s just not as easy (or fun tbh) to build things with
- oefrha 5y agoA settings view that is largely shared between macOS System Preferences, iOS Settings and icloud.com is not single-platform. Windows Settings uses React Native for the same reason.[1] [1] https://news.ycombinator.com/item?id=30384494 https://news.ycombinator.com/item?id=30384494 Edit: mention iOS Settings.
- boogies 5y ago> between macOS System Preferences, iOS Settings Why don’t those both use the same UI toolkit, like the convergent GNU/Linux DEs? (macOS seems to be getting more touch-optimized with each update — eg. making sliders giant and iOS-style; why hasn’t Apple merged Cocoa and Cocoa Touch into one yet?)
- gbear605 5y agoYou can already use SwiftUI to build apps that work on both macOS and iOS, so the libraries are there, Apple just needs to use.
- oefrha 5y agoAppKit and UIKit are very different. SwiftUI and Catalyst are the unification efforts, but uptake is gradual. Anyway, once you throw icloud.com into the mix it doesn’t matter.
- cosmotic 5y agoThey probably gave the icloud team, a team largely made up of web developers, full authority over that system preference pane. Their experience is in react, they chose react; makes a lot of sense. Even more so if the data here is used by similar pages on the web version of icloud.
- tonyedgecombe 5y agoI could see that they want the flexibility to change the web app without having to roll out a Mac update. The results aren't good though, the whole thing is painfully slow.
- avianlyric 5y agoIt has the advantage of allowing the iCloud team to update the preferences panel without the need to release macOS updates. Allowing them to decouple iCloud updates from the macOS release cycle. Sure you could use something like SwiftUI and create some simple DSL to dynamically build a native UI. But at that point you’re basically building a slightly crappier, less flexible version of HTML. So might as well use HTML+CSS and take advantage of the decades of learnings it represents. I’ve personally used a similar approach to power a banks fraud warning UI. Made it possible for us to quickly iterate and change our UI as various strategies used by fraudsters evolved. Meant we could go from see a new issue, to updating our ML models and deploying new UI in under a week, which is faster than the app review process.
- tksb 5y agoStill, they could've probably made some strides with React Native on macOS and the win-win that entails. UX improves in these instances + arguably RN benefits from the Apple buy-in.
- EnKopVand 5y agoWhy is it crazy? Doesn’t a lot of the office tools also use react these days (maybe just the online ones but still)? I’ve only recently started working with react, but so far it’s been the best experience I’ve had working with GUI in decades of working with different things. I’ve always been what you’d call a full stack developer, but I’ve always very much not been the front end design developer, and react with bootstrap and font awesome is the first time I’ve been able to effortlessly create GUI stuff that doesn’t look like it should’ve been made by a front end design type. So to me this is not at all surprising or crazy. It’s simply what happens when you have a really effective tool that a lot of people know how to use.