DEV Community

Ahmad Awais ⚡️
Ahmad Awais ⚡️

Posted on • Updated on

WordPress-React Breakup: Suggest A JavaScript Framework to WordPress & Tell Why? [POLL]"

ReactJS and WordPress are breaking up. Matt Mullenweg (co-founder of WordPress) announced is it today.


I was half asleep when I read the announcement and since then I have created a Twitter Poll, a Facebook poll/thread, started a Gutenberg issue Choosing the JavaScript Framework for Gutenberg (~WordPress), and now I am writing this post. It's exciting news.


Since I believe the community is moving in the right direction here – this issue is where one could share their thoughts about different JavaScript Frameworks for Gutenberg (that goes into the WordPress Core).

🚢 JavaScript Frameworks

IMHO there are two prominent contenders here.

  1. VueJS
  2. Preact
  3. Other options (Angular, Ember, Polymer, Aurelia, etc.)

Just to kick-start the discussion, here're a few ideas off the top of my head.

⚡️ VueJS:

  • PRO: Beginner friendly.
  • PRO: Proven track-record of success with Laravel.
  • PRO: Way more popular as compared to Preact with a great amount of community support.
  • PRO: More contributors than Preact.
  • CONS: Key person dependency.
  • STATS: 133 Core Contributors on GitHub, 66,943+ Stargazers, and 209 Releases.
  • MONETARY BACKING: At the time of writing, VueJS OpenCollective ($9,895/year – New campaign only four days old) and Evan You's Patreon page ($8,815/month) monetary backing from the community. Sören in comments pointed out that OpenCollective of Vue is only four days old.

🎯 I truly believe that WordPress can do a lot better with VueJS. VueJS has a huge set of followers, and it's easier for beginners to adopt. This can also turn into a big win for WordPress if done right.

I have used VueJS myself, in several projects, and I love it. Also, a framework that's used outside of WP (such as Vue and its integration with Laravel), allows developers to use their experience in WP projects and non-WP projects.

There's already a large cross-over of Laravel/WP devs, so having the same js framework makes a lot of sense as those devs can contribute to help drive Laravel, Vue, and WP forward all at the same time. – Jason Bahl.


⚡️ PreactJS:

  • PRO: Easier transition.
  • PRO: Evolving community with about the same amount of monetary support as of VueJS.
  • PRO: A subset of React based libraries would still be well supported with Preact and with compat.
  • CON: Transition could lead to messy code and confusion (for beginners).
  • CONS: Key person dependency.
  • STATS: 100 Core Contributors on GitHub, 14,062+ Stargazers, and 114 Releases.
  • MONETARY BACKING: At the time of writing, Preact OpenCollective ($16,087) monetary backing from the community.

While PreactJS has its benefits, I am not the right person to ask for an opinion about it (since I have only slightly used Preact in two small projects). Though, it does look like that transitioning from React to Preact is very easy. That can motivate developers to chose Preact. I think this would be the wrong reason to chose it.

🤔 I think this would be the wrong reason to chose it. It will only confuse the developers trying to adapt to this whole new eco-system of JavaScript frameworks, node modules, Webpack, and now aliasing Preact over React? Which could also lead to the code smells. Messier code.


🍕 Resources:


👉 VOTE HERE

Twitter Poll for 48 hours. 1000+ votes already.
Liquid error: internal


🎯 Which JavaScript Framework you think is the right choice?

  1. Tweet your thoughts
  2. Or drop by in this issue at Gutenberg's GitHub repository.

This post was initially published at AhmadAwais.com as: WordPress-React Breakup: My Vue on P*react + WordPress Development!


🎩 The WordPress Takeaway!

P.S. I will share the survey results and other news about WordPress & new JS Framework adoption in my newsletter called The WordPress Takeaway.
– written by my lovely wife @MaedahBatool and yours truly @MrAhmadAwais.

Discussion (13)

Collapse
ben profile image
Ben Halpern

Vue strikes me as the right choice. More mainstream than Preact, but I want some clarification: Where does Wordpress use these libs? Is it just on the admin side of things or do they ship as part of the front-end for end-users in any way? If it's strictly for the admin interface, I'd think the PreactJS build size wouldn't be as much of a benefit.

Collapse
mrahmadawais profile image
Ahmad Awais ⚡️ Author

WordPress will choose one lib and it will become the de-facto standard for everyone in the community to learn, support, and use both at the backend and frontend.

Right now, Gutenberg is in dev phase, it's the new Editor/Page builder for WordPress — the default one actually. It was using ReactJS and now we are looking at what's next?

I also think that VueJS is a good lib with a huge ecosystem. MarkoJS looks promising as well.

Collapse
ben profile image
Ben Halpern

Interesting. I'd definitely give a nod to Preact for the major emphasis on build size and close-to-the-metal performance, which I'd say is of huge importance for something as web-important as wordpress. The web really gets choked by too many basic content sites that force you to download a whole gigantic app on load.

I'll also note that Preact creator @_developit is Canadian🇨🇦 like me and has pretty great fashion sense if I do say so 😋

Thread Thread
mrahmadawais profile image
Ahmad Awais ⚡️ Author

You make some valid points there.

Esp about the fashion sense :P

Collapse
benediktg profile image
Benedikt Geißler

There is also Inferno – yet another React "remake". ;)
infernojs.org/

Collapse
mrahmadawais profile image
Ahmad Awais ⚡️ Author

Yes, I have been looking into it. Thanks!

Collapse
ben profile image
Ben Halpern

I agree, but it's a wholistic conversation. I don't think React's popularity is strictly on its technical merits either. In its case, I think the corporate backed was a huge part of its rise. So for better, or worse, I'm not sure it's ever much of a purely technical merit discussion.

Collapse
maxart2501 profile image
Massimo Artizzu

Why all those *JS? It's React, not ReactJS, just like it's Preact and Vue.

Anyway, I don't see Preact as ruled by one man (Jason Miller), as it has received important contributions from notable Googlers (Addy Osmani for Preact CLI, for example). Maybe it could be a key factor.

Collapse
mrahmadawais profile image
Ahmad Awais ⚡️ Author

By adding JS I only mean to call it a JS framework. I'd be more selective with that next time.

Yes, I have seen the CLI and Addy is also one of the backers there.

Collapse
patrickodacre profile image
Patrick O'Dacre

This is a good read and seems to take Preact out as an option: blog.cloudboost.io/3-points-to-con....

TLDR; Preact may actually be more of a problem than React. If I understand correctly, some of the protections afforded to React users aren't necessarily extended to Preact users.

Collapse
abauzac profile image
Amaury

List what you liked and disliked about react. Then choose your framework.
e.g, you liked the unopinionated philohophy of react, preact, polymer and vue might fit. At the contrary, if you'd prefer a more opinionated framework, angular, ember, aurelia would be better.
I would personally choose the later choices working in a OSS env. as there might be thousands of developer working on the project.