DEV Community

Cover image for Turn your website into a Cross-Platform Desktop App with less than 15 lines of code

Turn your website into a Cross-Platform Desktop App with less than 15 lines of code

Tapajyoti Bose on April 04, 2021

What is Electron? Electron is an open-source software framework developed and maintained by GitHub. It allows for the development of des...
Collapse
 
thanhlm profile image
Thanh Minh

Personally, I don't like electron that much. But for make a cross-desktop app in low bucket, electron is the best

Collapse
 
ruppysuppy profile image
Tapajyoti Bose • Edited

Same here. I am eagerly waiting for tauri to become production ready

Collapse
 
abhinav1217 profile image
Abhinav Kulshreshtha

I have actually started using it, Even though it is not marked as production ready, My app is quite stable. Most of the api's are now stable. Only issue I have faced is lack of Video Tutorials ( because I am a visual learner ) but their docs are mostly updated regularly.

Thread Thread
 
ruppysuppy profile image
Tapajyoti Bose

The more I hear about it, the more excited I get. Its a huge improvement over electron. I am waiting mainly for 2 features: Frameless window & Multiwindow Mode because I generally use these extensively.

Collapse
 
thanhlm profile image
Thanh Minh

Oh nice, I haven't heard it before, look promise.
In fact, when building refiapp.vercel.app/ with electron doesn't make me happy with it

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt

I believe Tauri is a fork of Golang's webview/webview.

I wrote about alternatives to WebView long time ago.

Currently, I bank on Lorca / Chrome DevTools Protocol, and I regretted it a little...

Thread Thread
 
thanhlm profile image
Thanh Minh

Thanks @patarapolw I did some research on other solution but I think it still missed some API that electron can provide. For eg: Context menu

Thread Thread
 
ruppysuppy profile image
Tapajyoti Bose

Yeah its an interesting project, but its still in development

Collapse
 
lyrod profile image
Lyrod

Do not install electron globally please

Collapse
 
ruppysuppy profile image
Tapajyoti Bose • Edited

Yeah, I did mention that later on (to use it in a project)

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ

Please don't. There are enough bloated, slow electron based apps around already

Collapse
 
khangnd profile image
Khang

It would be helpful to name a few, for reference and bad practices to avoid.

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ

TBH - the whole idea of Electron is flawed - you are essentially shipping almost an entire web browser with every single app. You end up with a whole bunch of web browsers all running at once, hogging memory and resources. This would be fine if all the apps were sharing an instance of a central webpage renderer - but AFAIK, they aren't.

The overall result is a bunch of massively bloated, resource hungry apps that, in reality could be way, way, way more efficient. Not to mention the fact that they'll all likely be running different versions of the web renderer, with all the associated security and update issues that that brings.

This is quite typical of the way a lot of development is done today - little or no consideration being given to whether or not the tools are appropriate to what is being built (using React for ridiculously simple portfolio sites etc.) - people just want to use whatever they know, or is the current 'cool' thing.

The priority always seems to be making it 'easier' for the developer with no regard to efficiency, resource use etc.

Thread Thread
 
khangnd profile image
Khang

Thank you, this is absolutely the insights that I would love to see.

Collapse
 
pcjmfranken profile image
Peter Franken

The author has already included a convenient list of some of the most bloated and worst performing ones right in in the article:

Some of the biggest desktop apps are made using electron like VS Code, Facebook Messenger, Twitch, Microsoft Teams.

Collapse
 
ruppysuppy profile image
Tapajyoti Bose

From the apps listed in the blog (as @pcjmfranken pointed out) you can see quite a few big names. Even though electron does come with a couple of cons its still the de facto standard till now.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

What??? You can do that in literally zero line of code, in Neutralino.js.

Collapse
 
l0uiscouture profile image
Louis Couture β€οΈπŸ³οΈβ€πŸŒˆπŸ‡ΊπŸ‡³βšœοΈ

Don’t use this. Electron is garbage and a waste of space. Use a PWA instead and/or react native. It’s literally like having multiple versions of chromes at the same time, totally useless.

Collapse
 
linshiyan1992 profile image
shiyan lim • Edited

15 lines of code===80 mega bytes binary.

Collapse
 
ruppysuppy profile image
Tapajyoti Bose

Yeah, the sad reality 😒