Skip to content

Commit a34fe00

Browse files
MeAkibmattrbeck
authored andcommitted
docs: update generated file names in the ecosystem guides
The web worker, service worker and app shell guides still showed `app.component.*` file names and the old root template text. Use the current names (`app.ts`, `app.html`, `app-shell.ts`), the current root template text, and list the files the generated `ngsw-config.json` actually caches. (cherry picked from commit cd9d0ae)
1 parent a58723a commit a34fe00

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

‎adev/src/content/ecosystem/service-workers/app-shell.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ The command updates the application code and adds extra files to the project str
3030
src
3131
├── app
3232
│ ├── app.config.server.ts # server application configuration
33+
│ ├── app.routes.server.ts # server routes configuration
3334
│ └── app-shell # app-shell component
34-
│ ├── app-shell.component.html
35-
│ ├── app-shell.component.scss
36-
│ ├── app-shell.component.spec.ts
37-
│ └── app-shell.component.ts
35+
│ ├── app-shell.css
36+
│ ├── app-shell.html
37+
│ ├── app-shell.spec.ts
38+
│ └── app-shell.ts
3839
└── main.server.ts # main server application bootstrapping
3940
```
4041

‎adev/src/content/ecosystem/service-workers/getting-started.md‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,13 @@ Instead, they are being loaded from the service worker's cache.
9797
Notice that all of the files the browser needs to render this application are cached.
9898
The `ngsw-config.json` boilerplate configuration is set up to cache the specific resources used by the CLI:
9999

100-
- `index.html`
101-
- `favicon.ico`
100+
- `index.html` (and `index.csr.html` for applications with server-side rendering or prerendering)
101+
- `favicon.ico` and `manifest.webmanifest`
102102
- Build artifacts (JS and CSS bundles)
103-
- Anything under `assets`
104-
- Images and fonts directly under the configured `outputPath` (by default `./dist/<project-name>/`) or `resourcesOutputPath`.
105-
See the documentation for `ng build` for more information about these options.
103+
- Images and fonts anywhere in the browser output (by default `./dist/<project-name>/browser/`)
106104

107105
IMPORTANT: The generated `ngsw-config.json` includes a limited list of cacheable fonts and images extensions. In some cases, you might want to modify the glob pattern to suit your needs.
108106

109-
IMPORTANT: If `resourcesOutputPath` or `assets` paths are modified after the generation of configuration file, you need to change the paths manually in `ngsw-config.json`.
110-
111107
### Making changes to your application
112108

113109
Now that you've seen how service workers cache your application, the next step is understanding how updates work.
@@ -120,8 +116,8 @@ Make a change to the application, and watch the service worker install the updat
120116
This should also close the Developer Tools.
121117

122118
1. Shut down `http-server` (Ctrl-c).
123-
1. Open `src/app/app.component.html` for editing.
124-
1. Change the text `Welcome to {{title}}!` to `Bienvenue à {{title}}!`.
119+
1. Open `src/app/app.html` for editing.
120+
1. Change the text `Hello, {{ title() }}` to `Bienvenue à {{ title() }}!`.
125121
1. Build and run the server again:
126122

127123
```shell

‎adev/src/content/ecosystem/web-workers.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ng generate web-worker <location>
1414
```
1515

1616
You can add a web worker anywhere in your application.
17-
For example, to add a web worker to the root component, `src/app/app.component.ts`, run the following command.
17+
For example, to add a web worker to the root component, `src/app/app.ts`, run the following command.
1818

1919
```shell
2020
ng generate web-worker app
@@ -32,9 +32,9 @@ The command performs the following actions.
3232
});
3333
```
3434

35-
1. Adds the following scaffold code to `src/app/app.component.ts` to use the worker.
35+
1. Adds the following scaffold code to `src/app/app.ts` to use the worker.
3636

37-
```ts {header:"src/app/app.component.ts"}
37+
```ts {header:"src/app/app.ts"}
3838
if (typeof Worker !== 'undefined') {
3939
// Create a new
4040
const worker = new Worker(new URL('./app.worker', import.meta.url));

0 commit comments

Comments
 (0)