21885 Commits

Author SHA1 Message Date
Dylan Hunn ca3b552af2 release: cut the v12.2.9 release (#43749)
PR Close #43749
12.2.9
2021-10-06 15:47:55 -07:00
dario-piotrowicz a0cf71717b fix(docs-infra): convert button-like elements to actual buttons (#43601)
some elements in the aio application are anchors or divs but behave
like buttons, it is semantically (and a11y) more correct to convert
them to actual button elements instead

PR Close #43601
2021-10-06 09:22:05 -07:00
Kristiyan Kostadinov df7fd87084 refactor(language-service): fix typo in method name (#43698)
The `fineRenameLocations` method should be called `findRenameLocations`.

PR Close #43698
2021-10-06 09:21:34 -07:00
Pete Bacon Darwin c9e21d080f build(docs-infra): ensure all overloads are shown in interfaces (#43734)
In the API docs, concrete classes do not list the "implementation" overload on a method, since this is not strictly part of its API.

We recently fixed the rendering of interfaces to display all the overloads, since there is no "implementation" overload.

This commit also fixes the rendering of "pseudo-classes", which are a combination of an interface
and a constant.

Fixes #43001

PR Close #43734
2021-10-06 09:21:09 -07:00
Alan Agius f45c692dd9 ci: change ownership of goldens/public-api/manage.js (#43664)
With this change we change ownership of `goldens/public-api/manage.js` from `public-api` to `dev-infra`. This file is a script to manage public-api golden files and therefore it should fall under the dev-infra umbrella.

PR Close #43664
2021-10-05 13:36:37 -07:00
George Kalpakas c4ecc07838 fix(service-worker): make ngsw.json generation deterministic and correct (#43679)
Previously, all asset-groups from `ngsw-config.json` were processed in
parallel. For each asset-group, we retrieved all files for the current
build, filtered out files that were already matched by other
asset-groups, determined which of the remaining files belonged to the
current asset-group and generated entries for the `ngsw.json` manifest.
This process was susceptible to race conditions when there were files
that would be matched by multiple asset-groups. This made the generation
of the `ngsw.json` manifest non-deterministic and violated the rule that
each file would belong to the first asset-group that matched it (based
on the asset-groups' order of appearance in `ngsw-config.json`), thus
leading to broken ServiceWorker behavior.

This commit fixes it by ensuring that the generation process is
deterministic and that asset-groups are processed in the proper order.

NOTE 1:
The generation process has been broken since the beginning, but we have
only noticed this recently. This is possibly related to the CLI's
switching from a virtual file system host (which has more consistent
timing characteristics) to the Node.js built-in `fs.promises` in
angular/angular-cli@d3bc530c10.

NOTE 2:
This commit also ensures that files in the `ngsw.json` hash-table are in
alphabetic order. Previously, the files were added to the hash-table in
blocks corresponding to each asset-group.
This change is not necessary (i.e. the order of keys in the hash-table
makes no difference in behavior), but it makes it easier to scan for a
file (for example, for debugging purposes).

PR Close #43679
2021-10-05 13:34:31 -07:00
George Kalpakas 307da62cd9 build(docs-infra): ensure ngsw.json generation is correct and deterministic (#43687)
As explained in #43679, currently the generation of the `ngsw.json` SW
manifest is non-deterministic and often incorrect. Until we can update
to an `@angular/service-worker` version that includes the fix from
PR #43679, we temporarily work-around the issue by re-generating the
`ngsw.json` manifest after `ng build` using the `ngsw-config` binary
exposed by `@angular/service-worker`.

NOTE:
This works around the issue, because the [FileSystem][1] class used by
the `ngsw-config` binary happens to be synchronous (unlike the
implementation provided by the Angular CLI), thus avoiding the race
conditions described in #43679.

[1]: https://github.com/angular/angular/blob/c721135e370b34c840756bcfb22c8119b4c8c452/packages/service-worker/cli/filesystem.ts#L15

PR Close #43687
2021-10-05 09:49:15 -07:00
George Kalpakas fb29da27cb build(docs-infra): update Angular Material to version 12.2.8 (#43687)
This commit updates angular.io to the latest stable version of Angular
CDK/Material (v12.2.8).

NOTE:
The payload size changes in styles are not entriely caused by this
commit, since the limits where outdated. The actual size changes caused
by this commit are ~100B per theme:
- `light-theme`: 79217 --> 79320
- `dark-theme`:  79116 --> 79216

PR Close #43687
2021-10-05 09:49:14 -07:00
George Kalpakas 087c37cc5c build(docs-infra): update Angular framework to version 12.2.8 (#43687)
This commit updates angular.io to the latest stable version of the
Angular framework (v12.2.8). Among other benefits, this version also
includes the ServiceWorker fix from #43518, which fixes #28114.

NOTE:
This commit also makes the necessary changes to more closely align
angular.io with new apps created with the latest stable Angular CLI.

Fixes #28114

PR Close #43687
2021-10-05 09:49:14 -07:00
George Kalpakas 04372247b6 refactor(docs-infra): prefix error messages with Angular version info (#43687)
Prefix error messages with the Angular version currently used in the
angular.io app. This applies to both errors logged to the console and
reported to Google Analytics and makes debugging certain errors easier.

PR Close #43687
2021-10-05 09:49:14 -07:00
George Kalpakas 5344dfecfe build(docs-infra): use $schema in ngsw-config.template.json to provide intellisense (#43687)
Add an appropriate `$schema` property in `ngsw-config.template.json` to
allow IDEs to provide intellisense about the various fields of the
config.

PR Close #43687
2021-10-05 09:49:14 -07:00
Wey-Han Liaw 7f6050587d fix(router): unset attachRef when router-outlet is destroyed to avoid mounting a destroyed component (#43697)
Previously, when a router-outlet is conditionally shown with an ngIf, and a sub-route was re-attached
via a custom RouteReuseStrategy, router-outlet would try to mount a destroyed component into the view
if the router-outlet is destroyed and re-initialized.

This commit fixes it by unsetting context.attachRef when router-outlet is destroyed, so when the
router-outlet is being initialized again, it no longer sees an attachRef that it needs to mount to the
view.

Fixes #43696

PR Close #43697
2021-10-05 09:48:41 -07:00
dario-piotrowicz 7bc46a877d fix(docs-infra): amend color of code links inside single anchors (#43586)
when some auto code links fail to happen they can be added manually
with the md ``[`code text`](link)``, these generate anchor elements which
contain a code element, such code element does not get the correct text
color, this commit fixes such issue

PR Close #43586
2021-10-04 16:31:17 -07:00
iRealNirmal dc885ebae4 docs: move angular-compiler-options tsconfig snippets to external file (#43545)
Moving angular-compiler-options docs inline code to external file of tsconfig.json and tsconfig.app.json.

closes #43336

PR Close #43545
2021-10-04 10:55:05 -07:00
ultrasonicsoft 12c1b9fcc5 docs: add balram chavan to GDE resources (#43658)
PR Close #43658
2021-10-04 10:53:59 -07:00
mgechev 04f2fd6d15 docs: add developer survey 2021 (#43670)
PR Close #43670
2021-10-04 10:24:59 -07:00
JoostK b4b441077a fix(core): handle invalid constructor parameters in partial factory declarations (#43619)
This commit fixes an oversight in the JIT compilation of partial factory
declarations, where the literal `'invalid'` was not accounted for
(unlike the AOT linker).

Fixes #43609

PR Close #43619
2021-10-01 12:24:31 -04:00
Daniel Díaz 75f74ded5f docs: fix typo in AOT compiler (#43640)
PR Close #43640
2021-10-01 12:24:01 -04:00
little-pinecone 74f71b483f docs: add button type in form array example (#43666)
add a button type in the example of creating a dynamic form so that the button that adds the alias control does not submit the entire form

PR Close #43666
2021-10-01 12:23:10 -04:00
George Kalpakas f3b2c717e5 docs: update commit message guidelines to reflect current requirements (#43650)
Update the commit message guidelines in `CONTRIBUTING.md` to reflect
recent changes in our dev-infra tooling:
- Remove the mention of the 100 chars/line limit, since that is
  [no longer in effect][1].
- Mention Deprecation sections:
  According to our [Deprecation practices][2], we should document
  deprecations in the Changelog, which our tooling supports via
  [DEPRECATED][3] sections in commit messages. Yet this was not
  mentioned in the commit message guidelines.

[1]: https://github.com/angular/angular/blob/a07cb097e9124738880f7978658a2972d25b892e/.ng-dev/commit-message.ts#L7
[2]: https://angular.io/guide/releases#deprecation-practices
[3]: https://github.com/angular/dev-infra/blob/b51360a7cc39cb3deb5ae1bf0bfb121fe7ee0a4e/ng-dev/commit-message/parse.ts#L77

PR Close #43650
2021-10-01 08:55:02 -07:00
xiaohanxu-nick fa0c57bc21 docs: fix missing step in get started example (#43646)
PR Close #43646
2021-10-01 08:46:02 -07:00
dario-piotrowicz c13f7cd1c3 docs: disable erroneous "browser" code links (#43554)
fix the keyword "browser" present in code segments being incorrectly
generated as a link to "api/animations/browser" by applying the
no-auto-link class

PR Close #43554
2021-10-01 08:36:08 -07:00
dario-piotrowicz 7a6cd8866a docs(animations): improve the aio animations introduction (#42885)
improve slightly the angular.io animation introduction guide, such
improvement are styling, information and clarity related

PR Close #42885
2021-10-01 08:34:20 -07:00
Alex Rickabaugh d6679e2969 release: cut the v12.2.8 release (#43654)
PR Close #43654
12.2.8
2021-09-30 13:02:15 -07:00
Alex Rickabaugh ca6bcb7d66 Revert "fix(language-service): provide dom event completions (#43299)"
This reverts commit c8f8d7d3b1.

This commit breaks in IE11, which is still supported by v12, likely due to
the usage of `Array.from()`.
2021-09-30 10:15:56 -07:00
Andrew Scott ca0f057491 test(router): refactor tests to not use deprecated loadChildren (#43578)
Many of the tests in the router code use the deprecated loadChildren as a string. This
has been deprecated for years and can easily be changed to just a function that
returns the module.

PR Close #43578
2021-09-29 11:14:09 -07:00
Chris e3e424e7ca docs: clarify description of :host and :host-context selectors (#41332)
Fixes #39466

PR Close #41332
2021-09-29 10:00:07 -07:00
Daniel Díaz 7a68cd75f2 docs: fix typo in observables file (#43630)
PR Close #43630
2021-09-29 09:59:39 -07:00
Pete Bacon Darwin 59ad3997bc build(docs-infra): ensure all overloads are shown in interfaces (#43614)
In the API docs, concrete classes do not list the "implementation" overload on a method, since this is not strictly part of its API.
There is already a special case for abstract methods that do not have such an implementation overload.

But we were missing the case where the method was part of an interface. In interfaces none of the methods have implementation overloads.

Fixes #43001

PR Close #43614
2021-09-29 09:58:48 -07:00
dario-piotrowicz 8da56d78d9 docs: amend wrong links to async pipe (#43576)
PR Close #43576
2021-09-29 09:57:59 -07:00
Raj Sekhar c9cbe6e7d8 docs: fix broken link to measure performance (#43628)
* "Chrome DevTools Network Performance page" was pointing to a broken link, that was giving 404 error
* The new link points to the right article where it explains the resource timing & network analysis
PR Close #43628
2021-09-28 14:43:47 -07:00
Bobby Galli cfca3d0a5e docs: fix typos in .vscode/README.md (#43621)
PR Close #43621
2021-09-28 14:28:15 -07:00
wszgrcy c1338bf837 fix(compiler-cli): correctly interpret token arrays in @Injectable deps (#43226)
When specifying the `deps` array in the `@Injectable` decorator to
inject dependencies into the injectable's factory function, it should
be possible to use an array literal to configure how the dependency
should be resolved by the DI system.

For example, the following example is allowed:

```ts
@Injectable({
  providedIn: 'root',
  useFactory: a => new AppService(a),
  deps: [[new Optional(), 'a']],
})
export class AppService {
  constructor(a) {}
}
```

Here, the `'a'` string token should be injected as optional. However,
the AOT compiler incorrectly used the array literal itself as injection
token, resulting in a failure at runtime. Only if the token were to be
provided using `[new Optional(), new Inject('a')]` would it work
correctly.

This commit fixes the issue by using the last non-decorator in the
array literal as the token value, instead of the array literal itself.

Note that this is a loose interpretation of array literals: if a token
is omitted from the array literal then the array literal itself is used
as token, but any decorator such as `new Optional()` would still have
been applied. When there's multiple tokens in the list then only the
last one will be used as actual token, any prior tokens are silently
ignored. This behavior mirrors the JIT interpretation so is kept as is
for now, but may benefit from some stricter checking and better error
reporting in the future.

Fixes #42987

PR Close #43226
2021-09-28 14:15:49 -07:00
Ricardo Chavarria 4cc9c397dc docs: Add Ricardo Chavarria to GDE resources (#43571)
update size image
update preview
docs: replace an avatar with smaller size
Change order


PR Close #43571
2021-09-27 14:25:57 -07:00
JoostK 69299f7d4d fix(ngcc): do not fail for packages which correspond with Object members (#43589)
Prior to this commit ngcc stored its package configuration in JavaScript
objects, which caused the builtin `Object` members to be found as
package configuration. This would subsequently crash as their shape was
not as expected.

This commit moves away from using raw JavaScript objects in favor of a
Map. To code was refactored such that `PartiallyProcessedConfig` is
now a class.

Fixes #43570

PR Close #43589
2021-09-27 14:21:54 -07:00
Adrien Crivelli 9d3c2d517d docs(router): params or queryParams are not advised against (#43562)
According to @atscott:

> We no longer speculate about future deprecations. There are no current plans to remove
> `params` or `queryParams` and there's no benefit to advising against their use.

PR Close #43562
2021-09-27 14:21:11 -07:00
Rafael Santana a8e84f6920 docs: close tags properly (#43610)
PR Close #43610
2021-09-27 10:54:56 -07:00
enisfr dac84dd9e1 docs: links added for each builder schema (#43564)
closes #43542

Signed-off-by: enisfr <enisfurkane@gmail.com>

docs: links pointed to the schema files.

closes angular#43542

docs: tslint removed.

closes angular#43542

docs: typo.

closes angular#43542

PR Close #43564
2021-09-27 10:51:49 -07:00
Andrew Scott c8f8d7d3b1 fix(language-service): provide dom event completions (#43299)
Native DOM events were previously not included in the completions
because the dom schema registry would filter out events completely. This
change updates the registry to include events in the private
element->property map and excludes events from lookups outside of the
new `allKnownEventsOfElement` function.

fixes https://github.com/angular/vscode-ng-language-service/issues/1479

PR Close #43299
2021-09-27 10:45:59 -07:00
Teri Glover 28b7f79a63 docs: Edits to remove jargon (#43000)
PR Close #43000
2021-09-27 10:44:22 -07:00
George Kalpakas cadef4caa8 ci: correctly handle commit message with carriage returns in payload-size.sh (#43569)
Previously, if a commit message contained a carriage return in its
header, the `payload-size.sh` script would fail to upload the payload
size data to Firebase, because the JSON payload would be messed up when
trying to concatenate the commit message headers. See an example
[here][1].

This commit avoids this problem by replacing carriage returns before
concatenating the commit message headers with the JSON payload string.

[1]: https://app.circleci.com/pipelines/github/angular/angular/37437/workflows/d0fa4adf-43bb-464e-a2fd-d87da15226dd

PR Close #43569
2021-09-24 10:56:41 -07:00
George Kalpakas 9a5086e9fe fix(docs-infra): display deprecation notes for properties (#43566)
Previously, deprecation notes for deprecated class/interface properties
were not shown in the API docs. This commit fixes it by ensuring that
deprecation notes are shown for properites (similar to how it works for
methods).

PR Close #43566
2021-09-24 10:56:05 -07:00
George Kalpakas 3cf41354ae fix(service-worker): do not unassign clients from a broken version (#43518)
Previously, when a version was found to be broken, any clients assigned
to that version were unassigned (and either assigned to the latest
version or to none if the latest version was the broken one). A version
could be considered broken for several reasons, but most often it is a
response for a hashed asset that eiher does not exist or contains
different content than the SW expects. See
https://github.com/angular/angular/issues/28114#issuecomment-923122967
for more details.

However, assigning a client to a different version (or the network) in
the middle of a session, turned out to be more risky than keeping it on
the same version. For angular.io, for example, it has led to #28114.

This commit avoids making things worse when identifying a broken version
by keeping existing clients to their assigned version (but ensuring that
no new clients are assigned to the broken version).

NOTE:
Reloading the page generates a new client ID, so it is like a new client
for the SW, even if the tab and URL are the same.

PR Close #43518
2021-09-24 10:54:22 -07:00
George Kalpakas 70b194abe3 test(service-worker): use correct assertion in tests (#43518)
Previously, a ServiceWorker test was using the
`MockServerState#sawRequestFor()` method. This method, however, only
returns a boolean indicating whether a request had been seen, but would
not throw an error in either case.

Since the intention was to assert that a specific request was made, this
commit switches to the correct `MockServerState#assertSawRequestFor()`
method.

PR Close #43518
2021-09-24 10:54:22 -07:00
Virginia Dooley d585c78ab3 docs: reviewed tag added (#43472)
PR Close #43472
2021-09-24 10:51:40 -07:00
Virginia Dooley 62e982d7e0 docs: review tag added (#43469)
PR Close #43469
2021-09-24 10:50:21 -07:00
Joe Martin (Crowdstaffing) 1c7545559d docs: update review date (#43245)
docs: Update review date for last content update.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 406abf2372 docs: add subtopics for internationalization (#43245)
Add subtopics for internationalization guide.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 579b05a43c docs: update content (#43245)
Update content per review.

PR Close #43245
2021-09-23 15:40:36 -07:00
Joe Martin (Crowdstaffing) 035b3f7ddb docs: update punctuation (#43245)
Update punctuation per review.

Co-authored-by: TeriGlover <teriglover@google.com>
PR Close #43245
2021-09-23 15:40:36 -07:00