Facebook just changed the license on React. Here‘s a 2-minute explanation why.

Facebook‘s popular JavaScript library React powers many of the most heavily trafficked sites on the web, from Netflix to Airbnb to Walmart.com. So when Facebook makes a major change to React, developers take notice.

In late September 2017, after months of controversy and debate, Facebook officially relicensed React, switching from a custom BSD+Patents license to the widely-used MIT license. Here‘s a detailed look at what happened and what it means for the future of web development.

The Rise of React

First, some background. React is a declarative, component-based JavaScript library for building reusable UI components. It was developed by Facebook engineer Jordan Walke, who was influenced by XHP, an HTML component framework for PHP.

React was first deployed on Facebook‘s newsfeed in 2011 and later on Instagram in 2012. Facebook open sourced React in May 2013, and it quickly gained traction among frontend developers.

React introduced several groundbreaking ideas to frontend web development:

  • The Virtual DOM: React abstracts the actual HTML DOM away, allowing developers to describe their user interfaces in terms of a "virtual DOM." React then figures out the most efficient way to update the actual DOM to match, minimizing costly DOM manipulation.

  • One-way Data Flow: In React, data flows in one direction down the component tree. Parent components pass data to child components via read-only "props." This makes data flow easier to reason about.

  • JSX: React utilizes an XML-like syntax called JSX that allows developers to write their DOM structure directly in their JavaScript code.

These innovative concepts have since been widely adopted in the JavaScript ecosystem, with libraries like Vue and Angular implementing their own flavors of component-based architecture and virtual DOM.

React has proven massively successful and is now one of the most widely used libraries in web development. According to the 2021 StackOverflow Developer Survey, React is used by 40.1% of professional devs, beating out other popular tools like Angular, Vue, and jQuery.

Chart of web framework popularity from StackOverflow 2021 survey showing React at 40.1%

React‘s component model has made it easy for developers to write modular, reusable code. And its performance optimizations allow complex user interfaces to be rendered efficiently.

As Sacha Greif, designer and co-author of the State of JavaScript survey, put it: "React‘s popularity is a testament to how much it has improved the experience of working with the DOM and how it has made it easier to build complex, interactive UIs."

The BSD+Patents License Controversy

From its initial open source release in 2013 through 2017, React was distributed under a BSD+Patents license. This included a standard three-clause BSD license with an additional patent grant.

The key language in the patent grant stated:

"The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software."

In essence, this clause said that if a company or individual sued Facebook for patent infringement, even if unrelated to React, they would lose the right to use React. Reacting to a patent lawsuit from a React user with a retaliatory patent lawsuit would trigger the clause as well.

This clause was controversial in the open source community from the start. Many felt it unfairly imposed restrictions on React users and went against the permissive, free-to-use spirit of open source.

Some companies, wary of the legal implications of the license, banned the use of React in their projects altogether. In 2015, Apache Software Foundation member Chris Mattmann called the BSD+Patents license "insane" and announced the Apache Foundation was banning its projects from using any components with the license.

But Facebook was initially committed to the BSD+Patents license. In an August 2017 blog post, Facebook engineering director Adam Wolff defended the license, writing:

We maintain React, along with many other open source projects. Web and mobile user interfaces are an area of heavy investment for Facebook and we have many patents in this domain. The BSD + Patents license allows us to maintain our React patents and still let the community use React.

However, pressure continued to mount on Facebook throughout 2017.

The Final Straw

The controversy reached a breaking point in September 2017. WordPress, which powers over 40% of all websites, announced it was dropping React from its new Gutenberg editor project after its founder Matt Mullenweg raised concerns about the patents clause.

In a blog post titled "On React and WordPress," Mullenweg wrote:

"I‘m not judging Facebook or saying they‘re wrong, but we have a lot of problems to tackle and convincing the world that Facebook‘s patent clause is fine isn‘t ours to take on. It‘s their fight."

This put Facebook in a difficult position. Losing WordPress would have been a major blow to React‘s already contested position as the leader in frontend frameworks. More broadly, it threatened React‘s standing as an open source project companies could trust and rely on.

Faced with an existential threat to React‘s dominance, Facebook blinked. A week after Mullenweg‘s announcement, Facebook declared it was relicensing React and several other open source projects under the MIT license, with no patent clause.

In its announcement, Facebook wrote:

"We‘re relicensing these projects because React is the foundation of a broad ecosystem of open source software for the web, and we don‘t want to hold back forward progress for nontechnical reasons."

