Menu

React, etc. Tech Stack

React, Flux, GraphQL, Hack, HHVM...? All of this and more!

React.js Isomorphic Rendering with PHP

Isomorphic rendering of React.js components is usually closely linked to Node.js. This is natural as both Node and React is are JavaScript technologies. It's however worth noting that Facebook itself is running on PHP and Hack languages.

This makes it evident that server side rendering using the default PHP runtime or HHVM is a lot more common than thought of. There are a number of methods to do this, some of which are the php-v8js extension, running a Node.js daemon or on demand calls to Node.js.

The biggest advantage in server side rendering is the experience on the first load of an application:

In reality Single Page Applications (SPAs) usually experience this kind of a lag when getting data from backends over slow networks and so on. HTTP/2 server push can be used to alleviate this for first loads of applications, but not completely remove it.

Learn more about rendering JavaScript like React with PHP:

Written by Jorgé on Saturday December 19, 2015

Permalink - Tags: react, php, hhvm, javascript

« Dump and debug HTTP/2 traffic with a reverse proxy (h2a) or WireShark - HHVM puts up a good fight against PHP 7 in Benchmarks »