WordPress 4.3 will be rewritten in Node.js
As one of the leading developers of the core WordPress Ryan Boren, in a significant part of version 4.3 of the popular CMS functionality will be rewritten in Node.js, while maintaining backward compatibility with previous versions.
WordPress and Node.js
It’s no secret that developers and project leading WordPress has long been regarded technology Node.js, which allows you to write server applications in a JavaScript language.
The first signs of Node.js project appeared in WordPress version 3.7, with the beginning of implementation tools for the Grunt development cycle. Since then, every kernel release was observed more and more code to JavaScript, and the language was recognized as the fastest growing programming language in 2015.
In WordPress 4.3 complete rejection of the language PHP will not happen, but the developers plan to start the process by rewriting some basic core classes, including WP_Query , WP_Error and WP_Object_Cache . The famous “cycle» WordPress will look as follows:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
var query = new wp.Query (); query.setQuery ({ post_type: 'post', post_status: 'publish', posts_per_page: 5 }); _.each (query.getPosts (), function (post) { console.log (post.title); console.log (post.content); console.log (post.author); }); |
It is worth noting that a similar request to the WordPress database can perform not only on the server side, but also on the client side using JSON REST API, which also appear in version 4.3.
System requirements and backward compatibility
As we have already mentioned, a complete rejection of PHP in the near future is not planned to WordPress, and with the introduction of Node.js, the developers promise to maintain full backward compatibility with existing themes and WordPress plugins.
Such compatibility will ensure a new module called node2php. It analyzes the compiled bytecode of PHP and converts it to JavaScript. This module is available on the website GitHub and is currently in beta testing.
In addition to backward compatibility with version 4.3, and will be a question of the compatibility with the current core hosting platforms. After all, not every company will be able to quickly and reliably provide the environment for Node.js applications, especially when it comes to cheap tariff plans.
Fortunately, most of the specialized providers are working closely with a team of core WordPress, and a new version promises full compatibility. The official release of WordPress version 4.3 is planned for October 2015.