Drupal Core Maintainers Propose Adopting React for Administrative UI’s

Both the Drupal and WordPress communities are now knee-deep in weighing JavaScript frameworks to modernize underlying architecture for building user interfaces in 2018 and beyond. Yesterday Drupal founder Dries Buytaert published a summary of his discussions with core committers, framework managers, JavaScript subsystem maintainers, and JavaScript experts at DrupalCon Vienna. Together they concluded that Drupal should consider adopting React.

“We agreed that today, React would be the most promising option given its expansive adoption by developers, its unopinionated and component-based nature, and its well-suitedness to building new Drupal interfaces in an incremental way,” Buytaert said. “Today, I’m formally proposing that the Drupal community adopt React, after discussion and experimentation has taken place.”

The proposal is now available to the broader Drupal community and Buytaert’s recommendation during his keynote presentation in Vienna was to test and research how Drupal’s administrative UX could be improved by using a JavaScript framework.

Two years ago Drupal explored adopting a JavaScript framework and at that time Buytaert was considering React, Ember, and Angular. Facebook’s patent clause in React’s licensing made him hesitant to want to pursue it for Drupal but the license has since been changed to MIT. The Drupal community was not eager to select a framework at that time and in response Buytaert opted to focus on improving Drupal’s web service APIs instead.

“By not committing to a specific framework, we are seeing Drupal developers explore a range of JavaScript frameworks and members of multiple JavaScript framework communities consuming Drupal’s web services,” Buytaert said. “I’ve seen Drupal 8 used as a content repository behind Angular, Ember, React, Vue, and other JavaScript frameworks.”

Buytaert shared an illustration showing how he envisions Drupal “supporting a variety of JavaScript libraries on the user-facing front end while relying on a single shared framework as a standard across Drupal administrative interfaces.”

This approach is similar to what WordPress’ Gutenberg contributors are proposing with framework-agnostic block interoperability where core would adopt a framework internally but developers could extend the new editor (and other UIs) using any JS library they prefer. In addition to giving developers more flexibility, this approach also helps to protect the project from the effects of the rapid pace at which JavaScript frameworks and libraries are coming and going.

“Several years later, we still don’t know what JavaScript framework will win, if any, and I’m willing to bet that waiting two more years won’t give us any more clarity,” Buytaert said. “JavaScript frameworks will continue to evolve and take new shapes. Picking a single one will always be difficult and to some degree ‘premature.’ That said, I see React having the most momentum today.”

The proposal on Drupal.org, authored by Lauri Eskola, Dupal’s core framework manager who specializes in JavaScript, said contributors’ discussions revealed “unanimous consensus…that React would be a good choice.” Eskola cited several benefits they believe React will bring to Drupal, including its large ecosystem of libraries, active developer community, project maturity, and improved career options for classical Drupal developers. WordPress.com, TYPO3, The New York Times, Airbnb, and others using React were also listed among React’s benefits.

The discussion on the proposal is an interesting read with many similarities to the recent discussions in the WordPress community regarding React. Several Drupal developers expressed concerns about how difficult it may be for those with a PHP background to learn React, as it adds more complexity to the development process.

“Overall I’m in favor of a framework,” Drual developer Mark Miller said. “However, a big question for me is how many PHP developers are going to easily pick up React? I know we want to bring in more Javascript developers, but it seems that most people creating modules and using this will be coming from a PHP background. I know pure JavaScript people love React, but it will likely be a steep curve to others in Drupal’s already steep learning curve.”

Others, who had previously become disillusioned by a perception of Drupal being unable to keep up with modern web development, welcome the proposal to experiment with React. A few advocated for their frameworks of choice and said they would like to see the experimentation expanded to include other frameworks as well.

“Is there an issue yet for the React prototype of the watchdog page?” Drupal core committer Angie Byron said. “When that’s created, folks interested in alternative frameworks (I’m hearing both ‘vanilla’ web components and Vue.js come up a lot, both here and in the WP discussions) could start an alternate implementation in a duplicate issue and we could compare/contrast, which would be very helpful in my opinion.”

Drupal is aiming to have enough real-world testing done to make a final decision before the upcoming 8.6.0 development period slated for the first part of 2018. Buytaert said that after deciding on a framework, Drupal’s leadership plans to begin adoption in a limited and incremental way “so that the decision is easily reversible if better approaches come later on.”