On React and WordPress

Big companies like to bury unpleasant news on Fridays: A few weeks ago, Facebook announced they have decided to dig in on their patent clause addition to the React license, even after Apache had said it’s no longer allowed for Apache.org projects. In their words, removing the patent clause would "increase the amount of time and money we have to spend fighting meritless lawsuits."

I'm not judging Facebook or saying they're wrong, it's not my place. They have decided it's right for them — it's their work and they can decide to license it however they wish. I appreciate that they've made their intentions going forward clear.

A few years ago, Automattic used React as the basis for the ground-up rewrite of WordPress.com we called Calypso, I believe it's one of the larger React-based open source projects. As our general counsel wrote, we made the decision that we'd never run into the patent issue. That is still true today as it was then, and overall, we’ve been really happy with React. More recently, the WordPress community started to use React for Gutenberg, the largest core project we've taken on in many years. People's experience with React and the size of the React community —  including Calypso — was a factor in trying out React for Gutenberg, and that made React the new de facto standard for WordPress and the tens of thousands of plugins written for WordPress.

We had a many-thousand word announcement talking about how great React is and how we're officially adopting it for WordPress, and encouraging plugins to do the same. I’ve been sitting on that post, hoping that the patent issue would be resolved in a way we were comfortable passing down to our users.

That post won't be published, and instead I'm here to say that the Gutenberg team is going to take a step back and rewrite Gutenberg using a different library. It will likely delay Gutenberg at least a few weeks, and may push the release into next year.

Automattic will also use whatever we choose for Gutenberg to rewrite Calypso — that will take a lot longer, and Automattic still has no issue with the patents clause, but the long-term consistency with core is worth more than a short-term hit to Automattic’s business from a rewrite. Core WordPress updates go out to over a quarter of all websites, having them all inherit the patents clause isn’t something I’m comfortable with.

I think Facebook’s clause is actually clearer than many other approaches companies could take, and Facebook has been one of the better open source contributors out there. 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.

The decision on which library to use going forward will be another post; it’ll be primarily a technical decision. We’ll look for something with most of the benefits of React, but without the baggage of a patents clause that’s confusing and threatening to many people. Thank you to everyone who took time to share their thoughts and give feedback on these issues thus far — we're always listening.

