Coder Social home page Coder Social logo

codebelt / hapi-react-hot-loader-example Goto Github PK

View Code? Open in Web Editor NEW
42.0 8.0 9.0 617 KB

Simple React Hot Loading example with Hapi Server-side rendering

Home Page: http://www.codebelt.com/javascript/webpack-react-hot-loader-hapi-js-server-side-rendering-example/

License: MIT License

HTML 0.80% JavaScript 86.92% CSS 12.29%
react react-redux redux hapi hapijs redux-form redux-saga universal-react universal-app isomorphic

hapi-react-hot-loader-example's Introduction

[No longer maintained] I will continue to maintain the TypeScript version.

hapi-react-hot-loader-example

Example universal/isomorphic application demonstrating react-hot-loader-3 with webpack-3, react and friends, async code splitting, and hapi.

Check out the TypeScript version here

Found this usefull? give it a โญ

Windows users see the last section of this README

get started

  1. $ yarn
  2. $ yarn dev
  3. http://localhost:3000

dev tasks

  • $ yarn lint (eslint)
  • $ yarn dev (local development w/ server)

Type rs with a carriage return to restart nodemon if you make changes to the server.js file or any files within the server folder. It's not efficient to automatically restart nodemon on file changes.

Note: Saga's do not hot load. You will have to reload the browser. Read more about potential issues and/or implement yourself.

production tasks

  • $ yarn prod (production build w/ server)
  • $ yarn prod:build (production build)

staging tasks

  • $ yarn staging (staging build w/ server)
  • $ yarn staging:build (staging build)

Other features/examples I am working:
  • Jest / Enzyme

Window Users

Use $ yarn devWindows during development. Note rs to restart nodemon will not work on windows.

If you want rs to restart nodemon you will need to run yarn watchServer and yarn devServer in two separate terminals.

hapi-react-hot-loader-example's People

Contributors

ccheney avatar codebelt avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hapi-react-hot-loader-example's Issues

Code Splitting is not working

Seems like code splitting is not working but is working on the TypeScript version. If you go to the about page you don't see the js file being loaded. Seems like it all getting compiled into the main js file.

Dev build not working on Windows (yarn dev)

Hi

I got the latest version of the project
ran
yarn
yarn dev

I see the logs:

`
$ cross-env npm run removeAndBuildServer

[email protected] removeAndBuildServer D:\Work\rococode\reacthotloader
cross-env npm run remove && npm run buildServer

[email protected] remove D:\Work\rococode\reacthotloader
cross-env rimraf dist

[email protected] buildServer D:\Work\rococode\reacthotloader
cross-env BABEL_ENV=server ./node_modules/.bin/babel src --out-dir dist

src\client.jsx -> dist\client.js
src\RouterWrapper.jsx -> dist\RouterWrapper.js
src\server\controllers\AssetsController.js -> dist\server\controllers\AssetsController.js
src\server\controllers\ReactController.jsx -> dist\server\controllers\ReactController.js
src\server\plugin\HapiWebpackHotPlugin.js -> dist\server\plugin\HapiWebpackHotPlugin.js
src\server\ServerManager.js -> dist\server\ServerManager.js
src\server.js -> dist\server.js
src\services\ProviderService.js -> dist\services\ProviderService.js
src\services\ServerService.js -> dist\services\ServerService.js
src\stores\loading\LoadingAction.js -> dist\stores\loading\LoadingAction.js
src\stores\loading\LoadingReducer.js -> dist\stores\loading\LoadingReducer.js
src\stores\meta\MetaAction.js -> dist\stores\meta\MetaAction.js
src\stores\meta\MetaReducer.js -> dist\stores\meta\MetaReducer.js
src\stores\render\RenderReducer.js -> dist\stores\render\RenderReducer.js
src\stores\rootReducer.js -> dist\stores\rootReducer.js
src\stores\rootSaga.js -> dist\stores\rootSaga.js
src\stores\user\UserAction.js -> dist\stores\user\UserAction.js
src\stores\user\UserReducer.js -> dist\stores\user\UserReducer.js
src\stores\user\UserSaga.js -> dist\stores\user\UserSaga.js
src\views\about\About.jsx -> dist\views\about\About.js
src\views\about\AboutAsync.jsx -> dist\views\about\AboutAsync.js
src\views\contact\Contact.jsx -> dist\views\contact\Contact.js
src\views\contact\ContactForm.jsx -> dist\views\contact\ContactForm.js
src\views\errors\NotFound.jsx -> dist\views\errors\NotFound.js
src\views\errors\NotFoundAsync.jsx -> dist\views\errors\NotFoundAsync.js
src\views\home\Home.jsx -> dist\views\home\Home.js
src\views\landmarks\Footer.jsx -> dist\views\landmarks\Footer.js
src\views\landmarks\FooterAsync.jsx -> dist\views\landmarks\FooterAsync.js
src\views\landmarks\Header.jsx -> dist\views\landmarks\Header.js
$ cross-env npm run watchServer & npm run devServer

[email protected] watchServer D:\Work\rococode\reacthotloader
cross-env BABEL_ENV=server ./node_modules/.bin/babel src --out-dir dist --watch

src\client.jsx -> dist\client.js
src\RouterWrapper.jsx -> dist\RouterWrapper.js
src\server\controllers\AssetsController.js -> dist\server\controllers\AssetsController.js
src\server\controllers\ReactController.jsx -> dist\server\controllers\ReactController.js
src\server\plugin\HapiWebpackHotPlugin.js -> dist\server\plugin\HapiWebpackHotPlugin.js
src\server\ServerManager.js -> dist\server\ServerManager.js
src\server.js -> dist\server.js
src\services\ProviderService.js -> dist\services\ProviderService.js
src\services\ServerService.js -> dist\services\ServerService.js
src\stores\loading\LoadingAction.js -> dist\stores\loading\LoadingAction.js
src\stores\loading\LoadingReducer.js -> dist\stores\loading\LoadingReducer.js
src\stores\meta\MetaAction.js -> dist\stores\meta\MetaAction.js
src\stores\meta\MetaReducer.js -> dist\stores\meta\MetaReducer.js
src\stores\render\RenderReducer.js -> dist\stores\render\RenderReducer.js
src\stores\rootReducer.js -> dist\stores\rootReducer.js
src\stores\rootSaga.js -> dist\stores\rootSaga.js
src\stores\user\UserAction.js -> dist\stores\user\UserAction.js
src\stores\user\UserReducer.js -> dist\stores\user\UserReducer.js
src\stores\user\UserSaga.js -> dist\stores\user\UserSaga.js
src\views\about\About.jsx -> dist\views\about\About.js
src\views\about\AboutAsync.jsx -> dist\views\about\AboutAsync.js
src\views\contact\Contact.jsx -> dist\views\contact\Contact.js
src\views\contact\ContactForm.jsx -> dist\views\contact\ContactForm.js
src\views\errors\NotFound.jsx -> dist\views\errors\NotFound.js
src\views\errors\NotFoundAsync.jsx -> dist\views\errors\NotFoundAsync.js
src\views\home\Home.jsx -> dist\views\home\Home.js
src\views\landmarks\Footer.jsx -> dist\views\landmarks\Footer.js
src\views\landmarks\FooterAsync.jsx -> dist\views\landmarks\FooterAsync.js
src\views\landmarks\Header.jsx -> dist\views\landmarks\Header.js
`

after that everything is stuck and I can't load anything on localhost:3000

any idea what is wrong?

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.