JavaScript framework Electron: With JavaScript to the desktop app

JavaScript framework Electron: With JavaScript to the desktop app

 

Note: We have used commission links in this article and marked them with “*”. If an order is placed via these links, t3n.de receives a commission.

Electron uses web technologies to implement cross-platform applications for the desktop. This is what the open source framework from GitHub has to offer and this is how you start your first project.

JavaScript was originally developed for the web browser. Contents should be able to change dynamically without manual reloading. This only became possible with the scripting language, which has been the most widely used programming language on GitHub for years. The very active developer community is constantly creating numerous tools, frameworks and libraries with which JavaScript has long since ceased to be used only for the web. This includes mobile cross-platform apps as well as server and desktop applications – which has been implemented with Electron since 2013.

The “State of JavaScript 2018” survey shows that there is a high level of interest in Electron among programmers. (Source: State of JavaScript 2018)

The open source framework has been public for more than five years. In December 2018, Electron also made the jump to the new major version 4. Nevertheless, in 2018, only around 22 percent of the participants surveyed in the annual developer survey “State of JavaScript” stated that they had already Outstaffing  worked with the framework. But the interest in Electron seems huge. Over 53 percent of programmers have not only heard of Electron, they also want to try it out. According to the survey, the framework is the most popular in the mobile and desktop sector. What makes Electron so special?

Electron simplifies desktop development

Developing a desktop application poses an immense number of challenges. This includes packaging, update management or learning new programming languages ​​and tools if the programmers come from other areas – such as web development. Providing the application for the various Windows, MacOS and Linux operating systems is also a major challenge. Especially when features such as native menus or notifications are to be implemented.

Web applications, on the other hand, have the edge when it comes to platform independence. Almost every user has a web browser installed that comes with support for HTML, CSS and JavaScript. Most browsers such as Google Chrome or Mozilla Firefox also have powerful debugging tools on board, which make the work of programmers even easier. In addition, the huge JavaScript community ensures steady growth in libraries and frameworks.

No question about it: There are also some stumbling blocks in web development. A common requirement for a website is to support the many different browser types and older versions. Then there are the many different platforms: The design must be responsive in order to work well on desktop, tablet and smartphone, which can quickly increase the effort. In addition, there is limited access to the file system. Direct reading, writing or creation of files in a specific directory on the end devices is not possible – therefore files must always be uploaded or downloaded separately. Web applications are also mostly dependent on a good network connection.

Electron is taking advantage of web development and transferring it to desktop development. This avoids disadvantages such as the dependency on the network connection and the limited access to the file system. In order to write cross-platform desktop applications with web technologies such as JavaScript, HTML and CSS, Chromium and Node.js are combined: Chromium is an open source browser on which Google Chrome, among other things, is based. The combination with the asynchronous, event-based JavaScript runtime environment Node.js ensures that an Electron application is ultimately nothing more than a kind of web browser with the ability to access the local file system. Reading and writing files normally is no longer a problem. Ultimately, the user interfaces are nothing more than websites – designed with HTML and CSS. Admittedly, it is difficult to imagine how a website could turn into a desktop application. But Electron apps no longer look like websites. There are even numerous advantages to developing with web technologies. Some companies are already taking advantage of this: Popular software such as Slack or Visual Studio Code rely on the GitHub open source project. Whether useful or not: Even games or photo editing tools are possible with the framework.

Pros and cons for use

Anyone who is at home in web development will quickly find their way into Electron, as it is ultimately a JavaScript framework like others. Even for novice programmers, Electron should be much less daunting than some other tools: Both JavaScript and Node.js are comparatively easy to learn. The benefits that can be booked for Electron include automatic updates, crash reports, and debugging and profiling. Native features such as menus and notifications can also be used with little effort.

You might be interested in that too

Ready to see us in action:

More To Explore

IWanta.tech
Logo
Enable registration in settings - general
Have any project in mind?

Contact us:

small_c_popup.png