BT

React Alternative Inferno Hits 1.0

by David Iffland on Jan 10, 2017 |

The React-like JavaScript library, Inferno, has reached version 1.0, giving developers familiar with React but frustrated with the size of modern JavaScript libraries a fix.

The tag line for Inferno is "An extremely fast React-like JavaScript library for building modern user interfaces." It's meant for those who like the concepts and API of React, but don't need all the bells and whistles such as the ability to use React Native. Inferno is built strictly for the browser or server and the typical DOM. Over the wire, Inferno weighs in at 9 KB compared to the 45 KB (both gzip sizes) payload of React. This results in much faster parse times and therefore better performance on mobile devices.

The team has spent a lot of time focused on actual performance. In an interview, founder Dominic Gannaway mentioned some of the work on performance:

Extensive checking was done to ensure that deoptimisations ("deopts", where a JIT compiler can't compile something) were kept to the absolute minimum. The Inferno team used benchmarks, profiling tools (IRHydra 2, Chrome Dev Tools) and lots of spikes re-writes on various parts of the codebase as way of constantly finding ways to remove deopts.

This code snippet shows how similar Inferno is to React:

class MyInfernoTest extends Component {
    componentDidMount() {
        setInterval(() => {
            this.setState({ 
                time: (new Date()).toLocaleString() 
            });
        }, 200);
    }
    render() {
        return <h2>
            Current time: <span>{this.state.time}</span>
        </h2>
    }
}

In a post announcing the release, core team engineer Luke Sheard noted that in 2016, the project rocketed from 150 stars on Github to almost 7,300 by the end of the year. It has over 8,000 now. It can be used as a drop-in replacement for React with an appropriate compatibility library, though performance improves by making Inferno specific code changes.

This year, the team hopes to expand the framework's ecosystem, but will need to do so without the ever-present guiding hand of Gannaway. At the end of 2016, Gannaway announced that he was joining Facebook to work on React. Sheard says that Inferno will carry on with a reduced role from Gannaway and that they're going to focus on improving the core experience and breadth of library support:

In 2017 Inferno will focus on continuously improving its core functions, addressing bugs as quickly as possible and providing support and guidance to the community. Effort will be placed into adapting new libraries to expand Inferno’s reach and modularity for a wide range of use cases. To date a range of modules have been ported, but with additional effort from the community we intend on expanding this further.

Inferno is a newcomer alongside the more well known React alternative, Preact. Both can be used in place of React, but the libraries differ in their focus.

Rate this Article

Relevance
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
General Feedback
Bugs
Advertising
Editorial
Marketing
InfoQ.com and all content copyright © 2006-2016 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.