42 thoughts on “On React and WordPress

  1. I personally feel Vue would be a better long-term option and already has buy-in in the PHP community through Laravel. It’s easier to learn and doesn’t require much outside the core to build most projects. We’re already using it internally on quite a few projects. Would love to talk about it a bit more next month in Seattle!

      1. Yes! Vue all the things! I’m currently in the process of converting all of our React components to Vue because they’re so much easier to work, more flexible and progressive

      2. +1 on Vue, I was a previous Angular 1 Dev but Angular 2 is over engineered and has a greater learning curve. Vue also has great SSR support which we are using as well with our PHP code. PHP -> Node back to PHP to output the HTML.

  2. Wow! Big decision. This point is particularly resonant:

    I think Facebook’s clause is actually clearer than many other approaches companies could take, and Facebook has been one of the better open source contributors out there. 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.

    Kudos on making a tough but important decision.

  3. Here comes Vue 🙂 But excellent decision by Automattic on the rewrite. Logical decisions shock us as much as outrageous ones these days

  4. I would go for Vue because it plays nice with PHP. The best alternative to React is Preact, many companies are switching to Preact right now as it’s almost identical but way smaller and even more performant.

  5. A bit worried on “it’ll be primarily a technical decision”. I hope the new framework is not just have a good architecture but also friendly for the WordPress developers.

  6. Have you and the team looked into Preact https://github.com/developit/preact? Same API wrappers we expect from React, MIT license and smaller overhead. Without sparking debate, React teaches sane Javascript fundamentals. It’s a great tool and I would hate to see WordPress rewrite, from the ground up, two great projects that up the ante when it comes to how great WordPress can be.

  7. I’ve switched to Preact (MIT) instead of React.

    3Kb is impactful for our mobile users, and it doesn’t require hacks to use custom HTML attributes.

  8. While the re-write of code will take a while this is likely to be a blessing in blessing in disguise.

    Considering how large the WordPress Development Community is the onboarding of another lib such as Vue (hint hint) is an easier path for developers.

  9. Hi Matt,

    I have something that will blow away React and all other cutting edge web frameworks. It’s brand new and based on a simple but consequential new mathematical theory. I use it to power ohayo.computer. I’d say odds are 50-50 it could be a viable option for your use immediately, but even if you don’t use it now I’d bet money you’ll be using it (or someone else’s derivative fork of it) in 2 years time. Happy to explain more to someone on your team over email or phone. I do everything over MIT license or public domain, if that works for you all.

    Thanks for WordPress! WP is how I first got into developing seriously a decade ago.

    Cheers,
    Breck

  10. Oh please. Don’t over-react.

    There has been enough turmoil & churn in the WP ecosystem in the last 5, 6 years.

    Fb’s business size & range makes the clause scary. They will have to give it up, eventually.

    1. One thing to note for commenters discussing Preact vs Vue.js is Vue.js appears to have a more active community, more commits (2x) and more individuals contributing to it’s Github project than Preact does. Developer community, and not just basing a decision on something having the same syntax as React, will be extremely important for any framework chosen by WordPress. But I don’t doubt that these are the types of things that will be factored into the decision.

  11. I love React! But definitely agree that their license should not be pushed out to ~28% of the web.

    Vue definitely looks like the best option! Can’t wait to see how the Gutenberg team takes what they’ve learned so far building on React and applies their learnings to something new. It’s been a fun project to follow.

  12. Matt, I know this couldn’t have been an easy decision and I commend you on it, as well as for announcing it on a Thursday 🙂 The patent clause really is onerous to those of use building web apps for clients that someday plan on selling them to another party… I know that’s not the 96% of WP sites with a single user… but it’s important component of WP being “the OS of the web”. It’s got to stay unencumbered.

    I think the vue ahead is clear! hehe…

    I certainly vote for Vue, but appreciate taking a step back and really considering the landscape. I suspect a lot of the React components can be reused or salvage into Vue, but leave that to those that have been toiling tirelessly on Gutenberg.

  13. Very happy to see this since React has never felt true to the spirit of GPL. But I think that begs the question. The next library can’t be considered only for it’s parity with React, you have to consider the licensing as well. That alone seems to make Vue.jsthe obvious front-runner, right?

  14. I appreciate that you gave the Gutenberg developers lots of room and freedom and that they have done a great job. Thank you for making the hard decision. I think you said that after the initial work the team would stop and rewrite. It is not that uncommon. Now they can benefit from the experience and progress quickly. 5.0 is going to awesome.

  15. This must have been a tough decision. But when you are doing it right it does matter. I also commend the move.

    You folks met with Evan? That’s excellent news. Vue.js makes more sense now than ever. The best thing is it will make the transition easy.

    But may I throw in Preact! It does have an added benefit of supporting the React eci system with having to support React. Though, it can make our code messier (in a way).

    One thing that I think matters the most here, is that we transition the code with coding best practices in mind and not in a way that just saves us time.

    ✔︎ What I mean to say is, whatever new JavaScript framework we adopt, it’s essential that we do it right. Having Gutenberg implement this new code in the right way will set the foundation of how WordPress developers will learn it.

    I have often seen the coding best practices being lost in the midst of converting projects from one framework to another.

    I know several developers who had started learning ReactJS because of WordPress. Done even paid to start learning it.

    While this is a good move, it’s a frustrating one for many of us. Transition to a new JS framework in the right way and also taking care of documentation (at least relevant to adopting THE new framework) would help mitigate the frustration.

    That said, I am thrilled to read that the community is being heard. It’s the high time for us. I’ll play my role in helping with this transition as much as I can.

    Gutenberg Boilerplate is already a resource for more than few hundred WordPress developers trying to learn to adapt Gutenberg. I’ll make sure to keep it updated.

    I’m supporting the adoption of Vue.js right now, but I must add I have only use Preact in two projects.

    Cheers!

SHARE YOUR THOUGHTS