GithubHelp home page GithubHelp logo

brakmic / inferno.js-starter Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 0.0 2.77 MB

:fire: Starter for Inferno.js, +WebPack, +Redux, +Mocha

License: MIT License

JavaScript 98.13% HTML 1.87%
inferno inferno-components inferno-js react

inferno.js-starter's Introduction

CarPool

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

inferno_front

Installation

npm install

Building

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.

Example code from React Hot-Loading Docs

// 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.

Running

npm start

Hapi.js will use index.js from the root of the project and serve the contents on http://localhost:8080

Testing

npm test

inferno_test

or for continuous testing

npm test:watch

Currently, there's not much to test because everything here is still in flux.

License

MIT

inferno.js-starter's People

Contributors

brakmic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

inferno.js-starter's Issues

Tests are broken

I get: Error: Cannot find module '../src/core'

Thanks for setting this demo up!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.