Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update readme and package.json to be real for PubPub
- Loading branch information
Showing
4 changed files
with
264 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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` |
Oops, something went wrong.