June 23, 2015Backend · Development Tools

Building Nuclide, a unified developer experience

Michael Bolin

At this year's F8, Facebook's developer conference, our infrastructure team talked about Nuclide, a project designed to provide a unified developer experience for engineers throughout the company — whether they work on native iOS apps, on React and React Native code, or on Hack to run on our HHVM web servers.

In addition to being an important part of our own production stack, Hack, HHVM, and React are, of course, amongst our most popular open source projects, and we realized that it would be helpful to those communities if we shared Nuclide as well. So over the last few months, we've been preparing to bring the project to the broader engineering community, and we're proud to announce that we're starting that journey today by making the source code available on GitHub.

Standing on the shoulders of giants

When we were looking at ways to bring this idea of a new internal developer experience to life, we realized we didn't want to build a new editor from scratch. At about the same time, we first saw (and quickly fell in love with) GitHub's Atom project. Over the last few years, we've worked closely with GitHub on our open source program as a whole — as well as on industry initiatives like the TODO Group — so we knew it would be an interesting option from the start.

But our key factor in deciding how to build Nuclide was that the result needed to be hackable. Of course, the Nuclide team itself needed an extensible platform to build the project upon. But just as important, the Facebook culture encourages broad collaboration — the motto "Nothing at Facebook is someone else's problem" hangs as posters on our walls — and so we also knew that we needed an approach that would allow people throughout the company to customize the project to the needs of their own teams and projects.

Atom provides exactly this sort of platform. It is built with contemporary web technology that allows us to use our own React and ES7 expertise. It provides a powerful native shell for integrating well with local mobile compilers and build tools. It already has a rich ecosystem of community packages for every language and keybinding imaginable. It has a rich and extensible API that allows us to quickly develop Nuclide-specific functionality. Above all, by making the source available itself, it allows us to upstream the changes we make to the core in order to benefit others.

What is Nuclide?

Nuclide is, therefore, simply a suite of packages for Atom. We've been able to avoid forking the editor's core, so Nuclide will install on a recent, regular version of Atom and users can continue to benefit from other community packages alongside Nuclide's.

Making the source available in this initial release, the suite includes some of the significant packages we've developed for engineers at Facebook. The functionality includes:

  • Remote development. At Facebook, our web and back-end engineers work on remote development servers in our data centers. Nuclide provides a pair of packages that allow connections over SSH to a lightweight node daemon on the server, making possible remote file editing and syntax/type validation. Of course, this also works for VMs, enabling local development on HHVM, for example.
  • Hack language support. The Hack codebase is one of the largest at Facebook. First-class Hack support — including syntax highlighting, type-checking, autocomplete, and click-to-symbol features — has been an important requirement on Nuclide from the start. We're also excited that the growing Hack community outside the company will be able to enjoy dedicated IDE support.
  • Flow support. For both local and remote JavaScript development, Flow has brought type integrity and the ability to quickly refactor our React components and apps. As it does for Hack, Nuclide supports Flow-specific decorations and editor features in @flow-annotated files.
  • Mercurial support. We now use Mercurial as our primary source control platform, so of course Nuclide adds support accordingly. This includes working to change highlighting in the file tree, bookmark labeling, and a read-only diff viewer — again, for both local and remote development.
  • Omni-search. Last but not least, this initial release includes our universal search tool package. In a large, multi-language codebase like ours, finding files and symbols quickly and efficiently is important for our engineers. Here's a glimpse:

The start of a journey

While we're pleased to share these initial packages with the community, we want to emphasize that this is just an early start to the project. For one thing, there is still plenty we can do to improve these packages themselves, and we are very excited to work with the community to collaborate and iterate on them. Pull requests are welcome!

But we also have a lot more planned, and our vision of a unified cross-platform developer experience is far from complete. Support for the iOS, React, and React Native use cases are all on the upcoming roadmap of packages to share. We know debugging is important on both the server and mobile sides, and this is also coming soon. Nuclide grows in functionality as underlying projects like Buck and Infer do. And finally, we are also excited (as many of you in the community probably are!) to start supporting forthcoming patterns like Relay and GraphQL as important first-class citizens in the suite.

Every one of these technologies is used in production at Facebook, and in some way we hope Nuclide showcases how naturally they integrate together. What's more, just as we want our own engineers to be able to write and debug code throughout our whole stack with consistent tools, we hope that we can help mobile, web, and back-end developers outside the company be as efficient and as innovative as ever too.

Finally, a project like Nuclide would never have been possible without the support and work of GitHub and the amazing community in general. So, thank you! We hope you enjoy trying Nuclide out and getting involved with the project.

Want to work with us?

Join the team, we're hiring! Here are some of our current open positions:

    Keep Updated

    Stay up-to-date via RSS with the latest open source project releases from Facebook, news from our Engineering teams, and upcoming events.

    Subscribe
    Facebook © 2017