Commit graph

25355 commits

Author SHA1 Message Date
Kristiyan Kostadinov
50f8928d56 refactor(core): add host directive definitions validation (#47589)
Adds some logic to ensure that host directives are configured correctly.

PR Close #47589
2022-09-30 10:52:12 -07:00
Alexander Wiebe
89006b1025 fix(docs-infra): add punctuation to dr iq (#47525)
add punctuation to dr iq name to aid in clarity

Fixes #46011

PR Close #47525
2022-09-29 16:43:55 -07:00
Ciprian Sauliuc
752e2245f4 docs: add oxford commas and rephrase sentences (#47540)
PR Close #47540
2022-09-29 16:41:32 -07:00
Pawel Kozlowski
d3c25f20a3 test(common): demonstrate that image loaders are configurable on a component level (#47565)
Add a test to ensure that optimized image loaders can be configured at any
level of the DI hierarchy, including component's node injector.

PR Close #47565
2022-09-29 16:39:35 -07:00
Pawel Kozlowski
2c8579f1b4 refactor(common): decouple preconnect checks from image loaders (#47565)
Previously the built-in image loaders for the optimized image directive
were tightly coupled to the preconnect checks infrastructure. This was
creating a problem when developers were trying to provide a loader on
a component level (or, more generally, deeper in the DI hierarchy):
- PreconnectLinkChecker is the application-level service, provided in root;
- it makes sense to provide loaders in different parts of the DI hierarchy;

This refactoring removes the PreconnectLinkChecker configuration from
the loaders infrastructure and makes it application-wide config. The
PRECONNECT_CHECK_BLOCKLIST is also a simple provider (it was a
multi-provider previously) which should make the overall configuration
easier.

PR Close #47565
2022-09-29 16:39:35 -07:00
Paul Gschwendtner
ec1105dd71 build: use shared circleci dev-infra for common circleci code (#47467)
This allows us to remove the duplicated `rebase-pr.js` script so that we can maintain this script in a single place.

PR Close #47467
2022-09-29 15:53:40 -07:00
Angular Robot
d90e76054f build: update cross-repo angular dependencies (#47454)
See associated pull request for more information.

PR Close #47454
2022-09-29 15:51:08 -07:00
dario-piotrowicz
051f75648d fix(compiler): scope css keyframes in emulated view encapsulation (#42608)
Ensure that keyframes rules, defined within components with emulated
view encapsulation, are scoped to avoid collisions with keyframes in
other components.

This is achieved by renaming these keyframes to add a prefix that makes
them unique across the application.

In order to enable the handling of keyframes names defined as strings
the previous strategy of replacing quoted css content with `%QUOTED%`
(introduced in commit 7f689a2) has been removed and in its place now
only specific characters inside quotes are being replaced with
placeholder text (those are `;`, `:` and `,`, more can be added in
the future if the need arises).

Closes #33885

BREAKING CHANGE:

Keyframes names are now prefixed with the component's "scope name".
For example, the following keyframes rule in a component definition,
whose "scope name" is host-my-cmp:

   @keyframes foo { ... }

will become:

   @keyframes host-my-cmp_foo { ... }

Any TypeScript/JavaScript code which relied on the names of keyframes rules
will no longer match.

The recommended solutions in this case are to either:
- change the component's view encapsulation to the `None` or `ShadowDom`
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.

PR Close #42608
2022-09-29 15:49:51 -07:00
Kristiyan Kostadinov
76a8c68cc1 refactor(core): add input and output filtering for host directives (#47536)
Adds the logic that will filter out unexposed inputs/outputs and apply the aliases that the author specified when writing the host directives.

PR Close #47536
2022-09-29 15:48:59 -07:00
George Kalpakas
c39a3a1539 build(docs-infra): upgrade cli command docs sources to 556a775f3 (#47554)
Updating [angular#main](https://github.com/angular/angular/tree/main) from
[cli-builds#main](https://github.com/angular/cli-builds/tree/main).

##
Relevant changes in
[commit range](4a6e62d46...556a775f3):

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

PR Close #47554
2022-09-29 10:53:50 -07:00
Ole M
26ad19e81a docs(common): update reference url to ICU docs (#47518)
PR Close #47518
2022-09-29 10:53:27 -07:00
Pawel Kozlowski
c5d1478cb8 test(upgrade): demonstrate that downgraded component can be standalone (#47504)
This change is adding a test demonstrating that a standalone component
can be downgraded to a AngularJS component.

PR Close #47504
2022-09-29 10:52:56 -07:00
Pawel Kozlowski
f0d6a0276b test(upgrade): demonstrate that upgraded component can be standalone (#47503)
This change is adding a test demonstrating that AngularJS component
can be upgraded to a standalone directive.

PR Close #47503
2022-09-29 10:52:14 -07:00
Joe Martin (Crowdstaffing)
7809e3a405 docs: Add topics for lifecycle directory (#47392)
Add empty topics to lifecycle directory.

PR Close #47392
2022-09-29 10:51:00 -07:00
Joe Martin (Crowdstaffing)
ee0c7161dd docs: add new files (#47391)
Add new files for component content.

PR Close #47391
2022-09-29 10:50:14 -07:00
mgechev
d8f1f63860 docs: temporarily hide banner to improve survey visibility (#47564)
PR Close #47564
2022-09-29 10:49:35 -07:00
Andrew Kushnir
5a17858c5a refactor(router): unify the RouterLink and RouterLinkWithHref class logic (#47500)
Currently, the `RouterLink` and `RouterLinkWithHref` classes share a lot of common code (with some special logic around handling `<a>`-related scenarios). This commit unifies the logic of the mentioned directives by moving the necessary handling to the `RouterLink` directive and making it a parent one for the `RouterLinkWithHref` class (i.e. class RouterLinkWithHref extends RouterLink).

This is the first step in upcoming unification to merge both directives and just keep `RouterLink` one (it'd be done in followup PRs).

PR Close #47500
2022-09-29 10:48:39 -07:00
Alex Rickabaugh
bcc4a95c44 release: cut the v15.0.0-next.4 release 2022-09-28 14:23:36 -07:00
Alex Rickabaugh
2d35395b69 docs: release notes for the v14.2.4 release 2022-09-28 14:18:22 -07:00
Andrew Scott
6a88bad019 fix(router): Ensure ActivatedRouteSnapshot#title has correct value (#47481)
ActivatedRouteSnapshot data gets mutated in the resolve phase of the Router. The title is assigned as part of this.
As a result, the title must be a getter in order to pick up the value that was note available during the class creation.

fixes #47459

BREAKING CHANGE: The title property is now required on ActivatedRouteSnapshot

PR Close #47481
2022-09-27 10:49:54 -07:00
Kristiyan Kostadinov
002ee3226c refactor(core): support applying directives to the root component (#47530)
Currently the code that creates a root component assumes that it's always going to deal with a single component definition which won't work with host directives. These changes rework the code so that it's able to apply multiple directives, allowing us to eventually add support for host directives.

I also tried to make the root component creation easier to follow by breaking it up into smaller functions.

PR Close #47530
2022-09-27 10:49:21 -07:00
Simona Cotin
551c641a64 docs: update broken link (#47532)
PR Close #47532
2022-09-27 10:18:00 -07:00
Alan Agius
a4167c8854 docs: update what what the CLI collects in analytics (#47529)
This commit adds more information on what is collected by the Angular CLI as with https://github.com/angular/angular-cli/pull/23718 we will collect additional information.

PR Close #47529
2022-09-27 10:17:35 -07:00
ivanwonder
e7ee53c541 feat(language-service): support to fix invalid banana in box (#47393)
The Angular compiler will report the invalid banana in box, this code fixes
will try to fix the error and all the same errors in the selected file.

Fixes #44941

PR Close #47393
2022-09-27 10:16:11 -07:00
Andrew Kushnir
120555a626 feat(core): support object-based DI flags in TestBed.inject() (#46761)
This commit applies the changes similar to the ones performed for the `inject()` function in df246bb235.

The `TestBed.inject` function is updated to use previously added object-based API for options: now the flags argument supports passing an object which configures injection flags.

DEPRECATED:

The bit field signature of `TestBed.inject()` has been deprecated, in favor of the new options object.

PR Close #46761
2022-09-27 10:09:53 -07:00
Andrew Kushnir
841c8e5138 feat(core): support object-based DI flags in Injector.get() (#46761)
This commit applies the changes similar to the ones performed for the `inject()` function in df246bb235.

The `Injector.get` function is updated to use previously added object-based API for options: now the flags argument supports passing an object which configures injection flags.

DEPRECATED:

The bit field signature of `Injector.get()` has been deprecated, in favor of the new options object.

PR Close #46761
2022-09-27 10:09:53 -07:00
Kristiyan Kostadinov
85b5d125be build: fix rxjs 7 build failure (#47548)
Fixes that the `node` typings weren't included in the rxjs 7 typings test.

PR Close #47548
2022-09-26 13:43:19 -07:00
Ashley Hunter
f9e21d36bd docs: fixing standalone components sample code (#47542)
PR Close #47542
2022-09-26 09:56:57 -07:00
JiaLiPassion
86372538ab refactor(zone.js): remove zone-async-tagging from zone.js (#47416)
1. Remove `zone-async-tagging` implementation from zone.js and move the
implementation to `@angular/core`, so `@angular/core` can import this
package more easily for better treeshaking.
2. Add `async tagging zone` implemenation into `@angular/core` package.
So we don't need to get the `AsyncStackTaggingZoneSpec` from `global`
instance, we can import the `class` directly for better treeshaking.
3. Only load this ZoneSpec when `ngDevMode` is `true`.

PR Close #47416
2022-09-23 14:44:38 -07:00
Rokas Brazdžionis
291a5b35bd docs: visualize keyboard shortcut for search (#47507)
PR Close #47507
2022-09-23 14:04:42 -07:00
Jessica Janiuk
478db892c2 docs: Add new PR response templates (#47515)
This adds new PR template responses for dealing with rebases and commit header changes.

PR Close #47515
2022-09-23 14:02:03 -07:00
Alan Agius
aef8d0bb02 fix(core): correctly check for typeof of undefined in ngDevMode check (#47480)
Previously, this check was wrong as typeof returns a string.

PR Close #47480
2022-09-23 14:00:46 -07:00
Doug Parker
ddef448cf3 docs: add v15 scheduled release dates (#47513)
These dates are week-specific to give some flexibility during the release process which frequently happens. I back-dated the most recent minors mainly to make sure we include them when we eventually update to v16 and beyond.

PR Close #47513
2022-09-23 14:00:04 -07:00
Alan Agius
85330f3fd9 fix(core): update isDevMode to rely on ngDevMode (#47475)
This commits update `isDevMode` to rely on the `ngDevMode` which in the CLI is set by the bundler.

We also update `@angular/platform-dynamic-browser` and `@angular/compiler` to remove usage of `jitDevMode`, with this change we remove all internal usages of `isDevMode`.

PR Close #47475
2022-09-23 13:58:45 -07:00
Kristiyan Kostadinov
3fe21a67ca refactor(core): expose host directives to their host through DI (#47476)
Exposes the host directives to the host and its descendants through DI. This can be useful, because it allows the host to further configure the host directives.

PR Close #47476
2022-09-23 13:58:17 -07:00
Pawel Kozlowski
7a5ba93ce2 release: cut the v15.0.0-next.3 release 2022-09-21 20:16:17 +02:00
Pawel Kozlowski
0ebd326d3e docs: release notes for the v14.2.3 release 2022-09-21 20:10:05 +02:00
JoostK
8fcadaad48 perf(compiler-cli): cache source file for reporting type-checking diagnostics (#47471)
When reporting type-checking diagnostics in external templates we create a
`ts.SourceFile` of the template text, as this is needed to report Angular
template diagnostics using TypeScript's diagnostics infrastructure. Each
reported diagnostic would create its own `ts.SourceFile`, resulting in
repeatedly parsing of the template text and potentially high memory usage
if the template is large and there are many diagnostics reported. This commit
caches the parsed template in the template mapping, such that all reported
diagnostics get to reuse the same `ts.SourceFile`.

Closes #47470

PR Close #47471
2022-09-21 18:22:23 +02:00
Angular Robot
8cef5dd7c1 build: update all non-major dependencies (#47487)
See associated pull request for more information.

PR Close #47487
2022-09-21 16:00:46 +02:00
Kristiyan Kostadinov
06ca0dcf27 refactor(core): remove assumptions that component will be first in directives list (#47490)
`TNode`s have the `directiveStart` and `directiveEnd` properties that indicate the indexes at which directive instances (including components) have been stored. Currently there are several places throughout the codebase which assume that if a component matches a node, its index will always be `directiveStart`.

As far as I can tell, we probably ended up accumulating these assumptions, because we needed a quick way of accessing the component instance and it happened to be conventiently stored at `directiveStart`. The reason why it's always stored at `directiveStart` is likely to match the lifecycle hook execution order from ViewEngine.

With host directives these assumptions won't be valid anymore, because we want the host directives to _always_ execute before the host component that they're on so that the host has a chance to override them. To achieve this we have to insert host directives before the component.

These changes address the issue by introducing a new `TNode.componentOffset` property which indicates the offset after `TNode.directiveStart` at which the component is stored. Furthermore, I've removed the `isComponentHost` flag since it was duplicating the information from `TNode.componentOffset` and I've audited and fixed all the places where we read `directiveStart` to account for the changed data structure.

Reasons for some of the decisions I made along the way:
* In the case of host directives, I decided to go against our current convention of executing the component lifecycle hooks before the directive, because lifeycle hooks are a chance to change the component state (e.g. in `ngOnChanges`) and running the component hooks first would allow the host directives to undo any overrides made by the host.
* I decided to go with a `componentOffset`, instead of a `componentIndex` indicating the exact index the component is at, because as the runtime is set up at the moment, it would be difficult to know what index the component is going to end up at. Another problem is that we appear to have some logic that moves the entire "directive window" by incrementing both `directiveStart` and `directiveEnd`. By using an offset, we don't have to worry about the index remaining correct.

PR Close #47490
2022-09-21 10:05:32 +02:00
JiaLiPassion
59aa2c06d1 test(zone.js): update jest test code after upgrade to jest 29.0 (#47486)
related to https://github.com/angular/angular/pull/47438
After jest 28, `jest-environment-node` and `jest-environment-jsdom` need
to be installed by the user themselves, and the API has some breaking
changes, so this PR fix these issues to make the zone/jest integration
test code work as expected.

PR Close #47486
2022-09-20 18:12:47 +02:00
dario-piotrowicz
d11b1d99b0 fix(animations): make sure that the useAnimation function delay is applied (#47468)
make sure that when an animation is used via the `useAnimation` function
and a delay has been provided then that delay gets correctly applied

(this PR is a follow up for #47285)

PR Close #47468
2022-09-20 10:10:23 +02:00
Sabareesh Kappagantu
32cad55f0d feat(devtools): implement inspect functionality for directives (#47334)
Previously, you could inspect the source code of a component but not a directive. This commit adds functionality to inspect source code for directives as well. Now you will see the inspect icon on the header component of each directive on a selected element.

PR Close #47334
2022-09-19 18:59:13 +02:00
famzila
150dd3092b docs: add fatima amzil to contributors (#47097)
PR Close #47097
2022-09-19 18:58:15 +02:00
Andrew Scott
8a3054c954 ci: remove atscott from unavailable list (#47482)
atscott is no longer OOO long term and is available.

PR Close #47482
2022-09-19 18:16:51 +02:00
Joey Perrott
7814da67cb build: fix AleksanderBodurri to be the correct capitalization in pullapprove config (#47483)
Fix AleksanderBodurri username.

PR Close #47483
2022-09-19 18:12:19 +02:00
Angular Robot
c9991ca49d build: update dependency google-closure-compiler to v20220905 (#47437)
See associated pull request for more information.

PR Close #47437
2022-09-19 17:21:02 +02:00
Bob Watson
53db8ab246 docs: add standalone component intro video (#47359)
Fix: #47358

PR Close #47359
2022-09-19 17:19:09 +02:00
Bob Watson
58e3d79fe6 docs: add link to YouTube video of Typed Forms (#47361)
Fix: #47360

PR Close #47361
2022-09-19 17:12:34 +02:00
AleksanderBodurri
14d5fc5700 docs: add issue template for Angular DevTools (#47383)
Previously there was no existing issue template for users who want to open a feature request or bug report issue for Angular DevTools.

This commit addresses this by creating a new issue template for Angular DevTools.

PR Close #47383
2022-09-19 17:10:54 +02:00