29435 Commits

Author SHA1 Message Date
Pawel Kozlowski 50623ea1e1 release: cut the v17.2.4 release 17.2.4 2024-03-06 20:28:55 +01:00
Matthieu Riegler 443e5f1591 fix(core): return a readonly signal on asReadonly. (#54719)
Previous `asReadonly()` returned the signal value and not the signal itself.

Fixes #54704

PR Close #54719
2024-03-06 15:18:51 +01:00
Alan Agius c75c168ed5 fix(docs-infra): do not delete BUILD.bazel in help directory during updates (#54697)
In https://github.com/angular/angular/pull/54591, a `BUILD.bazel` file was created in `aio/content/cli/help/BUILD.bazel`, this however breaks the automatic CLI help pages updates as prior to this change, the `help` directory was being deleted. See: https://github.com/angular/angular/pull/54691/commits/17346e89da2fbddf8274eeadf12bab9c5b8983d8

This commit, updates the process to delete only the JSON files and copying the new files.

PR Close #54697
2024-03-06 10:18:04 +01:00
Jessica Janiuk 3b50885691 docs: add process documentation to CARETAKER.md (#54664)
This adds documentation regarding the latest changes to framework merge tools. It specifically covers the requires: TGP label and separate sync for primitives.

PR Close #54664
2024-03-05 19:11:43 +01:00
Matthieu Riegler 6148d76e21 docs: fix clipped docs-code block in docs-reference-api-tab (#54621)
PR Close #54621
2024-03-05 18:35:20 +01:00
Matthieu Riegler aa0fce6531 docs: fix tutorial preview size (#54621)
PR Close #54621
2024-03-05 18:35:19 +01:00
Matthieu Riegler 43b027f36e docs: fix label on API link. (#54621)
Remove the unecessary double quotes on a @see link.

PR Close #54621
2024-03-05 18:35:14 +01:00
Matthieu Riegler e7eadd9aff docs(docs-infra): remove unwanted styling on API page. (#54621)
`box-sizing: border-box` prevents overflow caused by borders.

PR Close #54621
2024-03-05 18:35:13 +01:00
Jessica Janiuk badae7254e ci: fix ng-dev build for pr merging (#54708)
This updates ng-dev to the latest hash fixing the merge files query.

PR Close #54708
2024-03-05 18:28:25 +01:00
Andrew Kushnir 586cc24a10 fix(core): apply TestBed provider overrides to @defer dependencies (#54667)
This commit updates TestBed logic to take into account situations when dependencies loaded within `@defer` blocks may import NgModules with providers. For such components, we invoke provider override function, which recursively inspects and applies the necessary changes.

PR Close #54667
2024-03-05 09:21:23 +01:00
Paul Gschwendtner b558a01c84 fix(core): generic inference for signal inputs may break with --strictFunctionTypes (#54652)
This commit fixes that the generic inference for signal inputs may break
with `--strictFunctionTypes`.

We are not using --strictFunctionTypes` in all tests, so function parameters are always
checked bivariantly- while in 1P function parameters are checked contravariantly. This
breaks sub-typing and e.g. `InputSignal<number>` is not a subtype of `InputSignalWithTransform<unknown, number>`.

Root cause is that the input signal captures the equality function that
is exclusively concerned with the `ReadT`. And `ReadT` is never equal, or a
supertype of unknown.

https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgSSTAFcYBlBAcyUwBsB1BGACwBUpMkBndaAWwA8AJWCYAJqwA0celCbBWAPjgBvAFBw4Aei1xWACXxlEXOCzxQIEeNkzEuwAIRmAnmDxhMHPsFRRTXnjYzMDYANbAYnDYECgcAG5eCJwwtC7SAHIA8qxwAEYIALSJcilpAHQacMAAjsR0AFxwABSYTSLiUvntohIAlHAAvMp5VrSiSADcalUA+rNQvaw9ndOa8wDucqjLMtsK0wC+aqCQsIgoaFi4BESkFNR0wkuKVaCoSGKmhCTkVDQMJhsDjcXhQQQdCTSSFKVTHNQxbjwEBNH73f50RgsdicHj8ATEJBhJAQDZIaRIYh8PJoZSDKqU2i0ZyYb53P6PWgCSnU2nTKpaABUM00rDceAA5GiOQDuVSaVBFBKTHASfBWVwMXlxmYIK53HApeyHgCscDcWDBITiaTyar5bSJZVReLTBB0HAwJZ3LAXIbavVaMrAhcYnxPDAENrgM7NHpxYbWk0eQrpHlkw6oANhvkxhNlQhTGq4BqtTqYHqYAmJUm4NaSWS00167bsyM85wnVU4-H3G6PZ5vL40KYJZhg59DeOS4tQxBw5hI9HYz2XQaJS2yQWi9YS1xNY9o7r9ZKU2gnc0AEwzDTZVgAUSaABF7wAFe8ZF8ZXJZDJwAAGhSFFwMByNgMAAGKEuBCCxGKfb-nA6C0JglArqugpaEAA

PR Close #54652
2024-03-04 19:07:47 +01:00
Jessica Janiuk 2fc1971ac6 ci: Add primitives configurations for ng-dev tools (#54663)
This adds the configs to enable validators and google sync patterns for primitives sharing.

PR Close #54663
2024-03-04 18:20:46 +01:00
cexbrayat 9637b5d03d refactor(compiler): cleanup unused code in template builder pipeline (#54654)
This removes some unused code and fixes a few typos across the pipeline code.

PR Close #54654
2024-03-04 18:15:58 +01:00
danieljancar 7ead0fccb0 docs: revise documentation for @for control flow, 'track $index' performance issues explanation, and confusing 'trackBy' mention (#53806)
PR Close #53806
2024-03-04 11:37:41 +01:00
Pawel Kozlowski 6ca8ecad54 docs: queries as signals adev guide (#54505)
Add a angular.dev version of queries as signals guide.

PR Close #54505
2024-03-04 11:11:17 +01:00
Andrew Scott e3bdab12fa refactor(core): Pending effects should make the application unstable (#53835)
In zone-full applications, this is already true because effects are
scheduled inside a microtask and tracked by ZoneJS. When not using
zones, this should stay consistent on principle and for testability
reasons. A general pattern with zoneless testing will be to update state
and `await` some promise (i.e. `fixture.whenStable`, which will be
linked to `ApplicationRef.isStable`).

PR Close #53835
2024-03-04 10:35:42 +01:00
Matthieu Riegler 342737e01f docs(docs-infra): Update tutorial deps (#54677)
PR Close #54677
2024-03-04 10:03:17 +01:00
Hozefa Mangalorewala 0767adc603 docs: fix broken link on the tutorial page (#54669)
PR Close #54669
2024-03-03 13:59:03 +01:00
Swami 37dcf8d658 refactor(core): remove unused EffectRef import statement (#53863)
Remove unused, leftover imports.

PR Close #53863
2024-02-29 14:54:51 +01:00
Alex Rickabaugh ffbafc7d4a fix(core): untrack various core operations (#54614)
One downside of implicit dependency tracking in `effect()`s is that it's easy
to for downstream code to end up running inside the effect context by accident.
For example, if an effect raises an event (e.g. by `next()`ing a `Subject`), the
subscribers to that `Observable` will run inside the effect's reactive context,
and any signals read within the subscriber will end up as dependencies of the
effect. This is why the `untracked` function is useful, to run certain
operations without incidental signal reads ending up tracked.

However, knowing when this is necessary is non-trivial. For example, injecting
a dependency might cause it to be instantiated, which would run the constructor
in the effect context unless the injection operation is untracked.

Therefore, Angular will automatically drop the reactive context within a number
of framework APIs. This commit addresses these use cases:

* creating and destroying views
* creating and destroying DI injectors
* injecting dependencies
* emitting outputs

Fixes #54548

There are likely other APIs which would benefit from this approach, but this
is a start.

PR Close #54614
2024-02-29 11:38:58 +01:00
Kristiyan Kostadinov 917b9bdd2e fix(compiler-cli): unwrap expressions with type parameters in query read property (#54647)
Fixes that a query like `viewChild('locator', {read: ElementRef<HTMLElement>})` would throw because we didn't account for expressions with type parameters.

I've also included support for parenthesized expressions and `as` expressions since it's pretty easy to support them.

Fixes #54645.

PR Close #54647
2024-02-28 18:05:15 +01:00
Tommy Gaessler 7ca08aaa5b docs: updated setting up Zone.js instructions (#52409)
Updated the "Setting up Zone.js" instructions to the latest convention from
how the Angular CLI configures it.
Include adding zone-flats.ts to the tsconfig.app.json file step.
Added src/ to zone-flag.ts in the code example.

PR Close #52409
2024-02-28 17:35:18 +01:00
Kristiyan Kostadinov c19c44d694 docs: fix broken link in AIO (#54649)
Fixes a broken link that is currently breaking the CI.

PR Close #54649
2024-02-28 17:15:11 +01:00
Nikita Barsukov b0f434a893 docs: fix broken markdown syntax (#53567)
PR Close #53567
2024-02-28 15:16:17 +01:00
mgechev c05bef0ee8 docs: update versioning and deprecation policies (#51423)
Add more details around:
- What we consider a breaking change
- What is a deprecation
- How do we guarantee Angular stays stable
- Update invalid links

PR Close #51423
2024-02-28 14:38:41 +01:00
mgechev 3f0e892638 docs: add updating to v17 guide (#52410)
PR Close #52410
2024-02-28 14:19:46 +01:00
Dylan Hunn edc45d5b6f release: cut the v17.2.3 release 17.2.3 2024-02-27 16:23:40 -08:00
Sumit Parakh 79a32816dc fix(core): fix typo in injectors.svg file (#54596)
this commit fixes the unnecessary single quote in injectors.svg file

Closes #54592

PR Close #54596
2024-02-27 15:21:17 -08:00
Angular Robot 11a0a5d017 build: update io_bazel_rules_sass digest to 888dd9c (#54615)
See associated pull request for more information.

PR Close #54615
2024-02-27 14:06:34 -08:00
Doug Parker 89db58691f release: bump Angular DevTools version to 1.0.11 (#54631)
PR Close #54631
2024-02-27 14:02:20 -08:00
Doug Parker 624767c076 Revert "refactor(devtools): implement iframe support for Angular DevTools' browser code (#53934)" (#54629)
This reverts commit dd3dac9cc9.

PR Close #54629
2024-02-27 14:00:17 -08:00
Doug Parker 7b30a869e1 Revert "refactor(devtools): implement multiframe support in devtools page (#53934)" (#54629)
This reverts commit ebcdc8dc96.

PR Close #54629
2024-02-27 14:00:17 -08:00
Doug Parker 986b9c3bea refactor: add --spawn_strategy local to --config debug (#54167)
This seems to be necessary to debug Node tests.

PR Close #54167
2024-02-26 18:36:42 -08:00
Andrew Scott 69598c0c6c refactor(core): Internal render hooks trigger view refresh before executing user hooks (#54224)
This commit ensures that any internal render hooks that cause views to
become dirty again first refresh those dirty views before running user
render hooks. This ensures that user render hooks have the most complete
render state possible and stops them from needlessly executing multiple
times. This is important to maintain the goal of the public render
hooks, which is to provide the safest place to place code that depends
on DOM state, especially in ways that may force a browser paint.

PR Close #54224
2024-02-26 18:31:16 -08:00
Andrew Scott ffe3aa1169 refactor(core): Add helper function for queuing state updates (#54224)
This adds a helper function to defer application state updates to the
first possible "safe" moment. If application-wide change detection
(ApplicationRef.tick) is currently executing when this function is used,
the callback will execute as soon as all views attached to the
`ApplicationRef` have been refreshed. Refreshing the application views
will happen again before `checkNoChanges` executes.

When a change detection is _not_ running, this state update will execute
in the microtask queue.

This function is necessary as a replacement for current
`Promise.resolve().then(() => stateUpdate())` to be zoneless compatible
while ensuring those state updates are synchronized to the DOM before
the browser repaint. Without this, updates done in `Promise.resolve(...)` would
queue another round of change detection in zoneless applications, and
this change detection could happen in the next browser frame, and cause
noticeable flicker for the user.

Additionally, this function provides a way to perform state updates that
will run on the server as well as in the browser.

Last, current applications using `ngZone: 'noop'` may not be
calling `ApplicationRef.tick` at all so this function provides a
mechanism to ensure the state update still happens by racing
a microtask with `afterNextRender` (which might never execute).

PR Close #54224
2024-02-26 18:31:15 -08:00
cexbrayat 2aefed8763 fix(compiler-cli): catch function instance properties in interpolated signal diagnostic (#54325)
Currently, the following template compiles without error, even if the signal is not properly called:

```
<div>{{ mySignal.name }}</div>
```

This is because `name` is one of the instance properties of Function (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function#instance_properties).

The interpolated signal diagnostic is now extended to catch such issues.

PR Close #54325
2024-02-26 18:30:06 -08:00
Angular Robot 377442d90f build: update scorecard action dependencies (#54407)
See associated pull request for more information.

PR Close #54407
2024-02-26 18:29:39 -08:00
cexbrayat 20a549f1de docs: use components in model inputs guide (#54606)
The code example showcases a `@Directive` with a template instead of a `@Component`.

PR Close #54606
2024-02-26 18:28:15 -08:00
Kristiyan Kostadinov daf7c611b2 fix(compiler-cli): identify aliased initializer functions (#54609)
Fixes that initializer functions weren't being recognized if they are aliased (e.g. `import {model as alias} from '@angular/core';`).

To do this efficiently, I had to introduce the `ImportedSymbolsTracker` which scans the top-level imports of a file and allows them to be checked quickly, without having to go through the type checker. It will be useful in the future when verifying that that initializer APIs aren't used in unexpected places.

I've also introduced tests specifically for the `tryParseInitializerApiMember` function so that we can test it in isolation instead of going through the various functions that call into it.

PR Close #54609
2024-02-26 18:27:19 -08:00
Dylan Hunn c1163535d1 Revert "fix(compiler-cli): identify aliased initializer functions (#54480)" (#54595)
This reverts commit f04ecc0cda.

PR Close #54595
2024-02-26 08:36:50 -08:00
Andrew Kushnir 57123524a2 fix(core): collect providers from NgModules while rendering @defer block (#52881)
Currently, when a `@defer` block contains standalone components that import NgModules with providers, those providers are not available to components declared within the same NgModule. The problem is that the standalone injector is not created for the host component (that hosts this `@defer` block), since dependencies become defer-loaded, thus no information is available at host component creation time.

This commit updates the logic to collect all providers from all NgModules used as a dependency for standalone components used within a `@defer` block. When an instance of a defer block is created, a new environment injector instance with those providers is created.

Resolves #52876.

PR Close #52881
2024-02-23 12:30:06 -08:00
Pawel Kozlowski dcd6c8c79b refactor(core): use performance API for signals (#54521)
This commit adds a standard performance marker that can be viewed in Chrome dev tools and other tooling.
See more info at https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark

PR Close #54521
2024-02-23 12:18:31 -08:00
Kristiyan Kostadinov fbb0398795 docs: add a guide for model inputs (#54514)
Adds a guide for `model()` inputs for angular.io. Will port this over to angular.dev once it's finalized.

PR Close #54514
2024-02-23 11:47:04 -08:00
Felix Geißler 56ad65afa7 docs: syntax error in signal input transform example (#54567)
PR Close #54567
2024-02-23 11:46:14 -08:00
loka shafeek b1b7bbffb8 docs: Update wildcard route component to PageNotFoundComponent (#54570)
This PR enhances the Angular documentation by replacing the placeholder `<component-name>` with the actual `PageNotFoundComponent` in the wildcard route configuration. This update ensures that the documentation accurately reflects the recommended practice for handling page-not-found scenarios. Additionally, it addresses the issue where HTML entities like `&lt;` were being displayed instead of the desired `<` symbol, resulting in clearer and more readable documentation for users.
PR Close #54570
2024-02-23 11:45:39 -08:00
Kristiyan Kostadinov 48aec63ee4 fix(compiler-cli): identify aliased initializer functions (#54480)
Fixes that initializer functions weren't being recognized if they are aliased (e.g. `import {model as alias} from '@angular/core';`).

To do this efficiently, I had to introduce the `ImportedSymbolsTracker` which scans the top-level imports of a file and allows them to be checked quickly, without having to go through the type checker. It will be useful in the future when verifying that that initializer APIs aren't used in unexpected places.

I've also introduced tests specifically for the `tryParseInitializerApiMember` function so that we can test it in isolation instead of going through the various functions that call into it.

PR Close #54480
2024-02-23 11:44:40 -08:00
Lukas Matta d68cf175a4 docs: remove mutate function mention (#54569)
PR Close #54569
2024-02-23 11:43:25 -08:00
Matthieu Riegler 89f8331b7e ci: adding Matthieu as approver for ADEV (#54575)
This is to help the team approve changes on the new doc site.

PR Close #54575
2024-02-23 11:42:46 -08:00
Kristiyan Kostadinov 84ade02df6 refactor(compiler-cli): changes to get signal diagnostic working internally (#54585)
The diagnostic for signals that haven't been invoked wasn't working internally, because the path to `@angular/core` is different. These changes resolve the issue and do some general cleanup.

PR Close #54585
2024-02-23 11:42:07 -08:00
Kristiyan Kostadinov dbe673b027 fix(migrations): resolve infinite loop for a single line element with a long tag name and angle bracket on a new line (#54588)
Fixes an edge case where a single-line elemnt with a long tag name a closing bracket on a new line was putting the control flow migration into an infinite loop.

Fixes #54587.

PR Close #54588
2024-02-23 11:40:31 -08:00