Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Migrate Service Worker to Standalone (#51687)
Although there are several pages, only `service-worker-getting-started.md` has an example. That example code was migrated. Worked around the few references to NgModule. Other changes as follows: **Revised "Getting Started"** The original service worker example page (`service-worker-getting-started.md`) is full of holes! I don’t know how anyone got this working just by following this page - it doesn’t tell you where to get the example (and it isn’t generated by AIO) - it doesn’t tell you that ng serve doesn’t support service worker apps - it mentions http-server in passing but not what that is or where to get it. - several commands tell you to supply the “project-name” but (a) it doesn’t tell you how to find that name and (b) you never actually have to provide a name at all. That includes on the command that gets http-server going. **Hid section on `ngsw-config` tool** Hid the discussion of the `ngsw-config` tool in `service-worker-config.md` because (a) the command invoke it didn't seem to work and (b) it referenced `<project-name>` without explaining what that is or where to find it. Left the hidden text in the page in case someone wants to do something about this. Meanwhile, you seem to be able to edit the `ngsw-config.json` and then rebuild. That should suffice. **Disabled E2E** The AIO CI will no longer attempt to run the (thin) E2E tests. These tests could lightly test the app with the dev server but couldn't test the Service Worker aspects; that would require launching the app with something other than `ng serve` and the AIO CI is not set up for that. The existing tests appeared to pass when run locally with the dev server. However, only one of them actually ran; test runner reported. "There were tests whose specified size is too big." Decided to bypass E2E testing of this project for now. PR Close #51687
- Loading branch information
1 parent
0b3e6a4
commit 9f3b549
Showing
18 changed files
with
97 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
aio/content/examples/service-worker-getting-started/ngsw-config.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
aio/content/examples/service-worker-getting-started/src/app/app.module.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
aio/content/examples/service-worker-getting-started/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
import { bootstrapApplication, provideProtractorTestingSupport } from '@angular/platform-browser'; | ||
|
||
import { AppModule } from './app/app.module'; | ||
import { AppComponent } from './app/app.component'; | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule) | ||
.catch(err => console.error(err)); | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
provideProtractorTestingSupport(), // essential for e2e testing | ||
] | ||
}); |
7 changes: 7 additions & 0 deletions
7
aio/content/examples/service-worker-getting-started/zipper.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"files": [ | ||
"!dist/", | ||
"!**/*.d.ts", | ||
"!**/src/**/*.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.