WPTavern: WordPress Core JavaScript Framework Debate Heats Up, Contributors Narrow Discussion to React vs. Vue
WPTavern: 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.
Source: WordPress