# Repository: infernojs/inferno # Stars: 16410 ## README.md
[](https://github.com/infernojs/inferno/actions) [](https://coveralls.io/github/infernojs/inferno?branch=master) [](https://github.com/infernojs/inferno/blob/master/LICENSE.md) [](https://www.npmjs.com/package/inferno) [](https://www.npmjs.org/package/inferno) [](https://discord.gg/SUKuhgaBpF) [](https://unpkg.com/inferno/dist/inferno.min.js) [](#backers) [](#sponsors) Inferno is an insanely fast, React-like library for building high-performance user interfaces on both the client and server. ## Description The main objective of the InfernoJS project is to provide the fastest possible **runtime** performance for web applications. Inferno excels at rendering real time data views or large DOM trees. The performance is achieved through multiple optimizations, for example: - Inferno's own JSX compilers creates monomorphic `createVNode` calls, instead of `createElement` calls. Optimizing runtime performance of the application. - [SWC plugin inferno](https://github.com/infernojs/swc-plugin-inferno) is a plugin for [SWC](https://swc.rs/). It can compile TSX and JSX - [Babel plugin inferno](https://github.com/infernojs/babel-plugin-inferno) is a plugin for [BabelJs](https://babeljs.io/). It can compile JSX. - [TS plugin inferno](https://github.com/infernojs/ts-plugin-inferno) is a plugin for [TSC](https://www.typescriptlang.org/). It can compile TSX. - Inferno's diff process uses bitwise flags to memoize the shape of objects - Child nodes are normalized only when needed - Special JSX flags can be used during compile time to optimize runtime performance at application level - Many micro optimizations ## Features - Component driven + one-way data flow architecture - React-like API, concepts and component lifecycle events - Partial synthetic event system, normalizing events for better cross browser support - Inferno's [`linkEvent`](https://github.com/infernojs/inferno/blob/master/README.md#linkevent-package-inferno) feature removes the need to use arrow functions or binding event callbacks - Isomorphic rendering on both client and server with `inferno-server` - Unlike React and Preact, Inferno has lifecycle events on functional components - Unlike Preact and other React-like libraries, Inferno has controlled components for input/select/textarea elements - Components can be rendered outside their current html hierarchy using `createPortal` - API - Support for [older browsers](https://github.com/infernojs/inferno#browser-support) without any polyfills - defaultHooks for Functional components, this way re-defining lifecycle events per usage can be avoided - Inferno supports setting styles using string `` or using object literal syntax ``. For camelCase syntax support see [`inferno-compat`](https://github.com/infernojs/inferno/tree/master/packages/inferno-compat). - Fragments (v6) - createRef and forwardRef APIs (v6) - componentDidAppear, componentWillDisappear and componentWillMove (v8) - class and function component callbacks to ease animation work, see [inferno-animation](https://github.com/infernojs/inferno/tree/master/packages/inferno-animation) package ## Runtime requirements Inferno v9 requires following features to be present in the executing runtime: - `Promise` - `String.prototype.includes()` - `String.prototype.startsWith()` - `Array.prototype.includes()` - `Object.spread()` - `for ... of` ## Browser support Since version 4 we have started running our test suite **without** any polyfills. Inferno is now part of [Saucelabs](https://saucelabs.com/) open source program and we use their service for executing the tests. InfernoJS is actively tested with browsers listed below, however it may run well on older browsers as well. This is due to limited support of browser versions in recent testing frameworks. https://github.com/jasmine/jasmine/blob/main/release_notes/5.0.0.md [](https://app.saucelabs.com/open_sauce/user/Havunen/tests/vdc) ## Migration guides - [Inferno v4](https://github.com/infernojs/inferno/blob/master/documentation/v4-migration.md) - [Inferno v6](https://github.com/infernojs/inferno/blob/master/documentation/v6-migration.md) ## Benchmarks Live examples at [https://infernojs.github.io/inferno](https://infernojs.github.io/inferno) - [UI Bench](https://localvoid.github.io/uibench/) - [dbmonster](https://infernojs.github.io/inferno/dbmonster/) - [JS Web Frameworks Benchmark (current)](https://krausest.github.io/js-framework-benchmark/current.html) - [Isomorphic-UI-Benchmark](https://github.com/marko-js/isomorphic-ui-benchmarks) - [1k Components](https://infernojs.github.io/inferno/1kcomponents/) ## Code Example Let's start with some code. As you can see, Inferno intentionally keeps the same design ideas as React regarding components: one-way data flow and separation of concerns. In these examples, JSX is used via the [Inferno JSX Babel Plugin](https://github.com/infernojs/babel-plugin-inferno) to provide a simple way to express Inferno virtual DOM. You do not need to use JSX, it's completely **optional**, you can use [hyperscript](https://github.com/infernojs/inferno/tree/master/packages/inferno-hyperscript) or [createElement](https://github.com/infernojs/inferno/tree/master/packages/inferno-create-element) (like React does). Keep in mind that compile time optimizations are available only for JSX. ```jsx import { render } from 'inferno'; const message = "Hello world"; render(