This is a Starter App for Inferno.js, an extremely fast, React-API compatible library.
It contains:
- a complete infrastructure built on Inferno.js and Bootstrap
- a web server based on Hapi
- Babel.js and the needed presets and plugins. [see .babelrc]
- build configs for Gulp.js and WebPack
- testing skeleton based on Mocha & Chai
- a minimal Redux state management
- a rudimentary 'CarPool' WebApp showing a few (freely available) car pictures
npm install
gulp
Gulp will then copy all the files from src/
to build/tmp
and invoke WebPack which in turn will create a new release under build/release
.
For continuous development use:
gulp watch
There's no hot-reloading
because Inferno.js Components can't be consumed by WebPack's Hot-Loader. This is understandable as Inferno's components
only have a React-compatible API but not the internal structure. For example, the InfernoDOM.render() function doesn't return the instance of the root
Component. And without it the HotLoader will be unable to localize the root of the WebApp.
// When you render it, assign it to a variable
var rootInstance = React.render(RootComponent(), document.body);
// Then just copy and paste this part at the bottom of
// the file
if (module.hot) {
require('react-hot-loader/Injection').RootInstanceProvider.injectProvider({
getRootInstances: function () {
// Help React Hot Loader figure out the root component instances on the page:
return [rootInstance];
}
});
}
I'll try to find out if there's any possibility to hot-load Inferno's components and for the time being you can use the older livereload
functionality provided by LiveReload Chrome-Plugin + gulp watch
from the console.
npm start
Hapi.js will use index.js
from the root of the project and serve the contents on http://localhost:8080
npm test
or for continuous testing
npm test:watch
Currently, there's not much to test because everything here is still in flux.