38441 Commits

Author SHA1 Message Date
Alex Rickabaugh 16adbbf423 fix(core): ensure custom controls resolve transitive host directives
Custom controls can be modeled using a set of host directives to alias
and expose value and valueChange (or checked/checkedChange) bindings,
as well as native attributes like disabled.

This commit updates initializeCustomControlStatus to correctly identify
host components using mapped inputs/outputs, even when those inputs are
exposed via transitive host directives. It also updates
customControlHasInput so that the custom control presence check correctly
evaluates the exposed inputs across all applied host directives, caching
the result to optimize performance on hot code paths.
2026-03-25 13:00:46 -07:00
Kristiyan Kostadinov 3382e8a34b refactor(compiler-cli): generalize out of band diagnostics recorder
Currently the `OutOfBandDiagnosticRecorder` is tied to producing TypeScript diagnostics, however some of our use cases might call for a different form.

These changes decouple the recorder from TypeScript and make the diagnostic type generic.
2026-03-25 12:59:11 -07:00
Matthieu Riegler 1938054f34 docs(docs-infra): remove explicit OnPush 2026-03-25 12:58:39 -07:00
hawkgs 0ad18ee933 refactor(devtools): drop explicit OnPush change detection strategy
Drop explicit `ChangeDetectionStrategy.OnPush` from the apps since it's now the default.
2026-03-25 12:58:11 -07:00
Kristiyan Kostadinov 9ee4f83705 build: update to TypeScript 6 stable
Updates the repo to the stable version of TypeScript 6.
2026-03-25 12:57:49 -07:00
Angular Robot 5565ff15ae build: update dependency node to v22.22.2
See associated pull request for more information.
2026-03-25 12:57:20 -07:00
Alan Agius 6f20fb513c docs: reword allowedHosts security warning
Update the allowedHosts security warning in the security guide to remove the mention of DNS rebinding, which is primarily relevant for the dev server, and refocus on host header injection and SSRF. Additionally, clarify that allowing all hosts with "*" is only appropriate when header validation is handled by an external layer.
2026-03-25 12:56:42 -07:00
Alan Agius ad57c9d0d4 build: re-sync file
This fixes main CI
2026-03-25 09:31:58 +01:00
Matthieu Riegler eae8f7e30b feat(core): Set default Component changeDetection strategy to OnPush
The default change detection strategy is now OnPush.

BREAKING CHANGE: Component with undefined `changeDetection` property are now `OnPush` by default. Specify `changeDetection: ChangeDetectionStrategy.Eager` to keep the previous behavior.
2026-03-24 16:25:02 -07:00
guidettj 050b14bd7f docs: fix incorrect getHarnesses() method to getAllHarnesses and broken link 2026-03-24 15:35:32 -07:00
SkyZeroZx 098553bfe4 docs: update defer section to Markdown and fix absolute URL to relative in adev 2026-03-24 15:34:57 -07:00
Kristiyan Kostadinov d9712e605e refactor(core): expand input flags type
Expands the type for the input flags in definitions since the current one prevents some of the generated code from compiling.
2026-03-24 15:18:28 -07:00
hawkgs 78c2d0aa19 docs(docs-infra): redefine /guide/pipes redirect
Update the definition of the `/guide/pipes` redirect in order to avoid breaking the `a.dev/guide` redirect to Not Found page.
2026-03-24 15:17:11 -07:00
Fausto Davila c9f7a7f649 docs: fix typo in end-to-end.md regarding e2e command 2026-03-24 15:15:10 -07:00
Jens Kuehlers b4ae9cf040 docs: update release date to not clash with Google I/O 2026 2026-03-24 15:14:34 -07:00
Angular Robot 9192dfede1 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-03-24 15:12:28 -07:00
Angular Robot 1533242577 build: lock file maintenance
See associated pull request for more information.
2026-03-24 15:08:28 -07:00
Alex Rickabaugh 709f5a390c feat(forms): add FieldState.getError()
Added a `getError(kind: string)` method to `FieldState` that returns the first validation error of a given kind, or `undefined` if no such error exists. This method is reactive and will re-evaluate when errors change.

Fixes #63905

Also updated public API goldens and added unit tests.
2026-03-24 15:07:55 -07:00
Alex Rickabaugh ee8d2098cb fix(forms): change FieldState optional properties to non-optional | undefined
This improves compatibility with TypeScript's exactOptionalPropertyTypes.

Fixes #67246
2026-03-24 14:51:31 -07:00
weedorflow 37b1c5d0fe docs: clarify size budget configuration 2026-03-24 14:49:34 -07:00
SkyZeroZx 5879f310b4 docs: Update docs with ComponentInputBindingOptions 2026-03-24 14:48:52 -07:00
SkyZeroZx 1782114862 refactor(router): expose ComponentInputBindingOptions in public API
Expose  `ComponentInputBindingOptions` as part of the public API
2026-03-24 14:48:52 -07:00
Matthieu Riegler 8bc31a515f feat(core): Allow other expression for exhaustive typechecking
When the switched expression is nested within a union, exhaustive typechecking needs to know which expression to check.
This change adds the possibility of specifying the expression to check:

```
@Component({
  selector: 'app-root',
  imports: [],
  template: `
    @switch (state.mode) {
      @case ('show') { {{ state.menu }}; }
      @case ('hide') {}
      @default never(state);
    }
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class App {
  state!: { mode: 'hide' } | { mode: 'show'; menu: number };;
}
```

fixes #67406
2026-03-24 14:42:28 -07:00
Leon Senft 0eeb1b5f03 fix(forms): allow FormRoot to be used without submission options (#67727)
The `[formRoot]` directive will no longer call `submit()` if the bound
form doesn't define its own submission options. This allows the
directive to be used solely for the default behavior it provides:
setting `novalidate` on the `<form>` and calling `preventDefault()` on
the `submit` event.

Fix #67367

PR Close #67727
2026-03-23 15:41:19 -07:00
Leon Senft f4a5b42ebe refactor(forms): rename directive files for consistency (#67727)
- **FormField**:  `form_field_directive.ts` -> `form_field.ts`
- **FormRoot**:   `ng_signal_form.ts`       -> `form_root.ts`

PR Close #67727
2026-03-23 15:41:19 -07:00
Aleksander Bodurri 36edf4870f fix(devtools): fix incorrect logic in destroy function for ChromeMessageBus
Destroy uses window.removeEventListener but the ChromeMessageBus doesn't actually depend on a window object.

In practice this code is unlikely to ever be reached. If a tab is closed the entire context script JS process is killed so this is not an bug that would be very common or even reachable. That being said for correctness this should not be using window.
2026-03-23 14:51:27 -07:00
Joey Perrott 543753f551 ci: correct capitalization of MarkTechson in pullapprove
Correct the capitalization of MarkTechson's username to match their GitHub profile, ensuring proper evaluation by PullApprove.
2026-03-23 14:50:19 -07:00
Alan Agius b89af3c8da docs: remove redundant ng command from npx instructions in Angular Developer skill 2026-03-23 14:49:26 -07:00
SkyZeroZx 946f4eacfe docs(docs-infra): remove redundant provide http and zoneless providers
Removes `provideHttpClient(withFetch())` and `provideZonelessChangeDetection()` from the root config since both are already provided by default
2026-03-23 14:48:02 -07:00
SkyZeroZx 26afb736b7 docs: Update provideZonelessChangeDetection tsdocs 2026-03-23 14:48:02 -07:00
Matthieu Riegler f46e8bd440 refactor(compiler): remove fullTemplateTypeCheck compiler option.
The option was deprecated back in v13. Users should use `strictTemplates: true`.
2026-03-23 11:33:15 -07:00
Modeste ASSIONGBON 2615f35da9 docs: fix js doc of signal forms ignoreValidators option. 2026-03-23 11:21:16 -07:00
SkyZeroZx 1f9a42bb42 refactor(http): Make Fetch API the default in HttpBackend
Updates the `HttpBackend` default provider to `FetchBackend`.

Also updates related warning messages to reflect the new default behavior.
2026-03-23 11:20:39 -07:00
Pushkar-Mahajan4 1128e78913 docs: fix typo in Input decorator 2026-03-23 11:19:46 -07:00
Kristiyan Kostadinov 63ac1bd2fd refactor(compiler-cli): decouple host element creation logic from TypeScript
Reworks the logic for constructing a `HostElement` node so that we can reuse it without depending on TypeScript APIs.
2026-03-23 11:16:39 -07:00
SkyZeroZx 6d2eed61a1 docs(docs-infra): fix aria-label parsing breaking headings
Strip all HTML tags and escape quotes in aria-label to avoid breakage
2026-03-23 10:33:15 -07:00
splincode 25dad82e43 refactor(devtools): improve test descriptions by fixing spelling
Fixed misspellings in test descriptions in devtools/projects/shell-browser/src/app/tab_manager_spec.ts: recieved/recieves → received/receives in three it(...) titles.
2026-03-23 10:32:39 -07:00
splincode 13c198ae63 docs: fix typos in ssr-benchmarks README.md
Corrected typos in modules/ssr-benchmarks/README.md: mesure→measure, Struture→Structure, render→renders, benckmark→benchmark, capitalized DevTools, and clarified the flame chart instruction.
2026-03-23 10:27:38 -07:00
SkyZeroZx ad3991cd0b docs(docs-infra): replace non-interactive buttons with spans
These elements are not interactive, so using <button> is misleading for accessibility
(screen readers and keyboard navigation expect an action).
2026-03-23 10:24:08 -07:00
Alan Agius 293ac66a9f ci: support publishing dev-skills to snapshot repository
Updates the snapshot publishing script to package the contents of
`skills/dev-skills` and publish them to the `angular/skills`
repository.

The changes include:
- Ensuring the script always runs from the repository root.
- Updating `publishRepo` to support an optional third argument for
  specifying a custom repository name (defaulting to `-builds`).
- Implementing `publishDevSkills` to package individual skills at the
  root of the snapshot repository.
2026-03-23 09:49:11 -07:00
Matthieu Riegler d2054c7c1a refactor: prepare for required changeDetection prop on G3.
We'll make this a G3 only change to prevent backsliding during the transition period.
2026-03-20 15:52:38 -07:00
Angular Robot eb5bb93195 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-03-20 15:46:34 -07:00
Angular Robot 621c9083de build: update cross-repo angular dependencies
See associated pull request for more information.
2026-03-20 15:22:17 -07:00
splincode c5da47f63f refactor: replace any with stricter types in common and core
- `JsonPipe.transform`: `any` → `unknown`
- `renderStringify`: `any` → `unknown`
- `NgLocalization.getPluralCategory`: `any` → `number`
2026-03-20 15:20:43 -07:00
Kristiyan Kostadinov 96be4f429b fix(compiler): abstract emitter producing incorrect code for dynamic imports
Fixes that the abstract emitter wasn't adding quotes around the URL of a dynamic import.
2026-03-20 15:18:29 -07:00
Kristiyan Kostadinov 5e99ae9f00 fix(core): widen type for directive inputs/outputs
Currently the directive inputs and outputs are typed to match the members of the class. We can't guarantee that when generating code, because of cases like `model` where an output is generated implicitly.

These changes widen the type to be any string.
2026-03-20 15:18:29 -07:00
Kristiyan Kostadinov 22f8b0a500 fix(core): resolver function not matching expected type
Fixes that the `ɵɵresolveWindow` function wasn't match the type expected by `ɵɵlistener`. I've also added explicit type annotations to make cases like this easier to catch.
2026-03-20 15:18:29 -07:00
Matt Lewis 5a712d42d1 fix(compiler): prevent shimCssText from adding extra blank lines per CSS comment
The comment placeholder restoration in `shimCssText` appended an unconditional
`+ '\n'` to each non-hash comment replacement. Because `_commentRe` does not
consume the newline that follows a comment in the source, that newline already
remains in `cssText`. The extra `'\n'` was therefore inserted on top of the
existing one, shifting every line after each comment down by one. In files with
many comments (e.g. large SCSS preambles) this shifts all subsequent CSS rules
far enough that the CSS sourcemap — generated before `shimCssText` runs —
points to completely wrong source locations in browser DevTools.

The fix is to drop the `+ '\n'`; internal newlines within a multi-line comment
are still preserved via `_newLinesRe`, and the trailing newline that follows the
comment in `cssText` is already present without any extra injection.
2026-03-20 15:17:31 -07:00
Angular Robot 275a436a33 build: lock file maintenance
See associated pull request for more information.
2026-03-20 15:11:24 -07:00
Alex Rickabaugh df8b020299 fix(forms): clear native date inputs correctly in signal forms when changed via native UI
When a native date input gets cleared manually by a user via the internal browser
UI, the element changes from invalid to valid, but no `input` event is emitted.

This commit introduces `InputValidityMonitor`, an injectable service that
intercepts these edge-case native status changes. The monitor dynamically
installs CSP-compliant styles appending specific animation keyframes for
`:valid` and `:invalid` pseudoclasses on native form controls. By attaching an
`animationstart` listener, Angular intercepts these changes immediately and
re-invokes the parser.

Fixes #67300
2026-03-20 15:10:26 -07:00