All Projects → jgliner → react-router-v4-redux-ssr

jgliner / react-router-v4-redux-ssr

Licence: MIT license
Walkthrough for SSR with rr@v4 and rrr@v5

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-router-v4-redux-ssr

isomorphic-react-redux-saga-ssr
Isomorphic, React, Redux, Saga, Server Side rendering, Hot Module Reloading, Ducks, Code Splitting
Stars: ✭ 19 (-67.24%)
Mutual labels:  server-side-rendering, react-router-redux, react-router-v4
Universal React Demo
ES6 demo of a simple but scalable React app with react-router, code splitting, server side rendering, and tree shaking.
Stars: ✭ 50 (-13.79%)
Mutual labels:  server-side-rendering, react-router-v4
Hapi React Hot Loader Example
Simple React Hot Loading example with Hapi Server-side rendering
Stars: ✭ 44 (-24.14%)
Mutual labels:  server-side-rendering, webpack3
Universal React Redux
🧐 A sensible universal starter kit for React + Redux
Stars: ✭ 112 (+93.1%)
Mutual labels:  server-side-rendering, react-router-v4
Modern-Web-App
React PWA with SSR and Code splitting
Stars: ✭ 45 (-22.41%)
Mutual labels:  server-side-rendering, react-router-v4
ssr-starter-pack
Moved to https://github.com/Brigad/ssr-starter-pack
Stars: ✭ 12 (-79.31%)
Mutual labels:  server-side-rendering, webpack3
Egg Vue Webpack Boilerplate
Egg Vue Server Side Render (SSR) / Client Side Render (CSR)
Stars: ✭ 1,302 (+2144.83%)
Mutual labels:  server-side-rendering, webpack3
React-Redux-Enterprise
A React-Redux boilerplate for enterprise/large scaled web applications
Stars: ✭ 77 (+32.76%)
Mutual labels:  react-router-redux, react-router-v4
V2 Universal Js Hmr Ssr React Redux
⚡ (V2) Universal JS - Server Side Rendering, Code Splitting and Hot Module Reloading ⚡
Stars: ✭ 147 (+153.45%)
Mutual labels:  server-side-rendering, react-router-v4
Rogue.js
The "nearly invisible" way to server-render React applications
Stars: ✭ 1,923 (+3215.52%)
Mutual labels:  server-side-rendering, react-router-v4
Tips-in-React
在 React 开发实际项目过程的使用心得
Stars: ✭ 15 (-74.14%)
Mutual labels:  react-router-v4, react-router-config
rogue.js
The "nearly invisible" way to server-render React applications
Stars: ✭ 1,914 (+3200%)
Mutual labels:  server-side-rendering, react-router-v4
react-candee
A react framework that encapsulates the redux.
Stars: ✭ 30 (-48.28%)
Mutual labels:  react-router-redux, react-router-v4
Typescript React Express
typescript react express example
Stars: ✭ 12 (-79.31%)
Mutual labels:  server-side-rendering, webpack3
boss-lite
Boss Lite - React Redux Material Admin Template
Stars: ✭ 148 (+155.17%)
Mutual labels:  react-router-redux, webpack3
The Ultimate Boilerplate
webpack 2, react hotloader 3, react router v4, code splitting and more
Stars: ✭ 85 (+46.55%)
Mutual labels:  server-side-rendering, react-router-v4
React Redux Graphql Apollo Bootstrap Webpack Starter
react js + redux + graphQL + Apollo + react router + hot reload + devTools + bootstrap + webpack starter
Stars: ✭ 127 (+118.97%)
Mutual labels:  react-router-v4, webpack3
React Blog
personal blog design by react
Stars: ✭ 170 (+193.1%)
Mutual labels:  react-router-v4, webpack3
Redux React Session
🔑 Simple Session API storage for Redux and React
Stars: ✭ 140 (+141.38%)
Mutual labels:  server-side-rendering, react-router-v4
electron-react
A simple and compact boilerplate for electron and react (redux, router)
Stars: ✭ 66 (+13.79%)
Mutual labels:  react-router-v4, webpack3

React Server-Side Rendering Walkthrough

For:
React Router v4,
react-router-redux v5,
React Router Config v1

A fully annotated Demo for SSR with rr@v4 and rrr@v5

Currently WIP @TODO: Docs, unit tests


Installation

  1. git clone https://github.com/jgliner/react-router-v4-redux-ssr
  2. cd react-router-v4-redux-ssr
  3. Install (yarn is recommended, but npm install works just as well)

Development

npm run dev will start a webpack-dev-server on localhost:3005

  • HMR is enabled

Production

npm run start will:

  1. Clear the /dist folder
  2. Build, concat, and optimize the webpack bundle for production
  3. Start production server on localhost:3005

Things to Try

After you're up and running, a good way to see the benefits of SSR is to curl -v localhost:3005/plusDataDeps or any other route (with the exception of / or /static). You should see something very similar to the following:

*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3005 (#0)
> GET /plusDataDeps HTTP/1.1
> Host: localhost:3005
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Content-Type: text/html; charset=utf-8
< Content-Length: 2208
< Connection: keep-alive
<

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charSet="utf-8">
        <title>RR+RRR v4 Server-Side</title>
        <link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900' rel='stylesheet' type='text/css' />
        <link rel="icon" type="image/png" href="https://reacttraining.com/react-router/favicon-32x32.png" sizes="32x32">
        <link rel="icon" type="image/png" href="https://reacttraining.com/react-router/favicon-16x16.png" sizes="16x16">
        <link rel="stylesheet" type="text/css" href="/dist/main.css">
      </head>
      <body>
        <div id="root">
          <div><div data-reactroot="" data-reactid="1" data-react-checksum="1391679768"><div class="app-base" data-reactid="2"><h1 data-reactid="3">Base</h1><div class="static-data-view" data-reactid="4"><h1 data-reactid="5">Static Page + External Data</h1><div data-reactid="6"><p data-reactid="7"><!-- react-text: 8 -->foo<!-- /react-text --><!-- react-text: 9 --> -- <!-- /react-text --><!-- react-text: 10 -->bar<!-- /react-text --></p><p data-reactid="11"><!-- react-text: 12 -->baz<!-- /react-text --><!-- react-text: 13 --> -- <!-- /react-text --><!-- react-text: 14 -->qux<!-- /react-text --></p><p data-reactid="15"><!-- react-text: 16 -->quux<!-- /react-text --><!-- react-text: 17 --> -- <!-- /react-text --><!-- react-text: 18 -->corge<!-- /react-text --></p><p data-reactid="19"><!-- react-text: 20 -->uier<!-- /react-text --><!-- react-text: 21 --> -- <!-- /react-text --><!-- react-text: 22 -->grault<!-- /react-text --></p><p data-reactid="23"><!-- react-text: 24 -->garply<!-- /react-text --><!-- react-text: 25 --> -- <!-- /react-text --><!-- react-text: 26 -->waldo<!-- /react-text --></p></div><br data-reactid="27"/><a href="/" data-reactid="28">&lt; Back Home</a></div></div></div></div>
        </div>
        <script>window.INITIAL_STATE = {"apiData":{"foo":"bar","baz":"qux","quux":"corge","uier":"grault","garply":"waldo"},"apiDataWithParams":{},"currentPage":1,"dynamicApiData":{},"router":{"location":{"pathname":"\u002FplusDataDeps","search":"","hash":"","key":"8zz65g"}}};</script>
        <script src="/dist/main.js"></script>
      </body>
    </html>
* Connection #0 to host localhost left intact
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].