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

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.

84

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

Right. Spawning a websocket or http server or accessing the filesystem are two examples of features, which are not possible with PWAs, but essential for a whole lot of apps.

9

u/tontoto Nov 10 '18

If I could just remember a users file that they opened locally across refreshes... that is the only thing that has me use electron over pwa

0

u/[deleted] Nov 10 '18

[deleted]

3

u/tontoto Nov 10 '18 edited Nov 10 '18

Users can open very large indexed data files with our app (http://jbrowse.org) and it'd be basically impossible to move these into localstorage

12

u/Skhmt Nov 10 '18

Indexeddb? I'm pretty sure mega.nz stores multi-gb downloads there.

3

u/editor_of_the_beast Nov 11 '18

The point is why are you trying to figure out a hack for something that a file can easily do? What’s more universal than a FILE? Why are you trying to get around a limitation of the browser with weird solutions? Why are you totally fine with reinventing things that have existed since the 1960s, like FILES?

5

u/Skhmt Nov 11 '18

idk ask the iOS devs

3

u/[deleted] Nov 11 '18

You could make this same argument about you using web tech for something that "should" really be native to begin with. Rust, Swift, C++, Java, these can all handle local files natively because they're designed for it.

2

u/[deleted] Nov 11 '18

Electron is a hack LOL

2

u/Piece_of_Crap Nov 10 '18

LocalStorage?...what is that wizardry you speak of?

2

u/[deleted] Nov 11 '18

Where've you been for the past few years lol

0

u/[deleted] Nov 10 '18

[deleted]

-12

u/Piece_of_Crap Nov 10 '18

I'm only sarcastic in days that end in "y"

2

u/jeremypsu15 Nov 10 '18

Isn’t it possibly to access the filesystem using a web worker?

2

u/manys Nov 10 '18

in a local file, like outside of CORS?

1

u/jeremypsu15 Nov 10 '18

I was initially referring to this. I thought I read that it was possible through web workers, but looks like it’s not actually implemented in any browser yet...

https://wicg.github.io/entries-api/

6

u/dvlsg Nov 10 '18

I'm not sure I want tracking scripts to have access to my filesystem.

That link you have is about uploading files / directories, which (I assume) requires specific user input. Drag and drop, it looks like.

This specification documents web browser support for file and directory upload by drag-and-drop operations.

3

u/spacejack2114 Nov 10 '18

Some apps... VSCode, Postman yes, Slack, Gitter, Spotify, Discord, DevDocs not so much. I've been using the latter as "PWAs" that run in their own window for years already with Chrome's Add-to-desktop feature.

8

u/yeager-eren Nov 10 '18

if you are talking about postman chrome app, i think they have been discontinued because google planned to end the support for chrome apps

3

u/fgutz Nov 10 '18

They are talking about the stand alone Postman app you can download from their website.

1

u/cyberst0rm Nov 11 '18

websorkers can use websockets

1

u/[deleted] Nov 11 '18

So can JS in general, but also in the role of a server?

5

u/seiyria Nov 10 '18

Right. If, for example, you want to integrate your electron app with discord (using discord-rpc) - this is not something a PWA can do. I'm all for PWAs, but they are not a replacement in every case.

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.

5

u/poker158149 Nov 10 '18

Also, how likely are you to say, "yeah, sure!" when you visit a website and it pops up with "wanna install us as an app?" That's a big 0% for me.

5

u/[deleted] Nov 10 '18

That's a shitty way to propose installing PWA. If they have download / install button and you went the app, why not? As a user you just wouldn't know. Edge supports them, Chrome supports them, Firefox and Safari will. Majority of software would benefit from it.

2

u/poker158149 Nov 11 '18

I don't think I understand what you're saying. The article shows that this new form of desktop PWA is installed by visiting the website and having this ad-looking popup ask you if you want to install the website as a desktop app. I don't know if that's the only way to install them, but that's what I'm commenting on because that's what this article shows. And my point is that if I saw that kind of popup asking me to install the app, I'd be turned off from doing so.

3

u/[deleted] Nov 11 '18

PWA can be installed on user request.

Showing a popup to first time visitors is straight moronic. You're completely right nobody would install it this way.

Turn it into a regular install button as in any other software website or display a popup only for returning users.

1

u/XiberKernel Nov 10 '18

And a controllable environment, you don't need to worry about browser compatibility when you can control the "bowser" and version.

10

u/tdat00 Nov 10 '18

So PWA Visual Studio Code incoming?

28

u/ColtenP Nov 10 '18

Well, I would say no because it requires access to the file system. PWAs don’t quite have that sort of functionality exposed to them yet.

6

u/Maluen Nov 10 '18

Maybe more something like CodeSandbox. You can already import visual studio code themes (didn't test it): https://medium.com/@compuives/introducing-themes-e6818088bfc2

3

u/kaelwd Nov 10 '18

CodeSandbox (and the GitLab web IDE) use the Monaco editor.

7

u/vinnl Nov 10 '18

It actually supports full VSCode nowadays.

15

u/[deleted] Nov 10 '18

They do on Windows. You can access the WinRT API’s https://docs.microsoft.com/en-us/microsoft-edge/progressive-web-apps/windows-features 🤘

14

u/ColtenP Nov 10 '18

Well I’ll be damned. Look at Windows.

2

u/Sipike Nov 10 '18

Woah, I had no idea. Thanks!

1

u/FormerGameDev Nov 11 '18

there we go fracturing the world again. Luckily, few people use Edge.

1

u/[deleted] Nov 11 '18

I don’t see it as fracturing the web. In fact MS are promoting feature detection in order to use it. It also would be incredibly difficult to offer access to OS specific implementations in a single web standard way (each OS implements window control differently for example) As it stands the currently available PWA’s on Windows aren’t yet installable from Edge. Instead they list them in the Windows store (see the official Twitter app)

38

u/Pinewold Nov 10 '18

Electron allows chrome apps to run where security policies requires a certified exe or IE/edge. (E.g. WebRTC does not work in IE or edge, but does work in chrome. IT Org’s will not let you install chrome, but will let you install you own exe.) PWAs do not help here (not allowed to install chrome) . Please do not kill electron!

8

u/[deleted] Nov 10 '18

Electron won't be killed. If something better comes along, it'll need some time to be used in the wild and real world applications and proven to be at least as effective. Effective meaning having a low-learning curve and not being hard to find developers for.

It's a shame Electron is such a memory hog because other than that, Electron is pretty great to work with and allowed us to stop relying on the browser for our internal company app and have complete control over the environment they're working in, making bug tracking easier while also reducing bugs that inevitably arise from browser version quirks or certain users using other browsers that might not work as expected with our app.

-1

u/Pinewold Nov 10 '18

I would prefer that Microsoft (who claims to be an open standards company) Support WebRTC like Chrome, Firefox and desktop Safari. Everybody is all love of Microsoft being a good open source vendor, buying github, but Microsoft still goes the propriety path when they think they can get away with it! Let’s see them open Source Office, port them to Linux and open Source all their proprietary software.

15

u/[deleted] Nov 10 '18

That seems like a very strange way to approach security. They’ll let you install any old .exe but not one millions of people use?

10

u/[deleted] Nov 10 '18

MCSE/MCOP shops, where logic goes to die of sepsis.

I used to work in a place like this. MS certified IT personnel are taught parlor tricks, not technology, and the last thing they need is having to think about things that cannot be solved with an Add Server Role wizard.

8

u/hackers_d0zen Nov 10 '18

Think of it this way: Chrome does something bad, they have to sue Google, your .exe does something bad, they only have to sue / fire you.

7

u/[deleted] Nov 10 '18

😮 sounds nice.

4

u/Obtuse_Donkey Nov 11 '18

> your .exe does something bad, they only have to sue / fire you.

You haven't read a software license recently, have you.

1

u/hackers_d0zen Nov 11 '18

Huh? Sure I have, and have written a few as well. What part about limits of liability do you think I don’t understand?

1

u/Pinewold Nov 10 '18

No argument from me, welcome to the healthcare industry, where 1999 is alive and well.

In fairness, they let you install an .exe that survives their virus scan and you legally accept responsibility for if anything bad ever happens to the .exe. Better than old days when you had to accept responsibility for the whole pc security. Now they at least have to pin it on your .exe.

1

u/FormerGameDev Nov 11 '18

shit in healthcare, you're still frequently using XP.

2

u/imperfecttrap Nov 10 '18

Edge supports PWAs, though. If you don't use vendor-specific APIs or implementations (WebRTC, WinRT, etc.) then you should be fine.

1

u/[deleted] Nov 10 '18

Can’t you just feature detect and provide an alternative experience/implementation for runtimes without compatibility of those API’s.

23

u/Bluecewe Nov 10 '18

I'm really looking forward to seeing more PWAs.

However, it's worth noting that unfortunately there's one limitation which prevents a complete 'look and feel of an Electron Application'. It's not possible for PWAs to provide their own window UI. You're stuck with the default OS window UI, unlike an Electron app like Discord, which provides its own styled controls. For many apps, this isn't an issue. But it's worth noting on the aesthetic front.

5

u/Dougw6 Nov 10 '18

Good point. Some custom window style can really make your app stand out. I write a lot of tools for work in electron, and I almost always include a custom title bar and window controls. Really adds that extra something.

1

u/FormerGameDev Nov 11 '18

it's something alright. obnoxious.

2

u/[deleted] Nov 10 '18

I think this is also being worked on as I read somewhere that transparency of the body is being looked into. Fingers crossed it doesn’t take too long 🤞

0

u/State_ Nov 10 '18

That's a very easy fix on windows. Just need to disable the bits for WS_CAPTION and WS_SYSMENU for that particular window.

I'm not sure how PWA's are implemented, but if they are a stand-alone instance of the browser it should be easy to implement. If it uses node I could easily write a c module that will flip those bits for that window.

3

u/[deleted] Nov 10 '18

They do not use node unfortunately. They are still sandboxed web apps running in the browser in which you ‘installed’ them with (without the usual browser chrome). Currently only Chrome supports ‘installation’ on Windows directly from the browser. If they are installed from the windows store they are basically executed inside a privileged Edge instance with access to the WinRT API’s.

1

u/State_ Nov 10 '18

hmmm, I'm more familiar with win32 API, but looks like WinRT doesn't expose findwindow() and SetWindowLongPtr() / GetWindowLongPtr(). I thought UWP supported c++ backends, so setting style on launch would be pretty easy if someone could access win32 api's (but are these cross platform? would need to just wrap #ifdef __win32"

All windows on the system can have their styles modified. I have spent a lot of time playing with windows styles on a project of mine, and it doesn't even require admin rights, just the correct API calls.

2

u/[deleted] Nov 10 '18

I’m unsure whether the window can be modified. The window implementation is hidden from us and is an MS provided wrapper which is either an instance of Edge or a custom window they provide with embedded EdgeHTML? Either way, it’s only possible to call WinRT API’s currently.

I wonder if it is possible to access the window through Windows.UI.Core and if MS allow manipulation of that? Would be interested to see if someone could test this out.

1

u/State_ Nov 10 '18

Can you link me an app to install? I can run it through SPY++

1

u/[deleted] Nov 10 '18

The twitter app from the windows store. That’s the best example of a PWA which uses the WinRT API’s for certain things.

1

u/[deleted] Nov 10 '18

If you could let me know how it goes that would be great 👍 (even if we get nowhere)

2

u/State_ Nov 10 '18

I did some messing around with spy++ and it looks like the title bar is it's own child window.

I tried to modify the main window and it disabled rendering of the client area. After looking at the messages sent I tried to reenable the rendering of the client area by sending the opposite message of the the disable to no avail.

After digging through MSDN I came across DWM (Desktop Windows Management) and started playing with that.

Seems like the solution here might be modifying a child window.

Heres the code I attempted playing around with to see if it was possible: https://hastebin.com/zovitanipa.c

1

u/State_ Nov 10 '18

1

u/[deleted] Nov 10 '18

That looks promising. I wonder if it’s actually possible.

2

u/State_ Nov 10 '18

I just played around with a UWP app using the following code w/ c++

auto coreTitleBar = CoreApplication::GetCurrentView()->TitleBar;
coreTitleBar->ExtendViewIntoTitleBar = true;

This was the end result: https://i.imgur.com/Y5aVP0l.png

you can draw your own custom title bar, but the caption buttons in the top right cannot be changed. The CoreTitleBar class has properties that tell you the dimensions to draw your own title bar.

The caption buttons are automatically hidden if you go to full screen however.

EDIT: that code goes inside of App::OnLaunched() function

→ More replies (0)

46

u/FlashDaggerX Nov 10 '18

So what I'm reading is that in order to even USE PWAs, you MUST install Chrome or Chromium. Granted, most people use this browser, but now you have to install it if you want to use a PWA. Am I wrong, can someone clarify this for me?

It just doesn't sit right with me.

55

u/Bluecewe Nov 10 '18

For the avoidance of doubt, PWAs are underpinned by a number of Web standards, including Service Workers and the Web App Manifest.

Thus, you don't need Chrome as such, but you do need a modern browser which supports these standards.

Although PWAs appear as independent applications to the end user, they're actually essentially another browser tab under the hood.

10

u/vtesterlwg Nov 10 '18

can i use firefox and or edge?

14

u/imperfecttrap Nov 10 '18

Edge makes you install PWAs through the windows store on desktop, but otherwise yes.

5

u/mycall Nov 10 '18

I have a PWA website that works with Edge, so you don't need Windows Store.

1

u/imperfecttrap Nov 11 '18

Does Edge expose any install prompt, though? Last I checked it installation was only enabled through either the store or on mobile.

1

u/rohmish Nov 11 '18

On Firefox, not really although most standards are supported, on edge yes.

33

u/itomeshi Nov 10 '18

I'm currently developing a PWA for an enterprise app, and we are a couple Chrome releases behind, so even then feature support is spotty. As Bluecewe mentions, they are web standards; however, I think the 'can I use' pages tell a better story here:

  • ServiceWorkers have very wide support. They handle offline site caching. If you want to use it, I strongly recommend Google's Workbox library, which should have wide compatibility.

  • Web App Manifest is DEFINITELY trailing. However, in older Chromes and Firefoxes, this degrades somewhat gracefully. You only lose the desktop icon; a well-made ServiceWorker still means a user can go to your URL in the browser and have a functional app.

  • BLOB URLs have very wide support. These are used to inject a generated file into a link - like an img's src tag or a download link.

  • IndexedDB has very wide support. This lets you have a no-sql/JSON data store that survives browser restarts but NOT cache clears. Dexie is a great library for this; Vue-idb is a nice Vue binding for it.

  • Web Workers have wide support. These are essentially background threads.

  • CORS gives you a way of requesting resources from other domains. While they need to allow it via a CORS flag on the web server, it allows you to make an PWA reach other servers without getting blocked or security popups, and is useful for 3P service integrations.

There are a number of other features, like sensor access, that are useful for getting the feel of a native application. Support varies, but Firefox is generally just behind a bit. Even Edge, though further behind, is getting closer.

Vue is really nice for this as it lets you easily make Single-File Components that can be reusable. :) Even better, the Vue CLI 3 project generator has a PWA preset that pre-bundles Workbox into your build process. :D

-6

u/vtesterlwg Nov 10 '18

electron seems way better lol

3

u/imperfecttrap Nov 10 '18

Electron is also 5 major versions behind Chromium, with the latest being Chromium 67. That's a lot of known security holes to worry about.

1

u/itomeshi Nov 10 '18

Electron requires a user to be willing to download an installer and run it. Electron also does share state with the users browser cache. Electron code has to be written carefully if you want to reuse it in a browser.

11

u/ludonope Nov 10 '18 edited Nov 19 '18

Well the services such as Slack, VSCode, etc already "install chrome" along with themselves, but it is kind of hidden, you will not see Chrome itself appear in your apps if you don't have it installed already

3

u/[deleted] Nov 10 '18

[removed] — view removed comment

-2

u/Py64 Nov 10 '18

It is. Electron is running on Chrome, and thus it ships with basically full Chrome.

13

u/[deleted] Nov 10 '18

[removed] — view removed comment

7

u/[deleted] Nov 10 '18

The version of Chromium that comes with Electron just implements the render library and doesn't have other typical Chrome features like tabbing.

https://electronjs.org/docs/tutorial/about

4

u/vinnl Nov 10 '18

Theoretically, you can/will be able to use other browsers - especially Mozilla is also pushing this hard for Firefox.

In practice, I'm still afraid that developers will only focus on Chrome.

2

u/the_meme_grinch Nov 10 '18

If you consider the install flow, your user is already in chrome to even install it. With that in context, I don't see the problem. This is a feature of Chrome, that uses the web APIs that allow for PWAs.

1

u/spacejack2114 Nov 10 '18

Yeah well those other browsers should catch up. Most SPAs don't even need PWA features, all you need is for the browser to create a shortcut that launches the site in its own window, with its own taskbar icon, without the address bar clutter.

1

u/[deleted] Nov 10 '18

No, PWAs actually work out of the box on Windows 10 - with no extra software installed. They are even downloadable from Microsoft Store.

0

u/[deleted] Nov 10 '18

[deleted]

3

u/atomic1fire Nov 10 '18

Apple added PWA support, but it's basically well hidden and doesn't include notifications. Plus the support of other web platform features isn't as extensive as it is in Android.

You basically have to add a shortcut to your homescreen in IOS.

https://medium.com/@firt/progressive-web-apps-on-ios-are-here-d00430dee3a7

1

u/AwesomeInPerson Nov 11 '18

And it comes with lots of bugs/purposeful limitations and generally is horrible. :(

11

u/[deleted] Nov 10 '18

Desktop applications used to feel clunky and UI components always seemed outdated. Electron has definitely brought some sexiness to the desktop game!

So this is what it has come to... ugh

2

u/__hgx80 Nov 11 '18

has definitely brought some sexiness

sums up web design for the past few years.

fuck what works let's make it sexy

13

u/m0nk_3y_gw Nov 10 '18

they still come with some downsides. First, Electron applications ship with their own binary of Chromium.

Sounds like a feature, not a bug.

9

u/seiyria Nov 10 '18

Depends who you ask, but, IMO that is definitely a feature. You know that every electron app you ship will have a specific runtime that you can test against. Also, you know that every electron app will not randomly upgrade, break a feature you rely on, etc.

The downside is the binary size, which I can see being an issue for some people, but the average person probably doesn't care.

2

u/spacejack2114 Nov 10 '18

How many Electron apps don't have a web version that is developed to work in all current browsers though.

1

u/seiyria Nov 10 '18

Hard to say, because I don't really know much about the landscape. This is more if you're targetting specific environments, like, say you're making point of sale software - it doesn't make sense to offer a web version.

6

u/vtesterlwg Nov 10 '18

also im not going to require my users to have chrome.

7

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

The simple functionalities that PWA's provide for are nice, but they ain't anywhere near node, electron, proton, react-native, etc. It seems to me that the idea of a browser as an embedded content host in general is a really terrible idea that for some reason Google is relentlessly trying to brute-force against all odds. Just like with Web-components, it is as if they have completely lost touch with the real world: HTML/DOM and Javascript do not necessarily belong together. The next step (from Electron) seems obvious: javascript will render native desktop applications without any of the dom's crippling limitations, without the need for Chrome as a middleman. A package won't be 200mb for a hello world println, it won't eat half of the computers ram, it'll have access to the full platform, and it will perform as fast as any other native application.

8

u/PistolPlay Nov 10 '18

I work on a pretty big Electron app and the install comes out to be 76mb, and that's including a separate node API app. Just gotta treeshake properly

4

u/M123Miller Nov 10 '18

Did you follow any good resources for your tree shaking, just tinker until you got there or a bit of both?

4

u/PistolPlay Nov 10 '18

Tinkered until I got there. It required a deep dive into webpack which unlocked all sorts of other useful things.

1

u/M123Miller Nov 10 '18

Ah OK. Im pretty new to bundling JS for the front end after spending a year in Node.js land so I have a lot to learn!

6

u/spacejack2114 Nov 10 '18

HTML/CSS makes it practical to do cross-platform now. Cross platform native GUI has been a pipe dream since forever. I'll believe it when I see it.

2

u/[deleted] Nov 10 '18

Otherwise you can already do all of that with:

Windows: *UWP JS app *Node+JS file *WSH+JS file

Mac: *Rhino+JS file *Node+JS file

IOS/Android: *NativeScript

1

u/spacejack2114 Nov 10 '18

Couple other things that make me skeptical about this argument (at least with desktop apps.)

How many apps should abandon having a mostly feature complete browser version? As a way to attract users to try before you install. Maybe some subset of React will let you do that if you're very careful, but there will be some cost.

How long until you realize your app needs a webview anyway? Then how long until you find it's easier to update stuff in the webview than the rest of the app?

Deciding against HTML/CSS seems like you're closing a door on possibilities that you may regret not having later.

0

u/[deleted] Nov 10 '18

So WebAssembly then?

0

u/[deleted] Nov 10 '18

[deleted]

-1

u/[deleted] Nov 10 '18

You don’t need to write much to the DOM though, you can draw to a <canvas> as webGL games and Flipboard famously do.

0

u/[deleted] Nov 10 '18

[deleted]

0

u/[deleted] Nov 10 '18

Im not sure I understand. You have 3 options as I see it. 1. Build in the browser and use <canvas> 2. Build an electron app and use <canvas> 3. Run a JS file on desktop with either: WSH, Rhino or Node (needs to be installed) / build a NativeScript app on mobile

HTML/DOM is then only required in the first 2 options to display a <canvas>. Option 3 can use native User interface elements without DOM.

Chromium bundling is only required for option 2.

0

u/[deleted] Nov 10 '18

[deleted]

1

u/[deleted] Nov 10 '18

I’m unsure if a cross platform, OS independent GUI lib would actually be possible with the current trend in locking down operating systems and sandboxing apps. It’s something that’s been tried a few times over too, Java 👀 . It looks like MS is trying to do something with .net core too for a GUI but I can’t see that appearing on iOS/macOS anytime soon.

What might be possible is a framework like NativeScript but for all platforms which wouldn’t be a stretch too far, I don’t think. The issue with that though is that you still have to ship separate package bundles to each platform/store and if there’s an issue with an app you’ll need some platform specific experience to fix.

0

u/dv_ Nov 10 '18

So, switch from HTML+CSS+JS to QML.

1

u/FormerGameDev Nov 11 '18

i think most of us here rather enjoy our modern javascript.

1

u/dv_ Nov 11 '18

And QML gives you that (well, Qt Script, which is a variant of Ecmascript just like JS is), plus an object model that is actually designed for application interfaces.

1

u/FormerGameDev Nov 11 '18

You are aware that the QML JS engine is basically like 4 or 5 years out of date, at best?

1

u/dv_ Nov 11 '18

So? Upgrading that isn't such a big deal. The important bit is that HTML+CSS get replaced with QML, which is a million times better suited for application interfaces.

1

u/FormerGameDev Nov 12 '18

I agree that QML is better than HTML for user interfaces, I'd rather see QML adopted by browsers, than go back to the weird QML Javascript implementation. They've been rather resistant to implementing new features or absorbing V8... so.. I don't see much happening there in the future, either.

Also, Qt's licensing is driving people away from it.

2

u/reddit4matt Nov 10 '18

Is sounds like more of a replacement for “chrome apps” (for non Chrome OS) that they are killing off https://blog.chromium.org/2016/08/from-chrome-apps-to-web.html?m=1. Although the extensions API is way more powerful.. I’m not sure I follow killing it for this.

5

u/atomic1fire Nov 10 '18

The easy answer is that chrome apps are pretty much restricted to chrome, while PWAs can theoretically run in any browser.

It might have been much easier to support chrome apps once Edge and Firefox started supporting certain chrome extension apis, but I suspect that you won't get an official standard unless Apple, Google, Microsoft and Mozilla agree to formally create a standards spec out of web extensions.

That said, I actually prefer PWAs because they're not locked to any specific store, whereas web extensions are actually locked to places like chrome webstore and microsoft store for security reasons.

1

u/reddit4matt Nov 10 '18

But chrome is still controlling when the dialog to install shows up? Sounds like usage / visits but they still control.

1

u/atomic1fire Nov 10 '18

Not so much control, but they do have a dialog that asks you if you want to add the website to your homescreen/desktop.

It's not like they're actively blacklisting or white listing which websites count as PWAs.

Microsoft however is actually adding PWAs to the windows store, but you can still manually add shortcuts from the menu button.

1

u/[deleted] Nov 10 '18

Could you advise where you can install/add to desktop manually inside Edge? I didn’t think they added this yet?

1

u/atomic1fire Nov 10 '18

https://www.laptopmag.com/articles/pin-website-windows-10-start

You should be able to just pin a website to start and then drag the shortcut onto desktop.

1

u/[deleted] Nov 10 '18

That’s not quite the same. That won’t allow WinRT API access and the browser chrome is still present.

2

u/atomic1fire Nov 10 '18

I don't really consider the WinRT api to be a standard PWA thing though.

For starters you need a special manifest file specific to windows, and while I'm not 100 percent sure you might need to be approved on the windows store in order to use WinRT apis.

Whereas I'm pretty sure if I linked to https://airhorner.com anyone could use it offline on a newer browser even if they don't really have an install dialog yet.

1

u/[deleted] Nov 10 '18

Yep I agree with those sentiments. I was curious if I’d missed a feature about manually adding to desktop in Edge (with minimal browser chrome)

-1

u/[deleted] Nov 10 '18

Worth noting that MS's PWAs will be stuck on EdgeHTML/Chakra, which isn't the most ideal.

1

u/[deleted] Nov 10 '18

Same case as Chrome.

2

u/lzantal Nov 10 '18

Goodbye Electron, Hello nwjs :))

