What's up with WordPress and JavaScript? Are they ditching PHP and moving to JavaScript?
Yesterday Automattic (the company behind WordPress) announced Calypso, a new admin interface for anyone using a WordPress website.
As a JavaScript developer, I was excited to hear that it was built entirely in JavaScript. I was even more excited to hear that it was built in React, because I'm a huge WordPress fan and I just launched React For Beginners — my two worlds are colliding!
It seems like there is a lot of misinformation in the community. Let's clear this up and understand what it means for us as Web Developers.
https://twitter.com/mikeal/status/668889464563875840
Relax. WordPress is written in PHP, but the Calypso admin interface for WordPress is written with popular front end tools like React and Lodash.
This is part of a popular trend - use your server to just give us raw JSON data, and then build your application entirely in JavaScript to consume that JSON data. WordPress essentially becomes an API which you can pull and push data from. This decoupling of the view and the backend logic has let the developers of WordPress move much faster because they don't have 12 years of PHP view logic dragging them down.
So, why are we seeing tweets about Node.js? Well, almost all front-end tooling is built in Node.js. Calypso is built with popular node tools like WebPack, Babel, Jade, Uglify, Hot Loader, Marked and over 100 other modules.
This is how the front end space is evolving and frankly I'm glad to see WordPress start using them because its one space we don't see a lot of people using these tools.
Calypso is an editor and an RSS reader for WordPress.com sites. You can, however, use it to manage your self-hosted WordPress account. Once you enable Automattic's JetPack plugin, you can manage your content with Calypso.
I went ahead and built a copy locally to try it out.
Right now, you can only manage, Pages, Posts, Themes, Menus, Plugins and a few settings. Everything you need to manage a blog.
What is missing is an interface for custom fields, custom post types and any custom interface that a plugin would expose. This is a deal killer for most devs as we aren't using WordPress just as a blog, but I can only assume this will be coming.
Right now? Nothing. But this is thunder in the distance as to what is to come in the WordPress.
Much of a theme writing I do is already in JavaScript - I often use WordPress as just an API to get data out of, and then use frameworks like Angular, React, Google Maps or jQuery to display that data. I'm not building an entire website in a JavaScript framework, but much of the interactive view layer of these sites is moving into JavaScript frameworks.
Our trusty PHP template files aren't going anywhere anytime soon, but I'll bet you dollars to donuts you'll be writing a lot more JavaScript in your WordPress sites in the years to come.
Since Calypso is open source, I'm curious to see what will come next. I can imagine developers like Elliot Condon from Advanced Custom Fields and the folks at Web Dev Studios are excited about this. This means we can build much more flexible plugin and admin interfaces which will in turn make clients extremely happy.
There is a reason why things like Squarespace are becoming popular — the interface for creating a beautiful website is a breeze and WordPress is now _react_ing in a huge way.
So as a WordPress builder, don't rush to this, but don't write it off - keep an eye on it.
For many this is going to be the last straw with JavaScript. Plugins and STack Overflow questions can get you pretty far, but the front end dev landscape is changing, it's hard to ignore all that has happened with JavaScript in the last few years.
If you aren't super comfortable with JavaScript, it would be a great time to start learning. It's a little hard at first, but you can do it, no problem. I've seen hundreds of my students at HackerYou do it, and I know you can too.
Find an issue with this post? Think you could clarify, update or add something?
All my posts are available to edit on Github. Any fix, little or small, is appreciated!