On September 25, 2017, the React license officially changed to MIT in the project‘s GitHub repository. React 16 launched a day later with the new license in place.

The Fallout and the Future

In the immediate aftermath of the license change, there was a collective sigh of relief in the React community. The looming specter of the patents clause was finally gone. Influential React users like WordPress reaffirmed their support of the project. In a blog post titled "Facebook Dropping Patent Clause," Mullenweg wrote:

"I am surprised and excited to see the news that Facebook is going to drop the patent clause that I wrote about last week. They‘ve announced that with React 16 the license will just be regular MIT with no patent addition. I applaud Facebook for making this move, and I hope that patent clause use is re-examined across all their open source projects."

Crisis averted, React was able to move forward, and it has continued to dominate frontend development in the ensuing years.

According to the State of JavaScript 2021 survey of over 16,000 developers, React is used by 80% of respondents, a number that has grown steadily each year. The next most widely used library, Vue, is used by just 51%, and Angular comes in at 37%.

State of JS 2021 chart showing React used by 80% of respondents

But while React‘s MIT license means smooth sailing for users, the relicensing saga holds important lessons for the broader open source community.

For companies open sourcing their technology, it demonstrates the importance of choosing standard, permissive licenses. The open source community has spoken loud and clear: Restrictive licenses with patent clauses are a non-starter.

They breed distrust, limit adoption, and harm the collaborative spirit of open source. If a major project like React can be brought to the brink by license concerns, smaller projects have little hope of surviving such controversy.

Facebook is not the only company to learn this lesson the hard way. Google, for example, relicensed its popular Angular web framework from Apache 2.0 to MIT in 2018, removing the patent clause in the Apache license.

The React license change also highlights the power and influence major open source users have in shaping the ecosystem. WordPress taking a stand against the BSD+Patents license was a key catalyst in forcing Facebook‘s hand.

Large open source organizations and foundations like WordPress, Apache, and Linux Foundation serve as de facto regulators, holding corporate-sponsored open source projects to account. When they push back against restrictive licenses, companies are forced to rethink their approach or risk losing the trust and goodwill of developers.

Corporations, Open Source, and an Uneasy Alliance

Facebook‘s struggle to balance its business interests with the norms of open source raises deeper questions about the role of corporations in the free and open source software world.

On one hand, corporate investment in open source has been a boon to the ecosystem. Companies like Facebook, Google, and Microsoft employing developers to work full-time on open source code has led to major breakthroughs and wildly successful projects like React, Angular, and Visual Studio Code.

These projects have made developers‘ lives easier and pushed web technology forward immeasurably. It‘s hard to imagine the modern web existing without the open source contributions of major tech companies.

At the same time, the incentives and priorities of for-profit corporations will never be perfectly aligned with the ideals of free and open source software. Corporations ultimately have to make decisions in the best interest of their business, which may come at the expense of the broader community.

Facebook may have believed its BSD+Patents license was necessary to protect its intellectual property. But in the eyes of open source advocates, it violated the cardinal rule that open source software should be free for anyone to use, modify, and distribute without restriction.

As Debian Project Leader Chris Lamb wrote of the Facebook license controversy, "The free software community will never accept a license with such onerous patent restrictions and our only option, albeit a judicious one, is to avoid using software under this license entirely."

How corporations navigate this tension between business imperatives and open source values will be an ongoing challenge. Movements like "ethical source" licenses are attempting to square this circle by creating new licenses that put restrictions on the use of open source code by unethical actors like surveillance vendors, while still preserving key freedoms.

But finding the right balance will be a continuous negotiation between corporations and the developers who make their open source projects thrive.

The Road Ahead

In the end, Facebook made the right call in relicensing React and reaffirming its commitment to open source. Despite the friction along the way, the React community emerged stronger and more vibrant than ever.

And while easy answers to the broader questions raised by the React license controversy remain elusive, the open source community at least established clearer boundaries around what it will and won‘t accept from corporate open source projects.

The MIT and Apache licenses have emerged as the de facto standards for permissive open source licensing. Companies deviating from these established norms now do so at their own peril and risk alienating developers.

At the same time, open source foundations and leaders must remain vigilant watchdogs against the encroachment of corporate interests in open source spaces. The React relicensing saga showed the power these institutions have to push back against restrictive licenses and pressure companies to do the right thing.

As React and the web continue to evolve, new challenges and opportunities at the intersection of business and open source will undoubtedly emerge. But if the React community‘s principled stand is any indication, open source developers will continue to fight for the values of freedom, openness, and collaboration no matter where the road takes them next.

Similar Posts