开发者社区> 镜像站> NPM> @platform/react.ssr
@platform/react.ssr
A lightweight SSR (server-side-rendering) system for react apps bundled with ParcelJS and hosted on S3.
Last updated 24 days ago by philcockfield .
MIT · Original npm · Tarball · package.json
$ cnpm install @platform/react.ssr 
SYNC missed versions from official npm registry.

Module License: MIT NPM banner

A lightweight SSR (server-side-rendering) system for react apps bundled with ParcelJS and hosted on S3.

 

Live Demo:

https://ssr.platform.uiharness.com

 

Highlights:

  • Store assets on S3 (or Digital Ocean Spaces).
  • Serve entry HTML from server (immediate load from "server-side-render").
  • 307 redirect all other assets to S3/CDN (geo-edge cache).
  • Manage lifecycle with simple command-line tools:
    • Bundle and push to S3 via command-line.
    • Manage versioned releases (with simple roll-backs) across multiple sites/environments.
      (eg. dev, staging, prod)

 

diagram

Setup

yarn add @platform/react.ssr

 

Workflow

  • Develop UI components on local dev-server within the UIHarness or anything that can produce a javascript bundle (eg ParcelJS):

  • Ensure the UI module has a bundle script within it's package.json.

  • Create an ssr.yml configuration file for the server.

Sample

The /sample/now and /sample/server are expecting a .env file with your S3 account information:

# 
# Digital Ocean "SPACES" or AWS "S3" connection secrets.
# 
SPACES_KEY="..."
SPACES_SECRET="..."

These are referenced within the ssr.yml config file.

Example sequence:

????
cd sample/ui
yarn start

Bundle a version and push it to S3:

????
cd sample/server
yarn ssr bundle

Release bundled version by updating manifest:

????
cd sample/server
yarn ssr release

Start local SSR server to test the bundle:

????
cd sample/server 
yarn start

Open in http://localhost browser (address/port exposed in server startup log).

 

Routes

The following system routes are exposed for examining meta-data about the current state and configuration of the server.

https://domain.com/.manifest
https://domain.com/.manifest/summary
https://domain.com/.manifest/summary/<site>

 

 

Current Tags

  • 1.1.171                                ...           latest (24 days ago)

