Skip to content

Commit 1a3ba03

Browse files
jbogarthydemgechev
authored andcommitted
docs: add long description to app-shell subcommand
1 parent 7bd6e57 commit 1a3ba03

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
An app shell lets Universal render a portion of your application via a route at build time.
2+
This gives users a meaningful first paint of your application that appears quickly
3+
because the browser can simply render the HTML without the need to initialize any JavaScript.
4+
5+
Use this command with a routing app that is accompanied by a Universal server-side app.
6+
7+
To create an app shell, use the following command.
8+
9+
<code-example format="." language="bash">
10+
ng generate app-shell --client-project my-app --universal-project server-app
11+
</code-example>
12+
13+
* `my-app` is the name of your client application
14+
* `server-app` is the name of the Universal (server) application
15+
16+
The command adds two new architect build targets to your `angular.json` configuration file (along with a few other changes).
17+
18+
<code-example format="." language="none" linenums="false">
19+
"server": {
20+
"builder": "@angular-devkit/build-angular:server",
21+
"options": {
22+
"outputPath": "dist/my-app-server",
23+
"main": "src/main.server.ts",
24+
"tsConfig": "src/tsconfig.server.json"
25+
}
26+
},
27+
"app-shell": {
28+
"builder": "@angular-devkit/build-angular:app-shell",
29+
"options": {
30+
"browserTarget": "my-app:build",
31+
"serverTarget": "my-app:server",
32+
"route": "shell"
33+
}
34+
}
35+
</code-example>
36+
37+
To verify the that the app has been built with the default shell content:
38+
39+
1. Run the app-shell target.
40+
41+
<code-example format="." language="bash">
42+
ng run my-app:app-shell
43+
</code-example>
44+
45+
1. Open `dist/app-shell/index.html` in your browser.
46+
47+
The default text "app-shell works!" verifies that the app-shell route was rendered as part of the output.

packages/schematics/angular/app-shell/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"title": "Angular AppShell Options Schema",
55
"type": "object",
66
"description": "Generates an app shell for running a server-side version of an app.",
7-
"long-description": "",
7+
"long-description": "./app-shell-long.md",
88
"properties": {
99
"clientProject": {
1010
"type": "string",

0 commit comments

Comments
 (0)