docs: update universal docs for new ivy implementation (#33040)

PR Close #33040
This commit is contained in:
Alan Agius
2019-10-08 19:31:44 +02:00
committed by Matias Niemelä
parent 1b4eaea6d4
commit 755a80c7ec
5 changed files with 75 additions and 63 deletions

View File

@ -33,7 +33,7 @@ To create the server-side app module, `app.server.module.ts`, run the following
<code-example language="bash">
ng add @nguniversal/express-engine --clientProject angular.io-example
ng add @nguniversal/express-engine
</code-example>
@ -53,7 +53,6 @@ tsconfig.app.json <i>TypeScript client configuration</i>
tsconfig.server.json <i>* TypeScript server configuration</i>
tsconfig.spec.json <i>TypeScript spec configuration</i>
package.json <i>npm configuration</i>
webpack.server.config.js <i>* webpack server configuration</i>
</code-example>
The files marked with `*` are new and not in the original tutorial sample.
@ -152,7 +151,7 @@ The sample web server for this guide is based on the popular [Express](https://e
<div class="alert is-helpful">
**Note:** _Any_ web server technology can serve a Universal app as long as it can call Universal's `renderModuleFactory()` function.
**Note:** _Any_ web server technology can serve a Universal app as long as it can call Universal's `renderModule()` function.
The principles and decision points discussed here apply to any web server technology.
</div>
@ -162,15 +161,15 @@ server implementations of the DOM, `XMLHttpRequest`, and other low-level feature
The server ([Node Express](https://expressjs.com/) in this guide's example)
passes client requests for application pages to the NgUniversal `ngExpressEngine`. Under the hood, this
calls Universal's `renderModuleFactory()` function, while providing caching and other helpful utilities.
calls Universal's `renderModule()` function, while providing caching and other helpful utilities.
The `renderModuleFactory()` function takes as inputs a *template* HTML page (usually `index.html`),
The `renderModule()` function takes as inputs a *template* HTML page (usually `index.html`),
an Angular *module* containing components,
and a *route* that determines which components to display.
The route comes from the client's request to the server.
Each request results in the appropriate view for the requested route.
The `renderModuleFactory()` function renders the view within the `<app>` tag of the template,
The `renderModule()` function renders the view within the `<app>` tag of the template,
creating a finished HTML page for the client.
Finally, the server returns the rendered page to the client.
@ -263,7 +262,7 @@ The important bit in the `server.ts` file is the `ngExpressEngine()` function.
<code-example path="universal/server.ts" header="server.ts" region="ngExpressEngine">
</code-example>
The `ngExpressEngine()` function is a wrapper around Universal's `renderModuleFactory()` function which turns a client's
The `ngExpressEngine()` function is a wrapper around Universal's `renderModule()` function which turns a client's
requests into server-rendered HTML pages.
* The first parameter is `AppServerModule`.
@ -282,7 +281,7 @@ which then forwards it to the client in the HTTP response.
<div class="alert is-helpful">
**Note:** These wrappers help hide the complexity of the `renderModuleFactory()` function. There are more wrappers
**Note:** These wrappers help hide the complexity of the `renderModule()` function. There are more wrappers
for different backend technologies at the [Universal repository](https://github.com/angular/universal).
</div>