Commit graph

37211 commits

Author SHA1 Message Date
Angular Robot
ebffd80ce4 build: update all github actions
See associated pull request for more information.
2026-04-30 15:55:07 -07:00
Matthieu Riegler
bc637a304f refactor(core): add support for default exports to injectAsync
ex:
```
await injectAsync(() => import('./test_service'))
```

We'll be reusing the features that were already used by the router to support components lazy-loading.
2026-04-30 15:53:07 -07:00
Angular Robot
9dc4e44eea build: update cross-repo angular dependencies
See associated pull request for more information.
2026-04-30 15:52:21 -07:00
Matthieu Riegler
dc9c72da9b fix(language-service): Add support for @Input with transforms
Prior to this change @Input with transforms were not linked by language service and you couldn't navigate on it.
2026-04-30 15:51:48 -07:00
Alan Agius
9d7a609458 fix(core): validate security-sensitive attributes in i18n bindings
Ensures that security-sensitive attributes (e.g., sandbox, allow) are correctly validated when applied through i18n-* dynamic attribute bindings, preventing potential policy bypasses.

Closes #68418
2026-04-30 15:47:12 -07:00
Andrew Scott
d919f9a13e refactor: attempt stronger automatic comment blocking
Updates the PR review skill to have stronger language against automatic comment posting
without explicit approval
2026-04-30 15:45:40 -07:00
hawkgs
9fa4be9d09 test(zone.js): vitest patch for testing (#68395)
Test `fakeAsync` API in Vitest when Zone.js `vitest` patch applied.

PR Close #68395
2026-04-30 15:44:35 -07:00
Charles Lyding
62c6e3b7ee feat(zone.js): support vitest patching in zone.js/testing (#68395)
To support `fakeAsync` usage while using `vitest` as a test runner, Zone.js
now provides patching when using the `zone.js/testing` package import.
This patching is similar to that of the existing jasmine, mocha, and jest
functionality.

PR Close #68395
2026-04-30 15:44:35 -07:00
wowDAS Markus Ramšak
6aa40f6c04 docs: fix typo in CHANGELOG.md 2026-04-30 15:43:30 -07:00
Matthieu Riegler
6413e703fa refactor(http): refactor http options
Use shared types to ease maintenance of the http client apis.

fixes #64513
2026-04-30 15:42:32 -07:00
Alex Rickabaugh
e0536091f5
perf(forms): optimize reactivity by using shallow array equality
Add `shallowArrayEquals` to computed signals returning arrays of errors or reasons in Signal Forms. This prevents unnecessary downstream invalidations when the content of the arrays remains unchanged.
2026-04-30 15:41:45 -07:00
Sonu Kapoor
4c9afb68a3 fix(core): respect ngSkipHydration on components with projectable nodes in LContainers
When a component is created dynamically via ViewContainerRef.createComponent
and receives projectable nodes (e.g. raw DOM nodes or embedded view root nodes),
applying ngSkipHydration to its host element did not prevent NG0503 from being
thrown during SSR serialization.

The root cause is an asymmetry in the serialization pipeline. For inline child
components, serializeLView already guards the annotateHostElementForHydration
call with a ngSkipHydration attribute check, so the component's lView is never
serialized when hydration is opted out. For components hosted inside an
LContainer (created via ViewContainerRef.createComponent), serializeLContainer
called serializeLView unconditionally — bypassing that guard entirely. When
serializeLView then encountered a projection slot backed by a raw DOM node
array, it threw NG0503 regardless of the ngSkipHydration flag.

The fix adds the same guard inside serializeLContainer before calling
serializeLView: if the child lView belongs to a component whose host element
carries ngSkipHydration, the lView serialization is skipped. This matches the
existing behavior for inline components and allows the documented workaround to
actually work for dynamically created ones.

Fixes #67928
2026-04-29 16:09:14 -07:00
Andrew Scott
2eae497a04 feat(compiler-cli): support external TCBs with copied content in specific mode
This change adds a new  that allows environments that cannot support inline TCBs (such as the language service or source-to-source transforms where TS compilation and emit are downstream) to still perform template type checking.

    Instead of inlining the TCB into the original source file when non-exported symbols are referenced, we now copy the file content to the .ngtypecheck.ts shim file and generate the external TCB there, if requested by the inlining mode. This preserves the local scope of the original file while keeping the original file unmodified.
2026-04-29 16:08:33 -07:00
Alon Mishne
12d4844c8b release: cut the v22.0.0-next.10 release 2026-04-29 16:03:12 -07:00
Alon Mishne
662560effc docs: release notes for the v21.2.11 release 2026-04-29 15:40:46 -07:00
Kam
13c0422029 docs(docs-infra): open update guide external links in new tabs
External links in the update guide opened inconsistently. Override
marked's link renderer to add `target="_blank" rel="noopener noreferrer"`
to external anchors and apply the `external-link-with-icon` mixin for
the icon. Convert raw HTML and bare URLs in recommendations.ts to
markdown so they all flow through the renderer.
2026-04-29 13:59:42 -07:00
Kam
2101b13653 docs: document allowedHosts SSR requirement in v21 update guide
The GHSA-x288-3778-4hhx patch requires `allowedHosts` on
`CommonEngine` or SSR silently falls back to CSR. Add a checklist
item to the v21 update guide.
2026-04-29 13:59:12 -07:00
Angular Robot
82890dd9f5 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-04-29 13:58:03 -07:00
Andrew Scott
af24a4ae3a fix(vscode-extension): Look for tsdk override in the new js/ts.tsdk.path setting
recent versions of vscode use js/ts.tsdk.path rather than typescript.tsdk

relates to #68423
2026-04-29 13:39:15 -07:00
Bhuvansh855
9f7d41f296 docs: improve clarity in dependency injection guide 2026-04-29 13:38:17 -07:00
Alan Agius
0f7086add4 docs: update documentation for platform server URL token options
This `baseUrl` option is not available.
2026-04-29 13:36:59 -07:00
Andrew Scott
c70625e806 refactor(compiler-cli): remove reflectionhost from environment
all necessary info is already available in the tcb meta objects. environments without full ts program no longer need a reflectionhost for tcb generation
2026-04-29 13:36:21 -07:00
splincode
54a985c5ca refactor(forms): replace any with unknown in interop control value types
- `CombinedControl.value` and `InteropNgControl.value` getter now return
  `unknown` instead of `any`, matching the actual `ReadonlyFieldState<unknown>`
  return type of `controlValue()`.
- Remove redundant `as any` cast in `cvaControlCreate`: `parent` is typed as
  `FormField<unknown>`, so `state().controlValue` is `WritableSignal<unknown>`
  and accepts `unknown` directly.
2026-04-29 13:35:48 -07:00
Ben Hong
18826de489 docs: add debouncing section to signal forms async operations
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
2026-04-29 13:35:18 -07:00
Angular Robot
37ba0a79a6 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-04-29 13:34:08 -07:00
Matthieu Riegler
37ec63e745 refactor(compiler): introduce default constant for legacyOptionalChaining flag
This will help patch the value in G3 to help land this change.
2026-04-29 10:01:13 -07:00
Matthieu Riegler
2896c93cc1
feat(compiler): Angular expressions with optional chaining returns undefined
To mitigate this breaking change,  this behavior can be disabled by wrapping expressions with the `$null` magic function.
: `$null(foo?.bar?.baz)`
2026-04-28 15:26:53 -07:00
Matthieu Riegler
ef38017418 build: move devtools only deps out of the workspace
This reduces the clutering of the workspace package.
2026-04-28 13:05:33 -07:00
aparziale
8f8972b0fd feat(migrations): model + output migrations
becomes input + linkedSignal

When a component has both a model() property and a conflicting output property (e.g., foo model + fooChange output), this migration converts the model() to an input() + linkedSignal() pattern to avoid naming conflicts.

Fixes #67340
2026-04-28 12:43:55 -07:00
SkyZeroZx
97cac1cf4d fix(common): prevent focus from scrollToAnchor
Focus the target element using `focus({preventScroll: true})` after scrolling, so the browser doesn’t adjust the scroll position when applying focus.

Fixes #65938
2026-04-28 12:39:26 -07:00
Angular Robot
f5b139f5b8 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-04-28 12:33:28 -07:00
Denis Balan
5dfe37df8e docs: Fix links to Firebase AI Logic Angular example 2026-04-28 12:10:48 -07:00
Suraj Yadav
f2c6445681 docs(forms): add NG01902 error reference and link to docs
Add the NG01902 (Orphan field in signal forms) documentation page
to the Error Encyclopedia and change the ORPHAN_FIELD_PROPERTY
error code to -1902 so Angular's RuntimeError automatically appends
a link to angular.dev/errors/NG01902 in the thrown error message.
2026-04-28 12:07:46 -07:00
Matthieu Riegler
8c11816490 fix(core): fix ordering of view queries metadata in JIT mode
AOT was generating an array that was ordered as signal queries first, then the decorator queries.
Aligning JIT with AOT fixes the issue illustrated by the test.

fixes #68404
2026-04-28 12:03:41 -07:00
Kam
a6eb55642c docs: use contentChildren() in component harness example
The example already uses the signal-based input() but still declares
items with the @ContentChildren decorator. Convert to the signal-based
contentChildren() query for consistency.
2026-04-28 12:03:09 -07:00
Matthieu Riegler
444b024d49 feat(core): Add a injectAsync helper function
The commit introduces a new function to assist users who want to lazy load services and use the DI system to create them.

Example:

```ts
import {injectAsync} from 'angular/core';

class MyCmp {
  someSvc = injectAsync(() => import('..'));

  async onClick() {
    (await this.someSvc()).handleClick();
  }
}
 ```
2026-04-28 12:01:27 -07:00
Alon Mishne
0c56679049 build: lock file maintenance
Updated the pnpm-lock.yaml file to ensure all dependencies are up to date and consistent.
2026-04-28 11:55:09 -07:00
hawkgs
6abdef4f4f docs: add information about zone.js Vitest patch in the Vitest migration guide
Update the Karma to Vitest migration guide to include information about the zone.js Vitest patch that should handle `fakeAsync`.

Related to #68395.
2026-04-28 10:32:49 -07:00
Joey Perrott
e4f9781f28 build(dev-infra): update dev-infra actions to latest commit
Updates all GitHub Actions that use actions from the angular/dev-infra repository to the latest commit SHA 442c2fcbf06a321b5196b4c5fc70e78a49242958.
2026-04-28 10:32:20 -07:00
Kristiyan Kostadinov
72be5be9c1 refactor(compiler-cli): remove checkTwoWayBoundEvents flag
Removes the `checkTwoWayBoundEvents` flag since the code it generates is quite breaking and we never got the chance to enable it. Also it caused our tests to misrepresent how the compiler behaves for actual users.
2026-04-28 10:31:42 -07:00
Kam
273ff07469 docs: use inject() in @Self example in hierarchical DI guide
The surrounding @SkipSelf and @Host examples already use inject(),
and the section intro recommends it. Align the @Self example to match.
2026-04-28 10:30:57 -07:00
Herdiyan IT Dev
f219e65841 refactor(dev-infra): use shell: false and quote args in benchmark-compare workflow
Currently, the exec() utility uses childProcess.spawn() with shell: true. This commit changes the spawn option to shell: false to prevent OS command injection vulnerabilities and quotes the benchmark target in the github action.
2026-04-28 10:29:24 -07:00
Angular Robot
32d768f69c build: lock file maintenance
See associated pull request for more information.
2026-04-28 10:25:45 -07:00
Angular Robot
52bcec1ae4 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-04-28 10:19:56 -07:00
Alan Agius
1bfdae91aa docs: document NG_TRUST_PROXY_HEADERS environment variable for AngularNodeAppEngine
See: https://github.com/angular/angular-cli/pull/33056 for more info.
2026-04-28 10:11:12 -07:00
Simon
c8aad6acc6 docs: remove duplicated text 2026-04-27 17:10:19 -07:00
Simon
38c352766a docs: remove spaces to correct the indentation 2026-04-27 17:09:45 -07:00
Kristiyan Kostadinov
6bd1721662 fix(compiler): let declaration span not including end character
Fixes that the span for `@let` declarations didn't include the end token.
2026-04-27 17:09:14 -07:00
Alan Agius
2a6b6fafb0 fix(platform-server): ensure origin has a trailing slash when parsing url
The origin did not have a trailing slash, which caused parsing issues for relative URLs.

Fixes #68322
2026-04-27 17:08:36 -07:00
aparziale
982e3cce52 docs: Fix typo in doc
Fix typo in documentation. Changed "create workspace" to "create a workspace"

Fixed #68375
2026-04-27 17:08:02 -07:00