A new major version of Electron is in the works, and with it some changes to our versioning strategy. As of version 2.0.0, Electron will strictly adhere to Semantic Versioning.
This change means you'll see the major version bump more often, and it will usually be a major update to Chromium. Patch releases will also be more stable, as they will now only contain bug fixes with no new features.
Major Version Increments
Chromium version updates
Node.js major version updates
Electron breaking API changes
Minor Version Increments
Node.js minor version updates
Electron non-breaking API changes
Patch Version Increments
Node.js patch version updates
fix-related chromium patches
Electron bug fixes
Because Electron's semver ranges will now be more meaningful, we recommend
installing Electron using npm's default --save-dev flag, which will prefix
your version with ^, keeping you safely up to date with minor and patch
updates:
npm install --save-dev electron
For developers interested only in bug fixes, you should use the tilde semver prefix e.g. ~2.0.0, which which will never introduce new features, only fixes to improve stability.
For the last two years, Electron has helped developers build cross platform
desktop apps using HTML, CSS, and JavaScript. Now we're excited to share a major
milestone for our framework and for the community that created it. The release
of Electron 1.0 is now available from electronjs.org.
Electron 1.0 represents a major milestone in API stability and maturity. 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.
If you're ready to build your very first Electron app, here's a quick start guide
to help you get started.
We are excited to see what you build next with Electron.
We released Electron when we launched Atom a little over two years ago.
Electron, then known as Atom Shell, was the framework we'd built Atom on top of.
In those days, Atom was the driving force behind the features and functionalities
that Electron provided as we pushed to get the initial Atom release out.
In these last two years we've seen both companies and open source projects
choose Electron as the foundation for their apps. Just in the past year, Electron
has been downloaded over 1.2 million times. Take a tour of some
of the amazing Electron apps and add your own if it isn't already there.
Along with the 1.0 release, we're releasing a new app to help you explore the
Electron APIs and learn more about how to make your Electron app feel native.
The Electron API Demos app contains code snippets to help
you get your app started and tips on effectively using the Electron APIs.
We've also added a new extension to help you debug your Electron
apps. Devtron is an open-source extension to the Chrome Developer Tools
designed to help you inspect, debug, and troubleshoot your Electron app.
Require graph that helps you visualize your app's internal and external
library dependencies in both the main and renderer processes
IPC monitor that tracks and displays the messages sent and received
between the processes in your app
Event inspector that shows you the events and listeners that are registered
in your app on the core Electron APIs such as the window, app, and processes
App Linter that checks your apps for common mistakes and missing
functionality
Finally, we're releasing a new version of Spectron, the integration
testing framework for Electron apps.
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. Spectron is based on ChromeDriver
and WebDriverIO so it also has full APIs for page navigation, user
input, and JavaScript execution.
Electron 1.0 is the result of a community effort by hundreds of developers.
Outside of the core framework, there have been hundreds of libraries and tools
released to make building, packaging, and deploying Electron apps easier.
There is now a new community page that lists many of the awesome
Electron tools, apps, libraries, and frameworks being developed. You can also
check out the Electron and Electron Userland
organizations to see some of these fantastic projects.
New to Electron? Watch the Electron 1.0 intro video:
Electron 0.37 was recently released and included a major upgrade from Chrome 47 to Chrome 49 and also several new core APIs. This latest release brings in all the new features shipped in Chrome 48 and Chrome 49. This includes CSS custom properties, increased ES6 support, KeyboardEvent improvements, Promise improvements, and many other new features now available in your Electron app.
If you've used preprocessed languages like Sass and Less, you're probably familiar with variables, which allow you to define reusable values for things like color schemes and layouts. Variables help keep your stylesheets DRY and more maintainable.
CSS custom properties are similar to preprocessed variables in that they are reusable, but they also have a unique quality that makes them even more powerful and flexible: they can be manipulated with JavaScript. This subtle but powerful feature allows for dynamic changes to visual interfaces while still benefitting from CSS's hardware acceleration, and reduced code duplication between your frontend code and stylesheets.
The variable value can be retrieved and changed directly in JavaScript:
// Get the variable value ' #A5ECFA' let color =window .getComputedStyle(document.body) .getPropertyValue('--awesome-color'); // Set the variable value to 'orange' document.body.style.setProperty('--awesome-color','orange');
The variable values can be also edited from the Styles section of the development tools for quick feedback and tweaks:
Chrome 48 added the new code property available on KeyboardEvent events that will be the physical key pressed independent of the operating system keyboard layout.
This should make implementing custom keyboard shortcuts in your Electron app more accurate and consistent across machines and configurations.
window.addEventListener('keydown',function(event){ console.log(`${event.code} was pressed.`); });
The version of V8 now in Electron incorporates 91% of ES2015. Here are a few interesting additions you can use out of the box—without flags or pre-compilers:
// Destructuring an array and skipping the second element const[first,, last]=findAll(); // Destructuring function parameters functionwhois({displayName: displayName,fullName:{firstName: name }}){ console.log(`${displayName} is ${name}`); } let user ={ displayName:'jdoe', fullName:{ firstName:'John', lastName:'Doe', }, }; whois(user);// "jdoe is John" // Destructuring an object let{ name, avatar }=getUser();
Since the beginning of Electron, starting way back when it used to be called Atom-Shell, we have been experimenting with providing a nice cross-platform JavaScript API for Chromium's content module and native GUI components. The APIs started very organically, and over time we have made several changes to improve the initial designs.
Now with Electron gearing up for a 1.0 release, we'd like to take the opportunity for change by addressing the last niggling API details. The changes described below are included in 0.35.x, with the old APIs reporting deprecation warnings so you can get up to date for the future 1.0 release. An Electron 1.0 won't be out for a few months so you have some time before these changes become breaking.
By default, warnings will show if you are using deprecated APIs. To turn them off you can set process.noDeprecation to true. To track the sources of deprecated API usages, you can set process.throwDeprecation to true to throw exceptions instead of printing warnings, or set process.traceDeprecation to true to print the traces of the deprecations.
Built-in modules are now grouped into one module, instead of being separated into independent modules, so you can use them without conflicts with other modules:
var app =require('electron').app; varBrowserWindow=require('electron').BrowserWindow;
The old way of require('app') is still supported for backward compatibility, but you can also turn if off:
Because of the way using built-in modules has changed, we have made it easier to use main-process-side modules in renderer process. You can now just access remote's attributes to use them:
// New way. var app =require('electron').remote.app; varBrowserWindow=require('electron').remote.BrowserWindow;
Instead of using a long require chain:
// Old way. var app =require('electron').remote.require('app'); varBrowserWindow=require('electron').remote.require('BrowserWindow');
The ipc module existed on both the main process and renderer process and the API was different on each side, which is quite confusing for new users. We have renamed the module to ipcMain in the main process, and ipcRenderer in the renderer process to avoid confusion:
// In main process. var ipcMain =require('electron').ipcMain;
// In renderer process. var ipcRenderer =require('electron').ipcRenderer;
And for the ipcRenderer module, an extra event object has been added when receiving messages, to match how messages are handled in ipcMain modules:
The BrowserWindow options had different styles based on the options of other APIs, and were a bit hard to use in JavaScript because of the - in the names. They are now standardized to the traditional JavaScript names:
The API names in Electron used to prefer camelCase for all API names, like Url to URL, but the DOM has its own conventions, and they prefer URL to Url, while using Id instead of ID. We have done the following API renames to match the DOM's styles:
Url is renamed to URL
Csp is renamed to CSP
You will notice lots of deprecations when using Electron v0.35.0 for your app because of these changes. An easy way to fix them is to replace all instances of Url with URL.
We have restructured and standardized the documentation to look better and read better. There are also community-contributed translations of the documentation, like Japanese and Korean.
A patch by @jaanus has been merged that, like the other built-in OS X apps, allows creating frameless windows with system traffic lights integrated on OS X Yosemite and later.