160 Versions

  • 1.1.171                                ...           24 days ago
  • 1.1.167                                ...           a month ago
  • 1.1.166                                ...           2 months ago
  • 1.1.162                                ...           3 months ago
  • 1.1.160                                ...           3 months ago
  • 1.1.159                                ...           4 months ago
  • 1.1.158                                ...           4 months ago
  • 1.1.157                                ...           5 months ago
  • 1.1.156                                ...           5 months ago
  • 1.1.154                                ...           6 months ago
  • 1.1.153                                ...           6 months ago
  • 1.1.150                                ...           6 months ago
  • 1.1.149                                ...           6 months ago
  • 1.1.148                                ...           6 months ago
  • 1.1.147                                ...           6 months ago
  • 1.1.144                                ...           6 months ago
  • 1.1.142                                ...           6 months ago
  • 1.1.141                                ...           6 months ago
  • 1.1.139                                ...           6 months ago
  • 1.1.132                                ...           7 months ago
  • 1.1.130                                ...           8 months ago
  • 1.1.129                                ...           8 months ago
  • 1.1.127                                ...           8 months ago
  • 1.1.126                                ...           9 months ago
  • 1.1.119                                ...           9 months ago
  • 1.1.116                                ...           9 months ago
  • 1.1.115                                ...           9 months ago
  • 1.1.112                                ...           9 months ago
  • 1.1.108                                ...           9 months ago
  • 1.1.107                                ...           9 months ago
  • 1.1.106                                ...           9 months ago
  • 1.1.105                                ...           9 months ago
  • 1.1.104                                ...           9 months ago
  • 1.1.102                                ...           10 months ago
  • 1.1.100                                ...           10 months ago
  • 1.1.99                                ...           10 months ago
  • 1.1.98                                ...           10 months ago
  • 1.1.97                                ...           10 months ago
  • 1.1.95                                ...           10 months ago
  • 1.1.93                                ...           10 months ago
  • 1.1.92                                ...           10 months ago
  • 1.1.90                                ...           10 months ago
  • 1.1.86                                ...           10 months ago
  • 1.1.85                                ...           10 months ago
  • 1.1.84                                ...           10 months ago
  • 1.1.83                                ...           10 months ago
  • 1.1.81                                ...           10 months ago
  • 1.1.78                                ...           a year ago
  • 1.1.77                                ...           a year ago
  • 1.1.74                                ...           a year ago
  • 1.1.73                                ...           a year ago
  • 1.1.69                                ...           a year ago
  • 1.1.67                                ...           a year ago
  • 1.1.60                                ...           a year ago
  • 1.1.58                                ...           a year ago
  • 1.1.55                                ...           a year ago
  • 1.1.54                                ...           a year ago
  • 1.1.53                                ...           a year ago
  • 1.1.52                                ...           a year ago
  • 1.1.48                                ...           a year ago
  • 1.1.47                                ...           a year ago
  • 1.1.43                                ...           a year ago
  • 1.1.40                                ...           a year ago
  • 1.1.38                                ...           a year ago
  • 1.1.37                                ...           a year ago
  • 1.1.34                                ...           a year ago
  • 1.1.32                                ...           a year ago
  • 1.1.31                                ...           a year ago
  • 1.1.30                                ...           a year ago
  • 1.1.27                                ...           a year ago
  • 1.1.26                                ...           a year ago
  • 1.1.25                                ...           a year ago
  • 1.1.21                                ...           a year ago
  • 1.1.19                                ...           a year ago
  • 1.1.18                                ...           a year ago
  • 1.1.17                                ...           a year ago
  • 1.1.16                                ...           a year ago
  • 1.1.15                                ...           a year ago
  • 1.1.12                                ...           a year ago
  • 1.1.11                                ...           a year ago
  • 1.1.9                                ...           a year ago
  • 1.1.8                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.9.15                                ...           a year ago
  • 0.9.14                                ...           a year ago
  • 0.9.13                                ...           a year ago
  • 0.9.12                                ...           a year ago
  • 0.9.11                                ...           a year ago
  • 0.9.10                                ...           a year ago
  • 0.9.9                                ...           a year ago
  • 0.9.8                                ...           a year ago
  • 0.9.7                                ...           a year ago
  • 0.9.6                                ...           a year ago
  • 0.9.5                                ...           a year ago
  • 0.9.4                                ...           a year ago
  • 0.9.3                                ...           a year ago
  • 0.9.0                                ...           a year ago
  • 0.8.1                                ...           a year ago
  • 0.8.0                                ...           a year ago
  • 0.7.7                                ...           a year ago
  • 0.7.6                                ...           a year ago
  • 0.7.4                                ...           a year ago
  • 0.7.3                                ...           a year ago
  • 0.7.2                                ...           a year ago
  • 0.7.1                                ...           a year ago
  • 0.6.4                                ...           a year ago
  • 0.6.3                                ...           a year ago
  • 0.6.2                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.5.16                                ...           a year ago
  • 0.5.12                                ...           a year ago
  • 0.5.11                                ...           a year ago
  • 0.5.7                                ...           a year ago
  • 0.5.6                                ...           a year ago
  • 0.5.3                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.1                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.11                                ...           a year ago
  • 0.4.10                                ...           a year ago
  • 0.4.9                                ...           a year ago
  • 0.4.8                                ...           a year ago
  • 0.4.6                                ...           a year ago
  • 0.4.5                                ...           a year ago
  • 0.4.4                                ...           a year ago
  • 0.4.3                                ...           a year ago
  • 0.4.2                                ...           a year ago
  • 0.4.1                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.11                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
  • 0.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 33
Dependencies (15)
Dev Dependencies (6)
Dependents (0)
None