https://github.com/alt-j/fast-react-server
[DEPRECATED] Use last versions of React and Node.js for better performance
https://github.com/alt-j/fast-react-server
performance react render server-side-rendering
Last synced: 6 months ago
JSON representation
[DEPRECATED] Use last versions of React and Node.js for better performance
- Host: GitHub
- URL: https://github.com/alt-j/fast-react-server
- Owner: alt-j
- License: mit
- Created: 2016-08-22T18:34:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-23T11:07:46.000Z (about 8 years ago)
- Last Synced: 2025-05-13T10:16:24.472Z (7 months ago)
- Topics: performance, react, render, server-side-rendering
- Language: JavaScript
- Homepage:
- Size: 70.3 KB
- Stars: 137
- Watchers: 7
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
With the release of the new version [React](https://reactjs.org/blog/2017/09/26/react-v16.0.html#better-server-side-rendering) and Node.js the performance issue has ceased to be so acute. Use last versions of React and Node.js for better performance.
======
# React Server [](https://travis-ci.org/alt-j/react-server) [](https://coveralls.io/github/alt-j/fast-react-server?branch=master)
It's high speed react mock for server rendering.
You can use it with [fast react render](https://github.com/alt-j/fast-react-render), in that case render will be **12 times as fast** (see [benchmarks](https://github.com/alt-j/react-server-benchmark)) as [traditional react rendering](https://facebook.github.io/react/docs/environments.html) (in production mode).
## Quick start
```sh
npm install fast-react-render fast-react-server
```
```js
var React = require('fast-react-server');
var ReactRender = require('fast-react-render');
var element = React.createElement(
React.createClass({
render: function () {
return React.createElement('div', {}, this.props.text);
}
}),
{text: 'some text'}
);
console.log(ReactRender.elementToString(element));
```
If you want use it, you must remember: each component, which you want render, you must declared with this mock (configure you build system for that).
Also fast react server support [ES6 classes](https://facebook.github.io/react/docs/reusable-components.html#es6-classes) and [Stateless Functions](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions) (see examples: [es6](examples/es6.jsx) and [stateless-function](examples/stateless-function.js)).
More examples:
- tiny [seed project](https://github.com/alt-j/fast-react-seed) (in progress);
- [examples](examples/) for main features.
## Cache
Fast react server support cache for component which implement in [fast react render](https://github.com/alt-j/fast-react-render).
See how it use [here](https://github.com/alt-j/fast-react-render#cache).