Hot Module Reloading: - Replaces modules that have been changed in real time while preserving the state.
Server Side Rendering: - Renders Pages on the initial for fast page loads and search engine optimization
Code Splitting: - Split code into bundles so that code is asynchronously loaded by the client.
The Basic setup goes like this...
An express server handles a request, renders the page on the server, then sends it back to the client. The code is bundled into chunks on build time which are requested by the client when needed for that route.
When in development mode, the express server handles a request and uses the
configuration as middleware to listen for file changes, build, then and push them to the client.
This project is an updated version of this project. With the biggest updates being migrations to React Router 4 and Hot Module Reloading 3
The main goal of this project remains the same; A simple and no BS approach to a Universal JS, Server Side Rendering, Code Splitting and Hot Module Reloading using the following technologies:
First install the dependencies in the root directory of this project run.
For Development run
npm run development
This will start a development server on
localhost:8080 that utilizes hot module
reloading for both React components and Redux reducers.
For Production run
npm run build && npm run production.
This will build all your assets and write them to a
/build folder in the root directory of this project. The script will then start an express server on
localhost:8080 that will utilize server side rendering and route based code splitting.
Hot Module Reloading does not work with
System.import, as such there are two route sources.
src/universal/routes/static.jsis for static routes (no code splitting) that is for the development environment to work nicely with React Hot Loader 3
src/universal/routes/async.jsis for asynchronous routes (Code splitting using System.import).