项目作者: KnisterPeter

项目描述 :
React server-side rendering without special APIs
高级语言: JavaScript
项目地址: git://github.com/KnisterPeter/react-ssr-renderer.git
创建时间: 2021-01-30T18:09:13Z
项目社区:https://github.com/KnisterPeter/react-ssr-renderer

开源协议:MIT License

下载


react-ssr-renderer

This project aims to do a server side rendering of a react application.

The difference to ReactDOMServer is the usage of jsdom to do a full render including data-fetching and other asynchronous operations without special apis.

How it works

The crucial part of the rendering is to decide when we are ready to send the html to the client.

This is done by rendering a node.js vm environment with a few wrapped global variables like Promises.
We do track all asynchronous work and when nothing is left to do, we return the current rendered state.