WordPress Core JavaScript Framework Debate Heats Up, Contributors Narrow Discussion to React vs. Vue

photo credit: oskay Small Parts – (license)

WordPress core contributors met this morning to continue the discussion on selecting a new JavaScript framework for use with new core features. The discussion on the Make/Core post intensified over the weekend with more Vue.js proponents commenting to add their thoughts.

Adam Silverstein and Andrew Duthie facilitated this morning’s meeting and began by opening up the discussion to include other frameworks such as Preact, Angular, and Ember. However, the discussion quickly narrowed to React vs Vue.

Silverstein encouraged participants to remember that the new framework is for use with new features such as the new editor and that they will continue to use Backbone when it is the right tool, as well as in existing JavaScript. He also emphasized that the discussion pertains to a framework for core and developers are free to use whatever framework they choose to build plugins or themes.

Vue.js Proponents Consider “Ease of Learning” an Important Factor in Selecting a New Framework

Ease of learning is not among the criteria contributors identified for selecting a new framework, but it is one of the major concerns for Vue.js proponents.

“Vue can do everything that React can do and is much more approachable,” Justin Kopepasah said. “There is a huge adoption of Vue and growth does not show any signs of stopping. Some of the top open source frameworks have adopted Vue and it is used by the top three tech companies in China (including Alibaba). While I do agree that React is a good choice as well, it is not highly approachable by new developers and has Facebook behind it which can be very alarming for people in many ways (not just tech).”

Justin Tadlock, a core contributor whose code and tutorials have assisted many developers learning WordPress, shared similar thoughts over the weekend on the Mare/Core post:

I’ve tried React on a few occasions. Even with over 10 years of programming experience, it was tough to grok for me. I can’t imagine trying to learn it as someone new to WP development.

Vue is dead simple to start learning. I had a small app up and going in minutes. In a couple of hours, I was building some cool, form-related stuff without the docs.

If it were entirely up to me, I’d push for WP to build its own JS framework that solves the problems specific to WordPress. But, if we’re going to choose an existing framework, go with Vue.

Matias Ventura, an Automattic engineer and contributor on both the Calypso and Gutenberg projects, is a proponent of WordPress adopting React. He contends that considering which is easier to learn is the wrong focus for determining what WordPress’ future interfaces will need.

“In my opinion, instead of ‘easier to get started,’ we need to look at robust programming paradigms and an expressive approach to coding interfaces,” Ventura said. “This is what I fundamentally take from Matt’s ‘learn JavaScript deeply’ – the corollary being that WordPress becomes a platform for teaching JavaScript to new programmers, and we need to take that seriously, not just as a convenience to us in the short term.”

Ventura also noted that WordPress has historically not been successful in attracting JavaScript developers and the JS interfaces in core lack contributors when compared to the PHP side.

“We have an opportunity to make WordPress development more appealing to a newer generation of developers that learned how to code through JavaScript,” Ventura said. He encouraged other participants to examine the kinds of interfaces that WordPress needs to modernize and select the best framework for handling them in core.

“The ‘easier to get started’ [argument] seems a bit fallacious to me,” Ventura said. “Easier to whom? At what cost to properly learning JavaScript? The demands of rich interfaces in web applications require a deeper understanding of the technologies used. That’s not something we can avoid. JavaScript cannot be seen as mere progressive enhancement anymore as it is the language in which modern interfaces are expressed.”

Contributors are Concerned about React being Backed by Facebook

At the moment, React is more established and more widely adopted than Vue, but contributors are concerned about the framework being backed and licensed by Facebook. In addition to concerns over the interpretation of React’s additional patent grant, the company has been the source of numerous controversies regarding censorship, data mining, and privacy, among other issues. Opponents don’t want to see WordPress hitch its wagon to Facebook by using React in core.

“The adoption of React is much more than adding a library to WordPress: it is adding the culture, business practices, and code base led by a tech giant,” Justin Kopepasah said. “If we include React in Core, in a way we are asking users (from single site owners to enterprise) to accept Facebook has a key role in the future of WordPress. I have little doubt this will cause pause for some companies considering to adopt WordPress.”

However, other contributors have concerns about Vue.js’ longevity, because it’s so heavily dependent on its creator Evan You. You funds his efforts on Patreon but the project doesn’t have any major corporate backing.

“I’m uncomfortable relying on a project run by a single person that could disappear,” React proponent and WP REST API co-lead Ryan McCue said. “Being run by a corporation with a stake in the game means long-term support and relative stability.” McCue also noted that React has a “a massive community of teaching and support out there for people learning.”

Many Feel WordPress Selecting React as the New JS Framework is a Foregone Conclusion

Despite all the discussions in meetings and on Make/Core posts, many onlookers and community members are convinced that WordPress choosing React is a foregone conclusion. At the beginning of last week’s discussion it seemed that most core contributors are in favor of React, but a strong contingent of Vue proponents have turned out to add comments to the discussion.

Selecting React appears to be the only viable choice when the criteria from the beginning includes items like “proven in a WordPress context” and “alignment with Calypso.” Many have commented to say that the criteria is biased and they assume the decision was already made through the backchannels with a public discussion held for “optics.” Automattic engineer James Nylen commented last week on an open ticket for the Gutenberg project, saying that “Per recent discussion in core Slack, WP core has basically decided to adopt React.”

“If this was truly meant to be a community discussion, then why is it taking place now?” WordPress developer Christopher A. commented on our recent post that summarized the initial discussion. “Choosing a view framework should have happened before the first line of Gutenberg was written. It was known from the start that a view framework would be needed. It was Matt’s desire to get it off the ground as quickly as possible. The best way to accomplish this was to utilize Automattic developers who have experience with React.”

WordPress is selecting a JavaScript framework at a time where frameworks are rapidly evolving, but contributors involved in the decision said they will preserve the ability for theme and plugin developers to use any framework they choose to build their products. No framework was selected during today’s meeting and Andrew Duthie said he expects the conversation will continue at WordCamp Europe’s contributor summit.

“As to React vs Vue (vs Angular vs …), we’ve been discussing the arguments for and against each in the weekly chat, and we’re intentionally taking it slow,” Ryan McCue said. “The key criteria that we’ve picked come from what the project needs, and are not intended to bias the decision in a specific direction. Calypso and other projects are a strong signal towards React, but they’re not the ultimate argument (if they were, we wouldn’t even be discussing it).”

McCue said he doesn’t see WordPress replacing the whole admin with Calypso in a way that doesn’t allow developers to use whatever they choose for their own extensions. The decision to adopt a JavaScript framework for core is more for making core developers’ work easier. At this time, core developers working on new features have a greater knowledge of React than other frameworks.

“At the end of the day, we need to make a decision on what to use in core, and that decision directly impacts the people working on core,” McCue said. “Picking one framework over another doesn’t mean the others are worse, it’s just us (as core contributors) trying to make our own development easier.”

A summary of the discussion should be posted to the Make/Core blog soon and the discussion on selecting a new JavaScript framework will continue in future meetings.