React Gets a New Front-End Library — and a New License
React version 16.0 arrived this morning, bringing with it new render return types and better error handling.
Perhaps the biggest change, however, is the swapping of licenses behind the project. Until today, React had been distributed under a BSD license with patents encircling the project. This led to many developers leaving the React community for fear of being brought up on patent infringement charges.
Facebook’s side of the argument has been that its patents are there to protect users from trolls who might bring suit against them and their applications. Unfortunately, in recent weeks, the rancor over the license reached a fevered pitch, culminating in some developers throwing out React all-together.
Today’s release marks the first React release under the MIT license. React 15.6.2 is also now available under that same license so that developers who cannot yet make the jump to version 16.0 can also benefit from this more permissive, less patent-encumbered license.
Other Facebook projects will soon be making the transition to the MIT license as well, with Jest, Flow and Immutable.js being next up for the transition. Facebook has said the transition would occur this week, but as yet, these three projects still have BSD as their license.
Under the hood, this 16.0 release include an API-compatible rewrite of the entire React frontend UI library.
This means the APIs used by developers will remain the same, while the code behind the scenes running React is mostly changed out for newer, faster code. The new core allows for support for asynchronous rendering, meaning applications can now process large component trees without blocking the main execution thread. This also gave the team time to add some requested features, like catching exceptions using error boundaries and returning multiple components from render.
To ensure all of these changes were backward compatible, Facebook has spent months turning on new chunks of code inside its development team. The first goal was to bring over all existing unit tests to run on the newly reworked code. Eventually, the team rolled out the new React Core behind Messenger.com to ensure it could run a major frontline service. Today’s release also marks an internal shift to React 16.0 for Facebook’s infrastructure.
This release does have a few pitfalls and deprecations, too, however. For a start, React add-ons are completely discontinued in this release. The latest version of each add-on should continue to work for the foreseeable future, but they will not be updated any further. Facebook felt these were no longer being maintained, anyway. Facebook has suggestions on how to migrate away from add-ons.