Skip to main content

Electron-based web app containers are a risky investment, but you may need them (for now)

(Image credit: Image Credit: B-lay)

Electron-packaged web applications are a popular solution in the enterprise world, allowing the web applications to act as native citizens on the desktop. Along with the packaging however comes the cost of native-app distribution complexities – installation, upgrades, security scans, etc. The emerging set of technologies grouped under the moniker Progressive Web Applications mission is to remove those limitations, bringing back the web-apps-as-native fork back to the browser. Here, Petyo Ivanov, Product Manager, Glue42 looks at why we still need them and what the future looks like.

On the brink of the century, a nifty little program from Macromedia called Flash took the Web by storm. Distributed as a browser plugin, Flash brought an extensive set of features that were inconsistently supported or not present in the browsers of the time – Netscape 4 and Internet Explorer 4.

Flash gave birth to an entire generation of web developers and designers, allowing the production of stunning interactive multimedia experiences and rich, engaging user experiences. In a way, Flash transformed the Web to what we know it as know. Sites were no longer a collection of documents linked by blue hyperlinks, but powerful, interactive applications delivered through the browser.   

 Through the next several years, things slowly changed. Netscape was reborn as Firefox. Chrome became a thing. The W3C specs got implemented by the browsers. Flash popularity waned, as achieving the same thing in the standard browser became possible and easier. Finally, the iPhone did not support Flash, effectively shunning the remaining supporters and killing the platform. Google will drop the support of the player in 2020.

This was very misfortunate for the enterprises which chose Flex, a Flash-based rich internet application toolkit, as their sizable investments in the technology went to a dead end. Even now, Flex apps still used in production, rely on an obsolete player. These apps need to be entirely replaced – there is no smooth, gradual migration. A very similar, shorter-lived (but arguably, more impactful to the enterprise) story has been repeated with Microsoft Silverlight, despite Microsoft's authority and enormous .NET user base.

Both Flash and Flex were proprietary, non-standard extensions to the browser environment. As such, both never really became part of the open Web, where the enormous loosely connected ecosystem of browsers and existing web apps self-enforces backward compatibility and smooth evolution patterns. As the trunk of the Web caught up, both turned up to be evolutionary dead ends, losing tons of time and money to the corporations who decided to bet on them. 

A similar history is about to repeat with Electron, a desktop app container for web applications. While certainly much better in certain aspects (open-source, JavaScript-based, etc.), an Electron-based application is dependent on a non-standard set of capabilities, making it non-runnable by default in the standard browser. Of course, Electron itself is not evil or wrong; quite the contrary. It validated that web apps can successfully exist on the desktop without the uncanny valley effect. Just like Flash and Silverlight, it pushed the envelope of the Web. And, just like them, it is about to be replaced by a built-in set of features in the browsers themselves. And looks like Google and Microsoft are serious about that. 

Bridging the native app gap

According to Sam Richard, Developer Advocate for Chrome OS, making browser-compatible versions of the native app features is already in progress – an initiative which called Project Fugu. The features which will bridge the native app gap are listed and tracked in a document called Fugu API tracker. The great news - since Chrome and Edge now share a common core, those will be available in both browsers simultaneously. Access to the native device features is allowed only after explicit confirmation from the user, making them both secure and accessible for developers.

If it looks like a native app, behaves like a native app, then...

It does not matter if it is a native app. A particularly interesting capability from the Fugu Initiative is the so-called Progressive Web Applications (PWA). First available on the Android platform, PWAs gained desktop support with Chrome 73 in 2019. If a web app implements a set of relatively simple requirements, the browser suggests to the user to install the app on their device. The installation process is instant and does not involve actual download and execution of an installation package, which is a common problem in corporate environments. The app instantly "detaches" from the browser, and relaunches, no longer displayed in the standard browser UI, but in a minimal, native app-looking shell. Alternatively, an administrator in a corporate environment can manage the installed PWAs through the standard group policy templates.

PWA solves the most significant issues of Electron

Unlike apps targeting Electron, Progressive Web Apps are 100 per cent functional in the browser and work even better (more screen estate, minimal UI) when installed. With PWA, developers should no longer choose between the Browser and Electron or carefully maintain forks and compatibility layers. The other critical advantage of PWAs is the ease of distribution. Unlike Electron, Progressive Web Apps use the originating browser runtime. As soon as the browser updates (and all modern browsers are by default self-updating), the runtime of the app updates too. PWAs are easier to self-update – after all, they are standard web apps. Thanks to service workers, the update process can be smoothed even further. The Progressive Web App boots instantaneously from the locally cached resources, checks for updates in the background, and prompt the user for the update if such is present.

Are existing enterprise electron apps owners in trouble?

Not really - Electron will be around for a while. However, now is the right time to get acquainted with the upcoming native capabilities of the browsers and dip ones’ toes with PWA migration POCs. The complexity of such task depends on the amount of Electron specific API calls employed. For certain cases, it may be possible to run the same app in both Electron and PWA mode as a transition period. As a benefit, moving to PWA cuts development costs, and taps into a superior delivery model.

 Given the relatively longer lifecycle of the enterprise applications, however, migrating to PWA should happen sooner, rather than later. Late movers risk increasing the dependency on a stagnating platform, which exposes security risks, not to mention the decreased amount of development talent.

Should existing web apps become progressive web apps?

Yes, and that's a no brainer – it brings benefits to both desktop and mobile usage. Microsoft and Google are gradually doing that with their web properties, the latest additions being Google Drive and the web version of Outlook. Due to service workers, a Progressive Web App starts faster in the browser, even if the users don't install it.

Connecting progressive web apps into a single workflow

A very important benefit of PWAs is that they make possible an enterprise-specific pattern, which previously required Electron containers – the so-called interoperability between multiple web applications. Thanks to shared web workers, multiple apps can synchronise contexts, exchange messages, stream data, and perform task handovers (a.k.a. intents). Thanks to the minimal PWA window container, those apps are no longer bound to the browser windows and co-exist simultaneously on the desktop.

Assembling workflows from multiple loosely coupled web apps, a pattern commonly referred to as micro frontends, is an emerging alternative to developing a mega-monolith app that tries to address the ever-increasing and evolving use cases present in large organisations. In fact, an open standard for the interoperability calls between apps, called FDC3 is already present - it focuses on the specifics of Financial Services. At the moment, all implementations of the standard are based on the Electron container - either by wrapping or forking it.

Thanks to PWA, this is about to change. Glue42 for example has released an open-source, browser-based version of their desktop container. The solution, called Glue42 Core, targets Progressive Web Applications and provides a set of data sharing and window management capabilities.

A glimpse into the future

Within the last decade, we have seen how consumer-oriented innovations (like the smartphone) have infiltrated the enterprise office environment, as users get familiar with the technology first, by their own choice. As apps like Pinterest, Uber and Spotify gradually adopt PWA as means of distribution, we expect PWA to become a mainstream choice in the enterprise world as well. The technology is already here, and it is only a matter of time before for early movers to take advantage of it.

Petyo Ivanov, Product Manager, Glue42