Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Commit a178fd0

Browse files
authored
chore: update for Angular 5.0 and make cli the only option (#485)
- Rename 'static' to 'prerender' and 'dynamic' to 'ssr' in npm tasks so that it's not confused with JIT(dynamic) and AOT(static).
1 parent 1ea3175 commit a178fd0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1097
-4141
lines changed
File renamed without changes.

cli/.gitignore renamed to .gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.DS_Store
3+
.vscode
34
morgan.log
45

56
# Built #

README.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,37 @@ A minimal Angular starter for Universal JavaScript using TypeScript and Webpack
1212
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
1313

1414
## Getting Started
15-
There are two projects hosting in this repository: `/cli` and `/custom-webpack`, choose the one that best fits your situation.
16-
17-
## [cli](https://github.com/angular/universal-starter/tree/master/cli)
18-
An implementation of Universal using [@angular/cli](https://github.com/angular/angular-cli) to handle configuration.
19-
* Build config is already done for you
20-
* Standard in the Angular community
21-
* Less flexible than a custom build config
22-
23-
## [custom-webpack](https://github.com/angular/universal-starter/tree/master/custom-webpack)
24-
An implementation of Universal using a custom webpack configuration.
25-
* As flexible as possible
26-
* Sometimes hard to debug since not everyone has the same config
15+
16+
> This demo is built following the [Angular-CLI Wiki guide](https://github.com/angular/angular-cli/wiki/stories-universal-rendering)
17+
18+
We're utilizing packages from the [Angular Universal @nguniversal](https://github.com/angular/universal) repo, such as [ng-module-map-ngfactory-loader](https://github.com/angular/universal/tree/master/modules/module-map-ngfactory-loader) to enable Lazy Loading.
19+
20+
---
21+
22+
### Build Time Prerender(prerender) Vs. Server Side Rendering(ssr)
23+
This repo demonstrates the use of 2 different forms of Server Side Rendering.
24+
25+
**Prerender(prerender)**
26+
* Happens at build time
27+
* Renders your application and replaces the dist index.html with a version rendered at the route `/`.
28+
29+
**Server-Side Rendering(ssr)**
30+
* Happens at runtime
31+
* Uses `ngExpressEngine` to render you application on the fly at the requested url.
32+
33+
---
34+
35+
### Installation
36+
* `npm install` or `yarn`
37+
38+
### Development (Client-side only rendering)
39+
* run `npm run start` which will start `ng serve`
40+
41+
### Production (also for testing SSR/Pre-rendering locally)
42+
**`npm run build:ssr && npm run serve:ssr`** - Compiles your application and spins up a Node Express to serve your Universal application on `http://localhost:4000`.
43+
44+
**`npm run build:prerender && npm run serve:prerender`** - Compiles your application and prerenders your applications files, spinning up a demo http-server so you can view it on `http://localhost:8080`
45+
**Note**: To deploy your static site to a static hosting platform you will have to deploy the `dist/browser` folder, rather than the usual `dist`
2746

2847

2948
## Universal "Gotchas"

cli/README.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

cli/package.json

Lines changed: 0 additions & 61 deletions
This file was deleted.

custom-webpack/.editorconfig

Lines changed: 0 additions & 15 deletions
This file was deleted.

custom-webpack/.gitignore

Lines changed: 0 additions & 26 deletions
This file was deleted.

custom-webpack/.vscode/launch.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

custom-webpack/.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

custom-webpack/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

custom-webpack/nodemon.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

custom-webpack/package.json

Lines changed: 0 additions & 65 deletions
This file was deleted.

custom-webpack/src/app/+lazy/lazy.module.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)