Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News GitHub Rewrites its Desktop Client Using Electron

GitHub Rewrites its Desktop Client Using Electron

Leia em Português

This item in japanese

GitHub moved away from the native implementations of its macOS and Windows clients and replaced them with a complete rewrite based on Electron, announced GitHub’s director of client applications Phil Haack. Along with GitHub Desktop Beta, GitHub has also introduced a new beta of Atom sporting out-of-the-box Git and GitHub Integration.

As the team behind the rewrite explained, the key reason for GitHub to rebuild their desktop client from scratch was minimizing the cost of supporting multiple platforms. Indeed, developing native apps for Windows and macOS required using two completely different stacks, which meant having to implement, debug, and maintain each feature twice. Similarly, adding support for a third platform like Linux would have required a separate effort.

As it turns out, building native apps for multiple platforms doesn’t scale.

The GitHub team quickly converged on basing their new app on Web technologies, specifically Electron and TypeScript. Among the advantages of using Web technologies, the code-build-run cycle went down from minutes to seconds, with code changes reloading in place and the possibility of live-tweaking their design. Yet, using Web technologies to build desktop apps is not without its own set of limitations and constraints:

The web isn’t a perfect platform, but native apps aren’t built on perfect platforms either. Rewriting on Electron does mean swapping one set of trade-offs for another.

This is where using Electron paid off, explain the developers, since it gave them the chance to tweak things by extending Electron on top of the platform-specific API.

After about one year of development, the new Electron-based client can be now downloaded or forked. InfoQ has spoken with Phil Haack to learn more about their commitment to Electron.

Since its introduction, Electron has been chosen as the foundation for many notable apps. How would you describe the role Electron plays in the current arena of solutions to write cross-platform code solutions?

Phil Haack: Electron leverages the success of the web becoming a first-class platform; over time, Electron and the web are headed in the same direction, just from opposite ends. The fact that users can leverage folks with web-technology skills to build desktop apps is part of Electron’s success.

There has been a rather heated discussion recently on Reddit where Electron was dubbed “Flash for Desktop” — mostly due to its memory requirements and performance. What arguments would you propose to developers that are critical of Electron to better understand why it is an important technology?

Haack: As I mentioned before, Electron has hitched its wagon to the success of web technologies as a platform. As Chromium, Node, JavaScript, HTML, CSS, etc. continue to improve under the weight of huge investments in our industry, like from Google, Microsoft, Facebook, Slack, GitHub, and many others – Electron benefits as a result. That’s a lot of firepower directed at these set of tools. Thus, for those critical of Electron, I’d note the general history of these technologies, how they’ve improved and how they will continue to improve. We’re having many good conversations about improving Electron.

How much would you like Electron on mobile? Any chance that we will get there, in your opinion?

Haack: We’ve heard from our community that this is something they’d like to see, but given that Chromium is 90% of the codebase, we’re bound to places where Chromium and Node.js can run. That eliminates iOS and makes Android difficult. There’s a great opportunity here for the creation an API-compatible implementation.

As mentioned, GitHub has also announced a new Git and GitHub Integration for Atom, available in Atom 1.18 beta, with the goal of allowing developers to manage their Git workflows from within the editor, thus reducing the context switching implied by dropping to the command line or a separate tool.

Rate this Article