Nuclide

Command + Click: You Have One Job

One of the cool things about Nuclide is that, even though it’s an IDE with a ton of awesome IDE features, it still belongs to the TextMate/Sublime/Atom lineage of modern text editors. Unfortunately, sometimes these two things come into conflict. Such is the case with command click…

See, in the Atom family of editors, command + click (control + click on Windows and Linux) means multiple cursors.But if you’re coming from an IDE, you’re probably used to using command + click to jump to a definition (“Hyperclick”).

Since Nuclide is both of these things, we’ve always tried to do both: if you clicked on something that we could get a definition for, we’d take you to it; otherwise, we’d let Atom do its default behavior (add another cursor). This way we only interfered with expected Atom behavior when we knew we were supposed to. Perfect! Right?

An internal poll

It turns out that, in trying to accommodate everybody, we hadn’t made command + click predictable to anybody. It’s true: when you command click on something, you may want to go to its definition. Or you may want to add another cursor. But nobody wants to sometimes go to its definition and sometimes add a cursor. Sorry about that.

So as of v0.207 (rolled out last week!), command clicking will always jump to definition.

Upgrade Path

We know that these kind of breaking changes are disruptive, so the first time you command + click, we’ll show you a one-time notification explaining the situation:

Don’t despair, multicursor fans! command + option + click still works! (In Sublime too.) Or if you really insist on using command + click for multiple cursors, you can change the Hyperclick trigger to something else in the Nuclide package’s settings.

Nuclide v0.111.0: The Unified Package

This is a significant release for Nuclide that is mainly aimed at improving and simplifying Nuclide as an open source project. The most apparent and important change is moving Nuclide from many Atom packages—44 of them to be exact—to just one: nuclide. We will discuss below why we are excited about moving to a single package and how it improves Nuclide for everyone, but first we will cover how to get going with the new release.

Installing Nuclide v0.111.0

Nuclide v0.111.0 is a single Atom package. To install it, you can either search for the ‘nuclide’ Atom package in Atom > Packages > Install or install it from the command line with apm. While this release focuses on moving to a single package, it does include fixes and improvements that you can find in the CHANGELOG.md.

$ apm install nuclide

Installing Nuclide Server v0.111.0

Nuclide’s server has moved into the ‘nuclide’ NPM package. The server is required only if you intend to edit remote files from within Atom+Nuclide, and it should be installed on the host where the remote files live. We recommend installing the server as a global module using NPM’s -g flag so its binaries are available in ‘/usr/local/bin’.

$ npm install -g nuclide

New Version Scheme

The last version of the Nuclide packages that were published was v0.0.35. Internally, however, the server was last released as v0.108.0. This release adopts our internal version scheme so the versions stay in sync with open source releases.

Migrating from Previous Versions

If you previously installed Nuclide via the nuclide-installer package or by installing nuclide- packages individually, you should uninstall them first. Follow the v0.0.35 uninstall instructions to ensure previous versions of Nuclide are removed.

The new ‘nuclide’ package will automatically disable any deprecated ‘nuclide-*’ packages and warn you on start up that you should uninstall them to ensure everything works as expected.

Configuring Single-package Nuclide

Because Nuclide is now a single Atom Package, its settings are unified under the ‘nuclide’ package in Atom > Packages > nuclide > Settings.

Features you may have been familiar with as separate packages before, such as Hyperclick, Diagnostics, and File Tree, are now listed as features in Nuclide’s Settings page and are togglable as if they were Atom packages. If you want to use only one or a few of the features of Nuclide, you can disable the rest of Nuclide without incurring any load time for the disabled features’ code. All features are enabled by default.

Migrating Settings from Previous Packages

If you changed settings in any of Nuclide’s previous packages, the settings will be automatically migrated to their new location in the nuclide. namespace when you first launch Atom after installing the ‘nuclide’ package. The settings will be configurable like before but under the Atom > Packages > nuclide > Settings rather than under the package’s name.

Why a Single Atom Package?

The Atom ecosystem is centered around modular packages that can be installed and updated independently, and Nuclide took that same approach from the start. We wrote scripts to let our code live in a single repository but be released as many Atom packages. Nuclide releases were actually simultaneous releases of 40+ Atom packages. While this fit well with the Atom model, it meant we also had to distribute a “installer” package that oversaw the installation of top-level Atom packages.

In practice, the installer process was computationally expensive, difficult to troubleshoot, and took roughly 40 minutes partially due to large amounts of network traffic. When all Nuclide packages were installed, they filled over 3GB of disk space. Nuclide packages are heavily interdependent, and because they were installed as top-level Atom packages they each had their own ‘node_modules’ directory with largely duplicate dependencies.

By unifying Nuclide into a single Atom package, we aimed to improve installation, updates, and maintenance. The single ‘nuclide’ package does not require a special installer, only apm install like other Atom packages. This simplifies installation for everyone and makes Nuclide updates fast. Once installed, the ‘nuclide’ package takes under 110MB of disk space, a 95%+ reduction in disk use, and subsequently, network use during installation. The dramatic drop in disk use was possible because Nuclide’s features now share a single ‘node_modules’ directory and use relative paths to require one another, eliminating the duplicate dependencies present when Nuclide was 40+ top-level Atom packages.

What’s Next?

We are excited to greatly improve the experience of Nuclide for users outside Facebook. This release should solve many of the most common installation and upgrade issues that have been reported, and it paves the way for more frequent and more stable releases. We hope that simplifying the installation process will make Nuclide’s source more familiar to other Atom developers and make it easier for anyone to contribute.

If you run into issues with the upgrade process, or if you run into any issue at all, open a Nuclide GitHub issue so we can help out.