Here is when Electron enters the picture to save the day.

Electron allows you to build desktop applications using HTML, CSS, and JavaScript.

But why is it then that many people argue so poorly against it?

How to use Electron to build responsive desktop apps

The problem starts with the apps and the way people use Electron.

Is this a terrible thing to do?

Maybe not, but you are not taking advantage of the power of Electron to its fullest.

Article image

You are merely changing a internet tool tab for an independent tool.

What can we improve?

It’s free, every week, in your inbox.

Article image

How does Electron work?

Electron Architecture

Electron works with two types of processes.

Its important to note that the renderer processes cannot access OS features directly.

Article image

Instead, they communicate with theMain Processthrough IPC to achieve these tasks.

Many typical Electron applications would use the main process to create one renderer process and load their web utility.

Today we are going to take that a step forward.

Article image

Must-have section: Hello World!

Next, we are going to build a hello world!

We will not use any framework or libraries that are not necessary to stay focused on the Electron code.

Article image

Next, install Electron.

It will also address some scenarios to exit the utility and to re-launch the main window when needed.

The short answer is YES!

Article image

Though it comes at a cost.

But they are a great place to get you started.

How do we keep them performant?

It is the parent process for all the processes of the system.

Blocking this process means that the utility will stop responding until the operation finishes.

Under no circumstances run code that is CPU intensive here and takes a long time to complete.

Here are some recommendations:

Is it ok to block the renderer process?

Your windows may become sluggish or unresponsive, and the overall user experience will be terrible.

Be aware of this, as user expectations matter.

What can I do to make my apps more responsive?

When building Electron applications, you dont need any of that.

Reduce your bundles, and make everything faster by not loading these extra modules.

After all, for the web, we always need to download these assets to spin up the utility.

For desktop applications, this is different.

Just be aware, Electron can be great if used right.

Sign up for updates on everything related to programming, AI, and computer science in general.

Also tagged with