24918 Commits

Author SHA1 Message Date
Andrew Kushnir a72ff8b055 release: cut the v14.0.7 release 14.0.7 2022-07-20 10:37:05 -07:00
Doug Parker 3c43d42dac 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:44 -07:00
dario-piotrowicz 6aad6e40a2 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
Angular Robot a13d7526c8 build: update cross-repo angular dependencies to cdaaa15 (#46853)
See associated pull request for more information.

PR Close #46853
2022-07-20 08:48:44 -07:00
Bob Watson 3e3f4fec00 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:47:59 -07:00
Paul Gschwendtner d361eaaf83 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:56 -07:00
Paul Gschwendtner 1545a863e5 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:56 -07:00
Paul Gschwendtner cc86c30cb1 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:55 -07:00
Paul Gschwendtner 1264f0224d 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:55 -07:00
Paul Gschwendtner e82389a81a 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:55 -07:00
Angular Robot f42e5db419 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:05 +00:00
Angular Robot 6d9d9f499f 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 7a2b4c162f 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 91b3ad1672 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:18 +00:00
dario-piotrowicz 5bdbb6285b 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
Paul Gschwendtner 76badadf14 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:20:38 +00:00
Paul Gschwendtner 08f31a5c3c 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:20:38 +00:00
Paul Gschwendtner bd61dc3543 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:20:20 +00:00
Paul Gschwendtner b6ca56a80f 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:20:20 +00:00
Paul Gschwendtner fa308a6bdf 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:20:20 +00:00
Paul Gschwendtner 4e77c7fbf3 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:20:20 +00:00
Angular Robot 7ea0c2a4e9 build: update dependency karma-jasmine to v5
| datasource | package       | from  | to    |
| ---------- | ------------- | ----- | ----- |
| npm        | karma-jasmine | 4.0.2 | 5.1.0 |
2022-07-18 17:20:20 +00:00
George Kalpakas f1ca4ab848 build(docs-infra): upgrade cli command docs sources to a6747c168 (#46870)
Updating [angular#14.0.x](https://github.com/angular/angular/tree/14.0.x) from
[cli-builds#14.1.x](https://github.com/angular/cli-builds/tree/14.1.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/2cb508ffa...a6747c168):

**Modified**
- help/completion.json
- help/update.json

PR Close #46870
2022-07-18 17:06:50 +00:00
piyush132000 c5c3cbc726 docs: fix code style (#46862)
PR Close #46862
2022-07-18 16:44:21 +00:00
Cédric Exbrayat 031deb3b95 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
Jessica Janiuk e76f9a132c 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 97bff3cec8 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 e6bcdb999b build: update cross-repo angular dependencies to 84dd092 (#46848)
See associated pull request for more information.

PR Close #46848
2022-07-15 16:00:33 +00:00
jnizet d4684025d4 docs(core): document that destroyAfterEach is true by default (#46845)
PR Close #46845
2022-07-15 15:50:36 +00:00
Jessica Janiuk 98467fdf05 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 71062e140f build: update cross-repo angular dependencies (#46834)
See associated pull request for more information.

PR Close #46834
2022-07-14 22:35:08 +00:00
Angular Robot f8a25f7fc5 build: lock file maintenance (#46691) (#46840)
See associated pull request for more information.

PR Close #46691

PR Close #46840
2022-07-14 15:55:02 +00:00
Paul Gschwendtner 5579d96c60 refactor(docs-infra): update boilerplate to have proper angular.js types (#46840)
With the recent lock file maintenance, the `@types/angular` dependency
ended up being duplicated. This seems to happen because we locked our
type dependency, but other Angular deps like `angular-route` had a
looser dependency, resulting in e.g. `1.7` types and `1.8` types to be
loaded.

This ultimately ended up breaking TypeScript's auto-discovering
of types and broke some example compilations e.g.

```
app/app.animations.ts(3,3): error TS2339: Property 'animation' does not exist on type 'IModule'.
app/app.config.ts(5,45): error TS2694: Namespace 'angular' has no exported member 'route'.
app/phone-detail/phone-detail.component.ajs.ts(10,37): error TS2694: Namespace 'angular' has no exported member 'route'.
```

We fix this by loosening the type dependency ranges, updating all of
these. Also we update AngularJS itself to the final version.

PR Close #46840
2022-07-14 15:55:01 +00:00
Paul Gschwendtner 3a61ff6a10 test: update aio size golden to reflect reduction due to lock file maintenance (#46840)
The AIO payload size has been reduced with lock file maintenance which
resulted in updates of Angular framework and Angular devkit/CLI.

The same reduction is already visible in the `aio-local` job because
it was already using the latest FW packages (obviously -- given it being
from HEAD).

PR Close #46840
2022-07-14 15:55:01 +00:00
Angular Robot f344cbb171 build: lock file maintenance (#46840)
See associated pull request for more information.

PR Close #46840
2022-07-14 15:55:01 +00:00
Bob Watson 676bf041c1 docs: correct debugging task step (#46832)
Also remove lint errors.

Fix: #42781

PR Close #46832
2022-07-13 22:55:20 +00:00
Andrew Kushnir 481dc8dd2e 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:14 +00:00
George Kalpakas 8e2fc3e951 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:18 +00:00
Kristiyan Kostadinov 41253f9c46 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:50 +00:00
acvi 89edfe76a6 docs: describe smallest typo, "an" -> "a" (#46812)
PR Close #46812
2022-07-13 20:06:30 +00:00
Jessica Janiuk 79aa8be54d release: cut the v14.0.6 release (#46827) 14.0.6 2022-07-13 12:06:25 -07:00
Angular Robot dff82f2347 build: update cross-repo angular dependencies to 294d737 (#46821)
See associated pull request for more information.

PR Close #46821
2022-07-13 16:31:05 +00:00
Bob Watson fd15744fca docs: add warning about lack of testing used by TOH (#46811)
Adds a short note about how the .spec.ts testing files aren't used or modified in this tutorial.

Fixes #37652

PR Close #46811
2022-07-13 00:03:49 +00:00
Angular Robot 101ada9567 build: update cross-repo angular dependencies to e8da4c0 (#46809)
See associated pull request for more information.

PR Close #46809
2022-07-12 23:53:52 +00:00
dario-piotrowicz 862dd03764 refactor(animations): refactor non-animatable check to be timeline based (#46666)
move the check for non-animatable properties from the animation building
phase to the application of the animation's transition instead, in such
a way we can check it against the keyframes of the transition's timeline
in order to only provide warnings for properties which are being
animated, thus not providing any warning for non-animatable properties
being applied to elements via the style function

this change has the benfit just mentioned above but it comes with two
drawbacks:
 - the warning handling is not done in the building time so it is a bit
inconsistent with other type of validations (such as the unsupported css
properties one for example)
 - before the warning was being applied only when the animation's data
was being parsed, so it happed only once but now since it is applied
when the animation is actually being prepared to be played, it happens
each time the animation runs

resolves #46602

PR Close #46666
2022-07-12 22:36:22 +00:00
JoostK 99697dae66 fix(compiler-cli): only consider used pipes for inline type-check requirement (#46807)
After a bugfix in #46096, the compiler is now better capable of detecting pipes
which require an inline type constructor. However, there is an issue in how all
pipes are considered when verifying the inline type-ctor requirement: it should
only check actually used pipes.

Fixes #46747

PR Close #46807
2022-07-12 21:09:18 +00:00
Paul Gschwendtner 4a2c6e3693 test: update payload size goldens for AIO after analytics change (#46801)
Most of the increase comes from code being moved from `index.html`
to the main bundle. A small increase comes from the additional `gtag.js`
loading logic, but other than that the size is effectively increased
due to the untracked code from `index.html` being moved into the
`main.js` bundle.

PR Close #46801
2022-07-12 19:43:18 +00:00
Paul Gschwendtner 26ab3687bb refactor(docs-infra): enable ip anonymization for legacy universal analytics (#46801)
In GA4 ip anonymization is enabled by default, but in universal
analytics with `analytics.js`, this needs to be explicitly enabled.

PR Close #46801
2022-07-12 19:43:18 +00:00
Paul Gschwendtner f2a1ea39a4 refactor: move error reporting for analytics to service (#46801)
This is acceptable because `gtag.js` is also only loaded as part of the
service, similary `ga` is only registered in the service (so the
reporting was a noop if errors are thrown before -- no change here)

We can benefit from downleveling etc. and do not need to be careful
with the inline script in the `index.html`

PR Close #46801
2022-07-12 19:43:18 +00:00
Paul Gschwendtner a786cf68e2 feat(docs-infra): set up Google Analytics 4 along with keeping legacy Universal Analytics (#46801)
We currently use Universal Analytics. This is deprecated in favor of
Google Analytics 4 and UA will stop processing hits in October 2023.

This change intends to prepare us for this migration, and to already
pre-populate our GA4 property (there is no way to migrate existing data
/properties into a GA4 property -- a new one needs to be created).

This will help us minimize the data gap so that we can:

* Continue to look at the UA property with the full time span until
  October 2023
* Can start using the GA4 property long-term in the future, starting
  with data even before Universal Analytics stops processing new data.

We need to keep the existing `analytics.js` setup. Initially we have
considered using `gtag.js` for both the UA and GA4 properties, as it
supports that, but that doesn't work with our strict trusted types
enforcement because it results in multiple `gtag.js` scripts (specific
versions for UA or GA4) that recreate the same trusted type policies.
This causes runtime errors and breaks the setup.

Instead, with continued use of `analytics.js` we have the benefit of
a good separation of trusted types + events and configuration. There is
some problematic with translation of Universal Analytics Events to GA4,
or the other way around (even though we don't use custom events
currenlty)

We also do not need to send page views for our GA4 property because GA4
with gtag supports this automatically (respecting the history state --
using the `Enhanced measurement events` setting in the UI).
For our UA legacy instance we continue to dispatch events manually. This
logic can be removed in the future.

More details can be found here:
https://docs.google.com/document/d/1aK8u4ZlXbqQ2wMqmgSX7Ces8iLgamC13oCoG6VeBruA/edit?usp=sharing&resourcekey=0-EVe-Rhnme3bj_pkz2RcOmw.

PR Close #46801
2022-07-12 19:43:18 +00:00