mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Previously, all asset-groups from `ngsw-config.json` were processed in parallel. For each asset-group, we retrieved all files for the current build, filtered out files that were already matched by other asset-groups, determined which of the remaining files belonged to the current asset-group and generated entries for the `ngsw.json` manifest. This process was susceptible to race conditions when there were files that would be matched by multiple asset-groups. This made the generation of the `ngsw.json` manifest non-deterministic and violated the rule that each file would belong to the first asset-group that matched it (based on the asset-groups' order of appearance in `ngsw-config.json`), thus leading to broken ServiceWorker behavior. This commit fixes it by ensuring that the generation process is deterministic and that asset-groups are processed in the proper order. NOTE 1: The generation process has been broken since the beginning, but we have only noticed this recently. This is possibly related to the CLI's switching from a virtual file system host (which has more consistent timing characteristics) to the Node.js built-in `fs.promises` in angular/angular-cli@d3bc530c10. NOTE 2: This commit also ensures that files in the `ngsw.json` hash-table are in alphabetic order. Previously, the files were added to the hash-table in blocks corresponding to each asset-group. This change is not necessary (i.e. the order of keys in the hash-table makes no difference in behavior), but it makes it easier to scan for a file (for example, for debugging purposes). PR Close #43679 |
||
|---|---|---|
| .. | ||
| animations | ||
| bazel | ||
| benchpress | ||
| common | ||
| compiler | ||
| compiler-cli | ||
| core | ||
| docs | ||
| elements | ||
| examples | ||
| forms | ||
| language-service | ||
| localize | ||
| misc/angular-in-memory-web-api | ||
| platform-browser | ||
| platform-browser-dynamic | ||
| platform-server | ||
| private/testing | ||
| router | ||
| service-worker | ||
| upgrade | ||
| zone.js | ||
| BUILD.bazel | ||
| circular-deps-test.conf.js | ||
| empty.ts | ||
| goog.d.ts | ||
| license-banner.txt | ||
| README.md | ||
| system.d.ts | ||
| tsconfig-build.json | ||
| tsconfig-legacy-saucelabs.json | ||
| tsconfig-test.json | ||
| tsconfig-tsec-base.json | ||
| tsconfig.json | ||
| tsec-exemption.json | ||
| types.d.ts | ||
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT