Commit graph

14414 commits

Author SHA1 Message Date
Andrew Scott
1ab461c846 refactor(router): Store route injector on ActivatedRoute instance
This eliminates the need to pass around the EnvironmentInjector
everywhere we need the injection context for a route.
2025-11-20 17:05:10 -05:00
Andrew Scott
c25d749d85 feat(router): Execute RunGuardsAndResolvers function in injection context
Allows more sophisticated checks based on information available in DI
(e.g. the router state). Use-cases have been described in #53944 / https://github.com/angular/angular/issues/31843#issuecomment-1890955590

resolves #53944
2025-11-20 17:05:10 -05:00
Johannes Hoppe
11da7a65c0 docs(core): remove outdated regex template restriction in best-practices.md
Regular expressions in templates are now supported as of Angular 21.
2025-11-20 16:42:52 -05:00
JoostK
913cde8ab4 refactor(core): let the profiler handle asymmetric events leniently
Although the prior commit has made more profiler events guaranteed symmetric
through the use of finally-blocks, there continue to be some situations
that could potentially result in asymmetric events, e.g. application
bootstrap doesn't guarantee symmetric events. This commit makes the profiler
lenient to these situations by unrolling the stack past the asymmetric event
data, eventually reaching the expected start event.
2025-11-20 12:29:59 -05:00
JoostK
3760045e3e fix(core): notify profiler events in case of errors
Profiler events are expected to be symmetric, yet in the case of errors this symmetry may break
if events aren't always kept in sync with their corresponding start event. This commit moves
various end events to be run from a finally-block, allowing them to notify the profiler even
when an error has occurred.

Fixes #62947
2025-11-20 12:29:59 -05:00
David Kingma
0812ac3bec refactor(core): add debugName option to rxjs-interop toSignal
toSignal predates the debugName option for signals to name the signals in the Angular dev-tools This adds the debugName option to toSignal.
2025-11-20 10:49:50 -05:00
tsc036
34e1fe235f
refactor(core): export profile event as enum and move profile_types.ts and framework to shared devtools folder
move framework enum and profile_types to a shared folder so it can be used by wiz
2025-11-19 15:22:49 -08:00
Angular Robot
4c31f8ebf4 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-19 15:00:49 -08:00
SkyZeroZx
e9ba63a4c1 docs: Adds documentation for generic type argument to SimpleChanges 2025-11-19 14:31:53 -08:00
Shuaib Hasan Akib
c7affdfbc9 refactor(common): update examples to align with Angular best practices
Updated examples to use the standalone component approach and the latest
2025-11-19 14:29:49 -08:00
Kristiyan Kostadinov
5e6d8573f4 perf(core): avoid repeat searches for field directive
The `getControlDirective` is called multiple times, both at init and during each update run. Under the hood it performs a linear search for the `Field` directive.

We can speed this up by finding its index once and reusing it since the array of directive matches is static.
2025-11-19 14:28:56 -08:00
Kristiyan Kostadinov
81ce1ba1d9 refactor(compiler): remove interpolation-related symbols
We removed the ability to customize the interpolation some time ago. These changes remove the remaining code related to them.
2025-11-19 14:28:20 -08:00
Kristiyan Kostadinov
b6c141bf8b refactor(compiler): remove container blocks config
Removes the ability to specify container blocks when creating an i18n parser. We were only passing in `switch` and it likely won't change.
2025-11-19 14:28:20 -08:00
Miles Malerba
7ddf4a6b07 fix(forms): run reset as untracked
Run the signal forms `reset()` as untracked so it does not trigger
`effect` to rerun when the model changes

Fixes https://github.com/angular/angular/issues/65322
2025-11-19 14:27:52 -08:00
Jessica Janiuk
11ea1a01ff build: bump core zone.js version
this bumps the core dep on zone.js to 0.16.0.
2025-11-19 13:22:14 -08:00
Jessica Janiuk
58014cb01a release: cut the zone.js-0.16.0 release 2025-11-19 12:38:52 -08:00
Joey Perrott
9a663a28f9 release: bump version of in memory web api 2025-11-19 12:05:51 -08:00
Angular Robot
7e9f1cc8d8 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-18 15:28:38 -08:00
Angular Robot
6178e3ebfb build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-17 16:34:41 -08:00
Jessica Janiuk
88dfd96ec9 Revert "refactor(core): let the profiler handle asymmetric events leniently"
This reverts commit da9911f2b4.
2025-11-17 10:10:36 -08:00
Jessica Janiuk
adc2a57be0 Revert "fix(core): notify profiler events in case of errors"
This reverts commit af1ba52587.
2025-11-17 10:10:36 -08:00
Matthew Beck
9e7ddcaa10 fix(compiler): don't choke on unbalanced parens in declaration block
Following https://github.com/angular/angular/pull/64509 we started
choking on unbalanced closing parentheses in declaration blocks,
specifically in quoted background-image urls. This was reported in
https://github.com/angular/angular/issues/65137.

This occured because we previously (and now again) traverse the entire
declaration block when selecting for :host-context() selectors to shim.
This is an oddity of how we parse styles today, and is likely something
we'd want to remove if we parsed selectors properly.

This change adds a new flag to _splitOnTopLevelCommas which allows it to
continue past unbalanced closing parentheses in the declaration block,
returning _convertColonHostContext to its previous behavior while
keeping support for the extra nesting in :host-context().
2025-11-17 09:46:01 -08:00
Matthieu Riegler
c15836c8c7 refactor(core): promote the custom track profiler to stable.
We didn't get much report on the feature itself so we feel confident about promoting it to stable. In parallel we'll also land #62959 but one is not blocking the other.

fixes #64996
2025-11-17 09:42:32 -08:00
Matthieu Riegler
b41a94bc85 fix(forms): Set error message of a schema error.
Use the error message of the issue as the error message of the error itself.

fixes #65247
2025-11-17 09:41:54 -08:00
Miles Malerba
f47637426f refactor(forms): avoid console warnings when setting NaN
It can be useful for a developer to set `NaN` as the value for a number
input, as a way to say "clear the input". However, directly setting this
value to the `.valueAsNumber` causes a console warning. This PR fixes
the console warning by just doing `.value = ''` when we would otherwise
to `.valueAsNumber = NaN`
2025-11-17 09:41:29 -08:00
Leon Senft
c727df5d38
refactor(forms): reduce boilerplate needed to define custom controls
An early piece of feedback received regarding custom controls hosted on
native inputs was that they required a lot of boilerplate to bind
`FieldState` properties. Each property required an input to accept the
property, and a host binding to forward it to the native control.
2025-11-17 09:40:58 -08:00
JoostK
da9911f2b4 refactor(core): let the profiler handle asymmetric events leniently
Although the prior commit has made more profiler events guaranteed symmetric
through the use of finally-blocks, there continue to be some situations
that could potentially result in asymmetric events, e.g. application
bootstrap doesn't guarantee symmetric events. This commit makes the profiler
lenient to these situations by unrolling the stack past the asymmetric event
data, eventually reaching the expected start event.
2025-11-17 09:40:04 -08:00
JoostK
af1ba52587 fix(core): notify profiler events in case of errors
Profiler events are expected to be symmetric, yet in the case of errors this symmetry may break
if events aren't always kept in sync with their corresponding start event. This commit moves
various end events to be run from a finally-block, allowing them to notify the profiler even
when an error has occurred.

Fixes #62947
2025-11-17 09:40:04 -08:00
SkyZeroZx
0432e76171 docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
SkyZeroZx
d70310896c docs: add documentation for HostAttributeToken 2025-11-17 08:46:59 -08:00
SkyZeroZx
24243e34d9 refactor(common): removes unused NgModuleFactory config in NgComponentOutlet
Removes the `ngComponentOutletNgModuleFactory`  in `_needToReCreateNgModuleInstance`
2025-11-17 08:46:08 -08:00
Leon Senft
b1037ec2f0 fix(forms): debounce updates from interop controls
* Apply any debounce rules to updates from interop controls (if configured).
* Add tests to ensure debouncing works for all control types (native, custom,
  and interop).
