Commit graph

36863 commits

Author SHA1 Message Date
Kristiyan Kostadinov
55ac384d6f refactor(core): consolidate listener cleanup storage (#60549)
We were duplicating the logic for storing listener-related cleanup functions in a couple of places. These changes consolidate it into one function.

PR Close #60549
2025-03-26 20:44:31 -07:00
Kristiyan Kostadinov
277aa76876 refactor(core): simplify listener signature (#60549)
Reduces the number of parameters that need to be passed into listeners.

PR Close #60549
2025-03-26 20:44:31 -07:00
Kristiyan Kostadinov
acf84db778 refactor(core): separate out DOM listener logic (#60549)
Moves the logic for listening to a DOM event out into a separate function for easier reuse.

PR Close #60549
2025-03-26 20:44:31 -07:00
Kristiyan Kostadinov
defefae4b5 refactor(core): remove special-casing from listener wrapping (#60549)
We had a special case in the `wrapListener` function that would return the original function if it's invoked with `Function`. This was added for `DebugNode.triggerEventHandler`, but isn't necessary anymore.

PR Close #60549
2025-03-26 20:44:31 -07:00
Pawel Kozlowski
64f6fc0095 refactor(core): allow multiple profilers (#60548)
This commit changes the profiler infrastructure to
allow multiple profilers running at the same time.

PR Close #60548
2025-03-26 20:44:03 -07:00
Alan Agius
fe9b79b615 feat(core): update Node.js version support (#60545)
Node.js v18 will reach End-of-Life on April 30, 2025, and will no longer be supported in Angular v20.
Node.js Release Schedule: https://github.com/nodejs/release#release-schedule

BREAKING CHANGE:
- Angular no longer supports Node.js v18.
- Node.js versions 22.0 to 22.10 are also no longer supported.

Before upgrading to Angular v20, ensure the Node.js version is at least 20.11.1.
For the full list of supported versions, visit: https://angular.dev/reference/versions

PR Close #60545
2025-03-26 20:42:16 -07:00
Alan Agius
f845fbeb58 build: update development Node.js version to 22.14.0 and auto-update (#60545)
The version of Node.js used for development and CI jobs is now set to the active LTS version's latest minor and patch. Renovate is also now configured to update the minor and patch versions.

PR Close #60545
2025-03-26 20:42:16 -07:00
Angular Robot
384fa959ac build: update babel dependencies to v7.27.0 (#60544)
See associated pull request for more information.

PR Close #60544
2025-03-26 20:41:38 -07:00
Angular Robot
14d27eeb67 build: update scorecard action dependencies (#60543)
See associated pull request for more information.

PR Close #60543
2025-03-26 20:40:59 -07:00
Angular Robot
f9993e4fbe build: update all non-major dependencies (#60542)
See associated pull request for more information.

PR Close #60542
2025-03-26 20:40:29 -07:00
Andrew Kushnir
88ae6517a2 refactor(language-service): convert scripts within packages/language-service to relative imports (#60540)
This commit updates scripts within `packages/language-service` to relative imports as a prep work to the upcoming infra updates.

PR Close #60540
2025-03-26 20:40:01 -07:00
Andrew Kushnir
6a207ebfb0 refactor(localize): convert scripts within packages/localize to relative imports (#60540)
This commit updates scripts within `packages/localize` to relative imports as a prep work to the upcoming infra updates.

PR Close #60540
2025-03-26 20:40:01 -07:00
hawkgs
af67334fe5 ci: add hawkgs to pullapprove (#60536)
Add hawkgs to pullaprove for angular-dev.

PR Close #60536
2025-03-26 20:39:31 -07:00
Matthieu Riegler
c6ef75bdea docs(docs-infra): Use AlertSeverityLevel values for alerts (#60532)
PR Close #60532
2025-03-26 20:38:11 -07:00
Kristiyan Kostadinov
8b990a31c3 fix(compiler): error if rawText isn't estimated correctly (#60529)
The `TemplateLiteralElementExpr` has some logic where it tries to estimate the `rawText` if one isn't provided by looking at the node's source span. The problem with this approach is that we have some long-standing issues with our expression AST parser (see https://github.com/angular/angular/pull/60267#discussion_r1986402524) where it might not produce accurate spans if escape sequences are involved. This in turn can lead to unrecoverable errors, because TypeScript will throw an error if the raw string doesn't match the cooked one when constructing a TypeScript AST node.

These changes remove the logic that depends on the source span and relies purely on the secondary fallback that inserts escaped characters manually.

It's also worth noting that the `rawText` doesn't seem to matter much at this point, because the main usage of it is when downlevelling template literals to ES5 which we no longer support.

Fixes #60528.

PR Close #60529
2025-03-26 20:37:31 -07:00
Matthieu Riegler
d1510dafdf docs(docs-infra): fix the deferable views tutorials. (#60509)
PR Close #60509
2025-03-26 20:36:27 -07:00
Matthieu Riegler
217f6d96ba refactor(core): run effect cleanup as untracked (#60421)
A effect cleanup should not be considered reactive.

fixes #57757

PR Close #60421
2025-03-26 20:35:45 -07:00
Andrew Kushnir
34393874e6 refactor(upgrade): convert scripts within packages/upgrade to relative imports (#60238)
This commit updates scripts within `packages/upgrade` to relative imports as a prep work to the upcoming infra updates.

PR Close #60238
2025-03-26 20:35:11 -07:00
Andrew Kushnir
bc042935d0 refactor(service-worker): convert scripts within packages/service-worker to relative imports (#60238)
This commit updates scripts within `packages/service-worker` to relative imports as a prep work to the upcoming infra updates.

PR Close #60238
2025-03-26 20:35:10 -07:00
Alex Rickabaugh
40bd57646a release: cut the v20.0.0-next.4 release 2025-03-26 20:32:49 -07:00
Alex Rickabaugh
395f6c08b2 docs: release notes for the v19.2.4 release 2025-03-26 20:28:20 -07:00
Andrew Kushnir
6d3849ffc8 refactor(core): updates to golden files (#60227)
This commit updates golden files to include the changes that appeared after changing imports to relative paths.

PR Close #60227
2025-03-25 10:58:00 -07:00
Andrew Kushnir
ae047c59c0 refactor(core): convert scripts within packages/core/test to relative imports (#60227)
This commit updates scripts within `packages/core/test` to relative imports as a prep work to the
upcoming infra updates.

PR Close #60227
2025-03-25 10:58:00 -07:00
Andrew Kushnir
3d2263cb1f refactor(core): convert scripts within packages/core/src to relative imports (#60227)
This commit updates scripts within `packages/core/src` to relative imports as a prep work to the upcoming infra updates.

PR Close #60227
2025-03-25 10:58:00 -07:00
Hryhorii (Greg) Avcharov
7499b74d7d docs: fix templates bindings link (#60521)
PR Close #60521
2025-03-24 09:07:29 -07:00
Pawel Kozlowski
bf029e4f23 refactor(core): simplify signature of listenToDirectiveOutput (#60514)
We can simplify signature of listenToDirectiveOutput by passing less
arguments (some of them can be derived from already passed arguments).

PR Close #60514
2025-03-24 09:05:50 -07:00
Angular Robot
11994a715b build: update cross-repo angular dependencies (#60511)
See associated pull request for more information.

PR Close #60511
2025-03-24 09:04:36 -07:00
aparzi
cf5c61c849 fix(core): fix used templates are not deleted (#60459)
After running the control flow migration, used templates are not deleted.

PR Close #60459
2025-03-24 09:04:05 -07:00
Milo
d95d352a8e fix(devtools): show preview content even after expanding node (#60360)
this aligns with Chrome devtools behavior

PR Close #60360
2025-03-24 09:03:21 -07:00
Pawel Kozlowski
997836e858 refactor(core): specify reactive node kind for linked signal (#60451)
This commit adds reactive node kind for linked signal.

PR Close #60451
2025-03-24 07:06:47 -07:00
Matthieu Riegler
dcfa8a04f5 docs(docs-infra): disable shared-docs tests. (#60520)
Those tests are currently broken until we bump the angular version (pending release).

PR Close #60520
2025-03-24 06:56:15 +00:00
Jessica Janiuk
13d1c8ab38 fix(core): fixes timing of hydration cleanup on control flow (#60425)
This properly cleans up stale control flow branches in the case
that branches change between server and client at the same
timing as NgIf / NgSwitch.

fixes: #58670
fixes: #60218

PR Close #60425
2025-03-21 14:45:23 -07:00
Jessica Janiuk
58e1d9e39a refactor(compiler): Add conditionalCreate instruction (#60425)
This adds a new instruction for dealing with creating conditionals. It ensures flags are set on the TNode for later identification during hydration.

PR Close #60425
2025-03-21 14:45:23 -07:00
Paul Gschwendtner
115c2f8d38 build: fix linking of cdk/material in devtools and simplify code (#60516)
This commit fixes the linking of CDK/Material which recently broke
because the CDK/Material package now comes with potential shared FESM
chunks; that our current hard-coded, manual linking process doesn't know
about. This ultimately resulted in duplicate code, breaking
Material/CDK.

This commit fixes that.

In addition to the fix, we simplify our linking significantly and reduce
the rather large complexity around linking, or having to specify every
entry-point manually, by linking the full package and putting it into
a different location. This is also what we conceptually are doing in
Angular Material as part of the `rules_js` migration.

PR Close #60516
2025-03-21 14:37:56 -07:00
cexbrayat
7408a1f58b fix(localize): handle @angular/build:karma in ng add (#60513)
`ng add @angular/localize` now also adds the localize polyfill to the configuration of Karma if the `@angular/build:karma` builder is used
(which is the default in Angular CLI v20)

PR Close #60513
2025-03-21 14:37:24 -07:00
Alan Agius
9dbccae47a refactor(docs-infra): remove usage of @angular/platform-browser-dynamic from adev (#60504)
Usage of `@angular/platform-browser-dynamic` is not needed since Angular CLI always inject `@angular/compiler` when running JIT.

PR Close #60504
2025-03-21 14:36:54 -07:00
Paul Gschwendtner
87751c0796 test: ng-modules-importability test should import every module in isolation (#60503)
This will make the test even more useful, as it ensures that we aren't
accidentally relying on the compiler potentially discovering best
guessed modules from other imports that previously were part of the same
file (importing all modules as part of the test).

PR Close #60503
2025-03-21 14:36:27 -07:00
Andrew Temple
a3c209bb69 docs: remove link to lazy loading documentation (#60501)
Removes a link that no longer directs users to the expected documentation. Deleting the line is the recommended solution for issue #60500.
PR Close #60501
2025-03-21 14:35:58 -07:00
Matthieu Riegler
1339f06ebe docs(docs-infra): Improve markdown generation for code examples. (#60408)
Markdown requires code blocks (```) to start without white spaces. With this change we ensure that `@example` blocks with leading spaces are well supported.

fixes #60407

PR Close #60408
2025-03-21 14:35:19 -07:00
Miles Malerba
55e9f1ffa2 refactor(compiler-cli): remove unnecessary paren logic for ternaries (#60263)
Removes logic that was explicitly adding parentheses around ternaries
used as the condition of another ternary. Instead we can just rely on
Typescript to add the parentheses if they are needed to make the code
match the structure of the AST.

Also added a note pointing to the issue that currently prevents us from
removing similar logic pertaining to nullish coalescing

PR Close #60263
2025-03-21 14:34:35 -07:00
Matthieu Riegler
9ca2a58157 build: unpatch @angular/build (#60231)
This requires to bump the CLI to v20

PR Close #60231
2025-03-21 14:33:59 -07:00
Angular Robot
9ffeff91ea build: update cross-repo angular dependencies (#60490)
See associated pull request for more information.

PR Close #60490
2025-03-20 15:34:26 -07:00
Alan Agius
70bdb88b0c fix(platform-browser): ensure platformBrowserTesting includes platformBrowser providers (#60480)
Previously, `platformBrowserTesting` did not include any `platformBrowser` providers, causing an inconsistency with `platformBrowserDynamicTesting`.

This update resolves the issue by restructuring platform inheritance to ensure proper provider inclusion:

- `platformCore → platformBrowser → platformBrowserTesting`
- `platformBrowser → platformBrowserDynamic → platformBrowserDynamicTesting`

Now, `platformBrowserTesting` correctly inherits from `platformBrowser`, aligning with the expected behavior.

PR Close #60480
2025-03-20 12:33:12 -07:00
Paul Gschwendtner
6890eab220 test: add integration test to ensure all exported modules can be imported (#60489)
This commit adds a new integration test which will help ensure that all
exported `@NgModule`'s of framework packages can be imported by users
without any errors.

This test is generally useful, but with our upcoming changes with
relative imports, this is a good safety-net. Relative imports could
break re-exported NgModules inside NgModule's. For more details, see:
https://github.com/angular/components/pull/30667

Notably we don't expect any issues for framework package as re-exporting
`@NgModule`'s inside `@NgModule`'s is seemingly a rather rare pattern for
APF libraries (confirmed by Material only having like 4-5 instances).

PR Close #60489
2025-03-20 12:32:36 -07:00
Jessica Janiuk
4b312aeb43 ci: fix over extraction of init symbols in symbol tests (#60493)
This omits including any init_ symbols in the symbol tests that were unnecessary and causing friction.

PR Close #60493
2025-03-20 12:31:34 -07:00
Paul Gschwendtner
e0ff321433 build: prepare testing infrastructure for code splitting of core package (#60487)
When we switch to relative imports, shared `.d.ts` chunks can be
generated.

We need to also pull these into our mock virtual FS testing
environments. Notably this does not cause a test slow-down because we
are talking about very few extra `.d.ts` chunk files. In our experiments
before, with no dts bundling, we saw test time increase from e.g.
20seconds to 100seconds. The 20s are still the same locally!

In addition, since code for definitions can now reside in shared `.d.ts`
chunks, the language service tests need to be adjusted in cases where
they assert for code definition locations in `@angular/core`. A new
helper prepares for more code to be moved into arbitrary `.d.ts` files;
we should simply assert the definition comes out of
`node_modules/@angular/core`.

PR Close #60487
2025-03-20 12:30:57 -07:00
Alan Agius
a7183d8889 ci: run adev tests before build (#60485)
Since tests run faster than the build, executing them first allows for quicker failure detection, improving efficiency.

PR Close #60485
2025-03-20 12:30:05 -07:00
Alan Agius
aab765fa5e build: update cross-repo angular dependencies (#60485)
See associated pull request for more information.

Closes #60474 as a pr takeover

PR Close #60485
2025-03-20 12:30:05 -07:00
Kristiyan Kostadinov
911ad40067 build: fix type checking issues in test code (#60481)
Fixes some type checking issues in our own testing code that weren't showing up, because `strictTemplates` was turned off.

PR Close #60481
2025-03-20 11:55:52 -07:00
Kristiyan Kostadinov
b26b0abad6 fix(docs-infra): host binding type issues (#60481)
Resolves typing issues inside host binding in adev.

PR Close #60481
2025-03-20 11:55:52 -07:00