Commit graph

32714 commits

Author SHA1 Message Date
arturovt
ad5fbd944d refactor(common): drop value not a number message in production (#60699)
Drops value not a number message in production.

PR Close #60699
2025-04-02 19:20:11 +00:00
Jessica Janiuk
1c6d5b2e23 release: cut the v20.0.0-next.5 release 2025-04-02 15:05:23 -04:00
Jessica Janiuk
84c29d8961 docs: release notes for the v19.2.5 release 2025-04-02 14:59:48 -04:00
arturovt
1c7b356625 fix(core): release hasPendingTasks observers (#59723)
In this commit, we unsubscribe the `hasPendingTasks` subject to remove all active observers and enable granular garbage collection, as users may forget to unsubscribe manually when subscribing to `isStable`.

PR Close #59723
2025-04-02 18:26:06 +00:00
Domenico Gemoli
a07ee60989 feat(forms): add markAllAsDirty to AbstractControl (#58663)
Adds the `markAllAsDirty` method to the `AbstractControl` class. This method will mark the control and all its
descendants as dirty.

I pretty much just duplicated the behaviour and tests of `markAllAsTouched`.

Fixes #55990

PR Close #58663
2025-04-02 18:25:32 +00:00
Alex Rickabaugh
a611b234d7 fix(core): run root effects in creation order (#60534)
Previously, the order in which root effects were executed was
non-deterministic and relied on the order in which signal graph dirty
notifications were propagated. With this commit, root effects are always run
in creation order.

PR Close #60534
2025-04-02 18:24:40 +00:00
Angular Robot
9d5a1a8dec build: update cross-repo angular dependencies (#60706)
See associated pull request for more information.

PR Close #60706
2025-04-02 18:23:56 +00:00
Andrew Scott
0bb4bd661e feat(router): Add ability to directly abort a navigation (#60380)
This commit adds the ability to directly abort a navigation through the
`Router.getCurrentNavigation()?.abort()` method. While there are no
feature requests for this, it is a feature that will be necessary for
integration with the navigation API. The API enables better tracking of
an ongoing navigation for SPAs and a site visitor can cancel a
navigation by clicking the stop button in the browser. While this could
technically be done on the transition with an internal jsdoc comment to
hide it from application developers, there's no need.

With this feature, I believe it would be possible to create somewhat of a shim
to integrate with the navigation API even before the router has full support
using the router events to control a deferred navigation that never
commits the URL and always aborts itself on navigation end.

PR Close #60380
2025-04-02 17:30:27 +00:00
( Nechiforel David-Samuel ) NsdHSO
84ca0ef2d0 refactor: added typing for Response (#60541)
This adds a better re-usable type for Response in HttpResource.

PR Close #60541
2025-04-02 16:33:22 +00:00
Matthieu Riegler
7da56e23d0 refactor(compiler): add selectedcontent to the DOM element schema registry (#60683)
This is only adding support for `selectedcontent` at the compiler level. At runtime it doesn't behave as expected see #60636

fixes #60679

PR Close #60683
2025-04-02 16:27:01 +00:00
hawkgs
4f86f3f106 docs(docs-infra): fix algolia icon in the search dialog on safari (#60702)
The icon used to have zero height due to its display property.

PR Close #60702
2025-04-02 16:19:46 +00:00
arturovt
5f7f04634f fix(core): call DestroyRef on destroy callback if view is destroyed (#58008)
In this commit, we introduce the ability to check whether `lView` has already been
destroyed in `NodeInjectorDestroyRef`. If the `lView` is already destroyed, we call
the on-destroy callback immediately, without trying to register it to be called later.
This ensures that any necessary cleanup is handled gracefully and provides better
reliability in managing resources.

One of the use cases is `takeUntilDestroyed`, which aims to replace `takeUntil` in existing
applications. While `takeUntil` can be safely called once the view is destroyed—resulting
in no errors and finalizing the subscription depending on whether a subject or replay
subject is used—replacing it with `takeUntilDestroyed` introduces a breaking change, as
it throws an error if the `lView` is destroyed.

Related issue: #54527

PR Close #58008
2025-04-02 15:24:48 +00:00
aparziale
6acce7ca2a fix(core): fixes #592882 ng generate @angular/core:signal-queries-migration (#60688)
fixes #592882 - retain accessibility modifier if it's already present for signal migrations

PR Close #60688
2025-04-02 15:14:43 +00:00
Pawel Kozlowski
b6897bb8c3 refactor(core): extract directive inputs update logic (#60690)
This refactor extracts all the logic required to update a single
directive input while running the update pass of a template. It
also adds a number of TODOs that hint on subsequent reqfactorings.

PR Close #60690
2025-04-02 15:08:36 +00:00
arturovt
59d40f211c refactor(service-worker): pull less RxJS symbols (#60657)
In this commit, we reduce the number of imported RxJS symbols since they are redundant.

- We replace `merge` with a manual observable because `merge` internally pulls in `from()`.
- We remove `defer` and `throwError`, replacing them with `new Observable(s => s.error(..))`.
- We replace `toPromise()` with `new Promise`, as `toPromise()` is deprecated.
- We convert `readyToRegister` to a promise to avoid using RxJS operators like `delay`.

PR Close #60657
2025-04-02 15:00:34 +00:00
aparziale
cdbc6e8ec1 fix(core): fix ng generate @angular/core:output-migration (#60626)
output-migration command not keep type if @output declaring without initializer

PR Close #60626
2025-04-02 14:26:05 +00:00
Tomasz Domański
4546d4fb39 fix(service-worker): assign initializing client's app version, when a request is for worker script (#58131)
When a new version of app is available in a service worker, and a client with old version exists, web workers initialized from a client with old version will now be properly assigned with the same version.

Before this change, a web worker was assigned with the newest version.

Fixes #57971

PR Close #58131
2025-04-02 14:23:52 +00:00
Andrew Kushnir
84ba1ad878 refactor(core): drop unused ngDevMode metrics (#60686)
This commit updates the code to drop unused `ngDevMode` metrics and removes some related (and now unused) utility functions.

PR Close #60686
2025-04-02 14:17:10 +00:00
Ahmed Hakeem
316fabb814 docs: add a note about styles collision resolution (#59266)
PR Close #59266
2025-04-02 13:57:27 +00:00
Dany Marques
1faca6f4fd docs(core): give types to signal API (#58965)
PR Close #58965
2025-04-02 13:56:54 +00:00
Dany Marques
c980d06182 docs(core): improve computation example (#58965)
PR Close #58965
2025-04-02 13:56:54 +00:00
Matthieu Riegler
d3fec852df docs: Use inject for DI (#59835)
PR Close #59835
2025-04-02 13:37:30 +00:00
Matthieu Riegler
590b50254b docs(docs-infra): fix adev (#60695)
PR Close #60695
2025-04-02 12:37:04 +00:00
Matthieu Riegler
bdfbd54932 feat(forms): Allow to reset a form without emitting events (#60354)
This change  add an option paramter to `resetForm` that is passed to the FormGroup.

fixes #60274

PR Close #60354
2025-04-02 11:36:24 +00:00
Matthieu Riegler
e4be32d8f0 refactor(compiler): prevent object methods being recognised as entities (#58100)
With this commit object methods (like `valueOf`, `toString` are not considered as valid entities anymore.

PR Close #58100
2025-04-02 11:35:53 +00:00
Matthieu Riegler
23e4da430a refactor(http): remove non reactive signature from httpResource. (#60537)
The non reactive usage ``httpResource(\`http://test/${myId()}\`` gave the false impression that it was reactive when the signal was invoked. We prevent any possibility of oversight by removing the non reactive signature.

PR Close #60537
2025-04-02 11:35:23 +00:00
Matthieu Riegler
def8bdd229 build: remove orphan bundling symbols (#60692)
Those targets where removed by #60591 but the symbols files were left behind.

PR Close #60692
2025-04-02 11:34:53 +00:00
Jake Spievak
24d8d56a81 docs: update the first app tutorial to include a note about importing NgFor directive (#60627)
PR Close #60627
2025-04-02 11:34:24 +00:00
Matthieu Riegler
a69f5c557a docs: add targets for the bundling debug (#60693)
PR Close #60693
2025-04-02 11:33:52 +00:00
Matthieu Riegler
2af330df61 docs(docs-infra): Search results as HTML (#60394)
fixes #60384

PR Close #60394
2025-04-02 11:32:57 +00:00
Angular Robot
916f768bcd build: update @angular/ng-dev digest to 10732a8 (#60678)
See associated pull request for more information.

PR Close #60678
2025-04-01 20:19:28 +00:00
Andrew Kushnir
fe97db8935 build: exclude relative imports commits via .git-blame-ignore-revs (#60680)
This commit adds a list of commits that refactored the code to use relative imports to the .git-blame-ignore-revs.

PR Close #60680
2025-04-01 20:18:36 +00:00
iteriani
e9c5e46a60 refactor(core): Check for ngMetadataName instead of instanceof. Wiz doesn't extend InjectionToken. (#60572)
In cases such as Wiz, we avoid using the InjectionToken class since it comes from @angular/core.

PR Close #60572
2025-04-01 19:21:33 +00:00
Joey Perrott
b55f4de6e6 ci: update to latest dev-infra action versions (#60675)
Update to the latest actions

PR Close #60675
2025-04-01 18:15:18 +00:00
TJ Lavelle
b927ce8ec9 refactor(common): update AsyncPipe to explicitly accept PromiseLike only (#60551)
With the fixed in g3, we can keep the type limited to PromiseLike
instead of Promise|PromiseLike

PR Close #60551
2025-04-01 17:56:39 +00:00
TJ Lavelle
a300cf8cf7 refactor(common): update AsyncPipe to explicitly accept Promise | PromiseLike (#60551)
There is a chance that external users have "extended" AsyncPipe and are expecting to
pass in a Promise instance.

PR Close #60551
2025-04-01 17:56:39 +00:00
TJ Lavelle
301996e0b4 refactor(common): update AsyncPipe to explicitly accept Promise | PromiseLike (#60551)
There is a chance that external users have "extended" AsyncPipe and are expecting to
pass in a Promise instance.

PR Close #60551
2025-04-01 17:56:39 +00:00
TJ Lavelle
c8c828ee58 refactor(common): update AsyncPipe to support PromiseLike (#60551)
Updates the AsyncPipe to work with PromiseLike, in addition to Promise.

PR Close #60551
2025-04-01 17:56:39 +00:00
Andrew Scott
7b819be83f fix(core): Ensure errors in listeners report to the application error handler (#60251)
Practically speaking, this change ensures that Angular is able to make
decisions about what to do when an uncaught error happens.

For tests, this will mean that, by default, the error either causes the
`fixture.whenStable` promise to reject if there is one or rethrow the
error. This ensures tests do not accidentally ignore errors. Opting out
of this can be done with the `rethrowApplicationErrors: false` option in
`TestBed`.

For SSR, there may be additional behaviors in the future that we want to
add, such as redirecting to an error page or responding with a 500
status code.

BREAKING CHANGE: Uncaught errors in listeners which were previously only reported to
`ErrorHandler` are now also reported to Angular's internal error
handling machinery. For tests, this means that the error will be
rethrown by default rather than only logging the error. Developers
should fix these errors, catch them in the test if the test is
intentionally covering an error case, or use `rethrowApplicationErrors:
false` in `configureTestingModule` as a last resort.

PR Close #60251
2025-04-01 17:03:08 +00:00
Andrew Kushnir
eb97303769 test(bazel): update common package contents test to skip chunks (#60623)
This commit updates the `common` package contents test to skip JS chunks, while still making sure that the main entrypoint files are present.

PR Close #60623
2025-04-01 15:58:51 +00:00
Andrew Kushnir
ad65f44877 build(common): updating golden files for the @angular/common package (#60623)
This commit updates golden files that got changed after swtiching to relative paths. There are no actual change to the APIs, the golden file updates capture the change in imports.

PR Close #60623
2025-04-01 15:58:51 +00:00
Andrew Kushnir
3fa7b2b136 refactor(common): convert scripts within packages/common to relative imports (#60623)
This commit updates scripts within `packages/common` to relative imports as a prep work to the upcoming infra updates.

PR Close #60623
2025-04-01 15:58:51 +00:00
Alex Rickabaugh
57a240b07e refactor(core): support an opt-in sync version of toObservable (#60640)
This commit adds a flag `forceSyncFirstEmit` which opts in to the pending
new behavior for `toObservable`, which emits the first value synchronously.
This flag is only really meant for use during a short migration period
while we update g3, and is not meant for prolonged usage. As a result, it's
marked deprecated.

PR Close #60640
2025-04-01 15:56:39 +00:00
Andrew Kushnir
d025f3769f refactor(router): re-export the RouterTestingModule symbols (#60557)
This commit re-exports the symbols that are exposed by the `RouterTestingModule` (which re-exports
the symbols from the `RouterModule`. These re-exports are needed for the Angular compiler
to overcome its limitation (on the consumer side) of not knowing where to import import
symbols when relative imports are used within the package.

PR Close #60557
2025-04-01 14:54:05 +00:00
Andrew Kushnir
6d3f5752f2 refactor(router): switching to relative imports within the router package (#60557)
This commit updates scripts within `packages/router` to relative imports as a prep work to the upcoming infra updates.

PR Close #60557
2025-04-01 14:54:05 +00:00
Angular Robot
5d013e20a4 build: update cross-repo angular dependencies (#60671)
See associated pull request for more information.

PR Close #60671
2025-04-01 14:50:32 +00:00
Enea Jahollari
5db7e4cabb refactor(core): improve the messaging on effect manualCleanup option (#60426)
We always needs to pass an injector to an effect if it's used outside the injection context, even when manualCleanup option is true.

PR Close #60426
2025-04-01 14:07:03 +00:00
Andrew Scott
a5e8294376 refactor(router): Update StateManager base class with common concrete implementations (#60617)
This commit updates the `StateManager` base class to contain common
concrete implementations that would be the same regardless of whether
the state manager is backed by the browser history API or the Navigation
API.

PR Close #60617
2025-04-01 14:05:43 +00:00
arturovt
2fe8f1a9de refactor(core): drop component factory error in production (#60601)
Drops component factory error in production. Couldn't capture it before because of `throw Error` (without `new`).

PR Close #60601
2025-04-01 13:12:34 +00:00
Kristiyan Kostadinov
accc65c2c9 refactor(migrations): add a migration to move DOCUMENT imports (#60663)
Adds a migration that moves imports of `DOCUMENT` from `common` to `core`.

PR Close #60663
2025-04-01 12:48:06 +00:00