This commit fixes several issues discovered through use in real apps.
* The sha1() function operated on text content, causing issues for binary-format files.
A sha1Binary() function which operates on unparsed data now avoids any encoding issues.
* The characters '?' and '+' were not escaped in Glob-to-regex conversion previously, but
are now.
* URLs from the browser contain the full origin, but were checked against the table of
hashes from the manifest which only has the path for URLs from the same origin. Now the
origin is checked and URLs are relativized to the domain root before comparison if
appropriate.
* ngsw: prefix was missing from data groups, is now added.
* Occasionally servers will return a redirected response for an asset, and caching it could
cause errors for navigation requests. The SW now handles this by detecting such responses
and following the redirect manually, to avoid caching a redirected response.
* The request for known assets is now created from scratch from the URL before fetching from
the network, in order to sanitize it and avoid carrying any special modes or headers that
might result in opaque responses.
* Debugging log for troubleshooting.
* Avoid creating errors by returning 504 responses on error.
* Fix bug where idle queue doesn't run in some circumstances.
* Add tests for the above.
This is important to not confuse users nor downstream tools that
consume our source maps. For generated content for which we don’t
have an original source file, we use the generated file now.
Fixes#19538
The current `flattenSummaries` function re-process the same NgModule
summary even if it has been processed before. Certain modules like
CommonModule are repeated multiple times in the module tree and it is
expanded out every time.
This was making unit tests using AOT summaries really slow. This will
also slow down JIT bootstrap applications that load AOT summaries for
component libraries.
The fix is to remember which summaries were seen before and not to
process them again.
Each node now has two index: nodeIndex and checkIndex.
nodeIndex is the index in both the view definition and the view data.
checkIndex is the index in in the update function (update directives and update
renderer).
While nodeIndex and checkIndex have the same value for now, having both of them
will allow changing the structure of view definition after compilation (ie for
runtime translations).
Upgrading to dgeni-packages 0.21.4 gives us
access to more properties on the API docs, which
allows us to fix the following issues:
Closes#19450Closes#19452Closes#19456
For now, we always create all generated files, but diff them
before we pass them to TypeScript.
For the user files, we compare the programs and only emit changed
TypeScript files.
This also adds more diagnostic messages if the `—diagnostics` flag
is passed to the command line.
This service worker is a conceptual derivative of the existing @angular/service-worker maintained at github.com/angular/mobile-toolkit, but has been rewritten to support use across a much wider variety of applications.
Entrypoints include:
@angular/service-worker: a library for use within Angular client apps to communicate with the service worker.
@angular/service-worker/gen: a library for generating ngsw.json files from glob-based SW config files.
@angular/service-worker/ngsw-worker.js: the bundled service worker script itself.
@angular/service-worker/ngsw-cli.js: a CLI tool for generating ngsw.json files from glob-based SW config files.