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.

61

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

  1. “Considering which is easier to learn is the wrong focus for determining what WordPress’ future interfaces will need.”

    This quote shows a massive disconnect with exactly why WordPress is what it is and why it has been so successful: low barrier to entry. For developers more so than users. It’s why the theme and plugin ecosystem evolved the way it has. And you can complain about code quality all you want… but the theme and plugin ecosystem is a massive reason why WordPress has the market share it does. Low barrier to entry had A LOT to do with that.

    I’m fine with React or Vue.js from a business standpoint because I know we’ll be handle whichever direction it goes.

    But from a community and ecosystem standpoint it’s a bit concerning to see arguments being made that ease of use and barrier to entry are not a concern and being shrugged off as a non-factor.

    “What got us here won’t necessarily get us there.” is correct. However, “there” might end up being a higher barrier to entry for new and existing developers and that could have a profoundly negative impact on the WordPress.org ecosystem.

    I guess that isn’t so much a concern when you are looking at it from a WordPress.com/Calypso standpoint. But it should be for everyone else.

    I’m not saying Vue.js should be used over React. Or React should be used over Vue.js. But I am saying you have to take into account maintaining a low barrier to entry as part of the criteria when making a decision like this.

  2. I am not a Javscript developer. I happen to like programming in PHP a lot more than in JS, both from developer experience (PhpStorm + XDEBUG) and because I like the PHP language lot better. So I don’t have a predisposed opinion for one vs. another, but I know that I will probably have to work with JS at some point.

    Actually, our company does use React for client projects and not Vue, so that is one factor.

    But looking in from the outside I can’t help but be troubled by the fact the “much harder to learn” solution is “winning,” especially in the WordPress world.

    Now if the harder-to-learn solution is actuallly a lot more capable then I would grudgingly agree, but it seems a fallacious agrument to argue for “rich interfaces” that “require a deeper understanding of the technologies used” simply (it appears) because they feel more complex when according to all that I have read here that Vue can do anything React can do, but with an easier learning curve.

    We certainly could avoid overarchitecting it if it means many more plugin and theme developers will be able to learn and start using it sooner than later. And even more would have successes sooner that’s they would otherwise give up

    The idea that by using React more JavaScript developers will come and work on WordPress is a false dream. Ain’t gonna happen, just like hardcore PHP framework developers who spend their days on packagist.org ain’t going to fall in love with WordPress either.

    But what could happen, if we make JavaScript a LOT more approachable to existing WP professionals is they could become productive in JS quickly enough they would start working on JS projects for WP and the WP community can start growing our own JS developers, just like we did with PHP.

    But the flip side is, make JS in WP too hard and we will continue to see the dearth of JS developers for WordPress. As it has been since we added BackboneJS. Just building it won’t make them come, unfortunately.

    As for the “only one man” problem, well in open-source, that is certainly easy enough. If he goes away, or diverges from our needs we fork it and roll into WP complete with future WP-specific enhancements over time. (That) problem, solved.

    FWIW

    • I don’t think React is “a lot more capable” than Vue, and I’m very curious to get a proper answer by some experienced developer on what React can do that Vue doesn’t.

      In fact, the opposite is true: in Vue you can choose how to manage templates (HTML+CSS or JSX), while in React you’re stuck with JSX and JSCSS.

  3. I think one big part that’s missing from the discussion is State management. . .regardless of Vue or React, I think a good state management layer needs to be added to the WP-Admin.

    Some plugins (Jetpack, for example) have started to include their own Redux store, but I think a solid Redux (or similar) store should be added to the WP-Admin as a whole that establishes a standard way for handling state, so that components, (VUE, React, other) can easily communicate with each other in a predictable way (much like we store data in the WordPress database in a predictable way)

    I think without a good plan for consistent state management in the WP-Admin it’ll be tough to build solid JS interfaces that work cohesively across the admin no matter what view layer(s) are used.

    • I agree, I think state management is a key component what should be looked at. It also plays into how developers can extend (or not) whichever solution is decided upon. Having public access to a global “WP_State” would be awesome and help plugin authors to integrate into WordPress.

  4. I’ve not tried vue.js but i’ve done a fair bit of work with react and have found it actually pretty easy to pickup so vue must be amazing. What makes react hard is babel, webpack etc. The react cli abstracts this away.

    Having said this by the time wp makes a move on this es6 could be pretty well universally supported so you might be able to use react without webpack.

    I also want to say that either way both are great choices and i will support 100%.

    • I have to agree. I didn’t find React so insurmountably difficult that I couldn’t create a small app over a couple of days. It probably helps that there are so many tutorials (including the React docs themselves which are pretty great). It’s when I started to dive into whatever other layers in the stack that it got challenging but I think that’s true for all MVC’s. Having worked through Angular before, I can attest to that.

  5. Ease of learning is not among the criteria contributors identified for selecting a new framework

    What.

    WordPress becomes a platform for teaching JavaScript to new programmers

    It won’t. Just like it did not become application platform, web operating system, and whatever else grandiose label of the year.

    By this point WP grew into its peak comfortable role — legacy framework for content sites, in obsolete dialect of PHP.

    And there is a huge problem that we are routinely not honest about this. One solution cannot be simultaneously be chained to absolute backwards compatibility with a decade+ of code and be flexible cutting edge trendy platform.

    The great idea of JavaScript bailing WP out of its legacy is utopian and it is my strong wish it wasn’t pushed so hard. It bends internal perception of the project for worse and it compromises decisions like this one.

        • $george, it seems like you have kind of weird definition of CMS. In your definition a CMS is something that includes an editor and then all the possible kitchen sinks in the world.
          Why would a CMS need a rest api, oembed server, react etc.

          Actually even as CMS wordpress is not a very good one, images made public right when uploaded? No way to edit a published post and check the impact on the site without actually publishing the changes, no revision control for widget, and post meta, no user permission checks for shortcodes…

          WordPress puts the bar very low when it comes to have a CMS that is at about the same level of it.

      • To put what $rarst and $kaiser said in my own words, If wordpress wants to be an application framework, well there are better alternatives that do not carry the baggage of historical decisions and the need to retain backward compatibility.

        WordPress is a legacy tool, and there is actually nothing wrong with that, its power comes from the knowledge accumulate about how to spice it up, whether if it is in tutorials, themes, plugin, thousands of people with all kind of levels of understanding how it works.
        You can not just decide “wordpress is a cool web app platform” and by magic transform all of that into something that will support it. Even the obsolete codex is still coming in google before the “new” dev site, just an evidence how hard it is to **successfully** change course when you have such a big momentum.

  6. Doesn’t anyone find it disconcerting that lately there have been two movements inside WP at odds with each other? In one side we have the proponents of not removing the Hello Dolly plugin because it helps newbies get started with plugin development and in the other we have the advocates of learning JS deeply because modern web applications require modern design methodologies. Funnily, there are even some people upholding these two opposing views at the same time.

  7. Sad to see that Angular is not on the list ! Whatever technology is picked in the WordPress core will definitely get a massive boost and I strongly disagree that this is for the core team only. React’s patent grant is a big disadvantage, you can not build new ideas using react. Vue.js is good, have not used it to full potential like angular but I feel itis not exactly a framework. But at the end, shifting to JS frameworks is the need of the hour, so I am happy.

  8. I quit Facebook 7 years ago today, the following from Peter Knight in Slack overnight echoes much of my opinion of React and the patent clause Facebook includes in React.

    Just a parting note here, I develop on WordPress because it is pure OSS, to help democratize the web, empower users, inclusive, low barrier to entry, stands for the right things: an open web and unencumbered by the machinations of corporate philosophy. These things matter to me. Choosing React sullies those principles to me, it makes a material difference to whether I feel great about coding on this platform or not. I know this is subjective but hey. This is not just about making a cool pragmatic choice that the current crop of core developers find agreeable to work with in the moment.

    Src: https://wordpress.slack.com/archives/C02RQBWTW/p1496154046889104

    If Facebook removed the patent clause I doubt I’d have any issue with choosing React…

  9. My 2 cents

    Vue can do anything React can do
    Vue has a very low entry barrier and is much easier to learn
    Vue can handle animations way better than React
    Vue works fine without any transpiling while React force you to use Jsx (can work in plain js but is like using the native js dom functions… very unusable)

    • We choose Vue over React and Angular for a project last year, and have not regretted it. In fact, we’ve continued to use it on two more projects since.

      It’s been a joy to use. Personally, I’m okay with either Vue or React, but would certainly push for Vue.

  10. In one hand, most core-contributor having the greater knowledge of React. And lots of work already done in Calypso also happened over React. Dipping these efforts aside, is not something you can decide easily. :)

    On the other hand, Vue.js is promising and attractive enough for so many reasons that you should not dismiss it for the React. There is “only one man” should encourage you to put more resources into it, that’s the beauty of Open Source, and that’s how WordPress grew back in the days- by asking more people to volunteer.

      • Totally agree… Not that Vue’s increase in popularity is all that shabby, indeed I’m reading in a LOT of places that folks have chosen it over React/Angular2 or 4 as it is seems to have jumped a version (rather disconcertingly again!), but if it was adopted by the WP community, it would go stratospheric, which from my experience with Vue would be great – it just works!

  11. Two points I’d like to make. First this:

    [React] backed and licensed by Facebook

    should be enough to make it a non-starter. Second, the notion that the developer of Vue.js doesn’t have “any corporate backing”. Ummm…so Automattic doesn’t have enough free cash to fix that, if Vue.js becomes the choice? Seriously?

  12. Let’s face reality.

    The decision was already made long time ago when React was chosen to build Calypso and it has been used since that. The adoption of React by the core will only reflect that.

    This public discussion about selecting a new framework is bullshit. They aren’t asking community opinion, they are just informing their decision.

    And about rising the entry level barriers, well, it will, and that is intentional.

    I’ve been hearing this crap of “learning javascript properly” since the jQuery’s days when the elite of web development started crying about designers getting shits done using jQuery without knowing javascript properly and decided that jQuery was a bad thing because that. Pure elitism, now inside WordPress community. It is a shame.

  13. I am not sure, if all these basic websites and blogs build with WordPress need something like Vue or or React framework behind it. It will be interesting to see where WordPress will be in few years if there is continuously “adding” without any “removing”. Do 80% of users need this kind of framework for their “about page” and sharing buttons? Anything I install (plugin, theme) the biggest job for me is to removing extra scripts, files and junk around. Currently after some tests of alternatives to WP I ask myself, do I really need to host and manage that WP monster for simple websites? I feel that for basic website is WP too much and for something more complicated it’s not enough. I see the advantage with that low barrier to entry and huge community – plugins, themes, tweaks, but WP at core does not looks so cool from my perspective. I can even say, that WP is only about that community around. Maybe this community can say to WP (code) where to move, not that WP will force them to do something.

  14. WordPress engineers need to grow up and accept the fact that they need to learn new tools. With that comes and expectation that these new tools include JavaScript and their associated frameworks ( React / Vue ). React does teach sound JavaScript principles, and it is not harder to grasp than any other framework. Those that feel it’s more difficult are unfamiliar or scared of working with JavaScript.

    Being a WordPress engineer, tasks us with not just being PHP dev or a theme developer, but a full stack engineer. This means we should be comfortable in dealing with all aspects of a proper WordPress install, from the server / database / PHP and frontend. Anything else in this day and age is sloppy. The days of simply installing a theme and calling yourself a dev are long past. Grow up or find a new line of work. Your clients demand more of you.

    Failure to grasp these concepts is one reason WordPress engineers get a bad name among the community.

    Vue basically took the same concepts of AngularJS without really adding anything new. React built upon those concepts. React coupled with Redux gives us a clear cut way to handle state changes.

    Sure Vue gives us a nice way to write HTML, and CSS in their appropriately “named” files, but React gives us a way to write testable and abstractable code and components.

    The argument about Facebook being a tech giant and WordPress hitching a wagon to it is superfluous as far as I am concerned. Any company adopting WordPress or Automattic as part of their app / web solution is doing the same thing. When you “own” 25% of the internet, you are just as much of a tech giant as other large silicon valley companies. Secondly, any person that adds a FB login /Like button to their WP theme is just as much “hitching their wagon” to a large tech giant. You still adopt the same license agreement regardless of what pieces of FB you wish to use in your code.

    All the same, WordPress failing to adopt React feels like WordPress failing to cycle out older versions of PHP. The idea that we should continue to support EOL libraries, because adoption is poor ( ie, too difficult to learn ) if we don’t is a horrible argument. If we support tried and true libraries, the web world will follow and adopt accordingly. Yes, by adopting React, more developers will learn JavaScript.

    • Ranty, dismissive, straw-manning anonymous dudes rubbishing as many things they can in a few paragraphs while distorting other people’s views are what give ‘engineers’ a bad name. But it’s a good thing you’re not particularly representative as the vast majority of people that contribute to WordPress in one way or another don’t self-identify as ‘engineer’.

    • Show me the Ts &Cs where it says Facebook can terminate your license to a FB login or like button, if you bring a patent infringement action against FB. I have never seen that.

      However, for React, if you or your ‘affiliates’ brings an action then the license is automatically terminated. So down the road if FB were to infringe on WP intellectual property and WP filed an action — then it’s very likely that anyone on the WP platform will have their React license revoked. The converse might be true but it’s not clear: if someone using WP as a dev platform brings an action against FB, will that be enough to revoke WP core use of React.

      https://github.com/facebook/react/blob/master/PATENTS

      This is a big deal and should not be brushed aside; if anything it needs a competent IP attorney (or two) to render an opinion. I hope whoever the team is that is deciding on a framework is having this integrated legal discussion.

    • There once was a village next to a huge damn that had been built 50 years before. The mountainous area behind the damn filled up with water but was not really the reason for the damn. The reason for the damn was to allow for controlled release of water over time.

      However, the village started having economic problems and some residents of the area came up with the idea that if they got rid of the damn it would result in killer rapids in the area and downstream, and they believed it would create an economic development boom.

      But many of the other residents of the area really wanted the damn to stay as is. They didn’t think that rapids would provide the economic development value that the others believed it would, and thus did not want to potentially allow for flooding during parts of the year in hopes for some elusive economic development ideals.

      The debate got so heated that they had several town hall meetings about it, and the most respected local townspeople all got up and argued passionately for their preferred outcome to win the day. But even though these debates were vigorous the leaders of the debate knew and respected each other, and never stooped to personal attacks. They each just believed strongly in their preferred approach.

      Then at the last town hall, one guy showed up who appeared
      to come out of nowhere; none of the townspeople knew him. And he proceeded to tell the people who wanted to keep the damn that they needed to put their big boy pants on and get serious because they would see an economic boom if they got rapids. And he said that anyone who felt otherwise were just whiners.

      Then he made a startlingly proposal, and that is they should just blow up the damn that weekend so the village would not have to wait any longer for its economic windfall.

      At which point others who wanted the damn gone started to ask him it he understood what blowing up the damn would mean. And he said “Of course I so, some people just did not like change.” At which point many people started
      to point out to Mr. Blow-Up-The-Damn that his idea completely ignored all the people who lived in villages downstream and that blowing up the damn would pretty much wipe them all out with wall of water, all the way to the ocean. They did their best to explain that in a community decisions are often much more complex then they first appear.

      But Mr. Blow-Up-The-Damn was not to be deterred. To him
      it was simple, and that anyone who didn’t see it his way was obviously either flawed or just mentally lazy. At which point everyone else in the town hall realized that his tirades added no value to the debate and so they all just ignored him and, working together, finally came up with a viable plan.

      #FWIW

  15. There is not a single most important factor here everyone is going to agree on and drive a clear decision.

    While I’ve argued in the past we should use Composer and “barrier to entry” should not preclude that, that does not mean barrier to entry is irrelevant even in that arguement. It just means Composer is a wildly used and easy enough to use tool that we should adopt it.

    While JS is still challenging for me and my gut says the answer here should be Preact or Vue, React (or even Angular) doesn’t have such a high barrier to entry that it should be dismissed on the topic reason alone.

    Everyone here has a different rubric and needs to accept that what is important to them individually isn’t the same as what is be the for the project long term. I’m still unclear what is best for the project long term or that anyone can agree on the rubric.

    The best surge think I’ve seen is actual prototypes of dashboard modules and how to extend them with any of the proposed frameworks. WP’s most key feature has always been it’s extensibility and the reliability that those extensions would continue to work through years of updates. Maybe a contest is in order to do some small thing both ways, see what shakes out.

    I will say the the I think Calypso/Automattic’s familiarity with React should _not_ weigh heavily here. I get the temptation for that but WP’s choice should always stand on thier own.

    Other than that, looking forward to whatever color the bikeshed ends up.

      • Oh god no! My point is simply the the barrier to entry isn’t black and white, it’s a thing that needs to be weighed against the benefits. React doesn’t sound like an insurmountable barrier (I’ve played with it) , but Vue sounds awesome. Of course React sounded awesome coming from Angular so maybe that’s clouded by grass is greener thinking.

        I wanted to point again out again though that Calypso is/was a totally different beast, and really shouldn’t factor here. I totally understand using React for Calypso, it’s an app. Vue does however seem a better fit WP core. Again barely groking this stuff just on the surface Vue does seem more with keeping with WP’s paradigms.

  16. “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.

    The fact that a framework is easier to learn does not mean that its users does not have (or does not want to have) a deeper understanding of the underlying technology. Ease of use could in fact have the opposite effect; it makes you want to learn more, not less.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.