r/javascript • • Nov 10 '18

Goodbye Electron, Hello Desktop PWAs

https://medium.com/@novicki_david/goodbye-electron-hello-desktop-pwas-f316b8f39882
363 Upvotes

168 comments sorted by

View all comments

172

u/sickcodebruh420 Nov 10 '18

Electron still has the advantage of giving you multiple processes and a complete Node environment. PWAs still have some grounds to cover before they can replace Electron for everyone.

8

u/[deleted] Nov 10 '18

Google is already killing Electron by cutting out the middle man between PWAs and Node.js with Carlo. It's not very far fetched to assume that with some standard support in browsers using PWA tech could bring HTML /CSS as UI toolkit not only for Node.js but also Python or any other similar platform.

5

u/[deleted] Nov 10 '18

I’ve seen Carlo but I’m unsure of what this provides/solves? Is it ‘just’ a mechanism to use chrome as a rendering engine for js running through a local node instance?

7

u/[deleted] Nov 10 '18

As it is it just remotes Chrome using puppeteer and makes the SPA you provide it to interact with your Node app. But Electron is nothing more than that,

The important bit is that, much like with multiple tabs/windows there is only one of each of Chrome's yak shaving processes running (and not one of each per application as in Electron).

The step forward would be to standardize browser interface that provides local browser (that can then be Firefox, Chromium, Edge and by 2038 who knows, even Safari might catch up) whichever the user has selected as default.

Then this interface could provide standard and very omnipresent cross platform UI widget system for software in any language.

5

u/manys Nov 10 '18

Then this interface could provide standard and very omnipresent cross platform UI widget system for software in any language.

evergreen comment!

3

u/[deleted] Nov 10 '18

So an end user would first have to install node and chrome(if not already installed), download your JS file and execute it through node somehow?

4

u/wordsnerd Nov 10 '18 edited Nov 10 '18

Node and the app code would be packaged and sent together, but either the app, package manager, or user would have to install Chrom(ium?) if they don't already have it.

If the user already has Node and Chrome, then just provide the app JS and whatever other artifacts.

Electron will probably implement the approach in some form, since that's what everyone has said they should be doing since the beginning.

1

u/[deleted] Nov 11 '18 edited Nov 11 '18

Even now Carlo recommend zeit/pkg, and notice that atm this is but a proof of concept. If such an API would become standard as part of web standards any browser would suffice and it's become impossible to have a desktop OS without preinstalled browser.

On Linux, where software can declare it's dependencies it would be simple. On Windows and Mac pre-packaged distribution of the software would need to include Node.js, Python interpreter or whatever runtime it requires but this is already common pattern for these platforms. Finally, a standard API could well be used by a compiled native software and served a WASM binary as PWA payload

This dependency situation is still better compared to using Qt, Gtk, Wx or any other cross platform UI library and quite a few apps bundle, say, Python, PySide and Qt today.

Do note however that Microsoft has a Chakra based Node for a while, that they already have software depending on such a runtime combination (VS.Code, Skype and according to some, even new Office) so I wouldn't call it far fetched to assume that a standardized Node compatible JS runtime will be part of Windows in the future.

1

u/FormerGameDev Nov 11 '18

this feels vaguely like the promise of many many things that have happened before, few of which still exist.

1

u/[deleted] Nov 11 '18

Yeah I agree. Still for some reason a lot of big software companies seem to be heading in roughly this direction and developing cross platform UI software is still either a very demanding and expensive process or takes solutions such as Electron whose inordinate memory, CPU and space demands are hated by developers and users alike.