Skip to content

redfin/react-server

Repository files navigation

React Server is now defunct

ConsiderNext.jsinstead.

React Server

Build Status NPM version NPM downloads per month Chat on Slack NPM license Powered by Redfin

React framework with server render for blazing fast page load and seamless transitions between pages in the browser.


Just getting started withreact-server?

Theeasiestway to get started is with ouryeoman generator:

#install yeoman
npm install -g yo

#install the react-server generator
npm install -g generator-react-server

#make a new react-server project in the CURRENT directory
yo react-server

#run the new app
npm run start
#go to http://localhost:3000

That hooks you up withreact-server-cli,which will take care of theserverpart and get you up and running right away.

Whyreact-server?

One of the great things about React is its support for server-side rendering, which can make sites show up faster for users and play better with search engine bots.

However, when you actually try to use React for server-side rendering, you quickly run into a bunch of practical problems, such as:

  • How should I load data on the server for my components?
  • How do I ensure that the client and the server load the same data and generate the same HTML markup?
  • How do I write code that can be both generated server-side and be part of a single-page application (SPA)?
  • How should I optimize the delivery of my JavaScript and CSS?
  • How do I find out about and follow performance best practices?
  • How do I ensure that my site is streamed to the browser as quickly as humanly possible?
  • How can I make my app resilient when my backend has high latency spikes?

react-serveris a framework designed to make universal (née isomorphic) React easier to write, providing standard answers for these questions and more. When you write your app forreact-server,you concentrate on your React components, andreact-servertakes care of everything else that's needed to run and deploy real React server-rendered apps. Under the hood,react-serveris doing a bunch of clever optimizations, many borrowed from the ideas behindFacebook's Big Pipe, to make sure that your site shows up as quickly as humanly possible for your users.

Once you're hungry for more, dig intothe React Server documentationand thereact-servercode.


Migrating from react-server 0.8.1 to 1.0.0

This release is a major, potentially breaking, change which upgrades react-server's dependencies from webpack 1.x to webpack 4.x, and babel 6.x to babel 7.x.

If using default react-server configuration, you should be able to update to 1.0.0 without issue. However, if you have extended the default react-server webpack config using thewebpackConfigoption, you may need to update your webpack configuration options to matchWebpack 4.x Documentation.

Note:If you are having trouble loading css bundles inmode = production,try switching fromimporttorequire()syntax.webpack-contrib/mini-css-extract-plugin#27

Want to help?

Great! There's a lot to do! Seethe contributing guideto get started.

Where's all the code?!

This is aLernarespository with multiple npm packages! Check out thepackages/directory 👀.