Commit graph

5 commits

Author SHA1 Message Date
George Kalpakas
74345f34ae build(docs-infra): remove unnecessary work-around for SW config generation (#44114)
Since angular.io is now updated to a version that includes the fix
from #43679, the work-around added in
841c5aebbf can now be removed.

PR Close #44114
2021-11-09 18:08:20 +00:00
George Kalpakas
841c5aebbf build(docs-infra): ensure ngsw.json generation is correct and deterministic (#43686)
As explained in #43679, currently the generation of the `ngsw.json` SW
manifest is non-deterministic and often incorrect. Until we can update
to an `@angular/service-worker` version that includes the fix from
PR #43679, we temporarily work-around the issue by re-generating the
`ngsw.json` manifest after `ng build` using the `ngsw-config` binary
exposed by `@angular/service-worker`.

NOTE:
This works around the issue, because the [FileSystem][1] class used by
the `ngsw-config` binary happens to be synchronous (unlike the
implementation provided by the Angular CLI), thus avoiding the race
conditions described in #43679.

[1]: c721135e37/packages/service-worker/cli/filesystem.ts (L15)

PR Close #43686
2021-10-06 10:05:55 -07:00
George Kalpakas
b8ab5ff0fb build(docs-infra): update AIO to align with new v13.0.0-next.9 CLI apps (#43686)
This commit updates angular.io to more closely align with new apps
created with the latest Angular CLI and remove redundant files/config
now that CLI has dropped support for differential loading.

PR Close #43686
2021-10-06 10:05:54 -07:00
George Kalpakas
72d1dfdd46 build(docs-infra): use $schema in ngsw-config.template.json to provide intellisense (#43686)
Add an appropriate `$schema` property in `ngsw-config.template.json` to
allow IDEs to provide intellisense about the various fields of the
config.

PR Close #43686
2021-10-06 10:05:54 -07:00
George Kalpakas
d07e736f17 build(docs-infra): auto-generate SW navigationUrls from Firebase config (#42452)
Previously, redirects had to be configured in both the Firebase config
(`firebase.json`) and the ServiceWorker config (`ngsw-config.json`).
This made it challenging to correctly configure redirects, since one had
to understand the different formats of the two configs, and was also
prone to getting out-of-sync configs.

This commit simplifies the process of adding redirects by removing the
need to update the ServiceWorker config (`ngsw-config.json`) and keep it
in sync with the Firebase config (`firebase.json`). Instead the
ServiceWorker `navigationUrls` are automatically generated from the list
of redirects in the Firebase config.

NOTE:
Currently, the automatic generation only supports the limited set of
patterns that are necessary to translate the existing redirects. It can
be made more sophisticated in the future, should the need arise.

PR Close #42452
2021-06-18 17:32:58 +00:00