26470 Commits

Author SHA1 Message Date
Andrew Kushnir d1c83ccc02 ci: disable size tracking CI job in favor of integration tests size checks (#49788)
Currently we have multiple integration apps which are instrumented with the payload size checks. In addition to that, there is a separate CI job that performs similar checks. The checks in CI job are redundant, thus this commit disables a separate CI job.

PR Close #49788
2023-04-11 10:48:01 -07:00
Nikola Kološnjaji 108145020f docs: Typo (#49781)
PR Close #49781
2023-04-11 10:27:53 -07:00
Andrew Scott 702ec90110 fix(core): When using setInput, mark view dirty in same way as markForCheck (#49747)
`ComponentRef.setInput` internally calls `markDirtyIfOnPush` which only marks
the given view as dirty but does not mark parents dirty like `ChangeDetectorRef.markForCheck` would.
https://github.com/angular/angular/blob/f071224720f8affb97fd32fb5aeaa13155b13693/packages/core/src/render3/instructions/shared.ts#L1018-L1024

`markDirtyIfOnPush` has an assumption that it’s being called from the parent’s template. That is, we don’t need to mark dirty to the root, because we’ve already traversed down to it.
The function used to only be called during template execution for input
bindings but was added to `setInput` later. It's not a good fit because
it means that if you are responding to events such as an emit from an `Observable`
and call `setInput`, the view of your `ComponentRef` won't necessarily get checked
when change detection runs next. If this lives inside some `OnPush` component tree
that's not already dirty, it only gets refreshed if you also call
`ChangeDetectorRef.markForCheck` in the host component (because it will be "shielded" be a non-dirty parent).

PR Close #49747
2023-04-10 13:29:11 -07:00
Kristiyan Kostadinov ffdfdc238f refactor(migrations): log a link to the standalone migration (#49752)
Resolves an old TODO about adding a link to the standalone migration guide.

PR Close #49752
2023-04-10 09:04:03 -07:00
Matthieu Riegler e7dd72c8de docs: update docs about prodMode. (#49745)
Following angular#49723, this commit updates the doc to reflect the actual message prompted in the console.

PR Close #49745
2023-04-10 09:02:30 -07:00
Matthieu Riegler 9c07a42fbe docs: Improve previous version navigation (#49063)
In archive mode the link to the current doc will now point to same page.
If the page doesn't exist anymore, it will show a contextualized warning message.

See #46850

PR Close #49063
2023-04-06 11:07:01 -07:00
Dylan Hunn 9a37a7786a release: cut the v15.2.6 release 15.2.6 2023-04-05 19:44:18 -07:00
Matthieu Riegler da5f316ebf refactor(core): Use the nullish coalescing assignment in render3 functions (#49698)
The usage of `??=` make the code more clear & concise.

PR Close #49698
2023-04-05 09:45:55 -07:00
Andrew Scott cad7274ef9 fix(router): create correct URL relative to path with empty child (#49691)
The previous fix for squashing empty children didn't quite work when the
existing route had segments. The result would be that the segments from
the existing route were dropped from the final URL.

PR Close #49691
2023-04-04 15:05:42 -07:00
Guillaume Weghsteen d9efa1b0d7 feat(core): change the URL sanitization to only block javascript: URLs (#49659)
In modern browsers, the 'javascript:' URL scheme is the only scheme that
can execute JavaScript when passed in a navigation URL context (e.g.
`a.href` value). Validate URL shemes to only contain characters allowed
in the URL specification ([a-zA-Z-+.]), and that are not javascript
(case insensitive). This is not a breaking change. The URL sanitization
is loosen.

PR Close #49659
2023-04-04 15:01:14 -07:00
Robin Richtsfeld c26e4bea9d docs: fix typo (#49704)
PR Close #49704
2023-04-04 15:00:39 -07:00
Sandra Limacher bd82fbeec4 docs: fix typo (#49669)
PR Close #49669
2023-04-03 19:18:41 -07:00
Matthieu Riegler 1d32253ca6 refactor(core): remove unnecessary reflect-metadata import. (#49673)
The import is not needed for the tests to run.

PR Close #49673
2023-04-03 19:17:03 -07:00
vikram menon 6e1b3adadb docs: fix typo in quick reference (#49655)
Change indicatedr5t to indicated

PR Close #49655
2023-04-03 19:13:16 -07:00
Johnny Gérard a6def648f5 docs: fix typo (#49664)
PR Close #49664
2023-04-02 22:10:13 -07:00
Andrew Scott 9b61379096 fix(router): Ensure initial navigation clears current navigation when blocking (#49572)
The navigation transition clears the current navigation in the finalize
operator of the current navigation Observer. This commit both completes
the `bootstrapDone` observable and updates the transition to only take 1
emit from the completed navigation. Either of these changes on their own
would fix the issue. The latter is a preventative measure in case a
mistake like the former is made again.

fixes #49567

PR Close #49572
2023-03-31 17:04:02 -07:00
John Manners 08979e4589 docs: fix typo in toh-pg6.md (#49141)
Line 425. Change burning to burn.
PR Close #49141
2023-03-31 12:00:44 -07:00
Angular Robot 233f33e6f1 build: update scorecard action dependencies (#49609)
See associated pull request for more information.

PR Close #49609
2023-03-31 11:49:47 -07:00
Vinit Neogi 35f491880c docs(core): fix view hierarchy links (#49629)
fixes incorrect links to view-hierarchy (currently view-tree)

Fixes #49623

PR Close #49629
2023-03-30 09:39:39 -07:00
Sarthak Thakkar 43e89bdacf docs: fixed typo error (#49637)
PR Close #49637
2023-03-30 09:38:43 -07:00
Matthieu Riegler 07e78bbbf4 docs: Update Popup.service example to remove ComponentFactoryResolver (#49638)
`ComponentFactoryResolver` has been deprecated and can be replaced by `createComponent()`.

PR Close #49638
2023-03-30 09:38:16 -07:00
Andrew Scott e78a2a4a47 release: cut the v15.2.5 release (#49635) 15.2.5 2023-03-29 12:37:48 -07:00
Alan Agius 077f6b4674 fix(compiler): do not unquote CSS values (#49460)
Currently we are unsafely unquoting CSS values which in some cases causes valid values to become invalid and invalid values to become valid.

Example:
```html
<div style="width:&quot;1px;&quot;"></div>
```

In the above case, `width` has an invalid value of `"1px"`, however the compiler will transform it to `1px` which makes it valid.

On the other hand,  in the below case
```html
<div style="content:&quot;foo&quot;"></div>
```

`content` has a valid value of `"foo"`, but since the compiler unwraps it to `foo` it becomes invalid. For correctness, we should not remove quotes.

```js
const div = document.createElement('div');
div.style.width='"1px"';
div.style.content='foo';

div.style.width; // ''
div.style.content; // ''

div.style.width='1px';
div.style.content='"foo"';

div.style.width; // '1px'
div.style.content; // '"foo"'
```

More information about values can be found https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier

PR Close #49460
2023-03-28 11:35:39 -07:00
Alan Agius d201fc2dec fix(core): set style property value to empty string instead of an invalid value (#49460)
Currently when the value of a styling property that has a unit is empty string a invalid value is generated.

Example:
`[style.width.px] = ""` will generate a value of `"px"`, when instead it should be `""`.

This causes browser to reset the value to an empty string. This is however not the case in Domino with changes in https://github.com/angular/domino/commit/bfc9114d1eb5b7591c43a7c6aef6ad50d24e369f.

This commit fixes the issues and generate correct values.

PR Close #49460
2023-03-28 11:35:39 -07:00
Matthieu Riegler 6d6fc12c88 refactor(core): Remove usage of deprecated Injector.create() (#49606)
This commit removes all usages of the deprecated `Injector.create` method but does not remove the deprecated signature itself.

PR Close #49606
2023-03-28 10:15:36 -07:00
Asaf Malin 8ed4083a98 docs: fixed grammar (#49560)
PR Close #49560
2023-03-28 10:14:45 -07:00
Matthieu Riegler 4c89a2497a refactor(common): add missing override to satisfy the linter (#49599)
Linter was complaining of missing `override` despite being OK on the CI. this commits add them.

PR Close #49599
2023-03-28 10:12:36 -07:00
Paul Gschwendtner 0fecbabfd2 ci: update pullapprove config to reflect current availability (#49592)
Updating PullApprove to reflect current availability. Looks like it cannot be set via UI anymore...
PR Close #49592
2023-03-27 08:43:06 -07:00
Tano Abeleyra ca5acadb78 fix(common): invalid ImageKit transformation (#49201)
q-auto is an invalid/unsupported transformation and should not be used

PR Close #49201
2023-03-27 08:33:22 -07:00
Andrew Scott 978d37f324 fix(router): Ensure Router preloading works with lazy component and static children (#49571)
The preloading strategy did not handle a `loadComponent` on a route with
a static `children`. It only preloaded children if they were also
`loadChildren` or both were not lazy loaded.

fixes #49558

PR Close #49571
2023-03-24 10:41:11 -07:00
Angular Robot 656a38899a build: update actions/checkout digest to 8f4b7f8 (#49577)
See associated pull request for more information.

PR Close #49577
2023-03-24 10:27:35 -07:00
Paul Gschwendtner 29c682ce5b ci: update github.com known host given recent RSA update (#49580)
See: https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

PR Close #49580
2023-03-24 12:54:11 +00:00
Sid 3f8e4fb724 docs: add missing word (#49565)
I have added a word to make the sentence more meaningful.
PR Close #49565
2023-03-23 11:44:04 -07:00
Kristiyan Kostadinov c3cff35869 fix(compiler): handle trailing comma in object literal (#49535)
Fixes that the compiler wasn't parsing an object literal with a trailing comma correctly.

Fixes #49534.

PR Close #49535
2023-03-23 11:35:45 -07:00
Jan Cabadaj a844435514 fix(router): fix #49457 outlet activating with old info (#49459)
Avoid activating outlet with old info if route was changed before outlet activated

PR Close #49459
2023-03-22 14:41:43 -07:00
Andrew Scott 901353ec7a release: cut the v15.2.4 release 15.2.4 2023-03-22 13:15:53 -07:00
Kristiyan Kostadinov 288156b06b Revert "fix(migrations): preserve trailing commas in code generated by standalone migration (#49533)" (#49547)
This reverts commit bf4d856834.

PR Close #49547
2023-03-22 10:21:27 -07:00
Kristiyan Kostadinov bf4d856834 fix(migrations): preserve trailing commas in code generated by standalone migration (#49533)
This is based on some internal feedback. Adds logic to the standalone migration that attempts to preserve trailing commas when updating existing AST nodes. When creating new ones, it tries to infer whether to generate the trailing comma based on the surrounding code.

PR Close #49533
2023-03-22 16:41:53 +01:00
Peter Götz 3bb76768a6 docs: remove ticks in code sample to generate components (#49525)
These ticks appear in the actual documentation and when copied verbatim while following the tutorial, running this command in the terminal simply does nothing.
PR Close #49525
2023-03-22 16:02:48 +01:00
Andrew Scott be2db59a55 refactor(router): Remove deprecated loadChildren file (#49504)
This file was used while migrations were happening internally. All code is now updated to the callback

PR Close #49504
2023-03-21 14:09:23 -07:00
Andrew Scott 9c57b656a1 refactor(router): Update router export location for deprecated interfaces (#49504)
Moving these exports to a separate file will allow easier local patches internally.

PR Close #49504
2023-03-21 14:09:22 -07:00
Andrew Scott b293c6a77c refactor(core): Remove VE/Render3 aliases from ViewRef code (#49499)
These aliases were used while we needed to maintain compatibility with ViewEngine

PR Close #49499
2023-03-21 14:08:30 -07:00
Alex Rickabaugh 951a3474d6 test: increase size tracking threshold to 5K / 5% (#49520)
This commit increases the threshold of payload size tracking tests from
500 bytes to 5,000 bytes, and from 1% to 5%. This is done to minimize merge
conflicts while still catching real regressions.

PR Close #49520
2023-03-21 20:30:05 +01:00
Paul Gschwendtner b5e68e42c1 build: exclude draft PRs from triage queue (#49515)
Excludes draft PRs from triage queue. Note that we cannot use
`draft:false` as otherwise all issues would be filtered. Rather
we need to negate `draft:true` which matches non-draft PRs and
normal issues.

PR Close #49515
2023-03-21 16:40:48 +01:00
Angular Robot a404587615 build: update scorecard action dependencies (#49508)
See associated pull request for more information.

PR Close #49508
2023-03-21 16:39:10 +01:00
Angular Robot 6c9886b1ca build: update cross-repo angular dependencies (#49517)
See associated pull request for more information.

PR Close #49517
2023-03-21 15:30:37 +01:00
Thomas Pischke 3c75f98117 docs: remove pipe in exponential backoff (#49494)
PR Close #49494
2023-03-21 07:58:06 +01:00
Thomas Pischke cd5d7b6615 docs: update deprecated exponential backoff example (#49494)
PR Close #49494
2023-03-21 07:58:06 +01:00
Aditya Srinivasan 97d58ec091 docs: fix link ngFor documentation link (#49479)
Fix the `ngFor` API link under the "Structural directive shorthand" section
PR Close #49479
2023-03-21 07:56:38 +01:00
Masaoki Kobayashi 087f4412af fix(core): more accurate matching of classes during content projection (#48888)
Showing a minimum app to reproduce the bug.
1. Create the app and add angular material.
```
ng new project
cd project
ng add @angular/material
```
1. Overwrite the src/app/app.component.html with minimal content.
```
<button mat-button *ngIf="true"><span *ngIf="true" class="{{'a'}}"></span></button>
```
1. Run the app. The button is not shown because of an exception.
```
main.ts:6
ERROR TypeError: item.toLowerCase is not a function
    at isCssClassMatching (core.mjs:8726:35)
    at isNodeMatchingSelector (core.mjs:8814:22)
    at isNodeMatchingSelectorList (core.mjs:8931:13)
    at matchingProjectionSlotIndex (core.mjs:14179:13)
    at Module.ɵɵprojectionDef (core.mjs:14222:49)
    at MatButton_Template (button.mjs:113:99)
    at executeTemplate (core.mjs:10534:9)
    at renderView (core.mjs:10356:13)
    at renderComponent (core.mjs:11529:5)
    at renderChildComponents (core.mjs:10216:9)
```
Because isCssClassMatching() function does not take care if the value is not string, while attrs[] may contain AttributeMarker which is actually numbers, item.toLowerCase() throws the exception.
Just inserted a check if the item is string.

Created a testcase for the original fix. It causes an exception without the fix.

fix(core): add a check code to avoid an exception inside isCssClassMatching

Showing a minimum app to reproduce the bug.
1. Create the app and add angular material.
```
ng new project
cd project
ng add @angular/material
```
1. Add `import { MatButtonModule } from '@angular/material/button'`,
   and also MatButtonModule inside @NgModule imports in src/app/app.module.ts to use MatButtonModule.
1. Overwrite the src/app/app.component.html with minimal content.
```
<button mat-button *ngIf="true"><span *ngIf="true" class="{{'a'}}"></span></button>
```
1. Run the app. The button is not shown because of an exception.
```
main.ts:6
ERROR TypeError: item.toLowerCase is not a function
    at isCssClassMatching (core.mjs:8726:35)
    at isNodeMatchingSelector (core.mjs:8814:22)
    at isNodeMatchingSelectorList (core.mjs:8931:13)
    at matchingProjectionSlotIndex (core.mjs:14179:13)
    at Module.ɵɵprojectionDef (core.mjs:14222:49)
    at MatButton_Template (button.mjs:113:99)
    at executeTemplate (core.mjs:10534:9)
    at renderView (core.mjs:10356:13)
    at renderComponent (core.mjs:11529:5)
    at renderChildComponents (core.mjs:10216:9)
```
Because isCssClassMatching() function does not take care if the value is not string, while attrs[] may contain AttributeMarker which is actually numbers, item.toLowerCase() throws the exception.
Just inserted a check if the item is string.

PR Close #48888
2023-03-20 16:07:14 +01:00