Nuclide

Introducing Atom IDE UI

Since the beginning, Nuclide has strived to provide a feature-rich IDE experience on top of Atom, with functionality like code diagnostics, jump to definition, and much more. However, over time we’ve heard feedback that the “one-size-fits-all” philosophy can be overwhelming for many Atom users.

That’s why we’re proud to announce the new Atom IDE UI package, which is part of our collaboration with GitHub in the broader Atom IDE initative. Read more about that on the Atom blog.

Screenshot

Atom IDE UI is fast and lightweight by design. It extracts only the subset of the core UI features from Nuclide necessary to support Atom’s atom-languageclient library in displaying features supported by the language server protocol. Like Nuclide, it’s a unified package which contains the following features:

Atom IDE UI is designed to work out-of-the-box with packages using atom-languageclient, such as ide-typescript and our own ide-flowtype.

As always, these features can be also be used directly via Atom services. Documentation for these APIs is available inside the atom-ide-ui repository.

Getting started

Using Atom IDE UI is as simple as:

  1. Install the atom-ide-ui Atom package
  2. Install an “ide-“ package for your favourite language:

Note that if you’re already a Nuclide user, all of Atom IDE UI’s features will still be bundled inside of Nuclide, so there’s no need to install another package.

Roadmap

The list of features in Atom IDE UI doesn’t yet encompass all the features available in the language service protocol, and over time we’ll be working to fill in the gaps. In particular, we’re looking to add:

Our hope is that other Nuclide features will eventually also become part of the Atom IDE effort, including key components like the Nuclide debugger. Note that we’re still committed to supporting the open-source Nuclide package for the foreseeable future.

Contributions and bug reports are welcome over at facebook-atom/atom-ide-ui!

The Atom IDE UI code is released under the BSD-3-Clause license.

Code Search

One of the missing features in the Quick Open pane is searching for code in your current projects. Internally at Facebook, we have a plugin that provides this functionality but we never offered a similar tool for the open source world. And we’ve just published this missing feature!!

Now you can use Quick Open (command + T on Mac and control + T on Windows and Linux) and type any code you want to look for. You can also explore the Code Search tab.

Quick Open

Code Search supports ripgrep (rg), silversearcher (ag) and ack. We recommend ripgrep and ag because they are blazing fast. Sadly, only ripgrep works properly on Windows. You can configure which tool to use in the Nuclide package settings under the nuclide-code-search tab.

If you don’t specifically select a tool, Nuclide will try to use any available one. On Windows, it will only try rg.

Settings

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.