Skip to content

Commit fd2db65

Browse files
committed
docs: update hybrid rendering docs to remove RenderMode.AppShell
More context in angular/angular-cli#28818
1 parent 4c3e1a9 commit fd2db65

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

adev/src/content/guide/hybrid-rendering.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ const serverConfig: ApplicationConfig = {
8181
};
8282
```
8383

84+
When using the [App shell pattern](ecosystem/service-workers/app-shell), you must specify the route to be used as the app shell for client-side rendered routes. To do this, provide an options object with the `appShellRoute` property to [`provideServerRoutesConfig`](api/ssr/provideServerRoutesConfig 'API reference'):
85+
86+
```typescript
87+
const serverConfig: ApplicationConfig = {
88+
providers: [
89+
provideServerRoutesConfig(serverRoutes, { appShellRoute: 'shell' }),
90+
// ... other providers ...
91+
]
92+
};
93+
```
94+
8495
### Rendering modes
8596

8697
The server routing configuration lets you specify how each route in your application should render by setting a [`RenderMode`](api/ssr/RenderMode 'API reference'):
@@ -90,9 +101,6 @@ The server routing configuration lets you specify how each route in your applica
90101
| **Server (SSR)** | Renders the application on the server for each request, sending a fully populated HTML page to the browser. See the [Server-Side Rendering (SSR) guide](guide/ssr) for more information. |
91102
| **Client (CSR)** | Renders the application in the browser. This is the default Angular behavior. |
92103
| **Prerender (SSG)** | Prerenders the application at build time, generating static HTML files for each route. See the [Prerendering guide](guide/prerendering) for more information. |
93-
| **App shell** | Generates a static HTML shell of the application during the build process. This shell is displayed immediately for CSR routes while the full application loads. See the [App shell guide](ecosystem/service-workers/app-shell) for more information. |
94-
95-
IMPORTANT: An application can only have a one App shell, which is applied across all client-side rendered routes. By setting `renderMode` to [`RenderMode.AppShell`](api/ssr/RenderMode#AppShell 'API reference'), you're configuring that route as the application's shell, to be used by all client-side rendered routes.
96104

97105
#### Choosing a rendering mode
98106

@@ -136,10 +144,6 @@ Prerendering requires you to author code that does not strictly depend on browse
136144

137145
Prerendering incurs extremely little overhead per server request, as your server responds with static HTML documents. Static files are also easily cached by Content Delivery Networks (CDNs), browsers, and intermediate caching layers for even faster subsequent page loads. Deploying static HTML files to a CDN improves scalability by offloading work from your application web server, which is impactful for high-traffic applications.
138146

139-
##### App shell prerendering
140-
141-
An app shell offers improving perceived performance by displaying a basic layout quickly for client-side rendered routes. By showing users something immediately, it reduces the feeling of waiting for the application to load. App Shell provides a consistent user experience by creating a stable skeleton for the app, even while content is dynamically loaded. The shell can also be cached effectively, allowing the browser to cache it and speed up subsequent visits.
142-
143147
### Setting headers and status codes
144148

145149
You can set custom headers and status codes for individual server routes using the `headers` and `status` properties in the `ServerRoute` configuration.

0 commit comments

Comments
 (0)