Electron vs Web Apps (specifically, with React)
Asked Answered
P

1

7

Context

I am currently developing a single page web application using React (and other node libraries). I am relatively deep into this project already. This application is being built to replace a company's logistics platform (transactions, inventory management, etc).

Their current system is a Windows based application, hence the gut feeling that an Electron desktop app might suite their needs more. I am developing a web based app as these are technologies I'm familiar with.

What I Know

Not a whole lot, hence the question. It is to my understanding that you are able to build essentially the same web app but wrapped with desktop capabilities using Electron. Additionally, Electron can work offline whereas a web app cannot.

What I've Researched

I've done some research but nothing quite hits the nail on the head for what I'm looking for. Others compare Electron with Extentions, Chrome Apps (depreciating), and PWA's. Noone seems to compare Electron with a Web App.

What I'd Like To Know

It's hard to say exactly, as this is fairly open ended question. None the less here are some points I'm struggling finding answer to:

  • Direct comparison of Single Page Web apps to Electron (security, benefits of native desktop features, deployment, etc.)
  • Ease of transitioning from pure Reactjs to Electron/Reactjs

All in all I was hoping someone would be able to point out anything that I'm missing that could potentially be a big factor in deciding on which path to take.

Polyp answered 11/4, 2019 at 18:56 Comment(0)
S
15

I will try to give you a short answer to your questions:

What electron basically does is bundle a browser engine (chromium in this case) with your app. The browser engine takes care of rendering your app.

The way to work with native features is to communicate between a main process and the renderer process. So basically everything you want to do on the native desktop side is going to take place inside the main process. So in your case you would still need to do some extra work to make your web app work inside or with electron.

The benefits of native desktop features are depending of the use case of your web app. What i can tell from my own personal experience is that things like the following are very useful:

  • access to the file system (write,read,edit,delete local files)
  • global shortcuts (for example pressing alt+o will open up your app or a specific page no matter what other application the user is using at the moment)
  • like you said if you have no internet connection your app will at least still render.

Deployment wise the most common thing would be to build and generate a installable .exe file of your app. There are a lot of libraries out there allowing you to build a .exe of your electron application for example "electron-builder". There are also many ways to deliver updates to your users with the build in electron updater api or some third party libraries.

Security wise i must admit im not so much into that part but the electron devs are keeping the framework up-to-date very frequently so security issues should not be a problem.

Hope this answers at least some of your questions if not just ask more :)

Shalne answered 12/4, 2019 at 9:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.