-1

u/CMBDeletebot Nov 10 '18

goodbye electron, hecko nwjs :))

FTFY

2

u/qashto Nov 10 '18

they can't access the file system? what kind of app is that?

2

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

Just wait until you see the number of Electron apps that'd be exactly the same as a bookmark but the title bar wouldn't be as cool so they packaged the whole thing.

I wish PWAs had some of the APIs into the native space NACL presented.

1

u/deadlyicon Nov 11 '18

Chrome used to have this years ago. Then we used Fluid but the development halted. Hope someone keeps this feature going long enough for us to rely on it.

1

u/SpineEyE Nov 11 '18

I'm sorry but the only advantages of PWAs compared to Electron are less RAM usage and an easier installation? I don't understand the excitement for this.

1

u/treyhuffine Nov 10 '18

Excellent article, thanks for the write-up on PWAs

0

u/[deleted] Nov 10 '18

[deleted]

0

u/[deleted] Nov 10 '18

Not exactly true, as you can access WinRT API’s when the PWA is installed from the Windows store, can run WebAssembly, webGL and utilise all existing JS API’s for Bluetooth, accelerometer, camera, virtual file system etc etc

0

u/[deleted] Nov 10 '18

[deleted]

2

u/[deleted] Nov 10 '18

Access to bluetooth, accelerometer, camera, reading imported files and virtual file system are web standard JS API’s. I’m not saying the web replaces all native applications nor that native applications should be the only types of applications. I think the use cases depend on the project requirement and budget. For general use cases, web technologies allow cross platform functionality and can be implemented by, usually much cheaper, development resources.