2025-11-17 08:37:26 -08:00
SkyZeroZx
846d50ab23 docs: add documentation for DOCUMENT injection token usage in SSR 2025-11-17 08:28:00 -08:00
Angular Robot
d99b7437d1 build: update all non-major dependencies
See associated pull request for more information.
2025-11-17 08:04:29 -08:00
Angular Robot
cc0753411f build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-14 15:30:18 -08:00
Miles Malerba
722292f215 refactor(forms): improve typing on min & max (#65212)
If we're calling `min` on a path that's guaranteed to be `number` we
don't want to make the users validator function handle the `null` or
`string` cases.

This uncovered an issue in the `SchemaTreePath` type which needed to be
fixed by preventing the model type from being distributed over.

PR Close #65212
2025-11-14 21:56:58 +00:00
Miles Malerba
4f8ab4fa3c refactor(forms): allow passing number|string|null paths to min & max (#65212)
Relaxes the constraints on which paths can be used with the `min` &
`max` validation rules, since people may want to validate a
potentially-null number, or a numeric value represented as a string

PR Close #65212
2025-11-14 21:56:58 +00:00
Miles Malerba
fc1ef79ad4 build(forms): expose signal forms compat package
Hooks up @angular/forms/signals/compat to be released and have its docs
published
2025-11-14 09:23:36 -08:00
cexbrayat
c137f1fe91 docs: ExperimentalIsolatedShadowDom mentions 2025-11-14 08:41:13 -08:00
cexbrayat
b0dd813664 docs: FormArrayDirective mentions 2025-11-14 08:40:41 -08:00
Kristiyan Kostadinov
81bd455de8 refactor(compiler-cli): split up large file
The `type_check_block.ts` file was getting quite large and difficult to navigate. These changes split up the different pieces of functionality into separate files.
2025-11-14 08:40:11 -08:00
Leon Senft
acb78eeb7a test(forms): [field] inputs on components should just pass through
Test that a component with a bound `[field]` input is not treated as a
control, and that `fieldBinding` does not include the corresponding
`Field` instance.
2025-11-14 08:37:42 -08:00
Angular Robot
654e17651c build: update cross-repo angular dependencies
See associated pull request for more information.
2025-11-14 08:33:20 -08:00
Matthieu Riegler
1b895fece6 refactor(core): flip ngDevMode condition for formatter
In cases the `ngDevMode` flag hasn't been set, still enable the formatter. What matters is if `ngDevMode` is `false ` we tree shake that away.
2025-11-13 10:01:10 -08:00
SkyZeroZx
718eb7bb3a docs: adds guide references to router APIs
Adds `@see` tags with links to relevant guides in the router documentation.
2025-11-13 10:00:19 -08:00
Leon Senft
98ce9a7b17 refactor(forms): use AbortSignal to cancel debounced updates
Add an `AbortSignal` parameter to `Debouncer`. Implementations may
choose to accept this parameter to be informed when a debounced
operation is aborted. This may be useful for canceling pending timers or
avoiding unnecessary work.
2025-11-13 09:59:19 -08:00
Kristiyan Kostadinov
3f80ae74ba fix(core): SSR error in signal forms
Resolves an SSR error, because we weren't checking if `MutationObserver` is available.
2025-11-13 09:12:42 -08:00
Matthieu Riegler
d1ab73dd87 refactor(core): remove resource flag.
This was used to migrate G3 and is no longer necessary.
2025-11-13 09:12:16 -08:00
Kristiyan Kostadinov
f7e58577a4 refactor(compiler-cli): rework type checking for signal forms
Reworks the way we approach type checking of signal forms to be closer to the behavior at runtime. There are a couple of scenarios that we handle:

1. For native controls, we now produce simplified type checking code that looks as follows:

```
var t1 = null! as number | string; // Type depends on the input `type`.
t1 = someField().value();
```

2. For custom controls we generate bindings to the individual inputs, rather than checking conformance against `FormValueControl`/`FormCheckboxControl`. This is closer to the behavior at runtime and it allows us to handle generic directives properly.
2025-11-12 13:13:48 -08:00
Kristiyan Kostadinov
14152f69b9 refactor(core): remove unused type
Removes the `ExtractFromControlValue` type since it won't be necessary anymore.
2025-11-12 13:13:48 -08:00