From 9a3b3ad11df191c28798a6c8d13cd7820f069a90 Mon Sep 17 00:00:00 2001 From: Judy Bogart Date: Fri, 18 Jan 2019 09:20:24 -0800 Subject: [PATCH] docs: add long description to app-shell subcommand --- .../angular/app-shell/app-shell-long.md | 47 +++++++++++++++++++ .../schematics/angular/app-shell/schema.json | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/packages/schematics/angular/app-shell/app-shell-long.md b/packages/schematics/angular/app-shell/app-shell-long.md index e69de29bb2d1..260a3ce6da1e 100644 --- a/packages/schematics/angular/app-shell/app-shell-long.md +++ b/packages/schematics/angular/app-shell/app-shell-long.md @@ -0,0 +1,47 @@ +An app shell lets Universal render a portion of your application via a route at build time. +This gives users a meaningful first paint of your application that appears quickly +because the browser can simply render the HTML without the need to initialize any JavaScript. + +Use this command with a routing app that is accompanied by a Universal server-side app. + +To create an app shell, use the following command. + + + ng generate app-shell --client-project my-app --universal-project server-app + + +* `my-app` is the name of your client application +* `server-app` is the name of the Universal (server) application + +The command adds two new architect build targets to your `angular.json` configuration file (along with a few other changes). + + +"server": { + "builder": "@angular-devkit/build-angular:server", + "options": { + "outputPath": "dist/my-app-server", + "main": "src/main.server.ts", + "tsConfig": "src/tsconfig.server.json" + } +}, +"app-shell": { + "builder": "@angular-devkit/build-angular:app-shell", + "options": { + "browserTarget": "my-app:build", + "serverTarget": "my-app:server", + "route": "shell" + } +} + + +To verify the that the app has been built with the default shell content: + +1. Run the app-shell target. + + + ng run my-app:app-shell + + +1. Open `dist/app-shell/index.html` in your browser. + +The default text "app-shell works!" verifies that the app-shell route was rendered as part of the output. \ No newline at end of file diff --git a/packages/schematics/angular/app-shell/schema.json b/packages/schematics/angular/app-shell/schema.json index 975921de5784..beb4e71c6963 100644 --- a/packages/schematics/angular/app-shell/schema.json +++ b/packages/schematics/angular/app-shell/schema.json @@ -4,7 +4,7 @@ "title": "Angular AppShell Options Schema", "type": "object", "description": "Generates an app shell for running a server-side version of an app.", - "long-description": "", + "long-description": "./app-shell-long.md", "properties": { "clientProject": { "type": "string",