Commit graph

24024 commits

Author SHA1 Message Date
Renovate Bot
2ca4ef7a22 build: update actions/checkout action to v3 (#45248)
PR Close #45248
2022-03-08 10:28:31 -08:00
Mladen Jakovljević
9e56e400c5 fix(docs-infra): remove anchor tags from heritage docs (#45287)
Remove anchor tags from heritage docs and let `autoLinkCode` insert them properly.

PR Close #45287
2022-03-08 10:26:49 -08:00
George Kalpakas
4478dff471 docs(service-worker): improve description of NoNewVersionDetectedEvent (#45266)
The `NoNewVersionDetectedEvent` does not imply that the latest version
on the server is the same as the version the client is on (because a
client could be on an older version).

Update the description of the event to better describe what it actually
means (i.e. that the SW didn't find a version it didn't already know
about, but without implying anything about the version the current
client is using).

PR Close #45266
2022-03-08 10:26:05 -08:00
Luca
3ecf93020c fix(service-worker): file system hash in batch of 500 elements (#45262)
Add file system concurrency hash test

Fixes #45133
PR Close #45262
2022-03-08 10:23:38 -08:00
Andrew Scott
2b7553db6f fix(compiler): compute correct offsets when interpolations have HTML entities (#44811)
When parsing interpolations, the input string is _decoded_ from what was
in the orginal template. This means that we cannot soley rely on the input
string to compute source spans because it does not necessarily reflect
the exact content of the original template. Specifically, when there is
an HTML entity (i.e. ` `), this will show up in its decoded form
when processing the interpolation (' '). We need to compute offsets
using the original _encoded_ string.

Note that this problem only surfaces in the splitting of interpolations.
The spans to this point have already been tracked accurately. For
example, given the template `&nbsp;<div></div>`, the source span for the
`div` is already correctly determined to be 6. Only when we encounter
interpolations with many parts do we run into situations where we need
to compute new spans for the individual parts of the interpolation.

PR Close #44811
2022-03-08 10:23:07 -08:00
Kristiyan Kostadinov
9fa6f5a552 fix(core): incorrectly inserting elements inside <template> element (#43429)
Currently whenever we insert element we do it directly on the node using `appendChild` or `insertBefore`, however this doesn't work with `<template>` elements where the `template.content` has to be used.

These changes add a few checks to call `appendChild` and `insertBefore` on the `content` of the template.

Fixes #15557.

PR Close #43429
2022-03-08 10:22:18 -08:00
Srikanth Kolli
a659d15aa0 docs: Change tag name to TD from TR in context of colspan usage (#45257)
PR Close #45257
2022-03-07 15:41:35 -08:00
nanda18
0b31c8e2da docs: update flush description to include microtasks (#45237)
PR Close #45237
2022-03-07 15:41:07 -08:00
Renovate Bot
1a5cd06d92 build: update dependency google-closure-compiler to v20220301 (#45260)
PR Close #45260
2022-03-07 14:30:45 -08:00
Renovate Bot
68eda48670 build: update dependency magic-string to v0.26.1 (#45247)
PR Close #45247
2022-03-07 14:29:45 -08:00
Dylan Hunn
d336ba96d9 fix(forms): Update the typed forms migration. (#45281)
The typed forms migration was previously designed to add `<any>` type parameters to existing forms classes. However, due to some design changes, the new opt-out strategy requires untyped versions of the classes, as introduced in #45205 and #45268.

This PR updates the migration to import these new classes (in an idempotent manner), and replace constructor calls with the new classes. It respects qualified imports as well. Finally, the code has been refactored to move as much common code as possible into `util.ts`.

PR Close #45281
2022-03-07 12:24:59 -08:00
Kristiyan Kostadinov
d87f66c02f test(compiler): fix deprecation warning (#45285)
Jasmine logs a warning when there's a `describe` with no tests. These changes fix one such case in the compiler that happens when the tests are run against Windows.

PR Close #45285
2022-03-07 11:36:47 -08:00
JiaLiPassion
886cfe82d0 ci: components CI test should use local zone.js build (#45277)
CI components test install the angular package from the local
version, but still use the zone.js from npm, so this commit let
components also install zone.js from local too.

PR Close #45277
2022-03-07 11:34:58 -08:00
George Kalpakas
0bb55f8cb3 build(docs-infra): upgrade cli command docs sources to 9aa2eb03f (#45275)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](ac175ff10...9aa2eb03f):

**Modified**
- help/build.json
- help/generate.json

PR Close #45275
2022-03-07 11:34:31 -08:00
ananyahs96
aa7b857be8 fix(forms): Property renaming safe code (#45271)
This fixes property renaming related issues in advanced closure compiler
optimizations.

PR Close #45271
2022-03-07 11:33:54 -08:00
JoostK
8c171da29f refactor(compiler): specify @angular/core as peer dependency (#45267)
The compiler generates code for the Angular runtime in `@angular/core` which
has to be the exact same version, as otherwise there may be version skew
between what the compiler generates and what the runtime supports. This would
result in hard to diagnose problems at runtime. By adding a peer dependency
for `@angular/compiler` on `@angular/core` we can let the package manager
report an error (NPM 7+) or warning (NPM 6, Yarn) during installation to
signal that the set of packages is incompatible.

PR Close #45267
2022-03-07 11:32:21 -08:00
Kristiyan Kostadinov
94bba76a4a feat(core): support TypeScript 4.6 (#45190)
Adds support for TypeScript 4.6.

PR Close #45190
2022-03-07 11:31:39 -08:00
Dylan Hunn
4332897baa fix(forms): Add UntypedFormBuilder (#45268)
This was intended to be part of #45205, but was left out. Adds a new class for use in migration.

PR Close #45268
2022-03-04 15:25:09 -08:00
Andrew Scott
26ead25df6 refactor(router): Use helper function to throw NoMatch (#45244)
This update matches the other locations where noMatch is thrown.

PR Close #45244
2022-03-04 15:24:13 -08:00
Joey Perrott
bc89598bb9 build: patch snapshot issue in dev-infra selecting the latest version tag (#45269)
Local patch ahead of landing of https://github.com/angular/dev-infra/pull/449

PR Close #45269
2022-03-04 15:23:39 -08:00
JiaLiPassion
9b1e9c0bd7 release: cut the zone.js-0.11.5 release (#45256)
PR Close #45256
2022-03-03 15:49:46 -08:00
Joey Perrott
bd04fbc05b feat(service-worker): emit a notification when the service worker is already up to date after check (#45216)
When the service worker checks for an update and finds that the version on the server is the same as
the version locally installed, it currently noops.  This change introduces an event which it emits
in this situation which notifies clients a check has occurred without error and no update was found.

PR Close #45216
2022-03-03 12:29:04 -08:00
Anner Visser
5e0e64f8ba docs: change link for devtools to angular repo (#45207)
PR Close #45207
2022-03-03 12:28:25 -08:00
Aristeidis Bampakos
2e105a1118 docs: add Greek localization for Angular Docs (#45152)
PR Close #45152
2022-03-03 12:27:52 -08:00
JiaLiPassion
b437d1238d fix(zone.js): defineProperties should also set symbol props (#45098)
Close #44095

Fix `defineProperties` patch not set `symbol` props issue.

Co-authored-by: varomodt<varomodt@users.noreply.github.com>
Co-authored-by: AndrewKushnir<AndrewKushnir@users.noreply.github.com>

PR Close #45098
2022-03-03 12:22:05 -08:00
Andrew Scott
5883e0536c refactor(router): Remove special logic for hybrid apps (#45240)
This commit removes special (undocumented) logic in the Router code that is
meant to prevent duplicate navigations that result from location syncs in
AngularJS/Angular hybrid applications.

The duplicate navigations can occur when both the Router and the AngularJS sync
code detect a location change via a popstate/hashchange event. When this
happens, the Angular Router schedules a navigation to sync itself with
the browser, but the hybrid listener may also schedule an additional
navigation. There are a few reasons this logic should not be included in
the Router:

* This special logic is not tree shakeable so it introduces a bundle
  size cost for all applications, most of which don't need it.
* There have been many updates to the routing pipeline to tolerate
  duplicate navigations. That is, duplicate navigations can happen and
  routing should still complete successfully.
    * 0e8548f667
    * 9e039ca68b
* The logic is really in the wrong place: The hybrid sync code should be
  the location to handle this. If duplicate navigations are meant to be
  avoided, the hybrid sync code should have handling to _not_ trigger
  duplicate navs.
* This logic _also_ used to exist because the mock location
  helper used for test incorrectly triggered popstate events during
  router navigations. In order to avoid unexpected behavior in tests, this
  logic needed to be added. This incorrect mocking may also have been
  put in place because the upgrade module _would_ see a location change
  event and trigger a duplicate navigation.  The location mock has since been updated to
  match real browser behavior so this is no longer necessary. The
  upgrade module has also been updated to not trigger duplicate
  navigations.  The following commits are related to this:
    * 202a1a5631
    * c6a93001eb

Side note: The `setTimeout` in the location change listener is used to
ensure the ordering of duplicate navigations was consistent. You can see
that the logic being removed here expects the imperative navigation to precede the
popstate/hashchange. With the removal of this code, the `setTimeout` no
longer serves a purpose. However, it has been found that tests can rely
on this behavior (incorrectly) because they expect the navigation to be
complete but in reality, it hasn't even started because the test has not
flushed the timeout. Removing the timeout would be a breaking change as
a result.

PR Close #45240
2022-03-03 09:14:39 -08:00
Kristiyan Kostadinov
30c52ac126 build: add retry logic to postinstall script (#45252)
Several people on the team (myself included) have had issues where the `webdriver-manager` step of the `postinstall` script fails on the first run, but work correctly on the second one.

These changes attempt to simplify the workflow by retrying the script up to 3 times before giving up.

PR Close #45252
2022-03-03 09:13:25 -08:00
Jessica Janiuk
6459b253e8
release: cut the v14.0.0-next.5 release (#45243) 2022-03-02 10:51:46 -08:00
Jessica Janiuk
3b85a121ba
docs: release notes for the v13.2.5 release (#45242) 2022-03-02 10:27:13 -08:00
Kristiyan Kostadinov
69018c9f42 feat(core): allow for injector to be specified when creating an embedded view (#45156)
Adds support for passing in an optional injector when creating an embedded view through `ViewContainerRef.createEmbeddedView` and `TemplateRef.createEmbeddedView`. The injector allows for the DI behavior to be customized within the specific template.

This is a second stab at the changes in #44666. The difference this time is that the new injector acts as a node injector, rather than a module injector.

Fixes #14935.

PR Close #45156
2022-03-02 16:38:00 +00:00
Andrew Kushnir
05d50b849b perf(common): make NgLocalization token tree-shakable (#45118)
This commit updates the `NgLocalization` token to become tree-shakable (vs using a direct reference to that token in the `providers` section of the `CommonModule`). The `NgLocalization` token is used for apps that use i18n and for other apps it would be excluded from the bundle.

PR Close #45118
2022-03-01 20:42:39 +00:00
Dylan Hunn
c8e4d62882 refactor(forms): Split up model.ts. (#45217)
model.ts is currently extremely large. This is the first step in an attempt to refactor it to be more easily navigable and reviewable. This commit breaks up `model.ts` into the following new files:

* `model/abstract_model.ts`: The remainder of the model, including the `AbstractControl` base class and helper functions which are used throughout.
* `model/form_control.ts`: `FormControl`, `FormControlOptions`, and helpers, plus the constructor and untyped friends.
* `model/form_array.ts`: `FormArray` and untyped friends.
* `model/form_group.ts`: `FormGroup` and untyped friends.

This first phase is a purely mechanical code move. There is no new code at all, and no interfaces have been separated.

PR Close #45217
2022-03-01 19:49:31 +00:00
Theodore Brown
c5df474c7c fix(core): remove individual commands for updating gold files (#45198)
The documented command for updating the forms gold files was outdated
and didn't work. Since this command list can easily become outdated,
remove the individual commands in favor of the simpler global scripts.

PR Close #45198
2022-03-01 19:16:53 +00:00
JiaLiPassion
1b85811c00 refactor(zone.js): for legacy browser, still use hard coding eventNames (#40962)
For legacy browsers, we still use the eventNames array to patch event instead of
using `Object.getOwnPropertyNames()` to keep backward compatibility.

PR Close #40962
2022-03-01 18:41:15 +00:00
JiaLiPassion
0f298a13db refactor(zone.js): remove onProp eventNames array to reduce the bundle size (#40962)
Zone.js supports the google closure compiler in the advance optimization mode,
to prevent closure compiler modify the `onProperty` name such as `Element.prototype.onclick`,
Zone.js implements the `onProperty` patch logic by declaring all the
event names in the source code, this increases the bundle size and also require
updating the event names array to keep the information updated.

Now google closure compiler has the required event names defined in the built-in
externs files, so zone.js can use more simple implementation and decrease the bundle size
of zone.js (about 4k).

PR Close #40962
2022-03-01 18:41:15 +00:00
Dmitrij Kuba
c9679760b2 refactor(router): take only the first emitted value of every resolver to make it consistent with guards (#44573)
The router used to wait for the resolvers to complete and take the last
value. The changes here take only the first
emitted value of every resolver and proceed the navigation. This matches
how other guards work in the `Router` code.

Resolves https://github.com/angular/angular/issues/44643

BREAKING CHANGE: Previously, resolvers were waiting to be completed
before proceeding with the navigation and the Router would take the last
value emitted from the resolver.
The router now takes only the first emitted value by the resolvers
and then proceeds with navigation. This is now consistent with `Observables`
returned by other guards: only the first value is used.

PR Close #44573
2022-03-01 17:12:37 +00:00
Dylan Hunn
bd12f9eda4 refactor(forms): Move getRawValue into the AbstractControl hierarchy. (#45200)
Currently, there is a freestanding `getRawValue` function which examines the type of the control. This is an issue for refactoring `model.ts` because it creates unnecessary dependencies between the `AbstractControl` classes. It is cleaner to simply add this method to the model hierarchy and call it directly, and will ease upcoming refactoring.

PR Close #45200
2022-03-01 01:07:12 +00:00
Dylan Hunn
4b936a1014 Revert "feat(core): allow for injector to be specified when creating an embedded view (#45156)" (#45220)
This reverts commit 94c949a60a.

PR Close #45220
2022-03-01 01:04:57 +00:00
Dylan Hunn
b817f3cbf5 Revert "refactor(forms): Move getRawValue into the AbstractControl hierarchy. (#45200)" (#45219)
This reverts commit dfc4301b33.

PR Close #45219
2022-03-01 00:07:39 +00:00
Dylan Hunn
dfc4301b33 refactor(forms): Move getRawValue into the AbstractControl hierarchy. (#45200)
Currently, there is a freestanding `getRawValue` function which examines the type of the control. This is an issue for refactoring `model.ts` because it creates unnecessary dependencies between the `AbstractControl` classes. It is cleaner to simply add this method to the model hierarchy and call it directly, and will ease upcoming refactoring.

PR Close #45200
2022-02-28 19:44:07 +00:00
Dylan Hunn
7ee121f595 feat(forms): Add untyped versions of the model classes for use in migration. (#45205)
We had previously introduced an `AnyForUntypedForms` type alias. However, given our updated migration plan, we actually want to use aliases for the model classes themselves. This commit introduces these aliases, and adds them to the public API. It must be merged before the types, in order to migrate google3.

PR Close #45205
2022-02-28 19:43:22 +00:00
Kristiyan Kostadinov
94c949a60a feat(core): allow for injector to be specified when creating an embedded view (#45156)
Adds support for passing in an optional injector when creating an embedded view through `ViewContainerRef.createEmbeddedView` and `TemplateRef.createEmbeddedView`. The injector allows for the DI behavior to be customized within the specific template.

This is a second stab at the changes in #44666. The difference this time is that the new injector acts as a node injector, rather than a module injector.

Fixes #14935.

PR Close #45156
2022-02-28 19:42:26 +00:00
dario-piotrowicz
9366a3c5f3 docs: improve structure of http example (#44986)
improve the http aio example by:
 - adding a background color to the messages section so that it
   can be distinguished from the others
 - avoid using `hr` elements to divide the various sections, use
   css instead (so that the divisions can also be omitted when
   the sections are not being shown)
 - fix the erroneous presence of an input text element inside a button
   (see: https://github.com/angular/angular/pull/44557#discussion_r787239658)

PR Close #44986
2022-02-28 19:31:25 +00:00
JiaLiPassion
4d494d24cc feat(zone.js): add Promise.any() implementation (#45064)
Implements `Promise.any()` introduced in ES2021.

Close #44393

PR Close #45064
2022-02-28 17:39:28 +00:00
Paul Gschwendtner
f4fd488d4d build: update tooling to use new entry-point for dev-infra exports (#45206)
Previously, dev-infra only bundled the CLI with all its dependencies, while
we still also kept all bundled dependencies in the `dependencies`. This basically
meant that the CLI bundling did not provide any value at all.

We fixed this upstream and now dependencies are still bundled, but no longer
also declared as `dependencies`. We also stopped shipping deep JS files, only
shipping the bundles now.

As part of this deep file removal, we introduced a runtime entry-point for
exports/types. This one will also benefit from the bundling and it will be
predictable what symbols dev-infra consumer projects rely on (allowing us to
also have an API guard or something in the future).

PR Close #45206
2022-02-28 17:38:26 +00:00
Renovate Bot
064cbed0cb build: update angular (#45206)
PR Close #45206
2022-02-28 17:38:26 +00:00
Dylan Hunn
4c80ca3700 refactor(forms): Clean up the find function. (#45199)
Move `find` into the `AbstractControl` hierarchy, and clean up a longstanding implementation todo.

PR Close #45199
2022-02-28 17:26:31 +00:00
Guillaume Bonnet
cbbf13f100 docs(docs-infra): fix the stackblitz on page i18n-example (#45097)
The previous configuration didn't allow to serve in any language.

Fixes #45066

PR Close #45097
2022-02-28 17:25:40 +00:00
Paul Gschwendtner
78a0ac02a7 ci: instruct renovate to not update/override merge ready PRs (#45204)
Sometimes Renovate proposes an update and we need to add some
manual fixups, like updating a size golden. For this we push to
same upstream branch.

Renovate will update the PR though when another new revision/version
becomes available, overriding the fixup and discarding it.

This happened quite often now and causes significantly more
work required by the dev-infra time..

PR Close #45204
2022-02-25 22:10:55 +00:00
Paul Gschwendtner
e56472d3c2 ci: fix stamping for builds performed in CI (#45147)
Fixes the stamping for snapshot builds and the artifact deployment job.
Currently the stamped versions will have the `.with-local-changes` version
suffix given that we add a file to the Git repo that is just
needed for the CircleCI cache key computation.

PR Close #45147
2022-02-25 19:14:05 +00:00