BT

Atom 1.13 Brings Benchmarks, Project History, and Keystroke Resolver API

| by Sergio De Simone Follow 17 Followers on Jan 12, 2017. Estimated reading time: 2 minutes |

Version 1.13 of Atom, GitHub’s Electron-based open source text editor, adds a host of new features and improvements for users and developers, including a benchmarking tool, a Reopen Project menu option and API, and a custom keystroke resolver to map Chrome keyboard events to Atom-style keystrokes.

Previous to Atom 1.13, the only way to measure how changes in Atom’s codebase affect performance was using Chrome’s profiler. Atom 1.13 introduces a new atom --benchmark option that allows developers to run benchmarks on their machine and compare how different versions of Atom compare when running the same benchmark. The benchmark command is also available from the command palette invoking Window: Run Benchmarks and will execute all benchmarks found in the benchmarks directory. If you invoke atom --benchmark, you will get a textual output in CSV format; otherwise, Atom will plot the benchmark on screen.

To make it possible to go back to a previous editor state without resorting to using unusual command line options, version 1.13 introduces a new Reopen Project command and a related atom.history API. The new API includes the .getProjects(), .clearProjects(), and .onDidChangeProjects(callback) endpoints. The number of cached project names can be defined using core.reopenProjectMenuCount and defaults to 15.

Additionally, Atom 1.13 adds a new keystroke resolver API which aims to solve a number of bugs related to keyboard event handling by allowing to define how to interpret keystrokes:

atom.keymaps.addKeystrokeResolver(({event}) => {
  if (event.code === 'KeyG' && event.altKey && event.ctrlKey) {
    return 'ctrl-@'
  }
})

In particular, this should help improve keyboard event handling when modifier keys are used and with international layout.

As a final note, Atom 1.13 pulls back the Shadow DOM boundary, which was used to render the editor’s contents inside a protected namespace to avoid conflicts between styles belonging to the editor and styles intended for other elements in the workspace. The Shadow DOM boundary approach suffered from a number of issues and has been replaced in version 1.13 by the Light DOM, an approach that consists in prepending syntax-- to syntactic class names, e.g.:

.syntax--source.syntax--js .syntax--operator {
  color: #000000;
}

Atoms provides a guide describing the process of removing Shadow DOM styles from existing themes or packages. The required changes are not backward-compatible, meaning that an upgraded theme or package will not be able to run in versions of Atom prior to 1.13.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT