When just thinking about desktop, Electron will still be a solid choice vs react-native-windows. Howeverk, this is not Microsoft's end game it seems. They are also busy working on React-Native for MacOS as part of their work on ReactXP which aims to deliver the holy grail of writing code that will work on Web, iOs, Windows, MacOS and Android
Having worked on RN, I'd much rather see electron/PWA apps take off instead of more pseudo-native techs. Most application doesn't have a need for native controls beyond look/feel, and much of that could be addressed with exposing more rich controls in the browser. Maybe a new markup spec for browsers optimized for browsers. Bring apps as first class citizens in browsers instead of layered on top of a document spec.
Electron ain't great, though. I mean it works if all you need is an app that loads a web page (e.g. Slack) but it doesn't work if your app needs to do more than that (e.g. Spotify). This seems to be aimed at "real" apps, not just web wrappers.
eh. you can do all node stuff in electron. use native modules for stuff you cant do in js. only reason Spotify isnt in Electron is probably because it was written before Electron. there are bad ways to write Electron, which makes it slow, but VScode indicates this isnt a necessary outcome of Electron.
edit: /u/Earhacker knows more than i do, i will concede i am wrong but am leaving this up.
Spotify used to use Electron. They abandoned it for Chromium Embedded Framework because it worked better with how their dev team works (tribes building micro-frontends). Then they moved to a custom C++ framework.
VS Code uses a very thin Electron wrapper around C# components that were built for Visual Studio. They really are just piggy-backing on Electron for the cross-platform support; something that Microsoft has never done well.
I'm not an Electron hater. I've used it and like it. But VS Code and Spotify are not typical Electron apps. Slack and Discord are probably still the biggest and best examples of "pure" Electron apps, and they both work just fine. But neither of them work better than just opening Slack or Discord in a Chrome tab, and Spotify does.
I hope this will signal the end for tools like Electron. As good as it is, it's still a dirty stopgap solution. The moment React learns to reliantly render native on desktop as it does on mobile Electron could go. You can still use node btw, but your apps don't have to drag a browser along, depend on a dom-driven web view and eat a ton of disk space and ram. I have so many electron/chrome apps open right now (spottify, slack, discord, vsc, whatsapp, hyper, notion, kap, spectrum, etc), it makes my mba's fans spin practically all day, this has to stop at some point. I remember that laptops could last 10-13 hours years ago. Nowadays i can be glad if i make it through 2-3.
23
u/swyx May 06 '19
wonder how this will compete with Electron. electron is kinda “js native” for all desktops.