21206 Commits

Author SHA1 Message Date
Alex Rickabaugh 7db8e1f82e release: cut the v12.0.5 release (#42585)
PR Close #42585
12.0.5
2021-06-16 15:45:34 -07:00
dario-piotrowicz f9a5d25d72 fix(docs-infra): make anchor in list item inherit line-height (#42572)
in order to have a consistent line-height between list items containing
text and list items containing links the anchors should inherit the list
item's line-height

PR Close #42572
2021-06-16 14:03:33 -07:00
dario-piotrowicz 3160b11ee4 fix(docs-infra): add horizontal margins to nav menu (#42561)
add a 2px left and right margin to the aio-nav-menu to make
sure that the items outline doesn't get cropped

PR Close #42561
2021-06-16 14:02:55 -07:00
dario-piotrowicz 2187c57169 fix(docs-infra): fix width of sidenav icons (#42561)
make sure that the width of the sidenav chervon icon is 2.4rem
(this needs to be done using the flex property and not the
width one as that can change in flex containers)

also center chevron icon inside mat-icon container in order to maintain
the correct icon positioning at any font-size

PR Close #42561
2021-06-16 14:02:54 -07:00
dario-piotrowicz e8735fd9c3 fix(docs-infra): prevent vertical nav item overflowing (#42561)
prevent the overflowing unwanted effect that happens during
a nav item opening and closing (during the chevron rotation)

PR Close #42561
2021-06-16 14:02:54 -07:00
Dario Piotrowicz c479b1a3a6 fix(docs-infra): improve card layout for different browser font sizes (#42533)
Remove the fixed height set on the card elements present in angular.io,
allowing the cards to have a dynamic height derived from their content
and thus removing overflow issues related to the browser's font-size,
make other minor css related adjustments to allow the card to look good
on the different browser's font-size settings

PR Close #42533
2021-06-16 14:02:25 -07:00
Marius Bethge 3cb255cfb0 docs(forms): correct sample code for FormArray.reset (#42477)
Remove unexpected this, correct output comment for arr.value and correct parameter type for FormArray.get().

PR Close #42477
2021-06-16 14:01:56 -07:00
Pete Bacon Darwin 9c9ae274e7 feat(docs-infra): add support for "special elements" (#41299)
This commit adds support for generating pages that document
special Angular elements, such as `ng-content` and `ng-template`,
which have special behavior in Angular but are not directives nor
components.

Resolves #41273

PR Close #41299
2021-06-16 14:01:18 -07:00
Andrew Scott 6bf4cb6d44 refactor(language-service): add missing helper method (#42579)
PR #42559 added a reference to a helper method that was only in the 12.1.x branch.
This commit adds the helper to the 12.0.x branch.

PR Close #42579
2021-06-15 14:02:21 -07:00
Daniel Trevino ff8fe43856 docs: add Daniel Trevino to contributors file (#42573)
PR Close #42573
2021-06-15 12:53:11 -07:00
Kristiyan Kostadinov b362344cc1 build: remove unnecessary polyfills from tests (#42567)
Removes the polyfills for `MutationObserver` and `setPrototypeOf` from our testing setup, because none of the browsers that we support require them. It also removes a bit of code and one external dependency.

PR Close #42567
2021-06-14 14:14:41 -07:00
Andrew Scott 8192f1e1c2 fix(language-service): 'go to defininition' for objects defined in template (#42559)
Previously, the "go to definition" action did no account for the
possibility that something may actually be defined in a template. This
change updates the logic in the definition builder to convert any
results that are locations in template typecheck files to their
corresponding locations in the template.

PR Close #42559
2021-06-14 14:13:48 -07:00
Andrew Scott 11e0f53352 fix(language-service): Use last child end span for parent without close tag (#42554)
Unclosed element tags are not assigned an `endSourceSpan` by the parser.
As a result, the visitor which determines the target node at a position
for the language service was unable to determine that a given position
was inside an unclosed parent. This happens because we update the
`endSourceSpan` of template/element nodes to be the end tag (and there
is not one for unclosed tags). Consequently, the visitor then cannot
match a position to any child node location.

This change updates the visitor logic to check if there are any
`children` of a template/element node and updates the end span to be the
end span of the last child. This allows our `isWithin` logic to identify
that a child position is within the unclosed parent.

Addresses one of the issues found during investigation of https://github.com/angular/vscode-ng-language-service/issues/1399

PR Close #42554
2021-06-14 14:10:47 -07:00
Andrew Scott 89fc131ef8 fix(compiler): always match close tag to the nearest open element (#42554)
This commit updates the parser logic to continue to try to match an end
tag to an unclosed open tag on the stack. Previously, it would only
push an error to the list and stop looking at unclosed elements.

For example, the invalid HTML of `<li><div></li>`, has an unclosed
element stack of [`li`, `div`] when it encounters the close `li` tag.
We compare against the previously unclosed tag `div` and see that this is
unexpected. Instead of simply giving up here, we continue to move up the
unclosed tags until we find a match (if there is one).

PR Close #42554
2021-06-14 14:10:47 -07:00
Ankit Choudhary 18d8322188 docs: Grammatical error (#42571)
Updated a minor grammatical error.
PR Close #42571
2021-06-14 09:59:15 -07:00
Dylan Hunn 6f1b907b79 fix(forms): changes to status not always being emitted to statusChanges observable for async validators. (#42553)
When a FormControl, FormArray, or FormGroup is first constructed, if an async validator is attached, the `statusChanges` observable should receive a message when the validator complete (i.e. pending -> valid/invalid). If the validator was provided as part of the constructor options, it was not fired at construction time, which is fixed in this PR.

Fixes #35309.

PR Close #42553
2021-06-14 09:57:58 -07:00
George Kalpakas c9231d261c fix(docs-infra): correctly serve index.html with a query string (#42547)
Previously, due to a bug in Firebase hosting, requests to
`/index.html?<query>` would lead to an infinite redirect and eventually
a failure. This affected, for example, cache-busting requests from the
ServiceWorker, which look like: `/index.html?ngsw-cache-bust=...`
For more details see
https://github.com/angular/angular/issues/42518#issuecomment-858545483

This commit temporarily works around the bug by explicitly redirecting
`/index.html?<query>` to `/?<query>`.

Fixes #42518

PR Close #42547
2021-06-14 09:57:31 -07:00
George Kalpakas 0eac2ac130 feat(docs-infra): implement popup to inform about the use of cookies (#42259)
This commit adds a popup to angular.io to inform the user about the use
of cookies. Once the user confirms having read the info, the popup will
not be shown on subsequent visits.

This commit is partly based on angular/material.angular.io#988.

Fixes #42209

PR Close #42259
2021-06-14 09:54:09 -07:00
George Kalpakas cc963e6ca9 refactor(docs-infra): provide local-/sessionStorage via DI (#42259)
Previously, we had the same logic in a couple of places to safely access
the `Window`'s `local-/sessionStorage` and provide a no-op fallback if
necessary. Soon, we will need the same logic for the cookies popup
(see #42209).

This commit reduces code duplication by providing
`local-/sessionStorage` as injectables and sharing the logic for
accessing them safely. This also makes it easier to mock the storage in
tests without having to mess with the actual `Window` object.

NOTE:
This commit actually decreases the payload size in the `main` bundle by
40B.

PR Close #42259
2021-06-14 09:54:09 -07:00
George Kalpakas 6fd157f496 test(docs-infra): fix warnings in ThemeToggleComponent unit tests. (#42259)
due to unknown `<mat-icon>` element

This commit fixes some warnings in the unit tests of the
`ThemeToggleComponent`, which were caused by the following:

- The `<mat-icon>` element used in `ToggleThemeComponent`'s template was
  not declared in tests.
- The `dark-theme.css` and `light-theme.css` files requested by
  `ToggleThemeComponent` were not available.

PR Close #42259
2021-06-14 09:54:08 -07:00
George Kalpakas 311ca931fd build(docs-infra): align code with new CLI v12 apps (#42259)
This commit aligns the angular.io config files more closely to how a
newly generated CLI v12 app would look like. This helps validate the
setup and makes it easier to apply new chages in the future (by
preventing the angular.io layout from deviating too much from the
default new app layout).

PR Close #42259
2021-06-14 09:54:08 -07:00
Andrew Scott cee5c100af docs: remove section on tables from docs style guide (#42330)
The approach for tables is more of an ad-hoc determination based on the
complexity of what's in them. If/when we enable formatting of markdown
files, that will also make the markdown format of tables easier to read
and more consistent.

fixes #23978

PR Close #42330
2021-06-11 11:47:04 -07:00
Ahmed Ayed 013d1cb010 refactor(router): compute correct history restoration when navigation is cancelled (#38884)
We can’t determine whether the user actually meant the `back` or
the `forward` using the popstate event (triggered by a browser
back/forward)
so we instead need to store information on the state and compute the
distance the user is traveling withing the browser history.
So by using the `History#go` method,
we can bring the user back to the page where he is supposed to be after
performing the action.

implementation for #13586

PR Close #38884
2021-06-10 14:09:21 -07:00
Pete Bacon Darwin 1e6b913218 docs: fix i18n guide typo (#42545)
Fixes #42538

PR Close #42545
2021-06-10 14:04:44 -07:00
gobika21 5d3cf97584 docs: fix typo in "deploy multiple locales" section (#42541)
Fixes #42540

PR Close #42541
2021-06-10 14:03:34 -07:00
Pham Huu Hien dbd81af38d docs: change field name from id to $id in schema.json file (#42528)
fix error "SchematicsMyService" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.

PR Close #42528
2021-06-10 14:03:00 -07:00
Aristeidis Bampakos 58606877dc docs: add note for naming libraries (#42335)
PR Close #42335
2021-06-10 13:58:42 -07:00
Kapunahele Wong 51857958e6 docs: improve accessibility of router example (#40914)
PR Close #40914
2021-06-10 10:28:34 -07:00
JiaLiPassion e0158a1515 fix(zone.js): only one listener should also re-throw an error correctly (#41868)
Close #41867

In the previous commit https://github.com/angular/angular/pull/41562#issuecomment-822696973,
the error thrown in the event listener will be caught and re-thrown, but there is a bug
in the commit, if there is only one listener for the specified event name, the error
will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.

PR Close #41868
2021-06-10 09:24:04 -07:00
Alan Agius a75874c385 docs: CLI users polyfills (#42263)
With this change we remove polyfills that are listed in suggested/mandatory but are not needed by Angular CLI users, since the Angular CLI will include these polyfills by default.

Closes #39793

PR Close #42263
2021-06-09 16:10:49 -07:00
JoostK 60dbf017fb fix(compiler-cli): prevent prior compilations from being retained in watch builds (#42537)
In watch builds, the compiler attempts to reuse as much information from
a prior compilation as possible. To accomplish this, it keeps a
reference to the most recently succeeded `TraitCompiler`, which contains
all analysis data for the program. However, `TraitCompiler` has an
internal reference to an `IncrementalBuild`, which is itself built on
top of its prior state. Consequently, all prior compilations continued
to be referenced, preventing garbage collection from cleaning up these
instances.

This commit changes the `AnalyzedIncrementalState` to no longer retain
a `TraitCompiler` instance, but only the analysis data it contains. This
breaks the retainer path to the prior incremental state, allowing it to
be garbage collected.

PR Close #42537
2021-06-09 16:10:05 -07:00
Igor Minar 785da0f1bf fix(core): ensure that autoRegisterModuleById registration in ɵɵdefineNgModule is not DCE-ed by closure (#42529)
Previously the autoRegisterModuleById registration was marked with noSideEffects wrapper to ensure that we don't end up retaining all NgModules.

However the return value was not referenced by anything, so closure compiler removed it because it determined that this code has no side effects and is not referenced by anyone.

This issue affects apps that use Closure Compiler and also rely on https://angular.io/api/core/getModuleFactory to retrieve factories by ID. This combination is used heavily in google3, especially in Pantheon.

Fixes b/188453434

PR Close #42529
2021-06-09 12:13:24 -07:00
Pete Bacon Darwin 66399601cb docs: fix ngProjectAs selector in example (#42523)
Fixes #42522

PR Close #42523
2021-06-09 12:10:21 -07:00
Jessica Janiuk dfb072a93c release: cut the v12.0.4 release (#42531) 12.0.4 2021-06-09 11:03:28 -07:00
Andrew Scott 6203f5e3a7 docs: clarify onSameUrlNavigation behavior (#42275)
`onSameUrlNavigation` only affects whether the Angular Router
processes the URL and runs it through the navigation pipeline,
retriggering redirects, guards, and resolvers. The name `reload` is a
little confusing because it does _not_ reload the component. Developers
_also_ need to implement a custom `RouteReuseStrategy` to trigger a
component reload on same URL navigation.

Fixes #21115

PR Close #42275
2021-06-09 09:45:25 -07:00
David Shevitz 3abf365fdc docs: add guidance on adding filtering and sorting logic to componetns instead of pipes (#42368)
Fixes #41652

PR Close #42368
2021-06-08 17:53:31 -07:00
Teri Glover 5f6492e332 docs: Edited to remove jargon in Reference, Glossary, and Style sections (#42187)
PR Close #42187
2021-06-08 12:51:06 -07:00
kuncevic ef0ece14db docs: add Angular Rocks podcast (#42078)
PR Close #42078
2021-06-08 12:50:14 -07:00
Santosh Yadav 72b86c7c36 docs(platform-server): added commands for universal and add prerendering info (#36005)
Fixes #36004

PR Close #36005
2021-06-08 12:47:24 -07:00
Sam Severance f158ce1872 docs: Add selector for PeekABooDirective (#42146)
PR Close #42146
2021-06-08 12:46:06 -07:00
Teri Glover a42b9bf0ec docs: Edited to remove jargon in Reference Errors (#42186)
PR Close #42186
2021-06-08 12:45:24 -07:00
anups1 68ae32a864 docs: fix issue 24571 in ngOnChanges (#42517)
fix issue #24571 in ngOnChanges doc

PR Close #42517
2021-06-08 12:44:30 -07:00
Kapunahele Wong af5867d4b1 docs: improve accessibility of animations example (#41385)
PR Close #41385
2021-06-08 12:43:33 -07:00
Kapunahele Wong d509a76c2f docs: improve accessibility of reactive-forms example (#41252)
PR Close #41252
2021-06-08 12:42:20 -07:00
Kapunahele Wong 5746afe93d docs: improve accessibility of attribute-binding example (#41432)
PR Close #41432
2021-06-08 12:16:55 -07:00
Kapunahele Wong 6b8ecb448b docs: improve accessibility of pipes example (#41317)
PR Close #41317
2021-06-08 12:16:09 -07:00
Chris 93de5a0c5c docs: clarify documentation regarding passing multiple configurations to ng build (#41333)
Fixes #40923

PR Close #41333
2021-06-08 11:49:25 -07:00
Tiago Temporin 3ffdc751e4 docs: add components to material community components description (#41987)
PR Close #41987
2021-06-08 11:48:41 -07:00
Pete Bacon Darwin 8ad2feb0f3 refactor(docs-infra): prepare DocumentService to handle new disambiguated URLs (#42509)
A subsequent commit is going to change disambiguated URLs.
This commit prepares the AIO application to attempt the new URLs
if the old URLs fail. This will help to mitigate problems that may occur
during the period between deployment of the new version and the
service-worker not being updated.

PR Close #42509
2021-06-08 11:45:54 -07:00
Sam Severance a77ec5bcab fix(router): fix serializeQueryParams logic (#42481)
corrects a bug that resulted in query params such as
`[queryParams]={a: 1, b:[]}` being serialized as 'a=1&'
instead of 'a=1'

resolves #42445

PR Close #42481
2021-06-08 10:43:01 -07:00