Fun Links 2016-06-10

Since I’m in the middle of delivering a React training course to some of my colleagues, I thought why not highlight something React-related.

So I’m starting off with some React-inspired alternatives to React. The concept of virtual DOM comparisons and one-way data flow has become very popular in the JavaScript world, so there has been a slew of copycat libraries emerge. Some are almost drop-in replacements, others take the concepts and run in a different direction.

Inferno claims to be one of, if not the fastest virtual DOM libraries out there. It does this by only “diffing” the parts of the DOM that are potentially dynamic. The result is a React-like library which performs even better on low-power devices like phones and tablets. It has a Babel plugin as well, so you can write your components using the same JSX syntax you may be familiar with, and have it compiled to optimized Inferno virtual DOM.

React-lite is a drop-in replacement for React on the browser which optimizes for file size. It is less than 20% of the size of React. Obviously, it makes some sacrifices to do that, and certain development niceties of React didn’t make the cut, like PropTypes and support for the React dev-tools. It also doesn’t support rendering on the server. In all of these cases, you can use the full React if necessary.

Preact is a slightly less compatible, but even smaller version of React, weighing in at around 3kb when fully optimized. It only supports the newer ES2015 class and stateless components. It too is missing PropTypes, but otherwise is quite compatible with an extra compatibility package available if you need it.