-1

u/[deleted] Nov 10 '18

It’s great to talk to everyone interested in PWA’s 🙏 does anyone have a group/channel/forum we can join to help each other out/discuss/ask questions? I’d like to keep in touch.

0

u/[deleted] Nov 10 '18

[deleted]

14

u/FrancisBitter Nov 10 '18

My new favourite comment.

6

u/Lithial13 Nov 10 '18

I was literally looking at learning electron yesterday. Still gonna do it buts still

2

u/robolab-io Nov 11 '18

Make a mini test app first, from beginning to built application. Make sure what you're starting will actually work!

2

u/FrancisBitter Nov 11 '18

Let me also add something constructive to the conversation after my comment there: I strongly disagree with the writer saying these PWAs are comparable to desktop applications, there was even the word "clunky" to attribute them. The task of making a web app — how sophisticated it may get — feel, behave and integrate like a native app for the os it's running on is near insurmountable.

Not using native UI components from the os' primary framework for interface building (like Cocoa/AppKit on the Mac) comes at an immensely high price. We have seen this times before with non-native desktop apps written in Java.

1

u/Lithial13 Nov 11 '18

Yea I've looked at some of the apps I use daily that are made with electron and I'm not gonna be dissuaded by one article.

4

u/mitwilsch Nov 11 '18

Welcome to web development 2018

2

u/Historical_Fact Nov 11 '18

So? Nothing wrong with Electron. If you chase the latest trends, you won't ever get a deep knowledge of anything.

1

u/[deleted] Nov 23 '18

How would one do that?

1

u/robolab-io Nov 23 '18

Finish up an Electron app? Not sure. It's proven to be difficult.

0

u/[deleted] Nov 11 '18

[deleted]

2

u/[deleted] Nov 11 '18

They have/are. See the twitter app in the windows store.

0

u/[deleted] Nov 10 '18

[deleted]

4

u/libertarianets Nov 10 '18

I’ve played around with Proton Native, and I think this project has a lot of potential, but it’s still quite young in its development. It especially suffers in terms of design.