Compare commits

...

78 Commits

Author SHA1 Message Date
Andrew Kushnir b868f1c94e release: cut the v14.1.1 release 2022-08-03 10:48:18 -07:00
Andrew Scott efb8e3e431 docs(core): Update inject error documentation (#47020)
The inject function is also available when using EnvironmentInjector.runInContext.

PR Close #47020
2022-08-02 18:06:55 -07:00
Angular Robot 8085fe34f1 build: update eslint dependencies to v5.32.0 (#47016)
See associated pull request for more information.

PR Close #47016
2022-08-02 11:59:42 -07:00
George Kalpakas 9edfe4ac97 build(docs-infra): ensure all boilerplate dependencies are in sync (#47009)
All docs examples share the same `node_modules/` (symlinked into each
example from `aio/tools/examples/shared/node_modules/`). However, each
example type has a different `package.json`, which comes from
`aio/tools/examples/shared/boilerplate/*`). In order to ensure that the
dependencies in each example's `package.json` are the same as the ones
in the symlinked `node_modules/` (i.e. the ones that CI tests are run
with), we have a script (`yarn run sync-deps`) that can sync
dependencies from `shared/package.json` into the boilerplate
`package.json` files.

Previously, this script had to be run manually, which was easy to
forget/not know about and resulted in the boilerplate dependencies
often being out-of-sync with the ones in `shared/package.json` (and by
extension, the ones that were actually installed in `node_modules/`).

This commit helps keep the boilerplate dependencies up-to-date in the
following ways:
- Adds the `sync-deps` script to the `postinstall` scripts.
  This ensures that dependencies remain in sync whenever someone
  manually updates dependencies in `shared/package.json`.
- Runs the `sync-deps` script as a Renovate post-upgrade task.
  This ensures that the depenencies remain in sync whenever Renovate
  updates dependencies in `shared/package.json`.
  For more info on configuring post-upgrade tasks in Renovate, see:
  - [postUpgradeTasks][1]
  - [allowedPostUpgradeCommands][2]
  - [allowPostUpgradeCommandTemplating][3]

NOTE:
For the Renovate change to take effect, the [global config][4] in
`angular/dev-infra` also needs to be updated. This will be done in a
separate PR.

[1]: https://docs.renovatebot.com/configuration-options/#postupgradetasks
[2]: https://docs.renovatebot.com/self-hosted-configuration/#allowedpostupgradecommands
[3]: https://docs.renovatebot.com/self-hosted-configuration/#allowpostupgradecommandtemplating
[4]: https://github.com/angular/dev-infra/blob/22d3067021130271afcfd02d063828c5bdd9c2d7/.github/ng-renovate/runner-config.js

PR Close #47009
2022-08-02 11:58:51 -07:00
Andrew Scott 79825d3f10 fix(router): Do not call preload method when not necessary (#47007)
In Angular 14, we introduced the `loadComponent` API for a `Route` to
allow lazy loading of a routed component in addition to the existing
`loadChildren` which allows lazy loading of child routes. As a result,
the `preload` method of the `PreloadingStrategy` needs to sometimes be
called even when there is a `canLoad` guard on the `Route`. `CanLoad`
guards block loading of child routes but _do not_ block loading of the
component.

This change updates the conditional checks in the internal preloader to
skip calling the `PreloadingStrategy.preload` when there is only a
`loadChildren` callback with a `canLoad` guard an no `loadComponent`.
In this case, the callback passed to the `preload` method is already
effectively a no-op so it's not necessary to call it at all.

resolves #47003

PR Close #47007
2022-08-02 09:38:28 -07:00
Paul Gschwendtner 4e9492cf6d build: update dev-infra packages and account for build-tooling split from ng-dev (#46976)
The dev-infra build tooling is now decoupled from `ng-dev`. This will
make it easier to update `ng-dev` without necessarily needing to upgrade
the whole build system, Bazel etc. This is useful when e.g. new release
tool features have been added and should also be ported to active LTS
branches.

PR Close #46976
2022-08-02 09:37:38 -07:00
Andrew Scott 3f162f5e3f refactor(common): Align PathLocationStrategy constructor with default factory (#46929)
When using the Angular Router, one of `APP_BASE_HREF` or a `<base>` in
the header must be provided. When _not_ using the `RouterModule`,
injecting the `LocationStrategy` will result in the
`PathLocationStrategy` being provided with a default value used in place
of `APP_BASE_HREF` that is `document?.location?.origin ?? ''`.

It can be quite surprising and annoying that once you add `RouterModule`
to the application, suddenly the `APP_BASE_HREF` must be specifically
provide something new when it could use a sensible default instead.

The current behavior (before this commit) is as follows:

* When `RouterModule` is not provided (or the dev doesn't specifically provide
  `PathLocationStrategy`): use `DOCUMENT.location?.origin ?? ''`.
  Note that the base href in the dom and `APP_BASE_HREF` are not used.
* When `RouterModule` _is_ provided:
   1. APP_BASE_HREF if defined
   2. Get base href from DOM
   3. throw if neither of the two above are defined

This commit updates this behavior to be aligned regardless of `RouterModule`
usage. The order (by default) is now:
  1. Developer provided `APP_BASE_HREF`
  2. base href from the DOM
  3. `location.origin`
  4. If none of the above exist, use `''`

This is slightly different than the behavior before. However, I believe
it is more appropriate. For the case without `RouterModule`, it would
likely be surprising that `APP_BASE_HREF` and the base href from the DOM
are ignored by default. For the case with `RouterModule`, we now have a
more sensible fallback/default when neither `APP_BASE_HREF` nor `<base>`
are defined (instead of just throwing an error).

PR Close #46929
2022-08-01 14:21:14 -07:00
Marek Hám b6445c4cd6 docs: fix link to live example (#47011)
Fixes #46975

PR Close #47011
2022-08-01 14:20:37 -07:00
Durairaj Subramaniam d05d05e48e docs: fix link in routing (#46988)
PR Close #46988
2022-08-01 13:00:25 -07:00
Angular Robot 7a7452dc28 build: update bazel setup to v5.5.3 (#47000)
See associated pull request for more information.

PR Close #47000
2022-08-01 12:55:44 -07:00
Andrew Scott 05f3f7445a fix(router): Use correct return type for provideRoutes function (#46941)
The provideRoutes function of the Router returns a Provider array and should not be typed as 'any'

PR Close #46941
2022-08-01 11:20:50 -07:00
Andrew Scott 6307f3586e refactor(router): Remove unused ANALYZE_FOR_ENTRY_COMPONENTS (#46942)
`entryComponents` is a feature that is not used or necessary in Angular
anymore.

PR Close #46942
2022-08-01 11:18:10 -07:00
Roman Matusevich ce6ad5a66a docs: fix selector in Component Interaction guide (#46995)
The selector for the `CountdownTimerComponent` is `app-countdown-timer`
not `countdown-timer`.

PR Close #46995
2022-08-01 11:16:31 -07:00
Asaf M cbfd91b0f2 docs: fixed typos (#47008)
Used my script: https://github.com/Uziel302/websites-spell-checker/blob/master/mdnversion

PR Close #47008
2022-08-01 11:15:55 -07:00
J Rob Gant 8cd95d4901 refactor(zone.js): remove leftover debugging code using Error.stack (#46989)
Pull request #46672 added some debugging code to trace down the
root cause of its bug, but parts of the debugging code has never
been cleaned up and ended up landing as part of the PR.

This commit removes the code as it might cause unexpected issues.
Likely when e.g. `Error` is patched and would perform XHRs in testing,
unveiling e.g. CORS issues. See #46989.

PR Close #46989
2022-08-01 09:52:30 -07:00
Cédric Exbrayat ec00075a2f refactor(compiler-cli): remove unused error codes (#46847)
A few codes were unused, or no longer used.

PR Close #46847
2022-08-01 09:50:12 -07:00
Kristiyan Kostadinov a0a635322c fix(bazel): allow extendedDiagnostics option to be passed in through tsconfig (#46953)
Adds the `extendedDiagnostics` field to the list of allowed options so that it is picked up from the user's tsconfig.

PR Close #46953
2022-08-01 09:49:14 -07:00
Angular Robot 8dcd3cd263 build: update eslint dependencies to v5.31.0 (#46968)
See associated pull request for more information.

PR Close #46968
2022-08-01 09:46:41 -07:00
Angular Robot 677fe6a1cc build: update io_bazel_rules_sass digest to 030f696 (#46947)
See associated pull request for more information.

PR Close #46947
2022-08-01 09:40:03 -07:00
Angular Robot 5d8394cc8c build: update dependency google-closure-compiler to v20220719 (#46926)
See associated pull request for more information.

PR Close #46926
2022-08-01 09:39:26 -07:00
Angular Robot acdb28dc1d build: update cross-repo angular dependencies to 6d9c069 (#46905)
See associated pull request for more information.

PR Close #46905
2022-08-01 09:38:35 -07:00
Aristeidis Bampakos c5a5165294 docs: modify callout in TOH part 2 (#46964)
PR Close #46964
2022-08-01 09:30:04 -07:00
Andrew Quinn 71831c63ba docs: fix typo in guide/structural-directives page (#46961)
Fix typo [missing plural marker "element_s_"] on https://angular.io/guide/structural-directives.

Original:
>Structural directives are directives which change the DOM layout by adding and removing DOM element.

Fix:
>Structural directives are directives which change the DOM layout by adding and removing DOM element**s**.
PR Close #46961
2022-08-01 09:29:40 -07:00
Bob Watson 3511373e22 docs: initial upload of styles used by doc linter (#46897)
Add the configuration and style files to support documentation linting. The `README.md` file includes instructions for installation and use of the lint tool.

PR Close #46897
2022-08-01 09:29:06 -07:00
Bob Watson ff7c71653a build: update doc approvers (#46939)
Remove: TMDavis, who is no longer at Google
Add: bob-watson who is now on the team

PR Close #46939
2022-07-22 15:39:34 +00:00
Ivaylo Kirov 6b779b11d1 docs: add missing period to the Security guide (#46900)
PR Close #46900
2022-07-22 15:37:30 +00:00
Simona Cotin 1eb77a2f4f docs: add simona cotin to contributors (#46922)
PR Close #46922
2022-07-22 08:27:08 +00:00
Alan Agius 929d69e62f docs(router): remove incorrect deprecation text in InitialNavigation (#46916)
Remove left over deprecation note.

PR Close #46916
2022-07-22 08:26:25 +00:00
Andrew Scott f5d764d75c refactor(router): Update internal INITIAL_NAVIGATION token to use an enum (#46925)
This updates the internal use of INITIAL_NAVIGATION to do two things:

1. Explicitly provide `Enabled` as the default for the token factory
2. Use an enum instead of a string to reduce bundle size

PR Close #46925
2022-07-22 08:25:37 +00:00
Andrew Kushnir 55f485b3bb refactor(platform-server): include TransferState providers into ServerModule (#46899)
This commit updates the code to include the TransferState providers (used for serialization) into the `ServerModule` instead of having the need to import the `ServerTransferStateModule` separately.

The list of providers in the `ServerTransferStateModule` is now empty and importing it is a noop. This is not a breaking change, since the `ServerModule` must be included anyways to make server rendering work correctly.

PR Close #46899
2022-07-21 12:17:43 +00:00
Cédric Exbrayat 3606917732 fix(core): improve the missing control flow directive message (#46903)
Similarly to what has been done in #46846 for the extended diagnostics about missing control flow directive that was only mentioning that the `CommonModule` should be imported, this commit improves the validation done by the JiT compiler.
Now that the control flow directives are available as standalone, the message mentions that directive itself can be imported.

The message now also mentions which import should be used for the directive (as it can be tricky to figure out that `NgForOf` is the directive corresponding to `*ngFor`).

PR Close #46903
2022-07-21 08:27:32 +00:00
Andrew Scott 0cbbd6aeec refactor(router): Update Router to be providedIn: 'root' (#46914)
This commit updates the Router itself to be `providedIn: 'root'` with a
factory function rather than provided in the `RouterModule`.

PR Close #46914
2022-07-20 12:21:05 -07:00
Andrew Kushnir a8e9247e6a refactor(platform-server): make TransferState standalone-friendly (#46879)
This commit updates the `TransferState` to make it `providedIn: 'root'`. This makes the entire `BrowserTransferStateModule` module unnecessary, so it got deprecated as well.

The `ServerTransferStateModule` is still retained, but the `renderApplication` function now also includes the necessary tokens to serialize the `TransferState` automatically, so when using the `renderApplication` function, there is no need to include `ServerTransferStateModule` as well.

This change is a part of the ongoing efforts to update the shape of the FW APIs to make them standalone-friendly (so there is no need to import any NgModules).

PR Close #46879
2022-07-20 11:05:08 -07:00
Andrew Kushnir 793326deef release: cut the v14.1.0 release 2022-07-20 10:44:59 -07:00
Doug Parker 10d46b4247 refactor(bazel): remove experimental_extended_template_diagnostics flag (#46898)
Extended diagnostics are enabled by default now and this flag doesn't do anything anymore but I missed it in a previous cleanup.

PR Close #46898
2022-07-20 08:50:45 -07:00
dario-piotrowicz b744bf6a08 refactor(compiler-cli): improve error for non-exported non-standalone (#46114)
improve the error message for non-standalone components which are not
exported from their module, and that are also imported directly as if
they were standalone

this change simply adds the suggestion to the developer to import the
ngModule instead

resolves #46004

PR Close #46114
2022-07-20 08:50:01 -07:00
Andrew Kushnir 2e5bd88ebf refactor(core): NgModuleRef should not implement EnvironmentInjector interface (#46896)
This commit refactors the `NgModuleRef` implementation to drop functions required by the `EnvironmentInjector` interface. Previously the idea was that the `NgModuleRef` can act as an Injector to facilitate easier transition to standalone. However, from the mental model perspective, the `NgModuleRef` has the `injector` field, which is the correct injector reference and can be used is needed as an `EnvironmentInjector`.

PR Close #46896
2022-07-20 08:49:15 -07:00
Andrew Scott 9b8ea9b5ca Revert "fix(core): Fix runInContext for NgModuleRef injector (#46877)" (#46896)
This reverts commit 14081dc48d.

PR Close #46896
2022-07-20 08:49:15 -07:00
Angular Robot eb91035102 build: update cross-repo angular dependencies to cdaaa15 (#46853)
See associated pull request for more information.

PR Close #46853
2022-07-20 08:48:45 -07:00
Bob Watson 17e2a2a9d1 docs: add info about request timeouts (#46882)
* Adds a short note about how service workers report request timeouts
* Updated heading levels to present a clearer hierarchy and cleaner local TOC
* Removed documentation lint errors
* Moves the service worker service timeout paragraph to a more logical topic in service-worker-devops
* Removes line error from the more logical topic.
* address feedback from PR review comments

fixes #46445

PR Close #46882
2022-07-20 08:48:00 -07:00
Paul Gschwendtner b431b5c6d6 test: convert source-map core tests to use async/await instead of fakeAsync (#46888)
The source map tests rely on asynchronous logic from the `source-map`
package. The tests itself are written using `fakeAsync` but this
unnecessarily complicates the interaction with the asynchronous
source-map helpers/package.

To fix this, we just make the tests use async/await as we don't intend
to test fakeAsync in this `describe` block..

PR Close #46888
2022-07-19 09:40:57 -07:00
Paul Gschwendtner bc371dac44 build: disable jasminewd2 types for sourcemap playground test (#46888)
The sourcemap test in the e2e playground is now using async/await code.
This results in errors now with the Bazel TS compilation because it
detects that `expect` is returning a promise and should be awaited.

This happens due to the jasminewd2 types. We should just use the actual
jasmine types and not rely on the deprecated selenium control flow,
using explicit async/await in the whole test. This also solves the issue
with the source-map types being async/await now.

PR Close #46888
2022-07-19 09:40:57 -07:00
Paul Gschwendtner 36361b0506 test: update source-map tests to account for source-map breaking change (#46888)
The source-map package now requires the
`SourceMapConsumer`/`SourceMapGenerator` classes to be instantiated
asynchronously. This commit updates our tests to account for that.

PR Close #46888
2022-07-19 09:40:57 -07:00
Paul Gschwendtner 38f53a55c3 build: remove source-map package from compiler-cli bundling external list (#46888)
The source-map package is no longer explicitly used in the
`compiler-cli` package and therefore can be removed from the ESBuild
bundling, denoting it as external. This should be a noop.

PR Close #46888
2022-07-19 09:40:56 -07:00
Paul Gschwendtner 8de3d099d2 build: update source-map package to latest version (#46888)
The source-map package is updated as part #46707, but the minor
version bump introduced breaking changes. This commit extracts the
update so that we can handle it separately accounting for the breaking
changes. Also removing the caret since this package apparently makes
breaking changes in minor segment bumps.

PR Close #46888
2022-07-19 09:40:56 -07:00
Andrew Scott 945a3ad359 fix(core): Fix runInContext for NgModuleRef injector (#46877)
The `runInContext` for `NgModuleRef` was previously an infinite loop.

PR Close #46877
2022-07-19 09:37:32 -07:00
Angular Robot 88003e27db build: update github/codeql-action action to v2.1.16 (#46885)
See associated pull request for more information.

PR Close #46885
2022-07-19 16:05:06 +00:00
Angular Robot a4cba79440 build: update eslint dependencies to v5.30.7 (#46884)
See associated pull request for more information.

PR Close #46884
2022-07-19 16:04:37 +00:00
Angular Robot 6ca7a79bfd build: update babel dependencies to v7.18.9 (#46883)
See associated pull request for more information.

PR Close #46883
2022-07-19 16:04:09 +00:00
Andrew Scott e95ee96562 refactor(router): Update TitleStrategy to useFactory (#46876)
The implementation of the `DefaultTitleStrategy` was modeled after the
existing strategy patterns in the Router. These patterns were developed
before the `providedIn` syntax for injectables. We can simplify the
model a lot by providing the default in the factory of the abstract
class.

Note that the other strategy patterns aren't touched in this PR due to
how long they've existed. Because they have been there for such a long
time, it's possible there will need to be some adjustments to code
if/when they are refactored to do the same.

PR Close #46876
2022-07-18 22:02:19 +00:00
dario-piotrowicz 536ded2280 fix(animations): make sure falsy values are added to _globalTimelineStyles (#46863)
style values get added to the `_globalTimelineStyles` map in order to keep
them so that they can be used across different timelines

`_globalTimelineStyles` was previously a plain object but has been
refactored to a map in #44482, as part of the update a check has been
changed from a ternary operation to an or (||), causing falsy values (as 0)
not to be added to the map anymore, apply the nullish coalescing operator (??)
instead to make sure only `undefined` and `null` are filtered out

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves #46833

PR Close #46863
2022-07-18 21:46:13 +00:00
Cédric Exbrayat 6b8e60c06a fix(compiler-cli): improve the missingControlFlowDirective message (#46846)
The extended diagnostics about missing control flow directive was only mentioning that the `CommonModule` should be imported.
Now that the control flow directives are available as standalone, the message mentions that directive itself can be imported.

The message now also mentions which import should be used for the directive (as it can be tricky to figure out that `NgForOf` is the directive corresponding to `*ngFor`).

PR Close #46846
2022-07-18 19:56:08 +00:00
Paul Gschwendtner 5004b6ebf1 test: update tests to not run jasmine done function in sync-test zone from describe block
There are some ZoneJS tests that fork the zone from the `describe` block
for testing the zone patching. This does cause the Jasmine `done`
function later in `it` specs to be invoked in the sync-test zone from
the original `describe` block. The `done` implementation now has
changed with the Karma Jasmine update and breaks because it now causes
tasks to be scheduled.

It is conceptually incorrect/invalid to take the describe sync zone and
run test logic with that sync zone.

```
 An error was thrown in afterAll
  error properties: Object({ originalStack: 'Error: Cannot call jasmine.execute().forceTask from within a sync test (syncTestZone for jasmine.describe#FileReader).
      at new ZoneAwareError (packages/zone.js/test/browser_test_rollup.umd.js:98:37)
      at e.onScheduleTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:158:196)
      at e.scheduleTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:14:7529)
      at t.scheduleTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:14:3539)
      at t.scheduleMicroTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:14:3791)
      at r.execute (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:166:4312)
      at queueRunnerFa ...
      at <Jasmine>
```
2022-07-18 17:19:30 +00:00
Paul Gschwendtner 6c08635662 feat(zone.js): include jasmine describe block name when raising unexpected task error
As mentioned in the previous commit that ensured that the Zone name is
included in errors raised by the `SyncTestZoneSpec`, we can now include
the Jasmine describe block descriptions in such errors.

Errors can often happen when users accidentally try to set up Angular
tests without an `it` block. Resulting in errors where it's not clear
at all which describe block (of potentially a large repository) is
involved:

```
 An error was thrown in afterAll
  error properties: Object({ originalStack: 'Error: Cannot call XX from within a sync test.
      at new ZoneAwareError (packages/zone.js/test/browser_test_rollup.umd.js:98:37)
      at e.onScheduleTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:158:196)
      at e.scheduleTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:14:7529)
      at t.scheduleTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:14:3539)
      at t.scheduleMicroTask (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:14:3791)
      at r.execute (packages/zone.js/bundles/zone-testing-bundle.umd.min.js:166:4372)
      at queueRunnerFa ...
      at <Jasmine>
```

We now include the describe block description in the error, so that it
is easier to figure out the location of the culprit code.
2022-07-18 17:19:30 +00:00
Paul Gschwendtner f0add81caf feat(zone.js): include zone name when sync-test zone reports tasks
The sync-test zone is used in e.g. `describe` to raise an error when
there is asynchronous code scheduled in describe blocks. This commit
includes the zone name in such thrown errors to allow for us to include
the jasmine describe name in the error. This will be wired up in the
jasmine zonejs patches separately.
2022-07-18 17:18:49 +00:00
Paul Gschwendtner 21e7584c8c test: fix fake-async-test spec to properly test prefixed animation frame functions
In the fake async test for `zone.js` there is some logic to test various
prefixes of the request animation frame functions. This logic does not
have any effect currently, except for generating the same test at
maximum three times.

This commit fixes the test to actually test what it meant to do
initially.
2022-07-18 17:18:49 +00:00
Paul Gschwendtner 92c9661165 test: update tests to account for karma-jasmine v5.0.0
Karma jasmine updated the `jasmine-core` dependency. Jasmine is now more
strict when:

* The done callback is invoked multiple times
* The done callback is used, while a promise is also returned
* The done callback is treated as error when e.g. a number is returned
  as first argument. This was the case with `requestAnimationFrame`.
2022-07-18 17:18:49 +00:00
Paul Gschwendtner a462f91d3e fix(core): do not invoke jasmine done callback multiple times with waitForAsync
Currently tests written using `waitForAsync` would be prone to Jasmine
warnings or errors (depending on the version) for tests incorrectly
invoking asynchronous jasmine `done` callbacks multiple times.

This can happen because the async test zone logic schedules the
`done` callback to be called using `setTimeout`, but this could
be invoked multiple times, causing multiple `done` invocations to
be scheduled. Most of the issues have been resolved with #45025,
but it does not solve the case of multiple tasks finished and callbacks
being scheduled.

Technically, the current logic is built in way that _should_ result in
`_finishCallbackIfDone` and eventually the `done` callback to be invoked
at maximium once. This is unfortunately not the case in some rather
advanced/unexpected scenarios (like our AngularJS upgrade tests) where
the scenario is the following (and microtasks from before the actual
`waitForAsync` spec are still completing -- which is valid):

```
1. A test `beforeEach` schedules a microtask in the ProxyZone.
2. An actual empty `it` spec executes in the AsyncTestZone` (using e.g. `waitForAsync`).
3. The `onInvoke` invokes `_finishCallbackIfDone` because the spec runs synchronously.
4. We wait the scheduled timeout (see below) to account for unhandled promises.
5. The microtask from (1) finishes and `onHasTask` is invoked.

--> We register a second `_finishCallbackIfDone` even though we have scheduled a timeout.
--> we execute the `done` callback twice because the async zone spec state is "stable"
```
2022-07-18 17:18:49 +00:00
Angular Robot aa8d3ed69b build: update dependency karma-jasmine to v5
| datasource | package       | from  | to    |
| ---------- | ------------- | ----- | ----- |
| npm        | karma-jasmine | 4.0.2 | 5.1.0 |
2022-07-18 17:18:49 +00:00
piyush132000 2ca404dbfd docs: fix code style (#46862)
PR Close #46862
2022-07-18 16:44:21 +00:00
Cédric Exbrayat f9edb776ca refactor(forms): simplify group builder function (#46844)
Applies the same logic that we have in the `control` function.

PR Close #46844
2022-07-15 22:02:20 +00:00
Andrew Kushnir c195c3f73c refactor(core): annotate ComponentMirror object fields as readonly
This commit updates the `inputs` and `outputs` objects of the `ComponentMirror` to mark their properties as readonly.
2022-07-15 14:58:58 -07:00
Andrew Kushnir 114011d2a0 refactor(core): move the code to avoid circular dependencies
This commit refactors the code to move some functions around to avoid circular dependencies in TS imports. The newly added functions are now located in the `packages/core/src/render3/component.ts` file (instead of `packages/core/src/render3/component_ref.ts`), which is a better place for them anyway.
2022-07-15 14:58:58 -07:00
Andrew Kushnir b5153814af feat(core): add reflectComponentType function
This commit introduces a new function that allows creating a object which exposes a number of getters to retrieve information about a given component.
2022-07-15 14:58:58 -07:00
Andrew Kushnir e8e8e5f171 feat(core): add createComponent function
This commit introduces a new function that allows creating a `ComponentRef` instance based on provided Component and a set of options. The function can be used to cover a number of use-cases where the `ComponentFactory` symbol was used previously.
2022-07-15 14:58:58 -07:00
Jessica Janiuk 08fb7bc4ca Revert "Revert "build: update cross-repo angular dependencies to 84dd092 (#46848)" (#46849)" (#46852)
This reverts commit b2a74469de.

PR Close #46852
2022-07-15 21:41:59 +00:00
Jessica Janiuk 6d709273eb Revert "build: update cross-repo angular dependencies to 84dd092 (#46848)" (#46849)
This reverts commit 510f45957a.

PR Close #46849
2022-07-15 17:52:46 +00:00
Angular Robot 571d7debb5 build: update cross-repo angular dependencies to 84dd092 (#46848)
See associated pull request for more information.

PR Close #46848
2022-07-15 16:00:34 +00:00
jnizet b1ba6429d4 docs(core): document that destroyAfterEach is true by default (#46845)
PR Close #46845
2022-07-15 15:50:36 +00:00
Jessica Janiuk 6c104a28e0 build: Add Jessica and Andrew K to docs-infra (#46843)
This adds two people to the docs-infra pullapprove group.

PR Close #46843
2022-07-15 15:46:06 +00:00
Angular Robot 5e09cd1f67 build: update cross-repo angular dependencies (#46834)
See associated pull request for more information.

PR Close #46834
2022-07-14 22:35:09 +00:00
Andrew Scott 6a7b818d94 fix(router): Ensure target RouterStateSnapshot is defined in NavigationError (#46842)
The Router transition observable pipe keeps an outer reference to a `t`
variable for use in the `catchError` operator. However, this variable is
not updated with intermediate state. This commit fixes that so the
`catchError` can access properties that get updated in intermediate
states. Specifically, `RouterStateSnapshot` in the `NavigationError` for
now but could be more in the future.

PR Close #46842
2022-07-14 22:19:27 +00:00
Bob Watson 9ecaa05c7d docs: correct debugging task step (#46832)
Also remove lint errors.

Fix: #42781

PR Close #46832
2022-07-13 22:55:21 +00:00
Andrew Kushnir d36a9e6bf3 refactor(core): improve an error message when ENVIRONMENT_INITIALIZER is not a multi provider (#46829)
Currently if the `ENVIRONMENT_INITIALIZER` token is not configured with `multi: true` flag, the code fails while trying to iterate over the value. This commit checks whether the `ENVIRONMENT_INITIALIZER` token value type is an array and throws a helpful error message.

PR Close #46829
2022-07-13 22:01:15 +00:00
George Kalpakas 4b452ffd3d docs: redirect /guide/ivy to the v12 guide (#46820)
Since Ivy is the default since v13, the Ivy guide (that used to live at
https://angular.io/guide/ivy) has been removed (see #43860). However,
there are certain error messages emitted by the CLI that still point to
it.

This commit address the problem by adding a redirect from
https://angular.io/guide/ivy to https://v12.angular.io/guide/ivy (which
is the last version that includes the guide).

Fixes #46717

PR Close #46820
2022-07-13 21:59:19 +00:00
Kristiyan Kostadinov 3f2d16c823 fix(compiler): inputs/outputs incorrectly parsed in jit mode (#46813)
The `Directive` and `Component` decorators support `inputs` and `outputs` fields which accept an array in the format of `"someInput"` or `"someInput: someAlias"`, however the parsing during JIT compilation was splitting on commas, not on colons, which resulted in incorrect parsing. E.g. `inputs: ["someInput: someAlias"]` was being parsed into `{"someInput: someAlias": "someInput: someAlias"}` instead of `{someInput: "someAlias"}`.

The feature was working by accident, because there's some logic further down in the compiler pipeline that was splitting the strings again.

PR Close #46813
2022-07-13 21:26:51 +00:00
acvi 4dca1842b3 docs: describe smallest typo, "an" -> "a" (#46812)
PR Close #46812
2022-07-13 20:06:30 +00:00
Jessica Janiuk 442b16c551 release: cut the v14.1.0-rc.0 release (#46830) 2022-07-13 12:37:14 -07:00
310 changed files with 89748 additions and 2532 deletions
+5 -5
View File
@@ -96,11 +96,11 @@ build:remote --cpu=k8
build:remote --host_cpu=k8
# Toolchain and platform related flags
build:remote --crosstool_top=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=@npm//@angular/dev-infra-private/bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
build:remote --host_platform=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
build:remote --platforms=@npm//@angular/dev-infra-private/bazel/remote-execution:platform
build:remote --crosstool_top=@npm//@angular/build-tooling/bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=@npm//@angular/build-tooling/bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform
build:remote --host_platform=@npm//@angular/build-tooling/bazel/remote-execution:platform
build:remote --platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform
# Remote instance and caching
build:remote --remote_instance_name=projects/internal-200822/instances/primary_instance
+1 -1
View File
@@ -12,7 +12,7 @@ Info on remote development and developing inside a container with VSCode:
_Prerequisite: [Install Docker](https://docs.docker.com/install) on your local environment._
To get started, read and follow the instuctions in [Developing inside a Container](https://code.visualstudio.com/docs/remote/containers). The [.devcontainer/](.) directory contains pre-configured `devcontainer.json` and `Dockerfile` files, which you can use to set up remote development with a docker container.
To get started, read and follow the instructions in [Developing inside a Container](https://code.visualstudio.com/docs/remote/containers). The [.devcontainer/](.) directory contains pre-configured `devcontainer.json` and `Dockerfile` files, which you can use to set up remote development with a docker container.
In a nutshell, you need to:
- Install the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
+2 -2
View File
@@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- uses: angular/dev-infra/github-actions/commit-message-based-labels@8420d8593135df75b283e90beba0aa9b5b9838ce
- uses: angular/dev-infra/github-actions/commit-message-based-labels@22d3067021130271afcfd02d063828c5bdd9c2d7
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- uses: angular/dev-infra/github-actions/post-approval-changes@8420d8593135df75b283e90beba0aa9b5b9838ce
- uses: angular/dev-infra/github-actions/post-approval-changes@22d3067021130271afcfd02d063828c5bdd9c2d7
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -14,6 +14,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/feature-request@8420d8593135df75b283e90beba0aa9b5b9838ce
- uses: angular/dev-infra/github-actions/feature-request@22d3067021130271afcfd02d063828c5bdd9c2d7
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -14,6 +14,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/lock-closed@8420d8593135df75b283e90beba0aa9b5b9838ce
- uses: angular/dev-infra/github-actions/lock-closed@22d3067021130271afcfd02d063828c5bdd9c2d7
with:
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}
+1 -1
View File
@@ -45,6 +45,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2.1.15
uses: github/codeql-action/upload-sarif@3e7e3b32d0fb8283594bb0a76cc60a00918b0969 # tag=v2.1.16
with:
sarif_file: results.sarif
+1 -1
View File
@@ -1,4 +1,4 @@
import {CaretakerConfig} from '@angular/dev-infra-private/ng-dev';
import {CaretakerConfig} from '@angular/ng-dev';
/** The configuration for `ng-dev caretaker` commands. */
export const caretaker: CaretakerConfig = {
+1 -1
View File
@@ -1,4 +1,4 @@
import {CommitMessageConfig} from '@angular/dev-infra-private/ng-dev';
import {CommitMessageConfig} from '@angular/ng-dev';
/**
* The configuration for `ng-dev commit-message` commands.
+1 -1
View File
@@ -1,4 +1,4 @@
import {FormatConfig} from '@angular/dev-infra-private/ng-dev';
import {FormatConfig} from '@angular/ng-dev';
/**
* Configuration for the `ng-dev format` command.
+1 -1
View File
@@ -1,4 +1,4 @@
import {GithubConfig} from '@angular/dev-infra-private/ng-dev';
import {GithubConfig} from '@angular/ng-dev';
/**
* Github configuration for the `ng-dev` command. This repository is used as
+1 -1
View File
@@ -1,4 +1,4 @@
import {PullRequestConfig} from '@angular/dev-infra-private/ng-dev';
import {PullRequestConfig} from '@angular/ng-dev';
/**
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
+1 -1
View File
@@ -1,4 +1,4 @@
import {ReleaseConfig} from '@angular/dev-infra-private/ng-dev';
import {ReleaseConfig} from '@angular/ng-dev';
/** Configuration for the `ng-dev release` command. */
export const release: ReleaseConfig = {
+3 -2
View File
@@ -58,7 +58,7 @@
# josmar-crwdstffng
# ileil
# TeriGlover
# TMDavisGoogle
# bob-watson
version: 3
@@ -1062,8 +1062,9 @@ groups:
])
reviewers:
users:
- alxhub
- AndrewKushnir
- gkalpak
- jessicajaniuk
- josephperrott
# =========================================================
+1
View File
@@ -11,5 +11,6 @@
// The following extensions are useful when working on angular.io (i.e. inside the `aio/` directory).
//"angular.ng-template",
//"dbaeumer.vscode-eslint",
//"errata-ai.vale-server",
],
}
+84 -131
View File
@@ -1,3 +1,87 @@
<a name="14.1.1"></a>
# 14.1.1 (2022-08-03)
### core
| Commit | Type | Description |
| -- | -- | -- |
| [3606917732](https://github.com/angular/angular/commit/3606917732e5ad887426c1cbccf6e375eff905d6) | fix | improve the missing control flow directive message ([#46903](https://github.com/angular/angular/pull/46903)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [79825d3f10](https://github.com/angular/angular/commit/79825d3f1078c9b91eeb5e4699718ccde6c458b5) | fix | Do not call preload method when not necessary ([#47007](https://github.com/angular/angular/pull/47007)) |
| [05f3f7445a](https://github.com/angular/angular/commit/05f3f7445a0bbe3c7ffed3aec308ca8888e77d99) | fix | Use correct return type for provideRoutes function ([#46941](https://github.com/angular/angular/pull/46941)) |
## Special Thanks
Alan Agius, Andrew Kushnir, Andrew Quinn, Andrew Scott, Aristeidis Bampakos, Asaf M, Bob Watson, Cédric Exbrayat, Durairaj Subramaniam, George Kalpakas, Ivaylo Kirov, J Rob Gant, Kristiyan Kostadinov, Marek Hám, Paul Gschwendtner, Roman Matusevich and Simona Cotin
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.1.0"></a>
# 14.1.0 (2022-07-20)
## Deprecations
### core
- The `createNgModuleRef` is deprecated in favor of newly added `createNgModule` one.
- The bit field signature of `inject()` has been deprecated, in favor of the
new options object. Correspondingly, `InjectFlags` is deprecated as well.
### animations
| Commit | Type | Description |
| -- | -- | -- |
| [55308f2df5](https://github.com/angular/angular/commit/55308f2df5b0f6e8e40e3c4085c463a5b83c5ed1) | feat | add `provideAnimations()` and `provideNoopAnimations()` functions ([#46793](https://github.com/angular/angular/pull/46793)) |
### common
| Commit | Type | Description |
| -- | -- | -- |
| [4a2e7335b1](https://github.com/angular/angular/commit/4a2e7335b180190800cf2c5db8ed1c8841dbf473) | feat | make the `CommonModule` pipes standalone ([#46401](https://github.com/angular/angular/pull/46401)) |
| [a7597dd080](https://github.com/angular/angular/commit/a7597dd08026a4071758323d54ccbfb382e0c780) | feat | make the CommonModule directives standalone ([#46469](https://github.com/angular/angular/pull/46469)) |
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [33ce3883a5](https://github.com/angular/angular/commit/33ce3883a5d962adf5ee7feffd3426feefe0c0b5) | feat | Add extended diagnostic to warn when missing let on ngForOf ([#46683](https://github.com/angular/angular/pull/46683)) |
| [6f11a58040](https://github.com/angular/angular/commit/6f11a580406877e440c43df31fae3d5f120cafed) | feat | Add extended diagnostic to warn when text attributes are intended to be bindings ([#46161](https://github.com/angular/angular/pull/46161)) |
| [9e836c232f](https://github.com/angular/angular/commit/9e836c232ff66043bc101b905dae4c8bde18bc58) | feat | warn when style suffixes are used with attribute bindings ([#46651](https://github.com/angular/angular/pull/46651)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [93c65e7b14](https://github.com/angular/angular/commit/93c65e7b1468bb0c696dec1bc3362422a2ca5170) | feat | add extended diagnostic for non-nullable optional chains ([#46686](https://github.com/angular/angular/pull/46686)) |
| [131d029da1](https://github.com/angular/angular/commit/131d029da16b7d486cdc200f00160b9a11871fb2) | feat | detect missing control flow directive imports in standalone components ([#46146](https://github.com/angular/angular/pull/46146)) |
| [6b8e60c06a](https://github.com/angular/angular/commit/6b8e60c06a4f9a5fdbce9e7971d403ccb2bc6e8e) | fix | improve the missingControlFlowDirective message ([#46846](https://github.com/angular/angular/pull/46846)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [e8e8e5f171](https://github.com/angular/angular/commit/e8e8e5f1718f605c62a671b0ff15fa4dff7d8229) | feat | add `createComponent` function |
| [b5153814af](https://github.com/angular/angular/commit/b5153814af3e6b1ec8550ddf39584efd7cca36be) | feat | add `reflectComponentType` function |
| [96c6139c9a](https://github.com/angular/angular/commit/96c6139c9ab35aa6ab2330a5a79a5906d5c2e8be) | feat | add ability to set inputs on ComponentRef ([#46641](https://github.com/angular/angular/pull/46641)) |
| [a6d5fe202c](https://github.com/angular/angular/commit/a6d5fe202cafb419f3beb8d09711132124b6aa9a) | feat | alias `createNgModuleRef` as `createNgModule` ([#46789](https://github.com/angular/angular/pull/46789)) |
| [71e606d3c3](https://github.com/angular/angular/commit/71e606d3c3cfdcf93a6e40f84fd69aa75c5cca42) | feat | expose EnvironmentInjector on ApplicationRef ([#46665](https://github.com/angular/angular/pull/46665)) |
| [19e6d9ccd3](https://github.com/angular/angular/commit/19e6d9ccd36c7776fcee7de541bba413fd6dcabf) | feat | import AsyncStackTaggingZone if available ([#46693](https://github.com/angular/angular/pull/46693)) |
| [a7a14df5f8](https://github.com/angular/angular/commit/a7a14df5f8ff2d1e6a4dba3ac53f4479a6646810) | feat | introduce `EnvironmentInjector.runInContext` API ([#46653](https://github.com/angular/angular/pull/46653)) |
| [fa52b6e906](https://github.com/angular/angular/commit/fa52b6e906e549e1c6b4a4f4428596d093fb0549) | feat | options object to supersede bit flags for `inject()` ([#46649](https://github.com/angular/angular/pull/46649)) |
| [af20112222](https://github.com/angular/angular/commit/af20112222fcfa961ff9a2dee4050dd59aa4156e) | feat | support the descendants option for ContentChild queries ([#46638](https://github.com/angular/angular/pull/46638)) |
| [945a3ad359](https://github.com/angular/angular/commit/945a3ad359cd2fe3456f635b0fe36effbfe8d5c2) | fix | Fix `runInContext` for `NgModuleRef` injector ([#46877](https://github.com/angular/angular/pull/46877)) |
| [bb7c80477b](https://github.com/angular/angular/commit/bb7c80477b1258f48971b67b2eade6a4b41337f2) | fix | make parent injector argument required in `createEnvironmentInjector` ([#46397](https://github.com/angular/angular/pull/46397)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [82acbf919b](https://github.com/angular/angular/commit/82acbf919bae2ddb6a46f41239aa2a101901f089) | feat | improve error message for nullish header ([#46059](https://github.com/angular/angular/pull/46059)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [53ca936366](https://github.com/angular/angular/commit/53ca936366fb908278571bae5fcc7fa08b19a5a0) | feat | Add ability to create `UrlTree` from any `ActivatedRouteSnapshot` ([#45877](https://github.com/angular/angular/pull/45877)) |
| [de058bba99](https://github.com/angular/angular/commit/de058bba9979f68de2320118b537e6be4dbb888d) | feat | Add CanMatch guard to control whether a Route should match ([#46021](https://github.com/angular/angular/pull/46021)) |
| [6c1357dd7d](https://github.com/angular/angular/commit/6c1357dd7d5f466575398ebc32c581068d9bf2df) | feat | Add stable cancelation code to `NavigationCancel` event ([#46675](https://github.com/angular/angular/pull/46675)) |
| [a4ce273e50](https://github.com/angular/angular/commit/a4ce273e50551e6c6bc8f3a86591b04760de7ba4) | feat | Add the target `RouterStateSnapshot` to `NavigationError` ([#46731](https://github.com/angular/angular/pull/46731)) |
| [abe3759e24](https://github.com/angular/angular/commit/abe3759e2417c0396d75e226edcef2fae99e363b) | fix | allow to return `UrlTree` from `CanMatchFn` ([#46455](https://github.com/angular/angular/pull/46455)) |
| [e8c7dd10e9](https://github.com/angular/angular/commit/e8c7dd10e93d338456131e11d600bf758ee48634) | fix | Ensure `APP_INITIALIZER` of `enabledBlocking` option completes ([#46026](https://github.com/angular/angular/pull/46026)) |
| [ce20ed067f](https://github.com/angular/angular/commit/ce20ed067f12714ee6488ffe07f1a1c18bb60a15) | fix | Ensure Route injector is created before running CanMatch guards ([#46394](https://github.com/angular/angular/pull/46394)) |
| [6a7b818d94](https://github.com/angular/angular/commit/6a7b818d94fdd13d81a01285e3e4be953a29cc06) | fix | Ensure target `RouterStateSnapshot` is defined in `NavigationError` ([#46842](https://github.com/angular/angular/pull/46842)) |
| [f94c6f433d](https://github.com/angular/angular/commit/f94c6f433dba3924b79f137cfcc49d2dfd4d679c) | fix | Expose CanMatchFn as public API ([#46394](https://github.com/angular/angular/pull/46394)) |
| [e8ae0fe3e9](https://github.com/angular/angular/commit/e8ae0fe3e91e2e805146fad0d2f0976b1f886112) | fix | Fix cancellation code for canLoad rejections ([#46752](https://github.com/angular/angular/pull/46752)) |
### upgrade
| Commit | Type | Description |
| -- | -- | -- |
| [e9cb0454dc](https://github.com/angular/angular/commit/e9cb0454dce2113cfd5ba11deeca6cdcf47d47f0) | feat | more closely align `UpgradeModule#bootstrap()` with `angular.bootstrap()` ([#46214](https://github.com/angular/angular/pull/46214)) |
## Special Thanks
AleksanderBodurri, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Cédric Exbrayat, Dmitrij Kuba, Dylan Hunn, George Kalpakas, Jessica Janiuk, JiaLiPassion, Joey Perrott, John Vandenberg, JoostK, Keith Li, Or'el Ben-Ya'ir, Paul Gschwendtner, Pawel Kozlowski, SyedAhm3r, arturovt, mariu, markostanimirovic and mgechev
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.0.6"></a>
# 14.0.6 (2022-07-13)
### compiler-cli
@@ -18,33 +102,6 @@ Alan Agius, Andrew Scott, Bob Watson, Dylan Hunn, George Kalpakas, Ivaylo Kirov,
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.1.0-next.4"></a>
# 14.1.0-next.4 (2022-07-06)
## Deprecations
### core
- The bit field signature of `inject()` has been deprecated, in favor of the
new options object. Correspondingly, `InjectFlags` is deprecated as well.
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [6f11a58040](https://github.com/angular/angular/commit/6f11a580406877e440c43df31fae3d5f120cafed) | feat | Add extended diagnostic to warn when text attributes are intended to be bindings ([#46161](https://github.com/angular/angular/pull/46161)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [96c6139c9a](https://github.com/angular/angular/commit/96c6139c9ab35aa6ab2330a5a79a5906d5c2e8be) | feat | add ability to set inputs on ComponentRef ([#46641](https://github.com/angular/angular/pull/46641)) |
| [a7a14df5f8](https://github.com/angular/angular/commit/a7a14df5f8ff2d1e6a4dba3ac53f4479a6646810) | feat | introduce `EnvironmentInjector.runInContext` API ([#46653](https://github.com/angular/angular/pull/46653)) |
| [fa52b6e906](https://github.com/angular/angular/commit/fa52b6e906e549e1c6b4a4f4428596d093fb0549) | feat | options object to supersede bit flags for `inject()` ([#46649](https://github.com/angular/angular/pull/46649)) |
| [af20112222](https://github.com/angular/angular/commit/af20112222fcfa961ff9a2dee4050dd59aa4156e) | feat | support the descendants option for ContentChild queries ([#46638](https://github.com/angular/angular/pull/46638)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [6c1357dd7d](https://github.com/angular/angular/commit/6c1357dd7d5f466575398ebc32c581068d9bf2df) | feat | Add stable cancelation code to `NavigationCancel` event ([#46675](https://github.com/angular/angular/pull/46675)) |
| [e8c7dd10e9](https://github.com/angular/angular/commit/e8c7dd10e93d338456131e11d600bf758ee48634) | fix | Ensure `APP_INITIALIZER` of `enabledBlocking` option completes ([#46026](https://github.com/angular/angular/pull/46026)) |
## Special Thanks
Alan Agius, Alex Rickabaugh, Andrew Scott, Aristeidis Bampakos, Bob Watson, George Kalpakas, Paul Gschwendtner and Pawel Kozlowski
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.0.5"></a>
# 14.0.5 (2022-07-06)
### router
@@ -56,39 +113,6 @@ Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos,
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.1.0-next.3"></a>
# 14.1.0-next.3 (2022-06-29)
### animations
| Commit | Type | Description |
| -- | -- | -- |
| [4eb1ca11f0](https://github.com/angular/angular/commit/4eb1ca11f0fbc7683115fc382420b3e75f248b4c) | fix | cleanup DOM elements when the root view is removed ([#45143](https://github.com/angular/angular/pull/45143)) |
| [b417370383](https://github.com/angular/angular/commit/b41737038377af480763226a904b67e7d8e283ae) | fix | enable shadowElements to leave when their parent does ([#46459](https://github.com/angular/angular/pull/46459)) |
### common
| Commit | Type | Description |
| -- | -- | -- |
| [4a2e7335b1](https://github.com/angular/angular/commit/4a2e7335b180190800cf2c5db8ed1c8841dbf473) | feat | make the `CommonModule` pipes standalone ([#46401](https://github.com/angular/angular/pull/46401)) |
| [a7597dd080](https://github.com/angular/angular/commit/a7597dd08026a4071758323d54ccbfb382e0c780) | feat | make the CommonModule directives standalone ([#46469](https://github.com/angular/angular/pull/46469)) |
| [1c39aace0e](https://github.com/angular/angular/commit/1c39aace0e74b02338729e5fb61e322ab06a9e14) | fix | handle CSS custom properties in NgStyle ([#46451](https://github.com/angular/angular/pull/46451)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [8b6f4215a3](https://github.com/angular/angular/commit/8b6f4215a3c13a44d989d6068f6fb4625f3bab67) | fix | trigger `ApplicationRef.destroy` when Platform is destroyed ([#46497](https://github.com/angular/angular/pull/46497)) |
| [606d94299a](https://github.com/angular/angular/commit/606d94299ac929243e8fa10fe7e00dee6d40064b) | fix | Update ngfor error code to be negative ([#46555](https://github.com/angular/angular/pull/46555)) |
| [f86e0948f8](https://github.com/angular/angular/commit/f86e0948f80d398a8c4da9032372e083acc5d7a2) | fix | Updates error to use RuntimeError code ([#46526](https://github.com/angular/angular/pull/46526)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [0a5c8c0bc4](https://github.com/angular/angular/commit/0a5c8c0bc45ec58bcd297c7b001b88aec5c5e14d) | fix | Convert existing reactive errors to use RuntimeErrorCode. ([#46560](https://github.com/angular/angular/pull/46560)) |
| [f6a096e3d4](https://github.com/angular/angular/commit/f6a096e3d4db9dfc31ab9228f37e119b87e5f8cf) | fix | Update a Forms validator error to use RuntimeError ([#46537](https://github.com/angular/angular/pull/46537)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [ee39cf62bc](https://github.com/angular/angular/commit/ee39cf62bc3f3d60d1dfe7064fe34565e5429b84) | fix | Ensure that new `RouterOutlet` instances work after old ones are destroyed ([#46554](https://github.com/angular/angular/pull/46554)) |
## Special Thanks
Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bezael, Chad Ramos, Chellappan, Cédric Exbrayat, Dylan Hunn, George Kalpakas, Jeremy Meiss, Jessica Janiuk, Joey Perrott, KMathy, Kristiyan Kostadinov, Paul Gschwendtner, Pawel Kozlowski, Ramesh Thiruchelvam, Vaibhav Kumar, arturovt, dario-piotrowicz and renovate[bot]
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.0.4"></a>
# 14.0.4 (2022-06-29)
### animations
@@ -120,37 +144,6 @@ Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bezael, Chad Ramos, C
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.1.0-next.2"></a>
# 14.1.0-next.2 (2022-06-22)
### animations
| Commit | Type | Description |
| -- | -- | -- |
| [342effeb7d](https://github.com/angular/angular/commit/342effeb7d4d078ea51a7c345497794a7834b3c0) | fix | reset the start and done fns on player reset ([#46364](https://github.com/angular/angular/pull/46364)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [ddd6d66203](https://github.com/angular/angular/commit/ddd6d662038336f9a8e7d68a8b5cda2c3ca1c1d7) | fix | deduplicate imports of standalone components in JIT compiler ([#46439](https://github.com/angular/angular/pull/46439)) |
| [3d8787c961](https://github.com/angular/angular/commit/3d8787c961176e15a7583d415f778054378ea06e) | fix | handle NgModules with standalone pipes in TestBed correctly ([#46407](https://github.com/angular/angular/pull/46407)) |
| [bb7c80477b](https://github.com/angular/angular/commit/bb7c80477b1258f48971b67b2eade6a4b41337f2) | fix | make parent injector argument required in `createEnvironmentInjector` ([#46397](https://github.com/angular/angular/pull/46397)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [82acbf919b](https://github.com/angular/angular/commit/82acbf919bae2ddb6a46f41239aa2a101901f089) | feat | improve error message for nullish header ([#46059](https://github.com/angular/angular/pull/46059)) |
### platform-server
| Commit | Type | Description |
| -- | -- | -- |
| [08d3db232c](https://github.com/angular/angular/commit/08d3db232cb758701c41277996f1b41773f98e0d) | fix | invalid style attribute being generated for null values ([#46433](https://github.com/angular/angular/pull/46433)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [abe3759e24](https://github.com/angular/angular/commit/abe3759e2417c0396d75e226edcef2fae99e363b) | fix | allow to return `UrlTree` from `CanMatchFn` ([#46455](https://github.com/angular/angular/pull/46455)) |
| [ce20ed067f](https://github.com/angular/angular/commit/ce20ed067f12714ee6488ffe07f1a1c18bb60a15) | fix | Ensure Route injector is created before running CanMatch guards ([#46394](https://github.com/angular/angular/pull/46394)) |
| [f94c6f433d](https://github.com/angular/angular/commit/f94c6f433dba3924b79f137cfcc49d2dfd4d679c) | fix | Expose CanMatchFn as public API ([#46394](https://github.com/angular/angular/pull/46394)) |
## Special Thanks
4javier, Aakash, Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Dany Paredes, Derek Cormier, Dmitrij Kuba, JoostK, Kristiyan Kostadinov, Paul Gschwendtner, Ramesh Thiruchelvam, arturovt, behrooz bozorg chami, dario-piotrowicz, markostanimirovic, renovate[bot] and web-dave
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.0.3"></a>
# 14.0.3 (2022-06-22)
### animations
@@ -171,31 +164,6 @@ Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bezael, Chad Ramos, C
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.1.0-next.1"></a>
# 14.1.0-next.1 (2022-06-15)
### common
| Commit | Type | Description |
| -- | -- | -- |
| [8b9c32d4dc](https://github.com/angular/angular/commit/8b9c32d4dccca5417adce1ca6067adf0805d6d08) | fix | allow null in ngComponentOutlet ([#46280](https://github.com/angular/angular/pull/46280)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [131d029da1](https://github.com/angular/angular/commit/131d029da16b7d486cdc200f00160b9a11871fb2) | feat | detect missing control flow directive imports in standalone components ([#46146](https://github.com/angular/angular/pull/46146)) |
| [04acc6b14d](https://github.com/angular/angular/commit/04acc6b14d502597a98537019822f1a1217c9a61) | fix | don't emit empty providers array ([#46301](https://github.com/angular/angular/pull/46301)) |
| [f35f4751b5](https://github.com/angular/angular/commit/f35f4751b54dcb9e65f2d72aeea87651314159e8) | fix | use inline type-check blocks for components outside `rootDir` ([#46096](https://github.com/angular/angular/pull/46096)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [b1a3dec58d](https://github.com/angular/angular/commit/b1a3dec58d0dc21d76f757d4085c7581d89dc7dd) | fix | Resolve forwardRef declarations for jit ([#46334](https://github.com/angular/angular/pull/46334)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [de058bba99](https://github.com/angular/angular/commit/de058bba9979f68de2320118b537e6be4dbb888d) | feat | Add CanMatch guard to control whether a Route should match ([#46021](https://github.com/angular/angular/pull/46021)) |
## Special Thanks
Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Badawi7, Daniel Schmitz, Derek Cormier, Jessica Janiuk, JiaLiPassion, JoostK, Kevin Davila, Kristiyan Kostadinov, Paul Draper, Paul Gschwendtner, Tom Eustace, Totati, Younes Jaaidi, alefra, dario-piotrowicz, markostanimirovic, mgechev, piyush132000, sten-bone and vivekkoya
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.0.2"></a>
# 14.0.2 (2022-06-15)
### common
@@ -216,21 +184,6 @@ Alex Rickabaugh, Andrew Scott, Badawi7, Daniel Schmitz, Derek Cormier, JoostK, K
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.1.0-next.0"></a>
# 14.1.0-next.0 (2022-06-08)
### router
| Commit | Type | Description |
| -- | -- | -- |
| [53ca936366](https://github.com/angular/angular/commit/53ca936366fb908278571bae5fcc7fa08b19a5a0) | feat | Add ability to create `UrlTree` from any `ActivatedRouteSnapshot` ([#45877](https://github.com/angular/angular/pull/45877)) |
### upgrade
| Commit | Type | Description |
| -- | -- | -- |
| [e9cb0454dc](https://github.com/angular/angular/commit/e9cb0454dce2113cfd5ba11deeca6cdcf47d47f0) | feat | more closely align `UpgradeModule#bootstrap()` with `angular.bootstrap()` ([#46214](https://github.com/angular/angular/pull/46214)) |
## Special Thanks
AleksanderBodurri, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, George Kalpakas, Jessica Janiuk, Joey Perrott, Keith Li, SyedAhm3r, mariu and mgechev
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.0.1"></a>
# 14.0.1 (2022-06-08)
### bazel
+4 -4
View File
@@ -123,7 +123,7 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"
web_test_repositories()
load("@npm//@angular/dev-infra-private/bazel/browsers:browser_repositories.bzl", "browser_repositories")
load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories")
browser_repositories()
@@ -158,10 +158,10 @@ cldr_xml_data_repository(
# sass rules
http_archive(
name = "io_bazel_rules_sass",
sha256 = "2f86f221636cf721bd118ac954d0c982ef16cb3f795794ce17a5e0b7e62e103b",
strip_prefix = "rules_sass-eda73f679f50d1d30599cebb8cc1bbc5ae43d5c6",
sha256 = "3e0e115f380227f7f186bcfce29b125e4a02536b6c309f80912ee0d6b79a6e71",
strip_prefix = "rules_sass-030f696dcf32508b264c469f26d031f7996dea4c",
urls = [
"https://github.com/bazelbuild/rules_sass/archive/eda73f679f50d1d30599cebb8cc1bbc5ae43d5c6.zip",
"https://github.com/bazelbuild/rules_sass/archive/030f696dcf32508b264c469f26d031f7996dea4c.zip",
],
)
+4 -3
View File
@@ -1,9 +1,10 @@
@name `inject()` must be called from an injection context
@category runtime
@shortDescription `inject()` must be called from an injection context (a constructor, a factory function or a field initializer)
@shortDescription `inject()` must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with `EnvironmentInjector#runInContext`.
@description
You see this error when you try to use the `inject()` function outside of the allowed injection context. The injection context is available during the class creation and initialization.
You see this error when you try to use the `inject()` function outside of the allowed injection context. The injection context is available during the class creation and initialization. It is also available to functions
used with `EnvironmentInjector#runInContext`.
In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a field initializer:
@@ -34,7 +35,7 @@ providers: [
]
```
Calls to the `inject()` function outside of the class creation context will result in error. Most notably, calls to `inject()` are disallowed after a class instance was created, in methods (including lifecycle hooks):
Calls to the `inject()` function outside of the class creation or `runInContext` will result in error. Most notably, calls to `inject()` are disallowed after a class instance was created, in methods (including lifecycle hooks):
```typescript
@Component({ ... })
@@ -7,6 +7,5 @@ import { Component } from '@angular/core';
})
export class CartComponent {
constructor() { }
}
@@ -1,11 +1,6 @@
// #docplaster
/*
// #docregion as-generated
import { Component, OnInit } from '@angular/core';
// #enddocregion as-generated
*/
// #docregion imports
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input } from '@angular/core';
import { Product } from '../products';
// #enddocregion imports
// #docregion as-generated
@@ -16,14 +11,10 @@ import { Product } from '../products';
styleUrls: ['./product-alerts.component.css']
})
// #docregion input-decorator
export class ProductAlertsComponent implements OnInit {
export class ProductAlertsComponent {
// #enddocregion as-generated
@Input() product!: Product;
// #docregion as-generated
constructor() { }
ngOnInit() {
}
}
+1 -1
View File
@@ -165,7 +165,7 @@ The `CountdownLocalVarParentComponent` that hosts the timer component is as foll
The parent component cannot data bind to the child's `start` and `stop` methods nor to its `seconds` property.
Place a local variable, `#timer`, on the tag `<countdown-timer>` representing the child component.
Place a local variable, `#timer`, on the tag `<app-countdown-timer>` representing the child component.
That gives you a reference to the child component and the ability to access *any of its properties or methods* from within the parent template.
This example wires parent buttons to the child's `start` and `stop` and uses interpolation to display the child's `seconds` property.
+13
View File
@@ -76,6 +76,8 @@ v14 - v17
| `@angular/core/testing` | [`async`](#testing) | <!-- v9 --> v12 |
| `@angular/forms` | [`FormBuilder.group` legacy options parameter](api/forms/FormBuilder#group) | <!-- v11 --> v14 |
| `@angular/platform-server` | [`renderModuleFactory`](#platform-server) | <!-- v13 --> v15 |
| `@angular/platform-server` | [`ServerTransferStateModule`](#platform-server) | <!-- v14 --> v16 |
| `@angular/platform-browser` | [`BrowserTransferStateModule`](#platform-browser) | <!-- v14 --> v16 |
| `@angular/router` | [`relativeLinkResolution`](#relativeLinkResolution) | <!-- v14 --> v16 |
| `@angular/router` | [`resolver` argument in `RouterOutletContract.activateWith`](#router) | <!-- v14 --> v16 |
| `@angular/router` | [`resolver` field of the `OutletContext` class](#router) | <!-- v14 --> v16 |
@@ -159,6 +161,15 @@ In the [API reference section](api) of this site, deprecated APIs are indicated
| [`resolver` field of the `OutletContext` class](api/router/OutletContext#resolver) | No replacement needed | v14 | Component factories are not required to create an instance of a component dynamically. Passing a factory resolver via `resolver` class field is no longer needed. |
<a id="platform-browser"></a>
### &commat;angular/platform-browser
| API | Replacement | Deprecation announced | Details |
|:--- |:--- |:--- |:--- |
| [`BrowserTransferStateModule`](api/platform-browser/BrowserTransferStateModule) | No replacement needed. | v14.1 | The `TransferState` class is available for injection without importing additional modules on the client side of a server-rendered application. |
<a id="platform-browser-dynamic"></a>
### &commat;angular/platform-browser-dynamic
@@ -175,6 +186,8 @@ In the [API reference section](api) of this site, deprecated APIs are indicated
| API | Replacement | Deprecation announced | Details |
|:--- |:--- |:--- |:--- |
| [`renderModuleFactory`](api/platform-server/renderModuleFactory) | [`renderModule`](api/platform-server/renderModule) | v13 | This symbol is no longer necessary. See [JIT API changes due to ViewEngine deprecation](#jit-api-changes) for additional context. |
| [`ServerTransferStateModule`](api/platform-server/ServerTransferStateModule) | No replacement needed. | v14.1 | The `TransferState` class is available for injection without importing additional modules during server side rendering, when `ServerModule` is imported or `renderApplication` function is used for bootstrap. |
<a id="forms"></a>
+1 -1
View File
@@ -162,7 +162,7 @@ The following figure shows the final form.
| Steps | Details |
|:--- |:--- |
| Different types of forms and control collection | This tutorial shows how to build a questionaire, which is just one kind of dynamic form. The example uses `FormGroup` to collect a set of controls. For an example of a different type of dynamic form, see the section [Creating dynamic forms](guide/reactive-forms#creating-dynamic-forms "Create dynamic forms with arrays") in the Reactive Forms guide. That example also shows how to use `FormArray` instead of `FormGroup` to collect a set of controls. |
| Different types of forms and control collection | This tutorial shows how to build a questionnaire, which is just one kind of dynamic form. The example uses `FormGroup` to collect a set of controls. For an example of a different type of dynamic form, see the section [Creating dynamic forms](guide/reactive-forms#creating-dynamic-forms "Create dynamic forms with arrays") in the Reactive Forms guide. That example also shows how to use `FormArray` instead of `FormGroup` to collect a set of controls. |
| Validating user input | The section [Validating form input](guide/reactive-forms#validating-form-input "Basic input validation") introduces the basics of how input validation works in reactive forms. <br /> The [Form validation guide](guide/form-validation "Form validation guide") covers the topic in more depth. |
<!-- links -->
@@ -173,7 +173,7 @@ If the component's injector lacks the provider, it passes the request up to its
The requests keep forwarding up until Angular finds an injector that can handle the request or runs out of ancestor `ElementInjector` hierarchies.
If Angular doesn't find the provider in any `ElementInjector` hierarchiess, it goes back to the element where the request originated and looks in the `ModuleInjector` hierarchy.
If Angular doesn't find the provider in any `ElementInjector` hierarchies, it goes back to the element where the request originated and looks in the `ModuleInjector` hierarchy.
If Angular still doesn't find the provider, it throws an error.
If you have registered a provider for the same DI token at different levels, the first one Angular encounters is the one it uses to resolve the dependency.
+1 -1
View File
@@ -9,7 +9,7 @@ For example, you would use a pipe to show a date as **April 15, 1988** rather th
<div class="alert is-helpful">
For the sample application used in this topic, see the <live-example></live-example>.
For the sample application used in this topic, see the <live-example name="pipes"></live-example>.
</div>
+2 -2
View File
@@ -2382,12 +2382,12 @@ Currently, the `AdminModule` does not preload because `CanLoad` is blocking it.
<a id="preload-canload"></a>
#### `CanLoad` blocks preload
#### `CanLoad` blocks preload of children
The `PreloadAllModules` strategy does not load feature areas protected by a [CanLoad](#can-load-guard) guard.
You added a `CanLoad` guard to the route in the `AdminModule` a few steps back to block loading of that module until the user is authorized.
That `CanLoad` guard takes precedence over the preload strategy.
That `CanLoad` guard takes precedence over the preload strategy for loading children routes.
If you want to preload a module as well as guard against unauthorized access, remove the `canLoad()` guard method and rely on the [canActivate()](#can-activate-guard) guard alone.
+1 -1
View File
@@ -463,7 +463,7 @@ The link parameters array affords the flexibility to represent any routing depth
When the router navigates to a new component view, it updates the browser's location and history with a URL for that view.
Modern HTML5 browsers support [history.pushState](https://developer.mozilla.org/docs/Web/API/History_API/Working_with_the_History_API#adding_and_modifying_history_entries title="HTML5 browser history push-state"), a technique that changes a browser's location and history without triggering a server page request.
Modern HTML5 browsers support [history.pushState](https://developer.mozilla.org/docs/Web/API/History_API/Working_with_the_History_API#adding_and_modifying_history_entries "HTML5 browser history push-state"), a technique that changes a browser's location and history without triggering a server page request.
The router can compose a "natural" URL that is indistinguishable from one that would otherwise require a page load.
Here's the Crisis Center URL in this "HTML5 pushState" style:
+1 -1
View File
@@ -87,7 +87,7 @@ The following template binds the value of `htmlSnippet`, once by interpolating i
Interpolated content is always escaped &mdash;the HTML isn't interpreted and the browser displays angle brackets in the element's text content.
For the HTML to be interpreted, bind it to an HTML property such as `innerHTML`.
But binding a value that an attacker might control into `innerHTML` normally causes an XSS vulnerability
But binding a value that an attacker might control into `innerHTML` normally causes an XSS vulnerability.
For example, one could execute JavaScript in a following way:
<code-example header="src/app/inner-html-binding.component.ts (class)" path="security/src/app/inner-html-binding.component.ts" region="class"></code-example>
+51 -41
View File
@@ -1,9 +1,12 @@
# Service worker configuration
This topic describes the properties of the service worker configuration file.
## Prerequisites
A basic understanding of the following:
* [Service worker overview](https://developer.chrome.com/docs/workbox/service-worker-overview/)
* [Service Worker in Production](guide/service-worker-devops)
The `ngsw-config.json` configuration file specifies which files and data URLs the Angular service worker should cache and how it should update the cached files and data.
@@ -64,9 +67,11 @@ Example patterns:
| `/*.html` | Specifies only HTML files in the root |
| `!/**/*.map` | Exclude all sourcemaps |
## Service worker configuration properties
The following sections describe each property of the configuration file.
## `appData`
### `appData`
This section enables you to pass any data you want that describes this particular version of the application.
The `SwUpdate` service includes that data in the update notifications.
@@ -74,12 +79,12 @@ Many applications use this section to provide additional information for the dis
<a id="index-file"></a>
## `index`
### `index`
Specifies the file that serves as the index page to satisfy navigation requests.
Usually this is `/index.html`.
## `assetGroups`
### `assetGroups`
*Assets* are resources that are part of the application version that update along with the application.
They can include resources loaded from the page's origin as well as third-party resources loaded from CDNs and other external URLs.
@@ -134,12 +139,14 @@ interface AssetGroup {
</code-example>
### `name`
Each `AssetGroup` is defined by the following asset group properties.
#### `name`
A `name` is mandatory.
It identifies this particular group of assets between versions of the configuration.
### `installMode`
#### `installMode`
The `installMode` determines how these resources are initially cached.
The `installMode` can be either of two values:
@@ -151,7 +158,7 @@ The `installMode` can be either of two values:
Defaults to `prefetch`.
### `updateMode`
#### `updateMode`
For resources already in the cache, the `updateMode` determines the caching behavior when a new version of the application is discovered.
Any resources in the group that have changed since the previous version are updated in accordance with `updateMode`.
@@ -163,7 +170,7 @@ Any resources in the group that have changed since the previous version are upda
Defaults to the value `installMode` is set to.
### `resources`
#### `resources`
This section describes the resources to cache, broken up into the following groups:
@@ -172,7 +179,7 @@ This section describes the resources to cache, broken up into the following grou
| `files` | Lists patterns that match files in the distribution directory. These can be single files or glob-like patterns that match a number of files. |
| `urls` | Includes both URLs and URL patterns that are matched at runtime. These resources are not fetched directly and do not have content hashes, but they are cached according to their HTTP headers. This is most useful for CDNs such as the Google Fonts service. <br /> *\(Negative glob patterns are not supported and `?` will be matched literally; that is, it will not match any character other than `?`.\)* |
### `cacheQueryOptions`
#### `cacheQueryOptions`
These options are used to modify the matching behavior of requests.
They are passed to the browsers `Cache#match` function.
@@ -183,7 +190,7 @@ Currently, only the following options are supported:
|:--- |:--- |
| `ignoreSearch` | Ignore query parameters. Defaults to `false`. |
## `dataGroups`
### `dataGroups`
Unlike asset resources, data requests are not versioned along with the application.
They're cached according to manually-configured policies that are more useful for situations such as API requests and other data dependencies.
@@ -236,11 +243,13 @@ export interface DataGroup {
</code-example>
### `name`
Each `DataGroup` is defined by the following data group properties.
#### `name`
Similar to `assetGroups`, every data group has a `name` which uniquely identifies it.
### `urls`
#### `urls`
A list of URL patterns.
URLs that match these patterns are cached according to this data group's policy.
@@ -249,7 +258,7 @@ Only non-mutating requests \(GET and HEAD\) are cached.
* Negative glob patterns are not supported
* `?` is matched literally; that is, it matches *only* the character `?`
### `version`
#### `version`
Occasionally APIs change formats in a way that is not backward-compatible.
A new version of the application might not be compatible with the old API format and thus might not be compatible with existing cached resources from that API.
@@ -258,18 +267,22 @@ A new version of the application might not be compatible with the old API format
`version` is an integer field and defaults to `1`.
### `cacheConfig`
#### `cacheConfig`
This section defines the policy by which matching requests are cached.
The following properties define the policy by which matching requests are cached.
#### `maxSize`
##### `maxSize`
\(required\) The maximum number of entries, or responses, in the cache.
**Required**
The maximum number of entries, or responses, in the cache.
Open-ended caches can grow in unbounded ways and eventually exceed storage quotas, calling for eviction.
#### `maxAge`
##### `maxAge`
(required) The `maxAge` parameter indicates how long responses are allowed to remain in the cache before being considered invalid and evicted.
**Required**
The `maxAge` parameter indicates how long responses are allowed to remain in the cache before being considered invalid and evicted.
`maxAge` is a duration string, using the following unit suffixes:
| Suffixes | Details |
@@ -282,7 +295,7 @@ Open-ended caches can grow in unbounded ways and eventually exceed storage quota
For example, the string `3d12h` caches content for up to three and a half days.
#### `timeout`
##### `timeout`
This duration string specifies the network timeout.
The network timeout is how long the Angular service worker waits for the network to respond before using a cached response, if configured to do so.
@@ -298,7 +311,7 @@ The network timeout is how long the Angular service worker waits for the network
For example, the string `5s30u` translates to five seconds and 30 milliseconds of network timeout.
#### `strategy`
##### `strategy`
The Angular service worker can use either of two caching strategies for data resources.
@@ -309,19 +322,19 @@ The Angular service worker can use either of two caching strategies for data res
<div class="alert is-helpful">
You can also emulate a third strategy, [staleWhileRevalidate](https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#stale-while-revalidate), which returns cached data \(if available\), but also fetches fresh data from the network in the background for next time.
You can also emulate a third strategy, [staleWhileRevalidate](https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#stale-while-revalidate), which returns cached data if it is available, but also fetches fresh data from the network in the background for next time.
To use this strategy set `strategy` to `freshness` and `timeout` to `0u` in `cacheConfig`.
This essentially does the following:
1. Try to fetch from the network first.
1. If the network request does not complete after 0ms \(that is, immediately\), fall back to the cache \(ignoring cache age\).
1. Once the network request completes, update the cache for future requests.
1. If the resource does not exist in the cache, wait for the network request anyway.
2. If the network request does not complete immediately, that is after a timeout of 0&nbsp;ms, ignore the cache age and fall back to the cached value.
3. Once the network request completes, update the cache for future requests.
4. If the resource does not exist in the cache, wait for the network request anyway.
</div>
#### `cacheOpaqueResponses`
##### `cacheOpaqueResponses`
Whether the Angular service worker should cache opaque responses or not.
@@ -329,8 +342,8 @@ If not specified, the default value depends on the data group's configured strat
| Strategies | Details |
|:--- |:--- |
| Groups with the `freshness` strategy | The default value is `true` \(cache opaque responses\). These groups will request the data anew every time, only falling back to the cached response when offline or on a slow network. Therefore, it doesn't matter if the service worker caches an error response. |
| Groups with the `performance` strategy | The default value is `false` \(do not cache opaque responses\). These groups would continue to return a cached response until `maxAge` expires, even if the error was due to a temporary network or server issue. Therefore, it would be problematic for the service worker to cache an error response. |
| Groups with the `freshness` strategy | The default value is `true` and the service worker caches opaque responses. These groups will request the data every time and only fall back to the cached response when offline or on a slow network. Therefore, it doesn't matter if the service worker caches an error response. |
| Groups with the `performance` strategy | The default value is `false` and the service worker doesn't cache opaque responses. These groups would continue to return a cached response until `maxAge` expires, even if the error was due to a temporary network or server issue. Therefore, it would be problematic for the service worker to cache an error response. |
<div class="callout is-important">
@@ -344,27 +357,24 @@ If you are not able to implement CORS &mdash;for example, if you don't control t
</div>
### `cacheQueryOptions`
#### `cacheQueryOptions`
See [assetGroups](#assetgroups) for details.
## `navigationUrls`
### `navigationUrls`
This optional section enables you to specify a custom list of URLs that will be redirected to the index file.
### Handling navigation requests
#### Handling navigation requests
The ServiceWorker redirects navigation requests that don't match any `asset` or `data` group to the specified [index file](#index-file).
A request is considered to be a navigation request if:
* Its [mode](https://developer.mozilla.org/docs/Web/API/Request/mode) is `navigation`
* It accepts a `text/html` response \(as determined by the value of the `Accept` header\)
* Its URL matches certain criteria \(see the following\)
By default, these criteria are:
* The URL must not contain a file extension \(that is, a `.`\) in the last path segment
* The URL must not contain `__`
* It accepts a `text/html` response as determined by the value of the `Accept` header
* Its URL matches the following criteria:
* The URL must not contain a file extension \(that is, a `.`\) in the last path segment
* The URL must not contain `__`
<div class="alert is-helpful">
@@ -372,10 +382,10 @@ To configure whether navigation requests are sent through to the network or not,
</div>
### Matching navigation request URLs
#### Matching navigation request URLs
While these default criteria are fine in most cases, it is sometimes desirable to configure different rules.
For example, you might want to ignore specific routes \(that are not part of the Angular app\) and pass them through to the server.
For example, you might want to ignore specific routes, such as those that are not part of the Angular app, and pass them through to the server.
This field contains an array of URLs and [glob-like](#glob-patterns) URL patterns that are matched at runtime.
It can contain both negative patterns \(that is, patterns starting with `!`\) and non-negative patterns and URLs.
@@ -398,7 +408,7 @@ If the field is omitted, it defaults to:
<a id="navigation-request-strategy"></a>
## `navigationRequestStrategy`
### `navigationRequestStrategy`
This optional property enables you to configure how the service worker handles navigation requests:
@@ -413,7 +423,7 @@ This optional property enables you to configure how the service worker handles n
| Possible values | Details |
|:--- |:--- |
| `'performance'` | The default setting. Serves the specified [index file](#index-file), which is typically cached. |
| `'freshness'` | Passes the requests through to the network and falls back to the `performance` behavior when offline. This value is useful when the server redirects the navigation requests elsewhere using an HTTP redirect \(3xx status code\). Reasons for using this value include: <ul> <li> Redirecting to an authentication website when authentication is not handled by the application </li> <li> Redirecting specific URLs to avoid breaking existing links/bookmarks after a website redesign </li> <li> Redirecting to a different website, such as a server-status page, while a page is temporarily down </li> </ul> |
| `'freshness'` | Passes the requests through to the network and falls back to the `performance` behavior when offline. This value is useful when the server redirects the navigation requests elsewhere using a `3xx` HTTP redirect status code. Reasons for using this value include: <ul> <li> Redirecting to an authentication website when authentication is not handled by the application </li> <li> Redirecting specific URLs to avoid breaking existing links/bookmarks after a website redesign </li> <li> Redirecting to a different website, such as a server-status page, while a page is temporarily down </li> </ul> |
<div class="alert is-important">
+72 -57
View File
@@ -9,21 +9,21 @@ A basic understanding of the following:
* [Service Worker Communication](guide/service-worker-communications)
## Service worker and caching of app resources
## Service worker and caching of application resources
Conceptually, imagine the Angular service worker as a forward cache or a CDN edge that is installed in the end user's web browser.
The service worker's job is to satisfy requests made by the Angular application for resources or data from a local cache, without needing to wait for the network.
Imagine the Angular service worker as a forward cache or a Content Delivery Network (CDN) edge that is installed in the end user's web browser.
The service worker responds to requests made by the Angular application for resources or data from a local cache, without needing to wait for the network.
Like any cache, it has rules for how content is expired and updated.
<a id="versions"></a>
### App versions
### Application versions
In the context of an Angular service worker, a "version" is a collection of resources that represent a specific build of the Angular application.
Whenever a new build of the application is deployed, the service worker treats that build as a new version of the application.
This is true even if only a single file is updated.
At any given time, the service worker might have multiple versions of the application in its cache and it might be serving them simultaneously.
For more information, see the [App tabs](guide/service-worker-devops#tabs) section below.
For more information, see the [Application tabs](guide/service-worker-devops#tabs) section.
To preserve application integrity, the Angular service worker groups all files into a version together.
The files grouped into a version usually include HTML, JS, and CSS files.
@@ -35,15 +35,15 @@ In this scenario, it is not valid to serve the old `index.html`, which calls `st
This file integrity is especially important when lazy loading modules.
A JS bundle might reference many lazy chunks, and the filenames of the lazy chunks are unique to the particular build of the application.
If a running application at version `X` attempts to load a lazy chunk, but the server has already updated to version `X + 1`, the lazy loading operation will fail.
If a running application at version `X` attempts to load a lazy chunk, but the server has already updated to version `X + 1`, the lazy loading operation fails.
The version identifier of the application is determined by the contents of all resources, and it changes if any of them change.
In practice, the version is determined by the contents of the `ngsw.json` file, which includes hashes for all known content.
If any of the cached files change, the file's hash will change in `ngsw.json`, causing the Angular service worker to treat the active set of files as a new version.
If any of the cached files change, the file's hash changes in `ngsw.json`. This change causes the Angular service worker to treat the active set of files as a new version.
<div class="alert is-helpful">
`ngsw.json` is the manifest file that is generated at build time based on `ngsw-config.json`.
The build process creates the manifest file, `ngsw.json`, using information from `ngsw-config.json`.
</div>
@@ -52,25 +52,27 @@ With the versioning behavior of the Angular service worker, an application serve
#### Update checks
Every time the user opens or refreshes the application, the Angular service worker checks for updates to the application by looking for updates to the `ngsw.json` manifest.
If an update is found, it is downloaded and cached automatically, and will be served the next time the application is loaded.
If an update is found, it is downloaded and cached automatically, and is served the next time the application is loaded.
### Resource integrity
One of the potential side effects of long caching is inadvertently caching an invalid resource.
In a normal HTTP cache, a hard refresh or cache expiration limits the negative effects of caching an invalid file.
A service worker ignores such constraints and effectively long caches the entire application.
Consequently, it is essential that the service worker gets the correct content.
One of the potential side effects of long caching is inadvertently caching a resource that's not valid.
In a normal HTTP cache, a hard refresh or the cache expiring limits the negative effects of caching a file that's not valid.
A service worker ignores such constraints and effectively long-caches the entire application.
It's important that the service worker gets the correct content, so it keeps hashes of the resources to maintain their integrity.
#### Hashed content
To ensure resource integrity, the Angular service worker validates the hashes of all resources for which it has a hash.
Typically for an application created with the [Angular CLI](cli), this is everything in the `dist` directory covered by the user's `src/ngsw-config.json` configuration.
For an application created with the [Angular CLI](cli), this is everything in the `dist` directory covered by the user's `src/ngsw-config.json` configuration.
If a particular file fails validation, the Angular service worker attempts to re-fetch the content using a "cache-busting" URL parameter to eliminate the effects of browser or intermediate caching.
If that content also fails validation, the service worker considers the entire version of the application to be invalid and it stops serving the application.
If necessary, the service worker enters a safe mode where requests fall back on the network, opting not to use its cache if the risk of serving invalid, broken, or outdated content is high.
If a particular file fails validation, the Angular service worker attempts to re-fetch the content using a "cache-busting" URL parameter to prevent browser or intermediate caching.
If that content also fails validation, the service worker considers the entire version of the application to not be valid and stops serving the application.
If necessary, the service worker enters a safe mode where requests fall back on the network. The service worker doesn't use its cache if there's a high risk of serving content that is broken, outdated, or not valid.
Hash mismatches can occur for a variety of reasons:
* Caching layers in between the origin server and the end user could serve stale content
* Caching layers between the origin server and the end user could serve stale content
* A non-atomic deployment could result in the Angular service worker having visibility of partially updated content
* Errors during the build process could result in updated resources without `ngsw.json` being updated.
The reverse could also happen resulting in an updated `ngsw.json` without updated resources.
@@ -80,36 +82,36 @@ Hash mismatches can occur for a variety of reasons:
The only resources that have hashes in the `ngsw.json` manifest are resources that were present in the `dist` directory at the time the manifest was built.
Other resources, especially those loaded from CDNs, have content that is unknown at build time or are updated more frequently than the application is deployed.
If the Angular service worker does not have a hash to validate a given resource, it still caches its contents but it honors the HTTP caching headers by using a policy of "stale while revalidate".
That is, when HTTP caching headers for a cached resource indicate that the resource has expired, the Angular service worker continues to serve the content and it attempts to refresh the resource in the background.
If the Angular service worker does not have a hash to verify a resource is valid, it still caches its contents. At the same time, it honors the HTTP caching headers by using a policy of *stale while revalidate*.
The Angular service worker continues to serve a resource even after its HTTP caching headers indicate
that it is no longer valid. At the same time, it attempts to refresh the expired resource in the background.
This way, broken unhashed resources do not remain in the cache beyond their configured lifetimes.
<a id="tabs"></a>
### App tabs
### Application tabs
It can be problematic for an application if the version of resources it's receiving changes suddenly or without warning.
See the [App versions](guide/service-worker-devops#versions) section above for a description of such issues.
See the [Application versions](guide/service-worker-devops#versions) section for a description of such issues.
The Angular service worker provides a guarantee: a running application will continue to run the same version of the application.
If another instance of the application is opened in a new web browser tab, then the most current version of the app is served.
The Angular service worker provides a guarantee: a running application continues to run the same version of the application.
If another instance of the application is opened in a new web browser tab, then the most current version of the application is served.
As a result, that new tab can be running a different version of the application than the original tab.
<div class="alert is-important">
**IMPORTANT**: <br />
This guarantee is **stronger** than that provided by the normal web deployment model.
Without a service worker, there is no guarantee that code lazily loaded later in a running application is from the same version as the initial code for the application.
Without a service worker, there is no guarantee that lazily loaded code is from the same version as the application's initial code.
</div>
There are a few limited reasons why the Angular service worker might change the version of a running application.
Some of them are error conditions:
The Angular service worker might change the version of a running application under error conditions such as:
* The current version becomes invalid due to a failed hash
* An unrelated error causes the service worker to enter safe mode; that is, temporary deactivation
* The current version becomes non-valid due to a failed hash
* An unrelated error causes the service worker to enter safe mode and deactivates it temporarily
The Angular service worker is aware of which versions are in use at any given moment and it cleans up versions when no tab is using them.
The Angular service worker cleans up application versions when no tab is using them.
Other reasons the Angular service worker might change the version of a running application are normal events:
@@ -119,27 +121,35 @@ Other reasons the Angular service worker might change the version of a running a
### Service worker updates
The Angular service worker is a small script that runs in web browsers.
From time to time, the service worker will be updated with bug fixes and feature improvements.
From time to time, the service worker is updated with bug fixes and feature improvements.
The Angular service worker is downloaded when the application is first opened and when the application is accessed after a period of inactivity.
If the service worker has changed, the service worker will be updated in the background.
If the service worker changes, it's updated in the background.
Most updates to the Angular service worker are transparent to the app &mdash;the old caches are still valid and content is still served
normally.
However, occasionally a bugfix or feature in the Angular service worker requires the invalidation of old caches.
In this case, the application will be refreshed transparently from the network.
Most updates to the Angular service worker are transparent to the application. The old caches are still valid and content is still served normally.
Occasionally, a bug fix or feature in the Angular service worker might require the invalidation of old caches.
In this case, the service worker transparently refreshes the application from the network.
### Bypassing the service worker
In some cases, you might want to bypass the service worker entirely and let the browser handle the request instead.
An example is when you rely on a feature that is currently not supported in service workers \(for example, [reporting progress on uploaded files](https://github.com/w3c/ServiceWorker/issues/1141)\).
In some cases, you might want to bypass the service worker entirely and let the browser handle the request.
An example is when you rely on a feature that is currently not supported in service workers, such as [reporting progress on uploaded files](https://github.com/w3c/ServiceWorker/issues/1141).
To bypass the service worker, set `ngsw-bypass` as a request header, or as a query parameter.
\(The value of the header or query parameter is ignored and can be empty or omitted.\)
The value of the header or query parameter is ignored and can be empty or omitted.
### Service worker requests when the server can't be reached
The service worker processes all requests unless the [service worker is explicitly bypassed](#bypassing-the-service-worker).
The service worker either returns a cached response or sends the request to the server, depending on the state and configuration of the cache.
The service worker only caches responses to non-mutating requests, such as `GET` and `HEAD`.
If the service worker receives an error from the server or it doesn't receive a response, it returns an error status that indicates the result of the call.
For example, if the service worker doesn't receive a response, it creates a [504 Gateway Timeout](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) status to return. The `504` status in this example could be returned because the server is offline or the client is disconnected.
## Debugging the Angular service worker
Occasionally, it might be necessary to examine the Angular service worker in a running state to investigate issues or to ensure that it is operating as designed.
Occasionally, it might be necessary to examine the Angular service worker in a running state to investigate issues or whether it's operating as designed.
Browsers provide built-in tools for debugging service workers and the Angular service worker itself includes useful debugging features.
### Locating and analyzing debugging information
@@ -187,7 +197,7 @@ There are two possible degraded states:
| Degraded states | Details |
|:--- |:--- |
| `EXISTING_CLIENTS_ONLY` | The service worker does not have a clean copy of the latest known version of the application. Older cached versions are safe to use, so existing tabs continue to run from cache, but new loads of the application will be served from the network. The service worker will try to recover from this state when a new version of the application is detected and installed \(that is, when a new `ngsw.json` is available\). |
| `EXISTING_CLIENTS_ONLY` | The service worker does not have a clean copy of the latest known version of the application. Older cached versions are safe to use, so existing tabs continue to run from cache, but new loads of the application will be served from the network. The service worker will try to recover from this state when a new version of the application is detected and installed. This happens when a new `ngsw.json` is available. |
| `SAFE_MODE` | The service worker cannot guarantee the safety of using cached data. Either an unexpected error occurred or all cached versions are invalid. All traffic will be served from the network, running as little service worker code as possible. |
In both cases, the parenthetical annotation provides the
@@ -269,9 +279,9 @@ Debug log:
</code-example>
Errors that occur within the service worker will be logged here.
Errors that occur within the service worker are logged here.
### Developer Tools
### Developer tools
Browsers such as Chrome provide developer tools for interacting with service workers.
Such tools can be powerful when used properly, but there are a few things to keep in mind.
@@ -282,23 +292,28 @@ Such tools can be powerful when used properly, but there are a few things to kee
* If you look in the Cache Storage viewer, the cache is frequently out of date.
Right click the Cache Storage title and refresh the caches.
* Stopping and starting the service worker in the Service Worker pane triggers a check for updates
* Stopping and starting the service worker in the Service Worker pane checks for updates
## Service Worker Safety
## Service worker safety
Like any complex system, bugs or broken configurations can cause the Angular service worker to act in unforeseen ways.
While its design attempts to minimize the impact of such problems, the Angular service worker contains several failsafe mechanisms in case an administrator ever needs to deactivate the service worker quickly.
Bugs or broken configurations could cause the Angular service worker to act in unexpected ways.
If this happens, the Angular service worker contains several failsafe mechanisms in case an administrator needs to deactivate the service worker quickly.
### Fail-safe
To deactivate the service worker, remove or rename the `ngsw.json` file.
When the service worker's request for `ngsw.json` returns a `404`, then the service worker removes all of its caches and de-registers itself, essentially self-destructing.
To deactivate the service worker, rename the `ngsw.json` file or delete it.
When the service worker's request for `ngsw.json` returns a `404`, then the service worker removes all its caches and de-registers itself, essentially self-destructing.
### Safety Worker
### Safety worker
Also included in the `@angular/service-worker` NPM package is a small script `safety-worker.js`, which when loaded will unregister itself from the browser and remove the service worker caches.
<!-- vale Angular.Google_Acronyms = NO -->
A small script, `safety-worker.js`, is also included in the `@angular/service-worker` NPM package.
When loaded, it un-registers itself from the browser and removes the service worker caches.
This script can be used as a last resort to get rid of unwanted service workers already installed on client pages.
<!-- vale Angular.Google_Acronyms = YES -->
<div class="alert is-important">
**IMPORTANT**: <br />
@@ -306,11 +321,11 @@ You cannot register this worker directly, as old clients with cached state might
</div>
Instead, you must serve the contents of `safety-worker.js` at the URL of the Service Worker script you are trying to unregister, and must continue to do so until you are certain all users have successfully unregistered the old worker.
Instead, you must serve the contents of `safety-worker.js` at the URL of the Service Worker script you are trying to unregister. You must continue to do so until you are certain all users have successfully unregistered the old worker.
For most sites, this means that you should serve the safety worker at the old Service Worker URL forever.
This script can be used both to deactivate `@angular/service-worker` \(and remove the corresponding caches\) as well as any other Service Workers which might have been served in the past on your site.
This script can be used to deactivate `@angular/service-worker` and remove the corresponding caches. It also removes any other Service Workers which might have been served in the past on your site.
### Changing your app's location
### Changing your application's location
<div class="alert is-important">
@@ -321,11 +336,11 @@ You might have already encountered the error `The script resource is behind a re
</div>
This can be a problem if you have to change your application's location.
If you setup a redirect from the old location \(for example `example.com`\) to the new location \(for example `www.example.com`\) the worker will stop working.
If you setup a redirect from the old location, such as `example.com`, to the new location, `www.example.com` in this example, the worker stops working.
Also, the redirect won't even trigger for users who are loading the site entirely from Service Worker.
The old worker \(registered at `example.com`\) tries to update and sends requests to the old location `example.com` which get redirected to the new location `www.example.com` and create the error `The script resource is behind a redirect, which is disallowed`.
The old worker, which was registered at `example.com`, tries to update and sends a request to the old location `example.com`. This request is redirected to the new location `www.example.com` and creates the error: `The script resource is behind a redirect, which is disallowed`.
To remedy this, you might need to deactivate the old worker using one of the above techniques \([Fail-safe](#fail-safe) or [Safety Worker](#safety-worker)\).
To remedy this, you might need to deactivate the old worker using one of the preceding techniques: [Fail-safe](#fail-safe) or [Safety Worker](#safety-worker).
## More on Angular service workers
+1 -1
View File
@@ -2,7 +2,7 @@
This guide is about structural directives and provides conceptual information on how such directives work, how Angular interprets their shorthand syntax, and how to add template guard properties to catch template type errors.
Structural directives are directives which change the DOM layout by adding and removing DOM element.
Structural directives are directives which change the DOM layout by adding and removing DOM elements.
Angular provides a set of built-in structural directives (such as `NgIf`, `NgForOf`, `NgSwitch` and others) which are commonly used in all Angular projects. For more information see [Built-in directives](guide/built-in-directives).
+6 -6
View File
@@ -7,12 +7,12 @@ Debug specs in the browser in the same way that you debug an application.
1. Reveal the Karma browser window.
See [Set up testing](guide/testing#set-up-testing) if you need help with this step.
1. Click the **DEBUG** button; it opens a new browser tab and re-runs the tests.
1. Open the browser's "Developer Tools" \(`Ctrl-Shift-I` on Windows; `Command-Option-I` in macOS\).
1. Pick the "sources" section.
1. Open the `1st.spec.ts` test file \(Control/Command-P, then start typing the name of the file\).
1. Set a breakpoint in the test.
1. Refresh the browser, and it stops at the breakpoint.
1. Click the **DEBUG** button to open a new browser tab and re-run the tests.
2. Open the browser's **Developer Tools**. On Windows, press `Ctrl-Shift-I`. On macOS, press `Command-Option-I`.
3. Pick the **Sources** section.
4. Press `Control/Command-P`, and then start typing the name of your test file to open it.
5. Set a breakpoint in the test.
6. Refresh the browser, and notice how it stops at the breakpoint.
<div class="lightbox">
@@ -7,7 +7,7 @@ To adequately test a component, you should test that they work together as inten
Such tests require creating the component's host element in the browser DOM, as Angular does, and investigating the component class's interaction with the DOM as described by its template.
The Angular `TestBed` facilitates this kind of testing as you'll see in the following sections.
But in many cases, *testing the component class alone*, without DOM involvement, can validate much of the component's behavior in an straightforward, more obvious way.
But in many cases, *testing the component class alone*, without DOM involvement, can validate much of the component's behavior in a straightforward, more obvious way.
<div class="alert is-helpful">
+1 -1
View File
@@ -72,7 +72,7 @@ email.reset();
console.log(email.value); // null
```
TypeScript will enforce that you always handle the possibility that the control has become `null`. If you want to make this control non-nullable, you may use the `nonNullable` option. This will cause the control to reset to its intial value, instead of `null`:
TypeScript will enforce that you always handle the possibility that the control has become `null`. If you want to make this control non-nullable, you may use the `nonNullable` option. This will cause the control to reset to its initial value, instead of `null`:
```ts
const email = new FormControl('angularrox@gmail.com', {nonNullable: true});
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+9
View File
@@ -845,6 +845,15 @@
"twitter": "SiddAjmera",
"bio": "Siddharth is a Full Stack JavaScript Developer and a GDE in Angular. He's passionate about sharing his knowledge on Angular, Firebase and the Web in general. He's the organizer of WebStack, a local community of developers focused on Web, Mobile, Voice and Server related technologies in general. WebStack hosts free monthly meetups every 2nd or 3rd Saturday of the month. Siddharth is also an avid photographer and loves traveling. Find him anywhere on the Web with `SiddAjmera`.",
"groups": ["GDE"]
},
"simonaco": {
"name": "Simona Cotin",
"picture": "simonacotin.jpg",
"twitter": "simona_cotin",
"website": "https://github.com/simonaco",
"bio": "Engineering manager working on Angular Framework and Tooling",
"groups": ["Angular"],
"lead": "madleinas"
},
"simpulton": {
"name": "Lukas Ruebbelke",
+1 -1
View File
@@ -74,7 +74,7 @@ After the browser refreshes, the list of heroes appears.
<header>Interactive elements</header>
Inside the `<li>` element, add a `<button>` element to wrap the hero's details, and then make the hero clickable. To improve accessibility, use HTML elements that are inherently interactive instead of adding an event listeners to a non-interactive elements. In this case, the interactive `<button>` element is instead of adding an event to the `<li>` element.
Inside the `<li>` element, add a `<button>` element to wrap the hero's details, and then make the hero clickable. To improve accessibility, use HTML elements that are inherently interactive instead of adding an event listener to a non-interactive element. In this case, the interactive `<button>` element is used instead of adding an event to the `<li>` element.
For more details on accessibility, see [Accessibility in Angular](guide/accessibility).
+1
View File
@@ -75,6 +75,7 @@
{"type": 301, "source": "/getting-started", "destination": "/start"},
{"type": 301, "source": "/getting-started/:rest*", "destination": "/start/:rest*"},
{"type": 301, "source": "/guide/displaying-data", "destination": "/start#template-syntax"},
{"type": 301, "source": "/guide/ivy", "destination": "https://v12.angular.io/guide/ivy"},
{"type": 301, "source": "/guide/updating-to-version-10", "destination": "https://v10.angular.io/guide/updating-to-version-10"},
{"type": 301, "source": "/guide/updating-to-version-11", "destination": "https://v11.angular.io/guide/updating-to-version-11"},
{"type": 301, "source": "/guide/updating-to-version-12", "destination": "/guide/update-to-latest-version"},
+3 -3
View File
@@ -105,7 +105,7 @@
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/architect-cli": "0.1401.0-next.4",
"@angular-devkit/architect-cli": "0.1401.0-rc.3",
"@angular-devkit/build-angular": "^14.1.0-next",
"@angular-eslint/builder": "^14.0.0",
"@angular-eslint/eslint-plugin": "^14.0.0",
@@ -119,8 +119,8 @@
"@types/node": "^12.7.9",
"@types/trusted-types": "^2.0.2",
"@types/xregexp": "^4.3.0",
"@typescript-eslint/eslint-plugin": "5.30.6",
"@typescript-eslint/parser": "5.30.6",
"@typescript-eslint/eslint-plugin": "5.32.0",
"@typescript-eslint/parser": "5.32.0",
"@yarnpkg/lockfile": "^1.1.0",
"archiver": "^5.3.0",
"assert": "^2.0.0",
@@ -205,6 +205,7 @@
/guide/displaying-data --> /start#template-syntax
/guide/i18n --> /guide/i18n-overview
/guide --> /docs
/guide/ivy --> https://v12.angular.io/guide/ivy
/guide/learning-angular --> /start
/guide/learning-angular.html --> /start
/guide/metadata --> /guide/aot-compiler
+304
View File
@@ -0,0 +1,304 @@
# Angular documentation lint tool
The files in this directory support the [Vale][ValeMain] documentation lint tool for use while you edit [angular.io][AioMain] documentation files.
*Linting* is an automated process that lint tools, or *linters*, perform to identify stylistic errors in program source code.
Vale is a lint tool that performs a similar analysis of documentation source code.
For more information about lint tools, linting, and their history, see [*Lint* in Wikipedia][WikipediaWikiLintSoftware].
## Use Vale to lint your documentation
[Vale][ValeMain] is an open source, command-line tool that reviews writing style and phrases in your documentation.
You can add it to your integrated development environment \(IDE\) or code editor to test your documentation edits before you submit your pull request.
Using it can help improve the documentation's readability and the consistency of terminology and voice across a range of topics and contributors.
The lint tool is helpful and has been tailored to the Angular documentation style guide.
Unfortunately, it is not as powerful as the grammar and spelling features you find in contemporary document editors.
While Vale helps, it doesn't replace the reviewers that you're currently using to help you write great documentation.
**To use Vale in your documentation:**
1. [Install Vale][AioToolsDocLinterReadmeInstallValeInYourVsCodeIde] in your Visual Studio Code IDE.
To install and use Vale in a different IDE, see [Installation][ValeDocsValeCliInstallation].
2. Fix the problems that Vale identifies in your IDE.
Log any problem you encounter with the documentation linter as a [new docs issue][GithubAngularAngularIssuesNewAssigneesLabelsTemplate3DocsBugYaml] in the repo.
Be sure to specify that this is a linter issue in your description.
## Fix documentation problems identified by Vale
Vale evaluates a markdown \(`.md`\) file when you open it in the IDE and each time you save it. Vale does not review your document as you make changes in it.
When Vale identifies a problem, it can take a simple word substitution or rewriting several sentences or paragraphs to fix it.
Sometimes, you might need to take a step back from the text and consider other alternatives.
To find the best way to fix a problem that Vale identified, think of your reader, be flexible, and keep an open mind.
The documentation should be understood by a range of readers, some of whom might not have much experience with Angular or even web development.
> **Note**
> Remember that when a developer is reading documentation, they are often doing so while thinking about other things, such as coding their Angular application.
> Keeping the docs easy to read, helps developers concentrate on their coding.
These are some tips to help you resolve the issues that the lint tool identifies and to help you make your docs easier to read.
### Refer to the style guides
The lint tool tests against the styles found in these style guides.
Most style tests include links to relevant sections in these documents for more information.
* [Angular documentation style guide][AioGuideDocsStyleGuide]
* [Google Developer Documentation Style Guide][GoogleDevelopersStyle]
> **Note**
> Not every style mentioned in the style guides has a test.
> Style guides and the style tests can change.
### Split up long sentences
Generally, shorter sentences are easier to read than longer ones.
Long sentences can occur when you try to say too much at once.
Long sentences, as well as the use of parentheses, semi-colons, or words identified as *too-wordy*, generally require rethinking and rewriting.
Consider restructuring a long sentence to break its individual ideas into distinct sentences or bullet points.
### Use lists and tables
Sentences that contain comma-separated lists might be clearer if presented as a bulleted-list or table.
Consider changing a comma-separated list of items in a sentence to a list of bullets to make those list items easier to read.
### Use more common words
Shorter, more common words are generally easier to read than longer ones.
This does not mean you need to write down to the audience. Technical docs should still be precise.
Angular docs are read by many people around the world and should use language that the most people can understand.
If you think a specific term is required even though it is been flagged as uncommon, try to include a short explanation of the term.
Also, try adding some context around its first mention.
Linking a term to another section or definition is also an option, but consider the disruption that causes to the reader before you use it.
If you force a reader to go to another page for a definition, they might lose their concentration on the current topic and their primary goal.
### Use fewer words
If you can remove a word and not lose the meaning of the sentence, leave it out.
One common place where removing words can help is in a list of examples with more than two or three items.
Before you place the items in a bullet list, consider if only one of the items can convey the desired meaning.
Another option might be to replace a list of items with a single term that describes all the elements in your list.
### If all else fails
The style rules generally guide you in the direction of clearer content, but sometimes you might need to break the rules.
If you decide that the best choice for the text conflicts with the linter, mark the text as an exception to linting.
If you use these exceptions, please limit the amount of text that you exclude from analysis to the fewest lines possible.
When necessary, you can apply these exceptions to your content.
1. **General exception**
A *general exception* allows you to exclude the specified text from all lint testing.
To apply a general exception, surround the text that you do not want the linter to test with the HTML
`comment` elements shown in this example.
```markdown
<!-- vale off -->
Text the linter does not check for any style problem.
<!-- vale on -->
```
Be sure to leave a blank line before and after each comment.
2. **Style exception**
A *style exception* allows you to exclude text from an individual style test.
To apply a style exception, surround the text that you do not want the linter to test with these HTML
`comment` elements. Between these comments, the linter ignores the style test in the comment, but
still tests for all other styles that are in use.
```markdown
<!-- vale Style.Rule = NO -->
<!-- vale Style.Rule = YES -->
```
Replace `Style.Rule` in the comments with the style and rule from the problem message displayed in the IDE.
For example, imagine that you got this problem message and you want to use the word it identified as a problem.
```markdown
Did you really mean 'inlines'? It was not found in our dictionary. Vale(Angular.Angular_Spelling) [Ln 24, Col 59]
```
The `Style.Rule` for this message is the text inside the parentheses: `Angular.Angular_Spelling` in this case.
To turn off that style test, use the comments shown in this example.
```markdown
<!-- vale Angular.Angular_Spelling = NO -->
'inlines' does not display a problem because the linter does not spell check this text.
Remember that the linter does not catch any other spelling errors in this block of text.
The linter continues to test all other style rules.
<!-- vale Angular.Angular_Spelling = YES -->
```
## Install Vale on your development system
Complete these procedures to install the Vale documentation linter on your development system.
Vale can be installed on Windows, macOS, and Linux, and it can be integrated into many IDEs.
The instructions for installing it into Visual Studio Code on Windows and macOS are summarized here.
For more information, or to install Vale in another IDE or on another operating system, see [Vale installation documentation][ValeDocsValeCliInstallation].
### Prerequisites
Before you proceed, make sure that:
1. You have cloned the [`angular/angular` repo][GithubAngularAngular] on your system. You can work in a fork of the `angular/angular` repo,
but it's easier if your Vale installation uses an up-to-date clone of the `angular/angular` repo.
2. You have a development or writing environment for `angular.io` in the `angular/angular` repo and you can build the `angular.io` docs.
For information about how to create the authoring environment for `angular.io`, see [Angular documentation project][GithubAngularAngularTreeMainAioAngularDocumentationProjectHttpsangulario].
3. You have the required package manager installed on your system. If not, install it before continuing.
* [homebrew][BrewMain] on your macOS system.
* [chocolatey][Chocolatey] on your Windows system.
### Install the Vale command-line tool
Open the following tools on your development system.
1. Open a command-line tool:
* `terminal` on macOS, for example
* `Windows PowerShell` on Windows
2. Open Visual Studio Code.
Follow the instructions for the OS on your development system.
To install Vale on a different OS, see [Installation][ValeDocsValeCliInstallation].
#### Install Vale on macOS
In your command-line tool:
<!-- vale Angular.WriteGood_Illusions = NO -->
<!-- vale Angular.Angular_CliReference = NO -->
1. Run `brew install vale` to install Vale.
2. Get the path to the `vale` application to use as the value of the **Vale > Vale CLI : Path** setting.
1. In the command-line tool, run `which vale`.
Save the returned path for use in the next procedure.
2. If this command does not return a path, restart macOS and repeat this step.
3. Get the path to the configuration file, `vale.ini`, to use in the **Vale > Vale CLI : Config** setting.
1. In the command-line tool, navigate to your `git` working directory with the `angular/angular` repo.
2. Run `git pull` to update the repo.
3. In your clone of the `angular/angular` repo, navigate to the `aio/tools/doc-linter` directory.
4. In the `aio/tools/doc-linter` directory, confirm that you have the `vale.ini` file.
5. Run `pwd` to get the full path to `vale.ini` to use in the next procedure.
<!-- vale Angular.Angular_CliReference = YES -->
<!-- vale Angular.WriteGood_Illusions = YES -->
#### Install Vale on Windows
In your command-line tool:
<!-- vale Angular.WriteGood_Illusions = NO -->
<!-- vale Angular.Angular_CliReference = NO -->
1. Run `choco install vale` to install Vale.
2. Get the path to the `vale` application to use as the value of the **Vale > Vale CLI : Path** setting.
1. In the command-line tool, run `where vale.exe`.
Save the returned path for use in the next procedure.
2. If this command does not return a path, restart Windows and repeat this step.
3. Get the path to the configuration file, `vale.ini`, to use in the **Vale > Vale CLI : Config** setting.
1. In the command-line tool, navigate to your `git` working directory with the `angular/angular` repo.
2. Run `git pull` to update the repo.
3. In your clone of the `angular/angular` repo, navigate to the `aio\tools\doc-linter` directory.
4. In the `aio\tools\doc-linter` directory, confirm that you have the `vale.ini` file.
5. Run `cd` to get the full path to `vale.ini` to use in the next procedure.
<!-- vale Angular.Angular_CliReference = YES -->
<!-- vale Angular.WriteGood_Illusions = YES -->
### Install the Vale extension for Visual Studio Code
This procedure is the same for macOS and Windows.
To install Vale in a different IDE, see [Installation][ValeDocsValeCliInstallation].
<!-- vale Angular.WriteGood_Illusions = NO -->
<!-- vale Angular.Angular_CliReference = NO -->
**To install and configure the Visual Studio Code Vale extension:**
1. In Visual Studio Code, go to the **Extensions** pane.
2. In the Visual Studio Code **Extensions** pane:
1. In the search box, enter `Vale`.
2. In the Vale extension entry, choose, **Install**.
3. Access the settings in Visual Studio Code for the Vale extension.
* On macOS, in the **Code** menu, choose **Preferences**, and then choose **Settings**.
* On Windows, in the **File** menu, choose **Preferences**, and then choose **Settings**.
4. In the **User** settings, navigate to **Extensions > Vale**.
5. Update the Vale extension settings as shown.
* **Vale > Core : Use CLI**, checked.
* **Vale > Server : Lint Context**, `0`.
* **Vale > Server : Provide Fixes**, unchecked.
* **Vale > Server : Server URL**, leave empty.
* **Vale > Vale CLI : Config**, enter the full path to `vale.ini` from the preceding procedure and append the `vale.ini` filename.
* **Vale > Vale CLI : Min Alert Level**, choose `inherited` or `suggestion`.
* **Vale > Vale CLI : Path**, enter the full path of the `vale` application that `which vale` or `where vale.exe` returned in a preceding step.
6. Restart Visual Studio Code to apply the new settings.
<!-- vale Angular.Angular_CliReference = YES -->
<!-- vale Angular.WriteGood_Illusions = YES -->
## Update the Vale command-line tool
* To update Vale on macOS to the latest version, in your command-line tool, run `brew upgrade vale`.
* To update Vale on Windows to the latest version, in a PowerShell window, run `choco update vale`.
## Update the Vale style tests
The style tests are stored in your local clone of the [`angular/angular` repo][GithubAngularAngular] and
are updated automatically when you pull the latest code to your system.
If you're using another branch or fork of the `angular/angular` repo, be sure to also update that branch or fork.
<!-- links -->
[AioGuideDocsStyleGuide]: https://angular.io/guide/docs-style-guide "Angular documentation style guide | Angular"
[AioMain]: https://angular.io "Angular"
[AioToolsDocLinterReadmeInstallValeInYourVsCodeIde]: #install-vale-on-your-development-system "Install Vale | "
<!-- external links -->
[BrewMain]: https://brew.sh "homebrew"
[Chocolatey]: https://chocolatey.org/ "Chocolatey"
[GithubAngularAngular]: https://github.com/angular/angular "angular/angular | GitHub"
[GithubAngularAngularIssuesNewAssigneesLabelsTemplate3DocsBugYaml]: https://github.com/angular/angular/issues/new?assignees=&labels=&template=3-docs-bug.yaml "Issue: Docs or angular.io Bug Report | angular/angular | GitHub"
[GithubAngularAngularTreeMainAioAngularDocumentationProjectHttpsangulario]: https://github.com/angular/angular/tree/main/aio#angular-documentation-project-httpsangulario "Angular documentation project [AioMain] | angular/angular/aio | GitHub"
[GoogleDevelopersStyle]: https://developers.google.com/style "About this guide | Google developer documentation style guide | Google Developers"
[ValeDocsValeCliInstallation]: https://vale.sh/docs/vale-cli/installation "Installation | Vale.sh"
[ValeMain]: https://vale.sh "Vale.sh"
[WikipediaWikiLintSoftware]: https://en.wikipedia.org/wiki/Lint_%28software%29 "Lint (software) | Wikipedia"
<!-- end links -->
<!-- @reviewed 2022-07-15 -->
@@ -0,0 +1,205 @@
SET UTF-8
TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ'
ICONV 1
ICONV ’ '
NOSUGGEST !
# ordinal numbers
COMPOUNDMIN 1
# only in compounds: 1th, 2th, 3th
ONLYINCOMPOUND c
# compound rules:
# 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.)
# 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.)
COMPOUNDRULE 2
COMPOUNDRULE n*1t
COMPOUNDRULE n*mp
WORDCHARS 0123456789
PFX A Y 1
PFX A 0 re .
PFX I Y 1
PFX I 0 in .
PFX U Y 1
PFX U 0 un .
PFX C Y 1
PFX C 0 de .
PFX E Y 1
PFX E 0 dis .
PFX F Y 1
PFX F 0 con .
PFX K Y 1
PFX K 0 pro .
SFX V N 2
SFX V e ive e
SFX V 0 ive [^e]
SFX N Y 3
SFX N e ion e
SFX N y ication y
SFX N 0 en [^ey]
SFX X Y 3
SFX X e ions e
SFX X y ications y
SFX X 0 ens [^ey]
SFX H N 2
SFX H y ieth y
SFX H 0 th [^y]
SFX Y Y 1
SFX Y 0 ly .
SFX G Y 2
SFX G e ing e
SFX G 0 ing [^e]
SFX J Y 2
SFX J e ings e
SFX J 0 ings [^e]
SFX D Y 4
SFX D 0 d e
SFX D y ied [^aeiou]y
SFX D 0 ed [^ey]
SFX D 0 ed [aeiou]y
SFX T N 4
SFX T 0 st [eg]
SFX T y iest [^aeiou]y
SFX T 0 est [aeiou]y
SFX T 0 est [^ey]
SFX R Y 4
SFX R 0 r e
SFX R y ier [^aeiou]y
SFX R 0 er [aeiou]y
SFX R 0 er [^ey]
SFX Z Y 4
SFX Z 0 rs e
SFX Z y iers [^aeiou]y
SFX Z 0 ers [aeiou]y
SFX Z 0 ers [^ey]
SFX S Y 4
SFX S y ies [^aeiou]y
SFX S 0 s [aeiou]y
SFX S 0 es [sxzh]
SFX S 0 s [^sxzhy]
SFX P Y 3
SFX P y iness [^aeiou]y
SFX P 0 ness [aeiou]y
SFX P 0 ness [^y]
SFX M Y 1
SFX M 0 's .
SFX B Y 3
SFX B 0 able [^aeiou]
SFX B 0 able ee
SFX B e able [^aeiou]e
SFX L Y 1
SFX L 0 ment .
REP 90
REP a ei
REP ei a
REP a ey
REP ey a
REP ai ie
REP ie ai
REP alot a_lot
REP are air
REP are ear
REP are eir
REP air are
REP air ere
REP ere air
REP ere ear
REP ere eir
REP ear are
REP ear air
REP ear ere
REP eir are
REP eir ere
REP ch te
REP te ch
REP ch ti
REP ti ch
REP ch tu
REP tu ch
REP ch s
REP s ch
REP ch k
REP k ch
REP f ph
REP ph f
REP gh f
REP f gh
REP i igh
REP igh i
REP i uy
REP uy i
REP i ee
REP ee i
REP j di
REP di j
REP j gg
REP gg j
REP j ge
REP ge j
REP s ti
REP ti s
REP s ci
REP ci s
REP k cc
REP cc k
REP k qu
REP qu k
REP kw qu
REP o eau
REP eau o
REP o ew
REP ew o
REP oo ew
REP ew oo
REP ew ui
REP ui ew
REP oo ui
REP ui oo
REP ew u
REP u ew
REP oo u
REP u oo
REP u oe
REP oe u
REP u ieu
REP ieu u
REP ue ew
REP ew ue
REP uff ough
REP oo ieu
REP ieu oo
REP ier ear
REP ear ier
REP ear air
REP air ear
REP w qu
REP qu w
REP z ss
REP ss z
REP shun tion
REP shun sion
REP shun cion
REP size cise
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
# tests for <img> elements without alt attribute
extends: existence
message: '<img> elements need the alt attribute to be the first attribute.'
link: https://angular.io/guide/docs-style-guide#images
level: error
scope: raw
raw:
- '<img (?!alt=)[^\>]+>'
@@ -0,0 +1,8 @@
# tests for blank lines after an HTML tag or tag group
extends: existence
message: 'HTML in the Markdown should be followed by a blank line.'
link: https://angular.io/guide/docs-style-guide#markdown-and-html
level: error
scope: raw
raw:
- '[\r\n]\<.+\>[\r\n](?!(\s*[\r\n\<]))'
@@ -0,0 +1,8 @@
# tests for blank lines before an HTML tag or tag group
extends: existence
message: 'HTML in the Markdown should be preceded by a blank line.'
link: https://angular.io/guide/docs-style-guide#markdown-and-html
level: error
scope: raw
raw:
- '(?<![\r\n\>])[\r\n]\<.+\>[\r\n]'
@@ -0,0 +1,8 @@
# code and CLI references that should be marked as code
extends: existence
message: 'Clarify if this refers to a specific CLI, a specific ng command, or a command-line tool.'
link: 'https://angular.io/guide/glossary#command-line-interface-cli'
ignorecase: false
level: warning
tokens:
- '((?<!Angular )CLI(?! [B|b]uilder))'
@@ -0,0 +1,8 @@
# tests for strings qualified by back-ticks are surrounded by spaces or punctuation
extends: existence
message: 'The code term should be followed by a space or punctuation.'
link: https://angular.io/guide/docs-style-guide#when-to-use-code-font
level: error
scope: raw
tokens:
- '\s\x60[^\x60]+\x60[^ .;\n\r]'
@@ -0,0 +1,8 @@
# code and CLI references that should be marked as code
extends: existence
message: "If '%s' is a code reference, make sure it's marked correctly."
link: 'https://developers.google.com/style/code-in-text'
scope: sentence
ignorecase: false
level: suggestion
tokens: (ng [a-z]+)
@@ -0,0 +1,17 @@
# Inclusuve language tested by Angular CI/CD
# tests for strings that must be replaced before the content is published
extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/word-list'
level: error
ignorecase: true
action:
name: replace
swap:
master: primary|main|leader|active|writer
slave: secondary|node|worker|replica|passive
'white[\s_-]*list': include list|allow list
'black[\s_-]*list': exclude list|deny list
grandfathered: legacied|exempted
'sanity[\s_-]*check': confidence check
'man[\s_-]*hours': person-hours|human-hours
@@ -0,0 +1,11 @@
# tests for NOTE strings that are not bolded
extends: existence
message: 'Alert heading must be bold.'
link: https://angular.io/guide/docs-style-guide#alerts-and-callouts
level: error
ignorecase: false
scope: raw
raw:
- (?<!\*\*)NOTE[^\*]*(?!\*\*)
- (?<!\*\*)TIP[^\*]*(?!\*\*)
- (?<!\*\*)IMPORTANT[^\*]*(?!\*\*)
@@ -0,0 +1,7 @@
extends: occurrence
message: 'Try to keep your sentences shorter than 26 words. Shorter sentences tend to be easier to read.'
link: https://developers.google.com/style/accessibility#ease-of-reading
level: suggestion
scope: sentence
max: 26
token: '[\w-]+'
@@ -0,0 +1,11 @@
# Uses the built-in dictionary and filters.
extends: spelling
dicpath: ../../dictionaries/en_us/
message: "Did you really mean '%s'? It wasn't found in our dictionary."
level: warning
ignore:
- Vocab/Angular.txt # Angular terms
- Vocab/Foreign.txt # Foreign language words used in the text
- Vocab/Jargon.txt # Computer jargon
- Vocab/Names.txt # Names of people, products, and things
- Vocab/Web.txt # Web terms
@@ -0,0 +1,8 @@
# tests for TODO in HTML comments in the markdown
extends: existence
message: 'ToDo comments make the docs look unfinished. Consider removing them before you publish.'
link: https://angular.io/guide/docs-style-guide#when-to-use-code-font
level: suggestion
scope: raw
raw:
- '\<\!\-\-[\s]*[Tt][Oo][Dd][Oo][^>]*\-\-\>'
@@ -0,0 +1,9 @@
# tests for TODO in text when NOT used in a sentence
extends: existence
message: 'Remove %s before publishing.'
link: https://angular.io/guide/docs-style-guide#when-to-use-code-font
level: error
ignorecase: true
scope: sentence
raw:
- (?<!\s)[Tt][Oo][Dd][Oo](?!\s)
@@ -0,0 +1,10 @@
# adapted from Google style library
extends: existence
message: "Use 'AM' or 'PM' and precede it with a space."
link: 'https://developers.google.com/style/word-list'
level: error
nonword: true
tokens:
- '\d{1,2}[AP]M'
- '\d{1,2} ?[ap]m'
- '\d{1,2} ?[aApP]\.[mM]\.'
@@ -0,0 +1,66 @@
# adapted from Google style library
extends: conditional
message: "Spell out '%s', if it's unfamiliar to the audience."
link: 'https://developers.google.com/style/abbreviations'
level: suggestion
ignorecase: false
# Ensures that the existence of 'first' implies the existence of 'second'.
first: '\b([A-Z]{3,5})\b'
second: '(?:\b[A-Z][\w\- ]+ )+\(([A-Z]{3,5})\)'
# ... with the exception of these:
exceptions:
- API
- ASP
- CLI
- CPU
- CSS
- CSV
- DEBUG
- DOM
- DPI
- FAQ
- GCC
- GDB
- GET
- GPU
- GTK
- GUI
- HTML
- HTTP
- HTTPS
- IDE
- JAR
- JSON
- JSX
- LESS
- LLDB
- NET
- NOTE
- NVDA
- OSS
- PATH
- PDF
- PHP
- POST
- RAM
- REPL
- RSA
- SCM
- SCSS
- SDK
- SQL
- SSH
- SSL
- SVG
- TBD
- TCP
- TIP
- TODO
- URI
- URL
- USB
- UTF
- XML
- XSS
- YAML
- ZIP
@@ -0,0 +1,11 @@
# adapted from Google style library
# tests that the word following a colon is sentenced cased
# unless it appears to be an abbreviation
extends: existence
message: "'%s' should be in lowercase."
link: 'https://developers.google.com/style/colons'
nonword: true
level: warning
scope: sentence
tokens:
- ':\s[A-Z][a-z][a-z]'
@@ -0,0 +1,27 @@
# adapted from Google style library
extends: substitution
message: "You can use '%s' instead of '%s'."
link: 'https://developers.google.com/style/contractions'
level: suggestion
ignorecase: true
action:
name: replace
swap:
are not: aren't
cannot: can't
could not: couldn't
did not: didn't
do not: don't
does not: doesn't
has not: hasn't
have not: haven't
how is: how's
is not: isn't
should not: shouldn't
that is: that's
was not: wasn't
we have: we've
what is: what's
when is: when's
where is: where's
will not: won't
@@ -0,0 +1,10 @@
# adapted from Google style library
extends: existence
message: "Use 'July 31, 2016' format, not '%s'."
link: 'https://developers.google.com/style/dates-times'
ignorecase: true
level: error
nonword: true
tokens:
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
- '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}'
@@ -0,0 +1,10 @@
# adapted from Google style library
extends: existence
message: 'In general, try not to use an ellipsis.'
link: 'https://developers.google.com/style/ellipses'
nonword: true
level: warning
action:
name: remove
tokens:
- '\.\.\.'
@@ -0,0 +1,13 @@
# adapted from Google style library
extends: existence
message: "Don't put a space before or after a dash."
link: 'https://developers.google.com/style/dashes'
nonword: true
level: error
action:
name: edit
params:
- remove
- ' '
tokens:
- '\s[—–]\s'
@@ -0,0 +1,14 @@
# adapted from Google style library
extends: existence
message: "Use an em dash ('—') instead of '–'."
link: 'https://developers.google.com/style/dashes'
nonword: true
level: error
action:
name: edit
params:
- replace
- '-'
- '—'
tokens:
- '–'
@@ -0,0 +1,8 @@
# adapted from Google style library
extends: existence
message: "Don't use exclamation points in text."
link: 'https://developers.google.com/style/exclamation-points'
nonword: true
level: error
tokens:
- '\w!(?:\s|$)'
@@ -0,0 +1,14 @@
# adapted from Google style library
extends: existence
message: "Reword this to avoid first-person pronouns such as '%s'."
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
ignorecase: true
level: warning
nonword: true
tokens:
- (?:^|\s)I\s
- (?:^|\s)I,\s
- \bI'm\b
- \bme\b
- \bmy\b
- \bmine\b
@@ -0,0 +1,10 @@
# adapted from Google style library
extends: existence
message: "Use 'they' as a gender-neutral substitute for '%s'."
link: 'https://developers.google.com/style/pronouns#gender-neutral-pronouns'
level: error
ignorecase: true
tokens:
- he/she
- s/he
- \(s\)he
@@ -0,0 +1,46 @@
# adapted from Google style library
extends: substitution
message: "Use '%s' instead of '%s' if possible."
link: 'https://developers.google.com/style/inclusive-documentation'
ignorecase: true
level: error
swap:
(?:alumna|alumnus): graduate
(?:alumnae|alumni): graduates
air(?:m[ae]n|wom[ae]n): pilot(s)
anchor(?:m[ae]n|wom[ae]n): anchor(s)
authoress: author
camera(?:m[ae]n|wom[ae]n): camera operator(s)
chair(?:m[ae]n|wom[ae]n): chair(s)
congress(?:m[ae]n|wom[ae]n): member(s) of congress
door(?:m[ae]|wom[ae]n): concierge(s)
draft(?:m[ae]n|wom[ae]n): drafter(s)
fire(?:m[ae]n|wom[ae]n): firefighter(s)
fisher(?:m[ae]n|wom[ae]n): fisher(s)
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
lady lawyer: lawyer
ladylike: courteous
landlord: building manager
mail(?:m[ae]n|wom[ae]n): mail carriers
man and wife: husband and wife
man enough: strong enough
mankind: human kind
manmade: manufactured
manpower: personnel
men and girls: men and women
middle(?:m[ae]n|wom[ae]n): intermediary
news(?:m[ae]n|wom[ae]n): journalist(s)
ombuds(?:man|woman): ombuds
oneupmanship: upstaging
poetess: poet
police(?:m[ae]n|wom[ae]n): police officer(s)
repair(?:m[ae]n|wom[ae]n): technician(s)
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
service(?:m[ae]n|wom[ae]n): soldier(s)
steward(?:ess)?: flight attendant
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
waitress: waiter
woman doctor: doctor
woman scientist[s]?: scientist(s)
work(?:m[ae]n|wom[ae]n): worker(s)
@@ -0,0 +1,14 @@
# adapted from Google style library
extends: existence
message: "You don't need to put a period at the end of a heading."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
nonword: true
level: error
scope: heading
action:
name: edit
params:
- remove
- '.'
tokens:
- '[a-z0-9][.]\s*$'
@@ -0,0 +1,55 @@
# adapted from Google style library
# Tests for sentence capitalization in heading strings
extends: capitalization
message: "'%s' should use sentence-style capitalization and mark program references as code."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
level: warning
scope: heading
match: $sentence
indicators:
- ':'
exceptions:
- Angular
- AngularJS
- API
- APIs
- Architect
- Azure
- CLI
- Code
- Cosmos
- Docker
- ECMAScript
- Emmet
- ES
- French
- GitHub
- GitHub Pages
- gRPC
- I
- Ivy
- i18n
- JavaScript
- Kubernetes
- Linux
- l10n
- macOS
- Marketplace
- MongoDB
- NgModule
- NgModules
- Observable
- REPL
- RxJS
- Schematics
- Studio
- Tour of Heroes
- TypeScript
- TypeScript
- Universal
- URLs
- Vale
- View Engine
- Visual
- VS
- Windows
@@ -0,0 +1,12 @@
# adapted from Google style library
extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/abbreviations'
ignorecase: false
level: error
nonword: true
action:
name: replace
swap:
'\b(?:eg|e\.g\.)[\s,]': for example
'\b(?:ie|i\.e\.)[\s,]': that is
@@ -0,0 +1,15 @@
# adapted from Google style library
extends: existence
message: "'%s' doesn't need a hyphen."
link: 'https://developers.google.com/style/hyphens'
level: error
ignorecase: false
nonword: true
action:
name: edit
params:
- replace
- '-'
- ' '
tokens:
- '\s[^\s-]+ly-'
@@ -0,0 +1,13 @@
# adapted from Google style library
extends: existence
message: "Don't use an 's' in parentheses such as in '%s'. If it can be more than one, use the plural form without parentheses."
link: 'https://developers.google.com/style/plurals-parentheses'
level: error
nonword: true
action:
name: edit
params:
- remove
- '(s)'
tokens:
- '\b\w+\(s\)'
@@ -0,0 +1,8 @@
# adapted from Google style library
extends: existence
message: "Spell out all the ordinal numbers ('%s') in the text."
link: 'https://developers.google.com/style/numbers'
level: error
nonword: true
tokens:
- \d+(?:st|nd|rd|th)
@@ -0,0 +1,8 @@
# adapted from Google style library
extends: existence
message: "Use the Oxford comma in '%s'."
link: 'https://developers.google.com/style/commas'
scope: sentence
level: error
tokens:
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'
@@ -0,0 +1,12 @@
# adapted from Google style library
# test for parentheticals that don't contain all caps or
# a code referece to allow abbreviation definitions.
#
extends: existence
message: 'Use parentheses judiciously. Try to rewrite this sentence without them.'
link: 'https://developers.google.com/style/parentheses'
nonword: true
level: suggestion
scope: raw
raw:
- '\\\([^`\)]+(?<![A-Z])\\\)'
@@ -0,0 +1,8 @@
# adapted from Google style library
extends: existence
message: "Don't use periods in acronyms or initialisms such as '%s'."
link: 'https://developers.google.com/style/abbreviations'
level: error
nonword: true
tokens:
- '\b(?:[A-Z]\.){3,}'
@@ -0,0 +1,8 @@
# adapted from Google style library
extends: existence
message: 'Commas and periods go inside quotation marks. UI text should be bold and data entered by a user should be monospace.'
link: 'https://developers.google.com/style/quotation-marks'
level: error
nonword: true
tokens:
- '"[^"]+"[.,?]'
@@ -0,0 +1,8 @@
# adapted from Google style library
extends: existence
message: "Don't add words such as 'from' or 'between' to describe a range of numbers."
link: 'https://developers.google.com/style/hyphens'
nonword: true
level: warning
tokens:
- '(?:from|between)\s\d+\s?-\s?\d+'
@@ -0,0 +1,10 @@
# adapted from Google style library
# note the complex regex for this is used to ignore HTML entities to find semicolons in normal text
extends: existence
message: 'Semicolons can indicate a complex sentence. Try rewriting this sentence as multiple sentences.'
link: 'https://developers.google.com/style/semicolons'
code: false
nonword: true
level: warning
raw:
- '[^A-Za-z&]((?!\&\w)([\S]+\;))'
@@ -0,0 +1,12 @@
# adapted from Google style library
extends: existence
message: "Don't use internet slang abbreviations such as '%s'."
link: 'https://developers.google.com/style/abbreviations'
ignorecase: true
level: error
tokens:
- 'tl;dr'
- ymmv
- rtfm
- imo
- fwiw
@@ -0,0 +1,9 @@
# adapted from Google style library
extends: existence
message: "'%s' should have one space."
link: 'https://developers.google.com/style/sentence-spacing'
level: error
nonword: true
tokens:
- '[a-z][.?!] {2,}[A-Z]'
- '[a-z][.?!][A-Z]'
@@ -0,0 +1,9 @@
# adapted from Google style library
extends: existence
message: "In general, use the American spelling instead of '%s'."
link: 'https://developers.google.com/style/spelling'
ignorecase: true
level: warning
tokens:
- '(?:\w+)nised?'
- '(?:\w+)logue'
@@ -0,0 +1,13 @@
# adapted from Google style library
extends: occurrence
message: 'Only one title is allowed per topic'
link: https://angular.io/guide/docs-style-guide#title
level: error
# Here, we're counting the number of times a comma appears
# in a sentence.
#
# If it occurs more than 3 times, we'll flag it.
scope: raw
ignorecase: false
max: 1
token: '^# '
@@ -0,0 +1,10 @@
# copied from Google style library
# tests for correct format of numbers followed by units
extends: existence
message: "If '%s' is not code, put a nonbreaking space between the number and the unit."
link: 'https://developers.google.com/style/units-of-measure'
nonword: true
level: error
tokens:
- \d+(?:B|kB|MB|GB|TB)
- \d+(?:ns|ms|s|min|h|d)
@@ -0,0 +1,12 @@
# adapted from Google style library
extends: existence
message: "Try to avoid using first-person plural like '%s'."
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
level: warning
ignorecase: true
tokens:
- we
- we'(?:ve|re)
- ours?
- us
- let's
@@ -0,0 +1,15 @@
# adapted from Google style library
extends: existence
message: "Avoid using '%s'. Try to rewrite in present tense."
link: 'https://developers.google.com/style/tense'
ignorecase: true
level: warning
tokens:
- will
- I'll
- we'll
- you'll
- she'll
- he'll
- it'll
- they'll
@@ -0,0 +1,59 @@
# copied from Google style library
# tests for strings that should be considered for replacement before publishing
extends: substitution
message: "Consider using '%s' instead of '%s'."
link: 'https://developers.google.com/style/word-list'
level: suggestion
ignorecase: false
action:
name: replace
swap:
'(?:check[\s]+(?!out))': select
a number of: some
adjacent to: next to
admin: administrator
aggregate: together|join
all of: all
as to: to
assistance: help
boolean: Boolean
config: configuration
consolidate: join
data are: data is
demonstrate: show
disabled?: turn off|off
eliminate: remove
evaluate: consider
facilitate: make
finalize: complete
for the purpose of: to
generate: create
generated: created
if and when: when
iIn many cases: often
impacted: affected, affects
in between: between
in order to: to
in the case of: when
in the event that: when
in the process of: when
initiate: start
instantiable: that can be instantiated
monorepository: monorepo
obtain: get
overview screen: recents screen
params: parameters
precaching: pre-caching
prerender: pre-render
prerendering: pre-rendering
prior to: before
provided that: if
resubscription: re-subscribe|subscription
retain: keep
subsequent: later
sufficient: enough
terminal: command line tool
touch: tap
url: URL
user friendly: friendly
with the exception of: except for
@@ -0,0 +1,103 @@
# copied from Google style library
# tests for strings that should be replaced before the content is published
extends: substitution
message: "Use '%s' instead of '%s'."
link: 'https://developers.google.com/style/word-list'
level: warning
ignorecase: false
action:
name: replace
swap:
'(?:above[\s\.\;\,]+(?!the))': preceding
'(?:API Console|dev|developer) key': API key
'(?:cell ?phone|smart ?phone)': phone|mobile phone
'(?:dev|developer|APIs) console': API console
'(?:e-mail|Email|E-mail)': email
'(?:file ?path|path ?name)': path
'(?:kill|terminate|abort)': stop|exit|cancel|end
'(?:OAuth ?2|Oauth)': OAuth 2.0
'(?:ok|Okay)': OK|okay
'(?:WiFi|wifi)': Wi-Fi
'[\.]+apk': APK
'3\-D': 3D
'Google (?:I\-O|IO)': Google I/O
'tap (?:&|and) hold': touch & hold
'un(?:check|select)': clear
account name: username
action bar: app bar
ajax: AJAX
Ajax: AJAX
Android device: Android-powered device
android: Android
API explorer: APIs Explorer
app: application
approx\.: approximately
authN: authentication
authZ: authorization
autoupdate: automatically update
backoff: back-off
bugfix: bug fix
byelog: bye log
callout: call-out
callouts: call-outs
cellular data: mobile data
cellular network: mobile network
chapter: documents|pages|sections
check box: checkbox
ci: CI
circleci: CircleCI
circularities: circular dependencies
click on: click|click in
Cloud: Google Cloud Platform|GCP
combobox: combo box
command-line interface: command line tool
command line interface: command line tool
Container Engine: Kubernetes Engine
content type: media type
curated roles: predefined roles
datasource: data source
Developers Console: Google API Console|API Console
ephemeral IP address: ephemeral external IP address
execute: run|call
fewer data: less data
file name: filename
firewalls: firewall rules
folder: directory
functionality: capability|feature
Google account: Google Account
Google accounts: Google Accounts
Googling: search with Google
grayed-out: unavailable
heros: heroes
heterogenous: heterogeneous
homogenous: homogeneous
HTTPs: HTTPS
ingest: import|load
invalid: not valid|non-valid
javascript: JavaScript
k8s: Kubernetes
long press: touch & hold
network IP address: internal IP address
ngcontainer: ng-container
omnibox: address bar
open-source: open source
questionaire: questionnaire
readme: README
regex: regular expression
serviceworker: service worker
SHA1: SHA-1|HAS-SHA1
shrowded: shrouded
sidenav: side nav
sign into: sign in to
sign-?on: single sign-on
sourcemap: source map
sourcemaps: source maps
static IP address: static external IP address
stylesheet: style sheet
synch: sync
tablename: table name
tablet: device
thier: their
timespan: time span
vs\.: versus
World Wide Web: web
@@ -0,0 +1,11 @@
# Angular styles
These styles are specific to the Angular style guide.
Some have been imported from other style libraries and modified
to support the Angular documentation style guide.
For styles imported from other libraries, the .vale.ini file
should disable the corresponding style in its original directory.
A copied style SHOULD NOT be removed from its original directory
to make it easier to identify changes to the original that can
then be manually copied to the Angular version, if desired.
@@ -0,0 +1,8 @@
extends: metric
message: 'Try to keep the Flesch-Kincaid grade level (%s) below 8.'
link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
formula: |
(0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59
condition: '> 8'
@@ -0,0 +1,702 @@
extends: existence
message: "'%s' is a cliché"
ignorecase: true
level: warning
tokens:
- a chip off the old block
- a clean slate
- a dark and stormy night
- a far cry
- a fine kettle of fish
- a loose cannon
- a penny saved is a penny earned
- a tough row to hoe
- a word to the wise
- ace in the hole
- acid test
- add insult to injury
- against all odds
- air your dirty laundry
- all fun and games
- all in a day's work
- all talk, no action
- all thumbs
- all your eggs in one basket
- all's fair in love and war
- all's well that ends well
- almighty dollar
- American as apple pie
- an axe to grind
- another day, another dollar
- armed to the teeth
- as luck would have it
- as old as time
- as the crow flies
- at loose ends
- at my wits end
- avoid like the plague
- babe in the woods
- back against the wall
- back in the saddle
- back to square one
- back to the drawing board
- bad to the bone
- badge of honor
- bald faced liar
- ballpark figure
- banging your head against a brick wall
- baptism by fire
- barking up the wrong tree
- bat out of hell
- be all and end all
- beat a dead horse
- beat around the bush
- been there, done that
- beggars can't be choosers
- behind the eight ball
- bend over backwards
- benefit of the doubt
- bent out of shape
- best thing since sliced bread
- bet your bottom dollar
- better half
- better late than never
- better mousetrap
- better safe than sorry
- between a rock and a hard place
- beyond the pale
- bide your time
- big as life
- big cheese
- big fish in a small pond
- big man on campus
- bigger they are the harder they fall
- bird in the hand
- bird's eye view
- birds and the bees
- birds of a feather flock together
- bit the hand that feeds you
- bite the bullet
- bite the dust
- bitten off more than he can chew
- black as coal
- black as pitch
- black as the ace of spades
- blast from the past
- bleeding heart
- blessing in disguise
- blind ambition
- blind as a bat
- blind leading the blind
- blood is thicker than water
- blood sweat and tears
- blow off steam
- blow your own horn
- blushing bride
- boils down to
- bolt from the blue
- bone to pick
- bored stiff
- bored to tears
- bottomless pit
- boys will be boys
- bright and early
- brings home the bacon
- broad across the beam
- broken record
- brought back to reality
- bull by the horns
- bull in a china shop
- burn the midnight oil
- burning question
- burning the candle at both ends
- burst your bubble
- bury the hatchet
- busy as a bee
- by hook or by crook
- call a spade a spade
- called onto the carpet
- calm before the storm
- can of worms
- can't cut the mustard
- can't hold a candle to
- case of mistaken identity
- cat got your tongue
- cat's meow
- caught in the crossfire
- caught red-handed
- checkered past
- chomping at the bit
- cleanliness is next to godliness
- clear as a bell
- clear as mud
- close to the vest
- cock and bull story
- cold shoulder
- come hell or high water
- cool as a cucumber
- cool, calm, and collected
- cost a king's ransom
- count your blessings
- crack of dawn
- crash course
- creature comforts
- cross that bridge when you come to it
- crushing blow
- cry like a baby
- cry me a river
- cry over spilt milk
- crystal clear
- curiosity killed the cat
- cut and dried
- cut through the red tape
- cut to the chase
- cute as a bugs ear
- cute as a button
- cute as a puppy
- cuts to the quick
- dark before the dawn
- day in, day out
- dead as a doornail
- devil is in the details
- dime a dozen
- divide and conquer
- dog and pony show
- dog days
- dog eat dog
- dog tired
- don't burn your bridges
- don't count your chickens
- don't look a gift horse in the mouth
- don't rock the boat
- don't step on anyone's toes
- don't take any wooden nickels
- down and out
- down at the heels
- down in the dumps
- down the hatch
- down to earth
- draw the line
- dressed to kill
- dressed to the nines
- drives me up the wall
- dull as dishwater
- dyed in the wool
- eagle eye
- ear to the ground
- early bird catches the worm
- easier said than done
- easy as pie
- eat your heart out
- eat your words
- eleventh hour
- even the playing field
- every dog has its day
- every fiber of my being
- everything but the kitchen sink
- eye for an eye
- face the music
- facts of life
- fair weather friend
- fall by the wayside
- fan the flames
- feast or famine
- feather your nest
- feathered friends
- few and far between
- fifteen minutes of fame
- filthy vermin
- fine kettle of fish
- fish out of water
- fishing for a compliment
- fit as a fiddle
- fit the bill
- fit to be tied
- flash in the pan
- flat as a pancake
- flip your lid
- flog a dead horse
- fly by night
- fly the coop
- follow your heart
- for all intents and purposes
- for the birds
- for what it's worth
- force of nature
- force to be reckoned with
- forgive and forget
- fox in the henhouse
- free and easy
- free as a bird
- fresh as a daisy
- full steam ahead
- fun in the sun
- garbage in, garbage out
- gentle as a lamb
- get a kick out of
- get a leg up
- get down and dirty
- get the lead out
- get to the bottom of
- get your feet wet
- gets my goat
- gilding the lily
- give and take
- go against the grain
- go at it tooth and nail
- go for broke
- go him one better
- go the extra mile
- go with the flow
- goes without saying
- good as gold
- good deed for the day
- good things come to those who wait
- good time was had by all
- good times were had by all
- greased lightning
- greek to me
- green thumb
- green-eyed monster
- grist for the mill
- growing like a weed
- hair of the dog
- hand to mouth
- happy as a clam
- happy as a lark
- hasn't a clue
- have a nice day
- have high hopes
- have the last laugh
- haven't got a row to hoe
- head honcho
- head over heels
- hear a pin drop
- heard it through the grapevine
- heart's content
- heavy as lead
- hem and haw
- high and dry
- high and mighty
- high as a kite
- hit paydirt
- hold your head up high
- hold your horses
- hold your own
- hold your tongue
- honest as the day is long
- horns of a dilemma
- horse of a different color
- hot under the collar
- hour of need
- I beg to differ
- icing on the cake
- if the shoe fits
- if the shoe were on the other foot
- in a jam
- in a jiffy
- in a nutshell
- in a pig's eye
- in a pinch
- in a word
- in hot water
- in the gutter
- in the nick of time
- in the thick of it
- in your dreams
- it ain't over till the fat lady sings
- it goes without saying
- it takes all kinds
- it takes one to know one
- it's a small world
- it's only a matter of time
- ivory tower
- Jack of all trades
- jockey for position
- jog your memory
- joined at the hip
- judge a book by its cover
- jump down your throat
- jump in with both feet
- jump on the bandwagon
- jump the gun
- jump to conclusions
- just a hop, skip, and a jump
- just the ticket
- justice is blind
- keep a stiff upper lip
- keep an eye on
- keep it simple, stupid
- keep the home fires burning
- keep up with the Joneses
- keep your chin up
- keep your fingers crossed
- kick the bucket
- kick up your heels
- kick your feet up
- kid in a candy store
- kill two birds with one stone
- kiss of death
- knock it out of the park
- knock on wood
- knock your socks off
- know him from Adam
- know the ropes
- know the score
- knuckle down
- knuckle sandwich
- knuckle under
- labor of love
- ladder of success
- land on your feet
- lap of luxury
- last but not least
- last hurrah
- last-ditch effort
- law of the jungle
- law of the land
- lay down the law
- leaps and bounds
- let sleeping dogs lie
- let the cat out of the bag
- let the good times roll
- let your hair down
- let's talk turkey
- letter perfect
- lick your wounds
- lies like a rug
- life's a bitch
- life's a grind
- light at the end of the tunnel
- lighter than a feather
- lighter than air
- like clockwork
- like father like son
- like taking candy from a baby
- like there's no tomorrow
- lion's share
- live and learn
- live and let live
- long and short of it
- long lost love
- look before you leap
- look down your nose
- look what the cat dragged in
- looking a gift horse in the mouth
- looks like death warmed over
- loose cannon
- lose your head
- lose your temper
- loud as a horn
- lounge lizard
- loved and lost
- low man on the totem pole
- luck of the draw
- luck of the Irish
- make hay while the sun shines
- make money hand over fist
- make my day
- make the best of a bad situation
- make the best of it
- make your blood boil
- man of few words
- man's best friend
- mark my words
- meaningful dialogue
- missed the boat on that one
- moment in the sun
- moment of glory
- moment of truth
- money to burn
- more power to you
- more than one way to skin a cat
- movers and shakers
- moving experience
- naked as a jaybird
- naked truth
- neat as a pin
- needle in a haystack
- needless to say
- neither here nor there
- never look back
- never say never
- nip and tuck
- nip it in the bud
- no guts, no glory
- no love lost
- no pain, no gain
- no skin off my back
- no stone unturned
- no time like the present
- no use crying over spilled milk
- nose to the grindstone
- not a hope in hell
- not a minute's peace
- not in my backyard
- not playing with a full deck
- not the end of the world
- not written in stone
- nothing to sneeze at
- nothing ventured nothing gained
- now we're cooking
- off the top of my head
- off the wagon
- off the wall
- old hat
- older and wiser
- older than dirt
- older than Methuselah
- on a roll
- on cloud nine
- on pins and needles
- on the bandwagon
- on the money
- on the nose
- on the rocks
- on the spot
- on the tip of my tongue
- on the wagon
- on thin ice
- once bitten, twice shy
- one bad apple doesn't spoil the bushel
- one born every minute
- one brick short
- one foot in the grave
- one in a million
- one red cent
- only game in town
- open a can of worms
- open and shut case
- open the flood gates
- opportunity doesn't knock twice
- out of pocket
- out of sight, out of mind
- out of the frying pan into the fire
- out of the woods
- out on a limb
- over a barrel
- over the hump
- pain and suffering
- pain in the
- panic button
- par for the course
- part and parcel
- party pooper
- pass the buck
- patience is a virtue
- pay through the nose
- penny pincher
- perfect storm
- pig in a poke
- pile it on
- pillar of the community
- pin your hopes on
- pitter patter of little feet
- plain as day
- plain as the nose on your face
- play by the rules
- play your cards right
- playing the field
- playing with fire
- pleased as punch
- plenty of fish in the sea
- point with pride
- poor as a church mouse
- pot calling the kettle black
- pretty as a picture
- pull a fast one
- pull your punches
- pulling your leg
- pure as the driven snow
- put it in a nutshell
- put one over on you
- put the cart before the horse
- put the pedal to the metal
- put your best foot forward
- put your foot down
- quick as a bunny
- quick as a lick
- quick as a wink
- quick as lightning
- quiet as a dormouse
- rags to riches
- raining buckets
- raining cats and dogs
- rank and file
- rat race
- reap what you sow
- red as a beet
- red herring
- reinvent the wheel
- rich and famous
- rings a bell
- ripe old age
- ripped me off
- rise and shine
- road to hell is paved with good intentions
- rob Peter to pay Paul
- roll over in the grave
- rub the wrong way
- ruled the roost
- running in circles
- sad but true
- sadder but wiser
- salt of the earth
- scared stiff
- scared to death
- sealed with a kiss
- second to none
- see eye to eye
- seen the light
- seize the day
- set the record straight
- set the world on fire
- set your teeth on edge
- sharp as a tack
- shoot for the moon
- shoot the breeze
- shot in the dark
- shoulder to the wheel
- sick as a dog
- sigh of relief
- signed, sealed, and delivered
- sink or swim
- six of one, half a dozen of another
- skating on thin ice
- slept like a log
- slinging mud
- slippery as an eel
- slow as molasses
- smart as a whip
- smooth as a baby's bottom
- sneaking suspicion
- snug as a bug in a rug
- sow wild oats
- spare the rod, spoil the child
- speak of the devil
- spilled the beans
- spinning your wheels
- spitting image of
- spoke with relish
- spread like wildfire
- spring to life
- squeaky wheel gets the grease
- stands out like a sore thumb
- start from scratch
- stick in the mud
- still waters run deep
- stitch in time
- stop and smell the roses
- straight as an arrow
- straw that broke the camel's back
- strong as an ox
- stubborn as a mule
- stuff that dreams are made of
- stuffed shirt
- sweating blood
- sweating bullets
- take a load off
- take one for the team
- take the bait
- take the bull by the horns
- take the plunge
- takes one to know one
- takes two to tango
- the more the merrier
- the real deal
- the real McCoy
- the red carpet treatment
- the same old story
- there is no accounting for taste
- thick as a brick
- thick as thieves
- thin as a rail
- think outside of the box
- third time's the charm
- this day and age
- this hurts me worse than it hurts you
- this point in time
- three sheets to the wind
- through thick and thin
- throw in the towel
- tie one on
- tighter than a drum
- time and time again
- time is of the essence
- tip of the iceberg
- tired but happy
- to coin a phrase
- to each his own
- to make a long story short
- to the best of my knowledge
- toe the line
- tongue in cheek
- too good to be true
- too hot to handle
- too numerous to mention
- touch with a ten foot pole
- tough as nails
- trial and error
- trials and tribulations
- tried and true
- trip down memory lane
- twist of fate
- two cents worth
- two peas in a pod
- ugly as sin
- under the counter
- under the gun
- under the same roof
- under the weather
- until the cows come home
- unvarnished truth
- up the creek
- uphill battle
- upper crust
- upset the applecart
- vain attempt
- vain effort
- vanquish the enemy
- vested interest
- waiting for the other shoe to drop
- wakeup call
- warm welcome
- watch your p's and q's
- watch your tongue
- watching the clock
- water under the bridge
- weather the storm
- weed them out
- week of Sundays
- went belly up
- wet behind the ears
- what goes around comes around
- what you see is what you get
- when it rains, it pours
- when push comes to shove
- when the cat's away
- when the going gets tough, the tough get going
- white as a sheet
- whole ball of wax
- whole hog
- whole nine yards
- wild goose chase
- will wonders never cease?
- wisdom of the ages
- wise as an owl
- wolf at the door
- words fail me
- work like a dog
- world weary
- worst nightmare
- worth its weight in gold
- wrong side of the bed
- yanking your chain
- yappy as a dog
- years young
- you are what you eat
- you can run but you can't hide
- you only live once
- you're the boss
- young and foolish
- young and vibrant
@@ -0,0 +1,7 @@
extends: repetition
message: "'%s' is repeated. Try to rewrite the sentence without it."
level: warning
ignorecase: true
alpha: true
tokens:
- '[\w]+'
@@ -0,0 +1,5 @@
extends: existence
message: "Don't start a sentence with '%s'. Try to rewrite the sentence without it."
level: error
raw:
- '(?:[;-]\s)so[\s,]|So[\s,]'
@@ -0,0 +1,6 @@
extends: existence
message: "Don't start a sentence with '%s'. Try to rewrite the sentence without it."
ignorecase: true
level: error
raw:
- '(?:^[^\w]*|[;-]\s)There\b\s(is|are)\b'
@@ -0,0 +1,188 @@
extends: existence
message: "See if you can rewrite the sentence with '%s' to use more common words."
ignorecase: true
level: suggestion
tokens:
- abundance
- accede to
- accelerate
- accentuate
- accompany
- accomplish
- accorded
- accrue
- acquiesce
- acquire
- additional
- adjustment
- admissible
- advantageous
- adversely impact
- advise
- aforementioned
- aircraft
- all things considered
- alleviate
- allocate
- along the lines of
- already existing
- alternatively
- amazing
- ameliorate
- anticipate
- apparent
- appreciable
- as a matter of fact
- as a means of
- as far as I'm concerned
- as of yet
- as yet
- ascertain
- at the present time
- at this time
- attain
- attributable to
- authorize
- because of the fact that
- belated
- benefit from
- bestow
- by means of
- by virtue of the fact that
- by virtue of
- cease
- close proximity
- commence
- comply with
- concerning
- consequently
- constitutes
- depart
- designate
- discontinue
- due to the fact that
- each and every
- economical
- elucidate
- employ
- endeavor
- enumerate
- equitable
- equivalent
- evidenced
- exclusively
- expedite
- expend
- expiration
- factual evidence
- feasible
- first and foremost
- for all intents and purposes
- for the most part
- forfeit
- formulate
- have a tendency to
- honest truth
- however
- in a manner of speaking
- in a timely manner
- in a very real sense
- in accordance with
- in addition
- in all likelihood
- in an effort to
- in excess of
- in lieu of
- in light of the fact that
- in my opinion
- in regard to
- in some instances
- in terms of
- in the final analysis
- in the nature of
- in the near future
- inception
- incumbent upon
- indicate
- indication
- irregardless
- is applicable to
- is authorized to
- is responsible for
- it is essential
- it seems that
- magnitude
- maximum
- methodology
- minimize
- minimum
- modify
- monitor
- necessitate
- nevertheless
- not certain
- not many
- not often
- not unless
- not unlike
- notwithstanding
- null and void
- numerous
- objective
- obligate
- on the contrary
- on the other hand
- one particular
- optimum
- overall
- owing to the fact that
- participate
- particulars
- pass away
- pertaining to
- point in time
- portion
- possess
- preclude
- previously
- prioritize
- procure
- proficiency
- purchase
- put simply
- readily apparent
- refer back
- regarding
- relocate
- remainder
- remuneration
- requirement
- reside
- residence
- satisfy
- seamlessly
- shall
- should you wish
- similar to
- solicit
- span across
- strategize
- substantial
- successfully complete
- terminate
- the month of
- the point I am trying to make
- therefore
- time period
- took advantage of
- transmit
- transpire
- until such time as
- utilization
- utilize
- validate
- various different
- what I mean to say is
- whether or not
- with respect to
- witnessed
@@ -0,0 +1,4 @@
{
"feed": "https://github.com/errata-ai/Google/releases.atom",
"vale_version": ">=1.0.0"
}
+2
View File
@@ -0,0 +1,2 @@
> **NOTE**: These styles have been adapted from the
> publicly available styles found at https://github.com/errata-ai/styles.
@@ -0,0 +1,26 @@
angular
angular's
animatable
autoprefixer
bootstrapper
devtools
initializer
initializers
injectable
injectables
mixins
ng
ngc
ngcc
observable
onpush
preboot
preload
preloaded
preloader
preloading
preloads
prepends
profiler
rollout
routable
@@ -0,0 +1 @@
bienvenue
@@ -0,0 +1,135 @@
accessor
accessors
autodetect
autodetects
bitwise
boolean
booleans
breakpoint
browserlist
bugfix
buildable
bundler
bundlers
cacheable
callout
callouts
combinator
composability
config
debounce
debouncing
declarables
declaratively
declaratives
dev
dialogs
downlevel
downleveled
enum
enums
failsafe
falsy
fn
getters
gif
github
hardcode
hardcoded
implementors
interdependency
interdependencies
interoperate
javascript
keydown
keyframe
keyframes
loopback
matchers
memoization
microtask
microtasks
middleware
minifiers
minimalistic
misconfigured
mitigations
monorepo
multicast
multicasting
namespace
namespaces
navigations
node_modules
noop
nullability
nullable
onboarding
onwards
params
performant
polyfill
polyfills
preprocess
preprocessor
preprocessors
refactorings
reflows
reimagined
renderers
repo
repurpose
reusability
rollup
runtimes
sandboxing
sanitization
selectorless
signup
strikethrough
subcommand
subcommands
subcomponents
subfields
subfolder
subfolders
suboption
subpaths
substring
subtree
subtrees
subviews
superset
syntaxes
teardown
templated
timeframe
toolchain
toolchains
tooltip
tooltips
transclude
transcluded
transcluding
transclusion
transpilation
transpile
transpiled
transpiler
transpiles
triaging
truthy
typecheck
uncomment
unflattened
unhashed
unoptimized
unreferenced
unregister
unrequested
untracked
untrusted
untyped
validator
validators
walkthrough

Some files were not shown because too many files have changed in this diff Show More