Skip to content

Commit

Permalink
Update readme and package.json to be real for PubPub
Browse files Browse the repository at this point in the history
  • Loading branch information
isTravis committed Dec 29, 2017
1 parent 8362b1c commit 21daae6
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 138 deletions.
40 changes: 21 additions & 19 deletions README.md
@@ -1,33 +1,35 @@
# Introduction
# PubPub v4

This API is a test for SSR React
Collaborative Community Publishing

# Running Locally

## To Install

```
npm install
npm start
```

# SSR Architecture
## To Run Dev Mode

```
npm start
```
Navigate to `localhost:9876`

- Don't render SPA. Render individual pages
- Dealing with routing causes painful scroll issues. Don't reinvent the wheel
- Makes server-side analytics trickier - forcing non-free analytics platforms (e.g. Google)
- So much overhead goes into downloading the whole application (even when on serviceworker).
- Designing loading-states is a slow-delopers's excuse. Don't worry about immediate transitions - just worry about fast page loads.
- Allows for data calls to be generated at once while on the server. Only one round-trip, rather than 1) load app, 2) finish first API call for site data, 3) finish second api call for content.
- SEO. Prerendering remains painful. (Not to mention archive.org archiving).
- Redux and connect actually make storybook more tricky. Without them, rendering pages in storybook is simple and powerful. Use storybook for hot-reloading, Full site nav for integration testing.
- The idea that a static site reduces load is a fallacy. You still need an API to serve every site load. An rather than one call, you're making multiple. Sure - if your API is loaded, you can show users something - but they don't want something - they want the content. And if your API is loaded, it's loaded.
## Storybook

To build and test components, we use Storybook. To run:

```
npm run storybook
```

Navigate to `localhost:9001`

- Bundling Routes
- Need to manually specify all containers in webpack configs.
## To Build and Run Production Version

- What is worse?
- Service workers have been removed. Again - service workers let me show the app right away (and if offline conditions) - but they still rely on the API call, which does have an offline fallback - but may still be slow.
- full-site hot module reload is not implemented, and seem to be a trickier beast.
```
npm run prod
```

Navigate to `localhost:9876`

0 comments on commit 21daae6

Please sign in to comment.