Skip to content

Commit 6f79659

Browse files
committed
fixup! docs: update Universal guide
1 parent 1c08f73 commit 6f79659

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

aio/content/guide/universal.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ the client. This means that the application generally renders more quickly, givi
88
layout before it becomes fully interactive.
99

1010
For a more detailed look at different techniques and concepts surrounding SSR, please check out this
11-
[article](https://developers.google.com/web/updates/2019/02/rendering-on-the-web). For reference, Angular Universal
12-
falls under the category of "SSR with (Re)Hydration".
11+
[article](https://developers.google.com/web/updates/2019/02/rendering-on-the-web).
1312

1413
You can easily prepare an app for server-side rendering using the [Angular CLI](guide/glossary#cli).
1514
The CLI schematic `@nguniversal/express-engine` performs the required steps, as described below.
@@ -74,15 +73,16 @@ Navigation via `routerLinks` works correctly because they use the native anchor
7473
You can go from the Dashboard to the Heroes page and back.
7574
You can click a hero on the Dashboard page to display its Details page.
7675

77-
Notice, however, that clicks, mouse-moves, and keyboard entries are inert.
78-
76+
If you throttle your network speed so that the client-side scripts take longer to download (instructions below),
77+
you'll notice:
7978
* Clicking a hero on the Heroes page does nothing.
8079
* You can't add or delete a hero.
8180
* The search box on the Dashboard page is ignored.
8281
* The *Back* and *Save* buttons on the Details page don't work.
8382

8483
User events other than `routerLink` clicks aren't supported.
85-
You must wait for the full client app to bootstrap and run.
84+
You must wait for the full client app to bootstrap and run, or buffer the events using libraries like
85+
[preboot](https://github.com/angular/preboot), which allow you to replay these events once the client-side scripts load.
8686

8787
The transition from the server-rendered app to the client app happens quickly on a development machine, but you should
8888
always test your apps in real-world scenarios.
@@ -100,9 +100,9 @@ The server-rendered app still launches quickly but the full client app may take
100100

101101
There are three main reasons to create a Universal version of your app.
102102

103-
1. Facilitate web crawlers (search engine optimization, aka SEO)
103+
1. Facilitate web crawlers through [search engine optimization (SEO)](https://static.googleusercontent.com/media/www.google.com/en//webmasters/docs/search-engine-optimization-starter-guide.pdf)
104104
1. Improve performance on mobile and low-powered devices
105-
1. Show the first page quickly (first-contentful paint, aka FCP)
105+
1. Show the first page quickly with a [first-contentful paint (FCP)](https://developers.google.com/web/tools/lighthouse/audits/first-contentful-paint)
106106

107107
{@a seo}
108108
{@a web-crawlers}
@@ -115,9 +115,6 @@ These web crawlers may be unable to navigate and index your highly interactive A
115115
Angular Universal can generate a static version of your app that is easily searchable, linkable, and navigable without JavaScript.
116116
Universal also makes a site preview available since each URL returns a fully rendered page.
117117

118-
Enabling web crawlers is often referred to as
119-
[search engine optimization (SEO)](https://static.googleusercontent.com/media/www.google.com/en//webmasters/docs/search-engine-optimization-starter-guide.pdf).
120-
121118
{@a no-javascript}
122119
### Improve performance on mobile and low-powered devices
123120

@@ -214,7 +211,7 @@ import {HttpInterceptor, HttpHandler, HttpRequest, HttpHeaders} from '@angular/c
214211
import {Request} from 'express';
215212
import {REQUEST} from '@nguniversal/express-engine/tokens';
216213

217-
@Injectable({providedIn: 'root'})
214+
@Injectable()
218215
export class UniversalInterceptor implements HttpInterceptor {
219216

220217
constructor(@Optional() @Inject(REQUEST) protected request: Request) {}

0 commit comments

Comments
 (0)