• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kick-Ass Universal RFR Demo That Answers Your SSR + Splitting Questions
Edit Redux-First Router Demo

Universal Demonstration of Redux-First Router

This demo specializes in SSR and the sort of things like redirecting and authentication you will do on the server. For the simpler example that's easier to start with, check out the Redux-First Router Boilerplate.

redux-first-router-demo screenshot

Installation

git clone https://github.com/faceyspacey/redux-first-router-demo
cd redux-first-router-demo
yarn
yarn start

Files You Should Look At:

universal code:

client code:

server code:

Notes

I comment throughout the code various things you can try. Look out for comments starting with "TRY:" and "TASK:".

For example, there are simple values like the jwToken you can toggle to get access to the restricted admin area. That showcases a key feature: authentication filtering.

In general, this Demo is all about SSR. It shows how to use the onBeforeChange to properly authenticate user's and routes using JSON Web Tokens. And of course data-fetching via thunks is central to it all. There's even a real API.

Lastly, the server/configureStore.js file is the absolute most important file of the demo. It essentially brings your routing-aware Redux store full circle by bringing it server-side in a dead simple yet flexible manner. It works in combination with src/routesMap.js. Study those and your redux routing dreams have come true πŸ˜€

As a bonus, it comes with code-splitting thanks to react-universal-component. This setup makes splitting stupid-easy. In the future, routing-aware pre-fetching will be added to the mix, so the users never know you're only serving partial parts of your app πŸš€

TO DO

  • auth0-based signup/login that replaces current fake cookie/JWToken setup (PR welcome)

More Repositories

1

react-universal-component

πŸš€ The final answer to a React Universal Component: simultaneous SSR + Code Splitting
JavaScript
1,696
star
2

redux-first-router

πŸŽ– seamless redux-first routing -- just dispatch actions
JavaScript
1,568
star
3

extract-css-chunks-webpack-plugin

Extract CSS from chunks into multiple stylesheets + HMR
JavaScript
691
star
4

webpack-flush-chunks

πŸ’© server-to-client chunk discovery + transportation for Universal Rendering
JavaScript
355
star
5

universal-demo

DEMO: Webpack Flush Chunks + React Universal Component 3.0 πŸš€
JavaScript
230
star
6

tracker-react

No-Config reactive React Components with Meteor
JavaScript
126
star
7

babel-plugin-universal-import

🍾 universal(props => import(`./${props.page}`)) + dual css/js imports
JavaScript
114
star
8

redux-first-router-link

<Link /> + <NavLink /> that mirror react-router's + a few additional props
JavaScript
55
star
9

jest-storybook-facade

JavaScript
53
star
10

babel-plugin-dual-import

NOTE: now use babel-plugin-universal-import if you're using React Universal Component
JavaScript
50
star
11

require-universal-module

Universal-Rendering Module Loading Primitives
JavaScript
28
star
12

transition-group

What React CSS Transition Group is s'posed to be
JavaScript
25
star
13

respond-framework-docs-old

25
star
14

redux-first-router-boilerplate

JavaScript
23
star
15

flush-chunks-boilerplate

πŸ’© A boilerplate showing how to achieve Universal Code-Splitting and Universal HMR with react-loadable, webpack-flush-chunks and extract-css-chunks-webpack-plugin
JavaScript
18
star
16

redux-first-router-restore-scroll

JavaScript
13
star
17

remixx

JavaScript
12
star
18

flush-chunks-boilerplate-babel-chunknames

babel boilerplate for Webpack Flush Chunks + React Universal Component + webpack's "magic comment" feature
JavaScript
10
star
19

travis-github-status

Set statuses on github from travis for jest, flow, + eslint
JavaScript
8
star
20

extract-css-chunk

JavaScript
7
star
21

jest-redux-snap

πŸ“Έ reactive test helpers for redux and jest. snap everything!!!
JavaScript
7
star
22

redux-first-router-codesandbox

HOW TO USE: https://medium.com/faceyspacey/redux-first-router-lookin-sexy-on-code-sandbox-d9d9bea15053
JavaScript
6
star
23

react-native-20-screcorder-demo

JavaScript
6
star
24

redux-first-router-navigation

JavaScript
5
star
25

flush-chunks-boilerplate-webpack

universal webpack boilerplate for Webpack Flush Chunks + React Universal Component
JavaScript
5
star
26

rudy

JavaScript
5
star
27

blog-demo

JavaScript
3
star
28

redux-first-router-demo-codesandbox

JavaScript
3
star
29

redux-first-router-scroll-container

JavaScript
3
star
30

redux-first-router-navigation-boilerplate

JavaScript
3
star
31

nucleus

JavaScript
2
star
32

universal-react-vue-loader-demo

JavaScript
2
star
33

animated-transition-group

like <ReactTransitionGroup /> + callbacks, extras and child-specific customization
JavaScript
2
star
34

universal-render

2
star
35

ck

JavaScript
1
star
36

pure-redux-router

πŸ‘Ά Seamless Redux-First Routing
JavaScript
1
star
37

webpack-server-middleware

Hot updates Webpack bundles on the server
JavaScript
1
star
38

rudy-match-path

JavaScript
1
star
39

flush-chunks-boilerplate-babel

babel boilerplate for Webpack Flush Chunks + React Universal Component
JavaScript
1
star
40

redux-first-router-scroll-container-native

scroll restoration for React Native using Redux First Router
JavaScript
1
star
41

coastbeachwear

Web Store for Coast Beachwear Inc.
JavaScript
1
star
42

rfr-demo-mike

Created with CodeSandbox
JavaScript
1
star