BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

React Alternative Inferno Hits 1.0

| by David Iffland on Jan 10, 2017. Estimated reading time: 2 minutes |

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

Adoption Stage
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

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT