32221 Commits

Author SHA1 Message Date
Alex Rickabaugh 329cf9fbde fix(core): change Resource to use explicit undefined in its typings (#59024)
Originally the `T` in `Resource<T>` represented the resolved type of the
resource, and `undefined` was explicitly added to this type in the `.value`
signal. This turned out to be problematic, as it wasn't possible to write a
type for a resource which didn't return `undefined` values. Such a type is
useful for 2 reasons:

1. to support narrowing of the resource type when `Resource.hasValue()`
   returns `true`.

2. for resources which use a different value instead of `undefined` to
   represent not having a value (for example, array resources which want to
   use `[]` as their default).

Instead, this commit changes `resource()` and `rxResource()` to return an
explicit `ResourceRef<T|undefined>`, and removes the union with `undefined`
from all types related to the resource's value. This way, it's trivially
possible to write `Resource<T>` to represent resources where `.value` only
returns `T`.

`hasValue()` then actually works to perform narrowing, by narrowing the
resource type to `Exclude<T, undefined>`.

PR Close #59024
2025-01-16 09:22:46 -08:00
Leon Senft f8b8e80d79 fix(core): treat exceptions in equal as part of computation (#55818)
Prevent leaking signal reads and exceptions from a custom `equal`
function of a producer `computed()` to a consumer.

Upstream https://github.com/tc39/proposal-signals/pull/90 with a notable
change: Angular does **not** track reactive reads in custom `equal`
implementations.

PR Close #55818
2025-01-16 08:10:10 -08:00
Pawel Kozlowski 055624d0da docs: update linkedSignal documentation (#59532)
This commit updates the linkedSignal documentation around
the quality function option.

Fixes #59094

PR Close #59532
2025-01-16 08:09:23 -08:00
Matthieu Riegler e4dd1773db docs: update examples to the application builder (#59539)
fixes #59538

PR Close #59539
2025-01-16 08:08:36 -08:00
Pawel Kozlowski aa45d44c5b docs: release notes for the v19.1.1 release 2025-01-16 13:19:36 +01:00
Kristiyan Kostadinov c9cd5585c2 fix(core): run HMR replacement in the zone (#59562)
Fixes that in some cases the HMR replacement function was being run outside the zone which meant that change detection would break down after a replacement.

Fixes #59559.

PR Close #59562
2025-01-16 12:36:58 +01:00
Kristiyan Kostadinov 2fe54a11f4 fix(platform-browser): roll back HMR fix (#59557)
Rolls back the changes from #59514 because they ended up being breaking in 1P. We can revisit the internal fix in a different way.

Fixes #59558.

PR Close #59557
2025-01-16 12:27:51 +01:00
Pawel Kozlowski db745cd75f test(devtools): disable flaky highlighter test (#59561)
The test in question was very flaky on CI, example run:
https://github.com/angular/angular/actions/runs/12805645683/job/35702462974?pr=59557

Disabling as it is causing productivity loose for the team.

PR Close #59561
2025-01-16 12:19:39 +01:00
Doug Parker c9eaf53b4f release: bump Angular DevTools version to 1.0.21 (#59548)
PR Close #59548
2025-01-15 16:48:00 -08:00
Andrew Kushnir d0ad030ec7 Revert "feat(compiler-cli): detect missing structural directive imports (#59443)" (#59544)
This reverts commit ed705a856a.

PR Close #59544
2025-01-15 13:38:37 -08:00
arturovt 2e138e644c refactor(common): prevent duplicating Content-Type header (#59518)
Drops some bytes by moving `Content-Type` into a variable, which is then minified to something like `var b="Content-Type"` and reused in all the places.

PR Close #59518
2025-01-15 12:22:29 -08:00
Pawel Kozlowski af99c6c109 refactor(core): move logic out of shared instructions code (#59453)
This is first of a series of refactorings that moves code
around such that logic from the shared instruction file
is dispatched to the relevant functional parts.

PR Close #59453
2025-01-15 12:20:27 -08:00
kirjs e2925cccf8 docs: release notes for the v19.1.0 release 2025-01-15 14:59:28 -05:00
kirjs b223f7e9c6 docs: release notes for the v19.0.7 release 2025-01-15 14:47:20 -05:00
Kevin Brey ed705a856a feat(compiler-cli): detect missing structural directive imports (#59443)
Adds a new diagnostic that ensures that a standalone component using custom structural directives in a template has the necessary imports for those directives.

Fixes #37322

PR Close #59443
2025-01-15 13:59:37 -05:00
arturovt 3b3040d32a refactor(common): drop error message in production (#59471)
Switches to using `RuntimeError` and drops the error message in production by replacing it with an error code.

PR Close #59471
2025-01-15 12:28:29 -05:00
Matthieu Riegler d797c5cb94 docs: update class & style binding recommendation (#59240)
This commit introduces an update to the official recommendations when it comes to class & styles bindings.

`[class]` & `[style]` bindings are now recommended for basic uses cases.

`[ngClass]` and `[ngStyle]` allow more advanced bindings (like space separated keys) or keys with units (for `ngStyle`) which are not supported by the native bindings. They still require the dedicated directives.

PR Close #59240
2025-01-15 12:27:12 -05:00
Angular Robot 2a92dcf4b7 docs: update Angular CLI help [main] (#59535)
Updated Angular CLI help contents.

PR Close #59535
2025-01-15 12:25:32 -05:00
Jeremy Elbourn c38ea0767e docs: clarify that @for doesn't support break/continue (#59533)
We recently saw some confusion around this, so it's worth adding a
sentence to clarify

PR Close #59533
2025-01-15 12:00:21 -05:00
carimatics 3e31438d59 docs(forms): escape inequality signs of input tags in flowchart (#59517)
The input tags written within the flowcharts in the document were not being escaped, so we did that.
This change will ensure that the flowcharts in the document are properly displayed.

PR Close #59517
2025-01-15 10:17:21 -05:00
Sandeep Salwan e702934080 docs: fix typos in let.md (#59526)
PR Close #59526
2025-01-15 09:44:25 -05:00
Andrew Kushnir eadf6a35bb Revert "refactor: initialize headers map directly in HttpHeaders class (#59268)" (#59523)
This reverts commit e15226a444.

PR Close #59523
2025-01-14 17:48:34 -05:00
Abdul Wahab 9db23f9d12 docs: fix property wrong usage inside afterNextRender in lifecycle.md (#59521)
PR Close #59521
2025-01-14 16:27:39 -05:00
Angular Robot 88305373d1 build: update cross-repo angular dependencies (#59520)
See associated pull request for more information.

PR Close #59520
2025-01-14 16:05:15 -05:00
hawkgs b9155b5121 docs: set syntax highlighting to the remaining Markdown code examples blocks (#59088)
There are some code blocks that slipped through the initial Regex-es.

Related to #59026

PR Close #59088
2025-01-14 15:14:02 -05:00
hawkgs 265265a3f8 docs(docs-infra): fix scrolling issues in the API reference (#59207)
Fix issues related to scrolling in the API reference:
- Scroll to the top of the page when navigating to the API details page
- Preserve scroll position when navigating back from the API details page

PR Close #59207
2025-01-14 14:56:42 -05:00
arturovt bc77f44802 refactor(common): tree-shake lcpObserver in NgOptimizedImage (#59481)
Prior to this commit, the `this.lcpObserver?.updateImage` expression was still preserved in the production code because it wasn't wrapped with `ngDevMode`. The observer is injected only in development mode. Additionally, we moved the logic from `ngOnDestroy` to avoid having an empty method in production.

PR Close #59481
2025-01-14 14:54:16 -05:00
Angular Robot 19d224117e build: lock file maintenance (#59519)
See associated pull request for more information.

Closes #59494 as a takeover pull request

PR Close #59519
2025-01-14 14:44:30 -05:00
arturovt 1ff5cd6906 refactor(common): tree-shake transfer cache interceptor stuff (#59439)
In this commit, we replace `isPlatformServer` runtime call with the `ngServerMode` in the `transferCacheInterceptorFn` in order to make the functionality tree-shakable between client and server bundles.

PR Close #59439
2025-01-14 14:40:05 -05:00
Pawel Kozlowski 815f1b1457 refactor(core): add profiler calls for tne newly introduced events (#59233)
The set of profiler events was recently extended. This commit plugs
newly created events dispatch into the approriate places
of the Angular core.

PR Close #59233
2025-01-14 12:35:21 -05:00
Pawel Kozlowski 9c835e89fe refactor(core): profiler takes null as a default instance (#59233)
Several profiler calls don't have any meaningful instance when
producing a profiling event. This commit changes the default
instance value to null to sreamline profiler invocations.

PR Close #59233
2025-01-14 12:35:21 -05:00
Kristiyan Kostadinov 2ca258705f fix(core): destroy renderer when replacing styles during HMR (#59514)
Currently when we swap out the component during HMR, we remove the renderer from the cache, but we never destroy it which means that its styles are still in the DOM. This can cause the old styles to leak into the component after they're replaced. These changes add a `destroy` call to ensure that they're removed.

PR Close #59514
2025-01-14 11:22:06 -05:00
hawkgs 803358f0a3 docs(docs-infra): change API reference list items order to top-down (#58655)
Change the order from left-right to top-down (columns) and additionally make columns equal width.

PR Close #58655
2025-01-14 11:10:52 -05:00
hawkgs 6cd6780d38 docs(docs-infra): fix SCSS build-time warnings (#59115)
Fix SCSS "declarations after nested rules" and `@import` warnings.

PR Close #59115
2025-01-14 11:09:23 -05:00
Matthieu Riegler 52334e02e7 refactor(compiler): remove unused AstVisitors (#59297)
Those 2 clases weren't imported anywhere.

PR Close #59297
2025-01-14 11:08:25 -05:00
Andrew Kushnir ed05cb5695 refactor(core): do not serialize parent block id for top level blocks (#59190)
This commit updates incremental hydration-related annotation logic to avoid serializing parent block id when it's `null` (for top-level blocks).

PR Close #59190
2025-01-14 11:06:58 -05:00
Angular Robot 9ae0d3e189 build: update dependency typescript to v5.7.3 (#59512)
See associated pull request for more information.

PR Close #59512
2025-01-14 11:03:56 -05:00
Angular Robot d19b7bbe4e build: update io_bazel_rules_sass digest to adeaf81 (#59508)
See associated pull request for more information.

PR Close #59508
2025-01-14 11:03:21 -05:00
hawkgs 220608e4cc docs(docs-infra): generate errors and extended-diagnostics route NavigationItem-s (#59355)
Generate the `NavigationItem`-s as part of adev/shared-docs pipeline and use the output JSON files instead of the hardcoded objects in the `sub-navigation-data.ts`.

PR Close #59355
2025-01-14 11:00:06 -05:00
Angular Robot 1f4c9ec2cf build: update all non-major dependencies (#59510)
See associated pull request for more information.

PR Close #59510
2025-01-14 10:57:23 -05:00
Angular Robot 2c8f199cf7 build: update dependency @babel/generator to v7.26.5 (#59511)
See associated pull request for more information.

PR Close #59511
2025-01-14 10:55:24 -05:00
Angular Robot 5462c64047 build: update scorecard action dependencies (#59513)
See associated pull request for more information.

PR Close #59513
2025-01-14 10:53:21 -05:00
Pawel Kozlowski 3d1496274c ci: update Ethan Cline GitHub user name (#59516)
Use case-sensitive user name.

PR Close #59516
2025-01-14 10:52:04 -05:00
RafaelJCamara e15226a444 refactor: initialize headers map directly in HttpHeaders class (#59268)
Improved the initialization of the headers map to enhance performance
and code readability.

No breaking changes.

PR Close #59268
2025-01-14 10:50:15 -05:00
arturovt d038b3cdd1 refactor(docs-infra): lazy-load EmbeddedTutorialManager in editor UI state (#59509)
In this commit, we lazy-load the `EmbeddedTutorialManager` in the editor UI state as done in other parts of the code.

PR Close #59509
2025-01-14 10:15:12 -05:00
Charles Lyding 9963a73699 docs: update component HMR to fully stable (#59503)
As of 19.1, component HMR for both styles and templates is considered
stable and enabled by default. This includes support for both inline
and file-based component styles/templates.

PR Close #59503
2025-01-14 09:49:15 -05:00
Andrew Kushnir 412ac303bc Revert "refactor(core): profiler takes null as a default instance (#59233)" (#59506)
This reverts commit c4ad8fb2e7.

PR Close #59506
2025-01-13 17:03:36 -05:00
Andrew Kushnir e77df14620 Revert "refactor(core): add profiler calls for tne newly introduced events (#59233)" (#59506)
This reverts commit 435d31ed5f.

PR Close #59506
2025-01-13 17:03:36 -05:00
hawkgs 0bb81c5ab4 feat(devtools): tone down obtrusive elements in the Injector Tree tab (#59499)
Some of the elements are a bit too large so they have been shrunken to fit in with the rest of the UI.

PR Close #59499
2025-01-13 15:06:24 -05:00
arturovt 47e48b44dc refactor(docs-infra): lazy-load EmbeddedTutorialManager in code editor (#59505)
In this commit, we lazy-load the `EmbeddedTutorialManager` in the code editor component as done in other parts of the code.

PR Close #59505
2025-01-13 15:00:26 -05:00