Commit Graph

38355 Commits

Author SHA1 Message Date
Matthew Beck 81c3f3a6aa release: cut the v22.2.0-next.5 release v22.2.0-next.5 2026-09-02 19:40:50 -07:00
Matthew Beck e4b8822c43 docs: release notes for the v22.1.5 release 2026-09-02 19:37:23 -07:00
Matthew Beck 502fa130aa fix(docs-infra): ignore external links when mapping navigation items to routes
When navigation items contain external URLs (e.g. https:// links for documentation or third-party resources), mapNavigationItemsToRoutes previously registered them as Angular Router route definitions. In recent versions of @angular/build, the static prerender worker asserts that discovered routes do not return empty content during SSG prerendering, causing production builds and CI adev-deploy to fail on these routes.

This change filters out external links in mapNavigationItemsToRoutes so only valid internal application paths are registered as Angular routes.
2026-09-02 19:07:15 -07:00
SkyZeroZx 69c87301aa fix(vscode-extension): prevent JSDoc link provider injection
Treat link targets as file paths so crafted documentation cannot select arbitrary VS Code resource providers.

Fixes https://github.com/angular/angular/issues/70512
2026-09-02 16:06:55 -07:00
arturovt 58d536bc83 fix(core): don't fail NgModule checks for a pipe that extends a base class
When an abstract base class has something like a lifecycle hook, Angular
compiles it as a directive with no selector. If a pipe extends that base
class, the pipe picks up the base class's directive definition through
normal class inheritance.

The NgModule dev-mode checks then got confused by that inherited
definition and reported the pipe as a broken directive:

  - "Directive SomePipe has no selector, please add it!"
  - or, if the base class was a default (standalone) abstract directive,
    "SomePipe is marked as standalone and can't be declared..."

Both only happened in tests (TestBed), not when running the app.

Now the selector check and the standalone check both look at the pipe's
own definition and ignore a directive definition that only came from a
base class.

Fixes #36427
2026-09-02 16:06:12 -07:00
SkyZeroZx 7168bed663 fix(core): validate SVG animation attributes outside the SVG namespace
Make the SVG animation security context depend on the tag name instead of the namespace the element was created in. An animation element declared outside an `<svg>` is created in the HTML namespace, but still animates once it ends up inside an SVG subtree, so to and `attributeName` bindings were reaching the DOM unvalidated.

Fixes  #70490
2026-09-02 16:05:47 -07:00
Andrew Scott 7137a41223 feat(router): stabilize auto cleanup injectors feature
Removes experimental tags and stabilizes withAutoCleanupInjectors, AutoCleanupInjectorsFeature,
and RouteReuseStrategy cleanup methods, while re-exporting withExperimentalAutoCleanupInjectors as deprecated.
2026-09-02 16:05:12 -07:00
Jaime Burgos af26a8c521 fix(router): avoid view transitions when the user agent provides one
Preserve hasUAVisualTransition through Location and the Router navigation pipeline. This prevents withViewTransitions from starting an author transition after the browser has already performed one, including across redirects and when using experimental platform navigation.
2026-09-02 16:04:41 -07:00
Andrew Scott cd771174b9 build(zone.js): fix release PR URL and filter changelog to zone.js scope
In recent conventional-changelog version updates, the underlying
@conventional-changelog/git-client dropped support for the raw `grep` and
`extendedRegexp` options, causing all monorepo commits to be included in the
zone.js changelog. Additionally, without `tagPrefix: 'zone.js-'`, conventional-changelog
treated monorepo release tags as release boundaries, generating changelog sections
for every intermediate monorepo release.

This change:
- Configures `tagPrefix: 'zone.js-'` and filters commits by `scope === 'zone.js'`
  via `writerOpts.transform` in the gulp changelog task.
- Fixes the PR creation link in the release script to use the cross-fork
  compare URL format on GitHub.
- Fixes the release commit SHA lookup in `cutReleaseWorkflow`.
- Updates zone.js release documentation.
2026-09-02 15:59:31 -07:00
Angular Robot a66fd64cd4 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-09-02 15:52:44 -07:00
Angular Robot de91d10b80 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-09-02 15:39:44 -07:00
Cheng-Hsuan Tsai d7af4b5aca docs: decouple selection from aria toolbar examples and guide 2026-09-02 15:14:21 -07:00
Kam 45148dae44 docs: correct openFiles entries that point at missing files
Two tutorial steps list a file in `openFiles` that does not exist, and a
missing entry is dropped without complaint. `first-app/05-inputs` asks for
`housinglocations.ts` when the file is `housinglocation.ts`; since
`hiddenFiles` is everything not in `openFiles`, the interface that step
teaches was marked hidden rather than opened.
`signals/5-component-communication-with-signals` asks for
`quantity-selector.ts`, which exists in neither `src` nor `answer`. Every
openFiles entry in the tutorials now resolves.
2026-09-02 14:32:45 -07:00
Kam 90b9e081f5 fix(docs-infra): keep the collapsed code state when a code block is reshown
The code block lives inside `@if (showCode())`, so hiding it destroys the DOM and
showing it builds a fresh copy with no hidden lines. Nothing reapplied
`setCodeLinesVisibility()`, so a collapsed block came back showing the whole file.

Reapply it once the block is rendered again. It already branches on `expanded()`,
so a block that was expanded stays expanded.
2026-09-02 14:32:17 -07:00
Kam 431b170fd5 build: narrow the preview exclusions for two example apps
`reactive-forms` and `form-validation` were excluded from `embeddable` in
full, with a TODO to fix them. The examples are fine; four partial snapshots
quoted by the guides are not, since each shares the final template of the
component it precedes, which references members it does not have yet.
Excluding those four files clears all 30 errors and puts 23 app files back in
the preview pool, so both guides' final components can be previewed for the
first time.
2026-09-02 14:30:50 -07:00
Angular Robot 6fdb7f061b build: update dependency mocha to v12
See associated pull request for more information.
2026-09-02 14:30:09 -07:00
Angular Robot b8a750fb34 build: update dependency bazel to v8.8.0
See associated pull request for more information.
2026-09-02 14:28:44 -07:00
Matthew Beck 124bf44809 release: cut the zone.js-0.16.3 release zone.js-0.16.3 2026-09-02 14:19:15 -07:00
Matthieu Riegler f44bf0fe22 ci: move packages/private under fw-general
This doesn't need dev-infra approval as its mostly testing utils.
2026-09-01 14:42:04 -07:00
Kam c03e872ed9 docs: highlight the search tutorial @for block as Angular
The block quotes a `.ts` file but declares `language="html"`, and shiki's
HTML grammar does not know Angular control flow, so the whole `@for` line
renders unstyled. Use `angular-ts`, matching the other blocks in the
tutorial.
2026-09-01 14:41:31 -07:00
aparziale 1d9e445d1a fix(vscode-extension): handle escaped delimiters in inline template and styles highlighting
The TextMate grammars for inline templates and inline styles ended the
string at the first occurrence of the delimiter, so an escaped delimiter
(e.g. \`) terminated the highlighting prematurely and the rest of the
template was no longer highlighted as HTML.

Escape sequences are now consumed before delegating to the HTML/CSS
grammars, so escaped delimiters no longer end the string. Also removes
the stray pipes from the string delimiter character class, which
unintentionally matched a literal '|'.

Fixes #65493
2026-09-01 14:40:44 -07:00
Kristiyan Kostadinov 05c4d5a835 feat(core): add utility for testing directives
Adds `TestBed.createDirective` to make testing directives easier.

Fixes #54164.
2026-09-01 14:40:05 -07:00
Matthieu Riegler 9f440907e8 refactor(core): remove old deferredImports structure
This finishes the migration to the keyed object structure
2026-09-01 09:41:10 -07:00
Doug Parker 6e299da8cf feat(forms): hard-code readOnlyHint and untrustedContentHint for WebMCP implicit signal forms
Signal forms can safely assume `{readOnlyHint: false, untrustedContentHint: false}` given their context. A form _must_ alter page DOM (or else how would a user interact with it) and is therefore definitionally side-effectful. We also assume returned content is trusted, given it is currently hard-coded or derived from application errors.

In the future, we might want to consider cases where application errors are explicitly untrusted or where application developers choose to customize the response text with something which might be untrusted. For now, that's out of scope and we'll worry about it when a compelling use case arises.
2026-09-01 09:39:20 -07:00
Doug Parker 91a2bf8425 feat(core): support annotations in WebMCP tool declarations
This updates `declareExperimentalWebMcpTool` to allow annotations to be provided to opt-in the tool explicitly into being read only or returning untrusted content.
2026-09-01 09:39:20 -07:00
Matthieu Riegler faafd18a4c fix(compiler-cli): check uninvoked signal aliases in extended diagnostic
Extended template diagnostic interpolated_signal_not_invoked previously
only checked symbols with kind === SymbolKind.Expression. When a signal
is aliased via @let (or a template variable), getSymbolOfNode returns
a LetDeclarationSymbol (or VariableSymbol), causing the diagnostic to
skip checking uninvoked usages of signal aliases in interpolations and
bindings.

This commit updates interpolated_signal_not_invoked to also check
LetDeclarationSymbol and VariableSymbol, using the usage site's AST
name span for reporting the diagnostic.

Closes #70476
2026-09-01 09:38:21 -07:00
Kam b70edd2768 fix(docs-infra): parse docs-callout attributes correctly
Three ways a callout could be misparsed:

- A title quoted with `'` or a backtick was dropped, leaving an empty
  heading. Two callouts lose their title on angular.dev today, on
  guide/forms/template-driven-forms and guide/i18n/prepare. The first has
  to use single quotes because its title contains `"pristine"`.
- A title containing `>` was dropped, because the attribute capture
  stopped at the first `>` even inside a quoted value.
- The severity was matched anywhere in the tag, so a title such as
  "Why this is important" silently rendered an important callout.

Scan attributes with quoting in mind, accept all three quote characters
as #69268 did for docs-code-block, and match the severity flags against
the tag with attribute values removed. The i18n callout also spelled the
attribute `header`, which the extension has never read.
2026-09-01 09:36:47 -07:00
hawkgs 00ec65546b refactor(devtools): fix signal details UI
Fix different action buttons and value preview container size.
2026-09-01 09:33:35 -07:00
Kam a92f6057d3 refactor(docs-infra): remove two more unreferenced guide images
`input.svg` and `output.svg` are leftovers that #70335 missed. Their
last reference was deleted by #54829 when the AIO guides were removed,
and nothing in the repo mentions them or their directory. Removing both
empties `adev/src/assets/images/guide/inputs-outputs`.
2026-09-01 09:32:27 -07:00
Shuaib Hasan Akib b5ce15c659 refactor(core): use native Promise.withResolvers() in tests
Replaces the temporary `promiseWithResolvers` polyfill with the
native `Promise.withResolvers()` API in test files and Updates the TypeScript configuration to include the `es2024.promise`.
2026-09-01 09:31:48 -07:00
arturovt 8975b4346d docs: add NG0991 error page and document rxResource's completion contract
RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE had no guide, no JSDoc on
RxResourceOptions.stream, and — since the code was positive rather
than negative — could never get an auto-linked docs page even if one
existed. Flip it to -991, add the NG0991 reference page, and document
the "stream must emit a value or an error before completing"
requirement on stream's JSDoc and in the RxJS interop guide.

Also documents and tests that an unguarded template read of an
errored resource's .value() propagates to the global ErrorHandler,
and recommends guarding with .hasValue() as defense in depth.

httpResource can throw the same error, but for a different reason:
its internal request Observable isn't something app code writes
directly, so an empty completion there is almost always an
HttpInterceptor swallowing the response (catchError(() => EMPTY))
rather than a stream authored in the resource() call itself. The page
covers both APIs with guidance matched to what's actually going on
for each.
2026-09-01 09:31:00 -07:00
arturovt ca38305976 docs: explain that errors during early app startup miss ErrorHandler
There's a short window where Angular can't send errors to ErrorHandler
yet: while it's still building the root module or root component. It
needs that root instance to look up the ErrorHandler you provided, so
an error thrown before it exists just becomes a normal uncaught error
instead.

This mostly bites people using Angular elements, where a custom element
tag already sitting in the page gets upgraded (and its component built)
the moment you call customElements.define, which can happen very early.

Added a short section to the error handling guide explaining why this
happens and the usual ways around it: setTimeout, APP_BOOTSTRAP_LISTENER,
or moving element registration to ngDoBootstrap.

Fixes #29211
2026-09-01 09:26:44 -07:00
oerol 9fd77852fb docs: fix global target event listener example 2026-09-01 09:26:07 -07:00
Santosh Yadav e1bf5393ad docs: Update request handler to use handle method
there is no request method the correct method is hanlde
2026-09-01 09:25:24 -07:00
Angular Robot 1b0d861fe5 build: lock file maintenance
See associated pull request for more information.
2026-09-01 09:22:54 -07:00
SkyZeroZx d8e74e7d39 docs(docs-infra): improve update checkbox accessibility
Associate each recommendation with its checkbox so assistive technology has a descriptive label and non-interactive text toggles the control. Keep embedded links independently operable.
2026-08-31 20:33:18 -07:00
lazerg f72600eadd fix(migrations): skip tsconfig files of non-Angular projects
Only touch tsconfig files for targets that use an Angular builder, including community ones like Nx, so non-Angular projects in mixed workspaces are left alone.

Fixes #69837
2026-08-31 20:31:31 -07:00
Angular Robot 87d38ec3ff build: lock file maintenance
See associated pull request for more information.
2026-08-31 15:37:10 -07:00
Stefan 4c4a705ce3 fix(zone.js): preserve accessor and non-enumerable event listener options
`copyEventListenerOptions` copied the caller's options with `{...options}`
before forwarding to the native `addEventListener`. Object spread only
copies own enumerable data properties, whereas the native call reads
each dictionary member via WebIDL — a plain `[[Get]]` per member, which
invokes accessors and ignores enumerability. The copy was therefore
lossy in a way the native call is not:

- `Object.defineProperty(opts, 'passive', { get })` (the shape used by
  MDN's passive-listener feature test) — the getter was never invoked,
  so libraries that use the feature test fall back to the legacy boolean
  and register every listener as non-passive.
- `Object.defineProperty(opts, 'capture', { get: () => true })` — the
  listener was silently registered on the bubbling phase.
- `Object.defineProperty(opts, 'once', { get: () => true })` — the
  listener fired on every dispatch.

`signal` was already special-cased for `AbortController.prototype.signal`
after #54142; that patch generalises the workaround to every recognised
member.

The copy itself was the correct fix for #54142 (frozen/readonly options)
and is preserved. The fix reads each recognised member from the source
via `[[Get]]` when the spread did not, which recovers accessors and
non-enumerable properties without double-invoking any getter. The list
of recognised members is hoisted to module scope so it isn't allocated
on every `patchEventTarget` invocation.

The call site is reordered to `buildEventListenerOptions(
copyEventListenerOptions(...))` so the passive-events code path also
spreads a normalised data object rather than the caller's raw input.

Fixes #70431

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
2026-08-31 15:21:37 -07:00
Roman 0904f90b13 fix(core): cancel stale debounce timers to prevent timer leaks
The debounce() utility scheduled a setTimeout when using a numeric wait value, but the scheduled timer was never cleared when a new value arrived, the observable threw, or the injector was destroyed. This caused pending timers to fire after invalidation and leak beyond the owner's lifecycle.

Refactor timer cancellation into a dedicated helper and track the pending timer id so any stale timer is cleared on new values or teardown. Adds tests covering cancellation on new values, errors, and injector destruction.
2026-08-31 15:07:31 -07:00
Jessica Janiuk f3ed75eb6b ci: remove shared primitives pullapprove group
This group is no longer necessary as responsibilities for that are now spread amongst teams more equally.
2026-08-31 15:03:05 -07:00
Alan Agius b3bb36ad87 fix(platform-server): resolve HTTP(S) URLs without authority as relative during SSR
Under the WHATWG URL standard, HTTP and HTTPS URLs lacking an authority
(e.g., `http:/path` or `http:path`) resolve as relative paths when resolved
against an origin of the same scheme. Previously, `relativeUrlsTransformerInterceptorFn`
treated any URL with a scheme as an absolute URL, bypassing base resolution in SSR
and allowing Node fetch to parse the path as a cross-origin host.

This commit updates SSR URL resolution and the HTTP interceptor to ensure
HTTP(S) URLs without an authority are resolved against the current origin,
preventing unexpected origin changes and aligning SSR with browser behavior.

Fixes #70447
2026-08-31 13:22:53 -07:00
Kristiyan Kostadinov 38861ac41b fix(forms): avoid writing to name input on ControlValueAccessor
Fixes that signal forms were overridding the `name` input of the CVA with an auto-generated one. This can break directives like `mat-radio` that assign their own `name`.

Fixes #69677.
2026-08-31 13:21:15 -07:00
Matthieu Riegler 9cf7b44f7c build: remove explicit strict options
Those options are enabled by default, they don't need to be explicit.
2026-08-31 13:17:00 -07:00
Kam acdac1cb89 fix(docs-infra): restore the edit link on decorative header pages
The 34 pages using `<docs-decorative-header>` render their title
through `getPageTitle()` without passing the markdown file path, so
the "Edit this page" link is silently dropped. Every other page keeps
it. Compare https://v19.angular.dev/guide/components, which still has
the pencil, against https://angular.dev/guide/components, which does
not.

`filePath` was required until #63536 made it optional, so API
descriptions with no editable source could render a title without a
link. That removed the compile error forcing the decorative header to
supply it, and the argument was lost with nothing to catch it.

Pass the path again and cover both header variants with tests, since
the edit link had no coverage at all.
2026-08-31 13:14:25 -07:00
Kam d9afca095b fix(docs-infra): reject unclosed paired docs elements
An unclosed `<docs-step>` or `<docs-card>` produces no error, just wrong
output, so the two cases fixed in the previous commit went unnoticed for
years.

Validate that the paired custom elements balance before parsing. A
mismatch now names the file and the counts instead of silently
swallowing a section.
2026-08-31 11:31:02 -07:00
Kam 0752282c8f docs: close the unclosed docs-step tags in two guides
`reactive-forms.md` and `app-shell.md` each open a `<docs-step>` that is
never closed. The tokenizers match up to the *next* closing tag instead
of failing, so the unclosed tag pulls in the content that follows and
leaves the block after it unparsed in the output.

On https://angular.dev/guide/forms/reactive-forms the "Creating nested
form groups" section shows raw source: "To create a nested group in
`profileForm`, add a nested `address` element", backticks and all. Its
heading is swallowed into the unclosed step instead of being an h3, and
the page renders 20 of its 21 steps. On
https://angular.dev/ecosystem/service-workers/app-shell the third step
is missing entirely.

`reactive-forms.md` has been broken since #52536, `app-shell.md` since
#55550.
2026-08-31 11:31:02 -07:00
Kam 46b02cc181 docs: correct stale visibleLines ranges in the first-app tutorial
The tutorial's example files shifted without the README line references
following, so several steps point at the wrong code. In two cases every
requested line is past the end of the file; on the inputs step this renders
as a code block with no lines visible at all.
2026-08-31 11:26:37 -07:00
Kam cd3c8cdd3a docs: correct out-of-range highlight indices in two code blocks
Both indices point past the end of their block, so the intended lines are
never highlighted. The reactive forms block renders with no highlight at all,
and the first example in output-interop.md highlights nothing while its
sibling block is unaffected.
2026-08-31 11:25:03 -07:00
Kam 731c838dbb docs(zone.js): point the Bluebird link at the project repo
bluebirdjs.com no longer resolves. npm lists the GitHub repo as the package's
homepage, so the link now goes there.
2026-08-31 11:21:42 -07:00