Why does this exist? Is creating desktop programs out of HTML code really a good idea?
With all respect to leichzeit0 comment, IMHO, JS is an ugly language, with way too many pitfalls [0]. Even big boys [1] use CoffeScript to transpile into JS.
JS for cross platform desktop development may be an easy thing to manage, though it can become unusable and clunky super fast. You can spot JS desktop apps, just by the size of executable, which is at least 5-10 times bigger than you could expect (Spotify - 130MB). They have poorer performance, can drain your battery faster, and some OS native features/guidelines must be implemented in a custom way, or could not be implemented/used at all. Sorry, for my critical and conservative view, but it's just my opinion (probably due to annoyance of overflow of laggy (web)apps, riddled with complex JS, where it could be avoided).
Probably it's the price of 'cross-platformity'.
[0] https://www.youtube.com/watch?v=20BySC_6HyY (original site does not load for whatever reason)
This is my completely biased and highly selective history of events ;)
Apart from Javascript, of course. But that particular "bad decision" is getting modified with every version into something more acceptable ("now with classes!").
I guess the endpoint is that React + Javascript (+ Redux) becomes the defacto language for developing UIs in, and what implements that abstraction layer is immaterial. React-native all the things!
> Any application that can be written in JavaScript, will eventually be written in JavaScript
[0]: http://blog.codinghorror.com/the-principle-of-least-power/
That said, it'd be cool to have native code generation from this though.
For folks just learning about Electron / web-based desktop UI — we gave a talk about UI considerations at the Bay Area ElectronJS meetup last month: https://www.youtube.com/watch?v=JIRXVGVPzn8
Round 1: AWT. Uses the native widgets. Therefore the layout is slightly different on different platforms.
Round 2: Swing. Cross-platform identical, and therefore looks nothing like native apps. You could 'skin' it, at which point it would look native but behave subtly differently.
Round 3: SWT. Back to native widgets for Eclipse.
Round 4: Everyone throws up their hands in despair and stops writing desktop applications.
You end up targeting the lowest common denominator, and a UI convention that works on Windows won't work on OS X, and vice versa.
One big error made by these toolkits is to base themselves on generic pixel-oriented layouts, instead of more abstract declarative ones. For example, if you need a dialog box with a small form and "OK" and "Cancel" buttons, you'd lay each component out on a form, and the layout would be identical on each platform. But this is such a common thing to do that it would be better to just declare what fields should be visible and what actions should be available, and have different, platform-specific, opinionated adapters that can wire together a native UI from this metadata (together with some platfomr-specific, CSS-like hinting: "on OS X this field needs to be at least 500px wide", etc.).
There's a wide selection of common idioms (dialog boxes, file dialogs, "wizards", preference panes, alerts, etc.) that fit into this scheme. The reason nobody did this is probably because developers overestimate how important it is to micromanage the UI, and don't think a system like this could support all variations that apps need. In truth, most UIs are quite pedestrian, and could benefit from being driven by a high-level description.
This is where React (and React Native) actually would help, because the component interface is separate from the component implementation. You can have a fairly high-level mostly-declarative description of your app that pulls in platform-specific versions of certain UI widgets where it makes sense to have one, but otherwise relies on generic ones.
Mimicking native with CSS is only getting you to the uncanny valley of UX.
https://github.com/ptmt/react-native-desktop
Currently just "hacking weekend" level maturity. https://github.com/facebook/react-native/issues/247#issuecom...
I have never actually tried it, but this one is real native controls. It’s on my TODO list…
Wonder if once Swift is open-sourced we'll see a library like that in Swift. Imagine writing React code in Swift and rebuilding that for Windows!
Anyway, I would love to see these come in native form like reactive-native.
These components are just bunch of styles to make it look like a 'native' widget, though it's not a real native widget of OS.
Though, it leaves me with a question, how can you set up OS X accessibility features, in your web app/UI, that it could be used by OS X? I would guess you can't, and it's all left to the browser.
I think what you've got here for an OS X implementation is pretty good, but I can still tell that it isn't really native, and if an OS update changes anything in regard to the standard UI components forget about it.
Why not design and develop your own UI? That way you can control how it is supposed to work given the drawbacks and advantages of web technologies and not have to ask the user for forgiveness of minor quirks in your reimplementation.
sometimes you just want an app to look decent by default not unique.