Commit graph

14062 commits

Author SHA1 Message Date
Alan Agius
64e28ccf81 build: update cross-repo angular dependencies (#64073)
See associated pull request for more information.

Closes #64043 as a pr takeover

PR Close #64073
2025-09-25 10:26:19 -04:00
Matthieu Riegler
c0d88c37c9 fix(forms): Emit FormResetEvent when resetting control (#64024)
Prior to this change, the event was emitted by the Form Directive. With the change, it is now emitted at the control level.

fixes #58894

PR Close #64024
2025-09-24 16:48:32 +00:00
Matthieu Riegler
fffc7cf1c4 refactor(migrations): migrate usages of getTestBed.initTestEnvironment (#63997)
This commit also removes code paths that were only useful for G3.

PR Close #63997
2025-09-24 16:03:40 +00:00
aparziale
b96afb4bfc fix(migrations): handle reused templates in control flow migration (#63996)
The control flow migration was incorrectly removing `ng-template` elements in scenarios where they were referenced by multiple `*ngIf` directives' `else` clauses and also used independently via `ngTemplateOutlet`.

PR Close #63996
2025-09-24 16:01:58 +00:00
Matthieu Riegler
7e8e310868 refactor(compiler-cli): Don't emit optional chain non nullable diagnostics on indexed access. (#64007)
When `noUncheckedIndexedAccess` is not enabled, indexed accesses do not include `undefined` in the type.
This makes the OptionalChainNotNullableCheck inconvenient when wanting to safe guard an indexed access (and when the typings isn't helping you).

Ideally project should enable `noUncheckedIndexedAccess` for better typesafety, but this is often inconveninent (we do not enable it by default) and often not the resort of the developer.

So more better coding convinience,  `OptionalChainNotNullableCheck` will not raise an error/warning on indexed Acessed followed by an optional chaining when `noUncheckedIndexedAccess` is not enabled.

See also #63809 which will detect more cases

PR Close #64007
2025-09-24 15:08:05 +00:00
Joey Perrott
a9145f3856 Revert "feat(common): update to cldr 47 (#63923)" (#64031)
This reverts commit 8ca3e3a0bc.

PR Close #64031
2025-09-24 15:03:43 +00:00
Joey Perrott
8ca3e3a0bc feat(common): update to cldr 47 (#63923)
Update to CLDR version 47 for localization

PR Close #63923
2025-09-23 19:57:00 +00:00
Avcharov Hryhorii
1279364c3a refactor(core): improve linkedSignal type definitions, add debugName to options (#63346)
Add debugName for having ability to visualize linkedSignal name in devtools signal graph

PR Close #63346
2025-09-23 18:15:49 +00:00
JoostK
50d9d55f49 fix(core): fix narrowing of Resource.hasValue() (#63994)
This commit changes `Resource.hasValue()` and its derived types to improve narrowing
of resources whose generic type either does not include `undefined` (i.e. when a default
value has been provided) or when the generic type is `unknown`. This fixes the undesirable
behavior where `hasValue()` would cause the `else` branch of an `hasValue()` conditional
to have a narrowed type of `never`, given that the `hasValue()`'s type guard covers the
entire type range already (meaning that the type in the else-branch cannot be inhabited
in the type system, yielding the `never` type).

By making the `hasValue()` method only a type guard when the generic type includes `undefined`
these problems are avoided.

Fixes #60766
Fixes #63545
Fixes #63982

PR Close #63994
2025-09-23 14:20:55 +00:00
Matthieu Riegler
3d1e8fa08b docs: add types category for signal forms API entries (#63967)
PR Close #63967
2025-09-22 22:47:38 +00:00
Milo
5406e1a84b refactor(core): use version>0 instead of hasRun (#62467)
this saves a field for effect and watch nodes

PR Close #62467
2025-09-22 16:51:50 +00:00
SkyZeroZx
3bd91ded43 fix(compiler-cli): resolve import alias in defer blocks (#63966)
Fixes an error where using an alias in a defer block caused the compiler CLI to fail when parsing. The resolution logic in ComponentDecoratorHandler was updated to correctly handle deferred dependencies with aliased imports.

PR Close #63966
2025-09-22 15:52:16 +00:00
Steven Chim
e88f484ccb docs: fix typo in component bindings jsdoc (#63969)
PR Close #63969
2025-09-22 14:33:06 +00:00
Kristiyan Kostadinov
f5b50ec20d refactor: clean up explicit standalone flags from tests (#63963)
Since standalone is the default, we can dropn the `standalone: true` flags from our tests.

PR Close #63963
2025-09-22 14:27:34 +00:00
Matthieu Riegler
c50d659509 refactor(core): protect InjectionToken usage of ngDevMode (#63875)
Since those are top level APIs, `ngDevMode` might not be available at runtime if they're invoked before the variable is set.

fixes #62796

PR Close #63875
2025-09-19 21:27:45 +00:00
Jessica Janiuk
dde5badb71 fix(core): prevent animations renderer from impacting animate.leave (#63921)
This adds an optional flag to the renderer on `removeChild` called `requireSynchronousElementRemoval`, which can tell any downstream renderer that elements need to be removed synchronously. This gets passed down to the legacy animation renderer to ensure that any elements that set this flag aren't impacted by that renderers changes to timing.

fixes: #63893

PR Close #63921
2025-09-19 21:26:18 +00:00
Matthieu Riegler
56cb0931ef refactor(core): drop the usage of PromiseSettledResult<void> (#63955)
`PromiseSettledResult<void>` requires the ES2020 typings. Those might not be provided (or `skipLibCheck` is not enabled).

fixes #63931

PR Close #63955
2025-09-19 20:27:25 +00:00
Matthieu Riegler
e835c359f7 docs: Add categories to form apis (#63938)
PR Close #63938
2025-09-19 20:21:16 +00:00
Jessica Janiuk
2d232b39d4 Revert "refactor(compiler-cli): track member metadata using output AST (#63904)" (#63952)
This reverts commit ffe94b3a89.

PR Close #63952
2025-09-19 18:59:42 +00:00
Jessica Janiuk
5d538b21fd Revert "refactor(compiler): expose member decorator identifiers (#63904)" (#63952)
This reverts commit ef0ff78de2.

PR Close #63952
2025-09-19 18:59:42 +00:00
Jessica Janiuk
9d3cd16f33 Revert "fix(compiler-cli): capture metadata for undecorated fields (#63904)" (#63952)
This reverts commit 4c091abba6.

PR Close #63952
2025-09-19 18:59:41 +00:00
kirjs
b60d5e49b1 refactor(forms): get rid of watFor in validation status spec (#63948)
It was flaky, and now it is not flaky

PR Close #63948
2025-09-19 17:59:32 +00:00
Jessica Janiuk
db8f716a0e Revert "docs: Add categories to form apis (#63938)" (#63950)
This reverts commit 0c4feb8e9e.

PR Close #63950
2025-09-19 17:58:10 +00:00
Matthieu Riegler
0c4feb8e9e docs: Add categories to form apis (#63938)
PR Close #63938
2025-09-19 17:02:57 +00:00
Alan Agius
b725af9924 docs: add documentation for NG0401 error (#63947)
PR Close #63947
2025-09-19 17:01:20 +00:00
Matthieu Riegler
fec7c288e9 fix(core): Error on invalid APP_ID (#63252)
An invalid APP_ID could be responsible to generating broken CSS selectors. (eg `:` is an example for a character that breaks a selector by being a separator for pseudo-selectors.)
We now throw an error if the provided value is not alphanumerical

PR Close #63252
2025-09-19 15:00:10 +00:00
Leon Senft
f008045ded fix(core): do not rename ARIA property bindings to attributes (#63925)
https://github.com/angular/angular/pull/62630 made it so that all ARIA
property bindings would write to their corresponding attribute instead.
The primary motivation for this change was to ensure that ARIA
attributes were always rendered correctly on the server, where the
emulated DOM may not correctly reflect ARIA properties as attributes.
Furthermore, this change added support for binding to ARIA attributes
using the property binding syntax (e.g. `[aria-label]`).

Unfortunately, https://github.com/angular/angular/pull/62630 relied on
the incorrect assumptions that an ARIA property name could be converted
to its attribute name (without hardcoding the conversion), and that the
value of an ARIA property matched its corresponding attribute. For
example, the `ariaLabelledByElements` property's value is an array of
DOM elements, while the corresponding `aria-labelledby` attribute's
value is a string containing the IDs of the DOM elements.

This partially reverts https://github.com/angular/angular/pull/62630 so
that only property bindings with ARIA attribute names (begin with
`aria-`) are converted to attribute bindings.

* `[ariaLabel]` will revert to binding to the `ariaLabel` property.
* `[aria-label]` will continue binding to the `aria-label` attribute.

Note the only difference between `[aria-label]` and `[attr.aria-label]`
is that the former will attempt to bind to inputs of the same name while
the latter will not.

PR Close #63925
2025-09-19 14:50:39 +00:00
Matthieu Riegler
f1be5ae5dc refactor(core): fix MockRenderer in unit tests. (#63936)
This allows us to drop a test only check in the runtime.

PR Close #63936
2025-09-19 14:50:07 +00:00
Matt Lewis
aeb3e6c6a5 fix(migrations): handle import aliases to the same module name (#63934)
Fixes a bug in the standalone migration where 2 imported modules have the same class name but 1 is imported with an alias and would not be added to the component imports array when migrating

Fixes #63913

PR Close #63934
2025-09-19 14:48:32 +00:00
Kristiyan Kostadinov
4c091abba6 fix(compiler-cli): capture metadata for undecorated fields (#63904)
Currently if `TestBed.overrideComponent` is used on a class that uses initializer APIs (e.g. `input()`), the initializer metadata will be wiped out, because `overrideComponent` re-compiles the class with the information set by `setClassMetadata`. `setClassMetadata` only captures decorated members at the moment.

These changes introduce some logic to capture the new initializer-based APIs in `setClassMetadata` as well.

Fixes #57944.

PR Close #63904
2025-09-18 21:30:15 +00:00
Kristiyan Kostadinov
ef0ff78de2 refactor(compiler): expose member decorator identifiers (#63904)
Adds the member decorators to the map of exposed compiler symbols.

PR Close #63904
2025-09-18 21:30:15 +00:00
Kristiyan Kostadinov
ffe94b3a89 refactor(compiler-cli): track member metadata using output AST (#63904)
Reworks the logic that tracks the decorator metadata for members to do so using the output AST, rather than wrapping the TypeScript AST. This makes it easier to programmatically generate new members that weren't part of the TypeScript AST before.

PR Close #63904
2025-09-18 21:30:15 +00:00
aparziale
307e4eafef refactor(migrations): remove common module if there are no references (#63892)
ngclass-to-class migration removes commonModule if there are no references that use it

PR Close #63892
2025-09-18 20:18:43 +00:00
SkyZeroZx
e426302cca refactor(core): Remove duplicate code getSelectedTNode (#63897)
clean up duplicate functions

PR Close #63897
2025-09-18 16:04:25 +00:00
Kristiyan Kostadinov
bb381b707e refactor(compiler): integrate regular expression literals into pipeline (#63887)
Adds support for regular expression literals in the template pipeline and adds some logic to optimize non-global ones.

PR Close #63887
2025-09-18 15:08:56 +00:00
Kristiyan Kostadinov
f57b104ccd refactor(compiler-cli): support regular expression literals in AOT compiler (#63887)
Handles regular expression literals across the template type checker and the various translators.

PR Close #63887
2025-09-18 15:08:56 +00:00
Kristiyan Kostadinov
2971a001c6 refactor(compiler): add output AST node for regular expressions (#63887)
Adds the `RegularExpressionLiteral` node to the output AST.

PR Close #63887
2025-09-18 15:08:56 +00:00
Kristiyan Kostadinov
539717f58a feat(core): support regular expressions in templates (#63887)
Updates the template syntax to support inline regular expressions.

PR Close #63887
2025-09-18 15:08:56 +00:00
Kristiyan Kostadinov
c1559ece52 refactor(compiler): tokenize regular expression literals (#63887)
Updates the expression lexer to produce tokens for regular expression literals.

PR Close #63887
2025-09-18 15:08:56 +00:00
Angular Robot
5c74339dfc build: update cross-repo angular dependencies (#63902)
See associated pull request for more information.

Closes #63890 as a pr takeover

PR Close #63902
2025-09-18 14:39:51 +00:00
Andrew Scott
8ad26edb72 refactor(platform-browser): Remove zone provideres from BrowserTestingModule (#63872)
This removes the Zone providers from the `BrowserTestingModule`. These
already exist by default in all other entrypoints to Angular
environments (TestBed compiler, bootstrapModule, and createApplication).

PR Close #63872
2025-09-17 21:17:59 +00:00
Andrew Kushnir
a53ef1d69a Revert "refactor(compiler): tokenize regular expression literals (#63857)" (#63883)
This reverts commit 8a69c0629b.

PR Close #63883
2025-09-17 19:36:17 +00:00
Andrew Kushnir
ae55578b92 Revert "feat(core): support regular expressions in templates (#63857)" (#63883)
This reverts commit 328a2bf719.

PR Close #63883
2025-09-17 19:36:17 +00:00
Andrew Kushnir
c7e0c8b06a Revert "refactor(compiler): add output AST node for regular expressions (#63857)" (#63883)
This reverts commit a1288f8d66.

PR Close #63883
2025-09-17 19:36:17 +00:00
Andrew Kushnir
f53c6543db Revert "refactor(compiler-cli): support regular expression literals in AOT compiler (#63857)" (#63883)
This reverts commit f2ef838c06.

PR Close #63883
2025-09-17 19:36:17 +00:00
Andrew Kushnir
0a81784de2 Revert "refactor(compiler): integrate regular expression literals into pipeline (#63857)" (#63883)
This reverts commit dd77233cdf.

PR Close #63883
2025-09-17 19:36:17 +00:00
arturovt
dee6ef89c7 refactor(core): tree-shake HOST_TAG_NAME in prod (#63861)
Previously, HOST_TAG_NAME had its __NG_ELEMENT_ID__ set at the top level. This
prevented tree-shaking, since the bundler had to keep the assignment as a
potential side effect even when the token was never used.

This change moves the token creation and __NG_ELEMENT_ID__ assignment into a
@__PURE__ IIFE. If HOST_TAG_NAME is not injected anywhere, the IIFE result is
unused and can be dropped entirely by the optimizer. If it is used, the token
still behaves the same at runtime.

PR Close #63861
2025-09-17 17:40:35 +00:00
Kristiyan Kostadinov
dd77233cdf refactor(compiler): integrate regular expression literals into pipeline (#63857)
Adds support for regular expression literals in the template pipeline and adds some logic to optimize non-global ones.

PR Close #63857
2025-09-17 16:06:51 +00:00
Kristiyan Kostadinov
f2ef838c06 refactor(compiler-cli): support regular expression literals in AOT compiler (#63857)
Handles regular expression literals across the template type checker and the various translators.

PR Close #63857
2025-09-17 16:06:51 +00:00
Kristiyan Kostadinov
a1288f8d66 refactor(compiler): add output AST node for regular expressions (#63857)
Adds the `RegularExpressionLiteral` node to the output AST.

PR Close #63857
2025-09-17 16:06:51 +00:00