News

Remember the Desktop? Electron 1.0 Debuts

With everybody espousing "mobile-first" and "cloud-first," it has basically become a "desktop-last" development world these days. But the desktop isn't forgotten. Promising the cross-platform creation of truly native Mac, Linux and Windows apps, Electron 1.0 has debuted following a two-year open source development effort.

The catch is, it's done with Web-based technology -- leveraging Chromium, Node.js, HTML, CSS and JavaScript -- something abhorred by many developers. But something also welcomed by many.

"Electron 1.0 represents a major milestone in API stability and maturity," said GitHub Inc. developer Jessica Lord in a blog post yesterday. "This release allows you to build apps that act and feel truly native on Windows, Mac and Linux. Building Electron apps is easier than ever with new docs, new tools, and a new app to walk you through the Electron APIs."

Electron technology started out as the basis of GitHub's Atom code editor (then called Atom Shell) slightly more than two years ago. Though derided by many for being too slow, the technology has enjoyed exploding growth and popularity and now underlies popular software such as Slack, Visual Studio Code, WordPress and many more.

Driving that popularity is the cross-platform simplicity of Web technologies. "Supporting multiple platforms often means untangling sets of specialized tools or navigating the nuances of a whole new programming language," says a video accompanying yet another Lord-authored blog post. Web apps, in contrast, run basically anywhere because almost everybody has a browser. They're also supported by an extensive ecosystem of libraries and frameworks, like Bootstrap, React, AngularJS, jQuery and more.

However, Web developers face their own challenges in tailoring their wares for different browsers and OSes and interacting with native file systems. Web app performance can also be degraded by slow network connections. Electron is designed to take the best of both worlds to enhance their advantages and smooth out the hard parts.

"What if you could take the pervasiveness of Web technology, the native experience of a desktop application and the cross-platform versatility of the humble Web browser and wrap everything into a single package with all of the advantages and none of the barriers?" the video asks. That's the idea behind Electron.

Along with API stability and usability improvements, Electron 1.0 comes with some new tools to help developers.

 Electron API Demos App
[Click on image for larger view.] Electron API Demos App (source: GitHub)

Among these is the Electron API Demos app, with examples, code snippets and tips to help developers explore Electron APIs and learn to make Electron apps look and feel native.

For improved debugging, a new Chrome Developer Tools extension called Devtron aids in code inspection and troubleshooting.

Devtron, for Debugging
[Click on image for larger view.] Devtron, for Debugging (source: GitHub)

A third tool, an integration testing framework called Spectron, has been improved in a version 3.0 upgrade. "Spectron 3.0 has comprehensive support for the entire Electron API allowing you to more quickly write tests that verify your application's behavior in various scenarios and environments," Lord said. "Spectron is based on ChromeDriver and WebDriverIO so it also has full APIs for page navigation, user input, and JavaScript execution.

Also, a new Electron Community page lists myriad Electron ecosystem tools, apps, boilerplates, libraries, components and frameworks, along with how-to videos for creating desktop apps, packaging and distribution, multi-window development and more. It's based on the extensive Awesome Electron GitHub site.

The Growth of Electron
[Click on image for larger view.] The Growth of Electron (source: GitHub)

"Electron 1.0 is the result of a community effort by hundreds of developers," Lord said. "Outside of the core framework, there have been hundreds of libraries and tools released to make building, packaging and deploying Electron apps easier."

Whether it becomes easy and performant enough for the majority of mainstream desktop developers is an open question. There's still some friction regarding the project on coding sites such as Hacker News and Reddit:

  • "Electron is the cancer that is killing desktop computing."
  • "Slow, sluggish, resource hungry and looks alien everywhere."
  • "Native apps just feel better. It's all those ms (milliseconds) here and there that in the end make huge difference. Still best showcase is Sublime v Atom. I use Atom, because it's free and open-source, but when I fire up Sublime from time to time, it is amazing how better it feels."
  • "It's Web developer's revenge for Java applets."

Note, however, there are probably an equal number of proponents (and, notably, many more of these folks seem to actually be using Electron in real-world development):

  • "I've been building on Electron for the last 18 months (@Nylas), and it's really impressive how far it's come in the last year. Coming from native Mac OS X development, Electron is an breath of fresh air."
  • "My team is currently rewriting our Java app with Electron. The advantages for us is faster iteration time, more accessible language, cross platform with almost no extra work, and we can re-use some of the code for our mobile & Web platform."
  • "One of the things I really like about Electron apps is they look good consistently across platforms, which is something I don't often see for cross-platform apps."
  • "Congrats to the Electron community! We've been excitingly using Electron at Wagon to build SQL analytics tools. We're using Haskell + React + Electron as our primary technologies: wagonhq.com/blog/electron."

The debates will rage on, but Electron has definitely secured a place in many devs' toolboxes.

"In just the last year, we've seen 1.2 million downloads and a growing community of hundreds of developers, open source maintainers, and companies who use the framework as the foundation of their apps," Lord said. "They've built everything from e-mail, chat, and Git apps to SQL analytics tools, torrent clients, and robots."

All Electron releases can be accessed from this page.

About the Author

David Ramel is an editor and writer for Converge360.