Node.js: Building Better Technology and a More Diverse Community

339

Almost exactly one year ago Node.js released version 4, the first release after the re-unification of the io.js and Node.js codebases, Mikeal Rogers, Node.js Community Manager, reminded attendees at the Node.js Interactive conference in Amsterdam on Thursday. Since then, the project has become the fastest growing open source community in the world, effectively doubling active members every year. Now, there are 87 committers working on the core repository alone, and more than 400 modules are published every day.

Rogers reflected on why Node.js, a Linux Foundation project, is so successful. Apart from running on all kinds of environments, from cloud, to desktop, to mobile, to IoT, he concluded that “Node lowers the barrier for all environments.” He pointed out how Cordova makes programming for all mobile platforms easy, how Electron eases the development of apps for any desktop, and how NodeBots is leading the way in development for robotics and micro-controlled devices.

State of the Node Union

James Snell, Technical Lead at IBM, furthered this message of growth in his “Core State of the Union” keynote. When Snell got involved with Node in January 2015, the team of core developers had actually shrunk down to 14 contributors after the io.js fork in December 2014.

Today, more than a thousand individuals contribute in total — with 476 members in the Node.js organization on GitHub, 103 related GitHub repositories, and 92 teams. However, the number of overall major commits has not grown proportionally to the number of contributors. This is not a bad thing, according to Snell. Instead of adding new functionality, most developers have focused on stabilizing the core, making transitioning from one version to the next a much easier process than with earlier releases.

Another task involves adapting all major commits to as many architectures as possible. Important changes to the core are tested on everything, from all major flavors of Linux (including Raspbian), to Windows, MacOS X, and FreeBSD, plus several dockerized and virtual systems. This means that whatever you are running Node.js on, the core team will probably test that changes will not break your setup.

As for ongoing work, Snell said the team were working hard to improve standards compliance in Node. Developers are on track to fully comply with the HTTP 1.1 specifications and are making headway in complying with HTTP/2. Efforts are also underway to implement support for ES6 (ECMAScript version 6), but this is happening more slowly, he said.

The Event Loop, Untangled

Bert Belder, a Node.js core developer and founder of StrongLoop, wanted to help the audience understand how the all-important event loop worked. Despite being one of the most critical components of the Node.js architecture, Belder explained that the event loop is very poorly understood and that most graphical interpretations trying to explain it are plain wrong.

In his rather technical talk, Belder described how the Event Loop doesn’t actually branch out to carry out tasks but delegates their execution to workers. Callbacks and parsing the results from tasks are handled by the so-called “unicorn process.” As callbacks are declared, a counter is increased by 1 in the unicorn process. As callback functions finish, a 1 is subtracted from the counter, and, when it reaches zero, the loop exits and the program finishes.

Promoting Diversity

Focusing more on the human side of things, both Ashley Williams and Tracy Hinds described the need to promote inclusiveness and diversity within the Node.js community.

Ashley Williams is the founder of NodeTogether, a work group that travels the world teaching Node.js to people that may not be included in the mainstream community of Node.js developers. In five-hour sessions, Williams and the NodeTogether mentors teach students to create a practical and working web app that they can deploy online. She explained that by creating a safe space devoid of prejudice, where all participants come from diverse backgrounds, NodeTogether has managed to create stable communities of Node developers within underrepresented groups, made up of mentors and students that continued working beyond the sessions.

Node.js Education Community Manager Tracy Hinds then explained the efforts being carried out by Node.js’s own Inclusivity Program. Hinds posited that Node.js’s lack of diversity may stem from a tyranny of structurelessness, arguing that the community had grown organically, concerned mainly with technological matters and disregarding inclusiveness. This, she said, is a mistake, because diversity has proven to have a long-term positive impact on communities and projects.

Hinds thinks that “to improve we have to take fault” and implement explicit and proactive strategies to promote inclusiveness. The inclusivity work group is, for example, promoting more diverse panels and lineups of speakers at conferences and encouraging the inclusion of underrepresented groups. They are also aiming to improve online communication and establishing a code of conduct and moderation for the Node IRC and GitHub. The work group has also set up a board to field complaints about inappropriate interactions. Finally, they are setting measurable goals to gauge the effectiveness of these strategies.

The aim, ultimately, is to make Node.js a first-class technology and to build a first-class community to go with it.

Want to learn Node.js? See our tutorial on how to get started writing web applications with Node.js.