37085 Commits
Author SHA1 Message Date
Joey Perrott 3f678c7300 build: update angular/dev-infra and @angular/ng-dev to latest
Updates angular/dev-infra GitHub Actions and @angular/ng-dev to the latest build.
2026-11-09 10:00:51 -08:00
Joey Perrott 2c73fac2b6 build: update angular/dev-infra and @angular/ng-dev to latest
Updates angular/dev-infra GitHub Actions and @angular/ng-dev to the latest build.
2026-11-02 17:03:12 -08:00
Alex Rickabaugh 93ed4cdc02 release: cut the v21.2.26 release v21.2.26 2026-11-02 14:35:53 -08:00
Matt Berry 9c432075dd build: update cypress-io/github-action action to v7.4.6
Updates `cypress-io/github-action` from v7.1.10 to v7.4.6 (matching `main` and `22.2.x`) so URL polling uses `got@16` instead of `got@11`, fixing `ERR_SOCKET_CLOSED_BEFORE_CONNECTION` on Node.js 24.20+ GitHub Actions runners.
2026-10-29 08:28:28 -07:00
Jaime Burgos bc74d72035 fix(upgrade): only compile the template contents of a downgraded component
Previously, a downgraded component compiled whatever its element contained when the component was created. By then, AngularJS could already have linked or written content into the element, for example through `ng-transclude` or `ng-bind` on it, and that content was compiled again.
2026-10-28 16:42:44 -07:00
Andrew Scott 8ac0a2c79a release: cut the v21.2.25 release v21.2.25 2026-09-30 11:17:41 -07:00
Andrew Scott a83f8119ac fix(router): require outlets to match a route before processing child segments
Previously, empty-path outlet groups in a request URL (such as `x:/(detail:2)`,
`///(detail:2)`, or `x:/()`) were allowed to match without a corresponding
route for that outlet name in the route configuration:

1. `processChildren` called `processSegmentGroup` for each child outlet,
   which immediately delegated any zero-segment group with children back to
   `processChildren` against the same parent `config` and `parentRoute`
   without matching a route. Calling `processSegment` directly in
   `processChildren` ensures only the root `UrlSegmentGroup` short-circuits
   to `processChildren`.
2. `processSegmentAgainstRoute` allowed named outlets to pierce empty-path
   routes for other outlets even when the route had no children to pierce into
   or the URL segment group had no segments or children to pierce with.
3. `matchSegmentAgainstRoute` branched into `processChildren` or returned a
   completed leaf match before `getOutlet(route) === outlet` was satisfied,
   and did not require a descendant `TreeNode` match when piercing an
   empty-path route for a different outlet.
4. `noLeftoversInUrl` only checked `!segmentGroup.children[outlet]` rather
   than `!segmentGroup.hasChildren()`, allowing unmatched zero-segment outlet
   groups with child outlets for other names to be treated as having no
   leftovers instead of throwing `NoMatch`.

Together, these allowed crafted URLs with unconfigured zero-segment outlet
groups to fan out across empty-path routes (#70932) or repeatedly evaluate
guards and construct duplicate route snapshot subtrees across sibling outlets
(#70997). Requiring every child segment group to match a route for its outlet
before unwrapping children or completing a match prevents the invalid matches
at the source.

Fixes #70932
Fixes #70997
2026-09-30 07:42:17 -07:00
Alan Agius 450af9c813 fix(platform-server): reject protocol-relative paths in resolveUrl
Previously, resolveUrl only checked whether the raw URL string started with '//' before WHATWG URL resolution. When given an input such as '/.//evil.test', WHATWG dot-segment normalization popped the leading '/.', leaving a pathname starting with '//'. This corrupted ServerPlatformLocation and led to protocol-relative open redirects in SSR.

Now, resolveUrl also verifies that the normalized URL pathname does not start with '//' when allowProtocolRelative is false.

Fixes #71076
2026-09-30 07:21:16 -07:00
SkyZeroZx 6489ca5d84 fix(router): reject duplicate outlets in production builds
A URL group that consumes no segments is matched against the same config as
its parent, so a route can match once for every group the URL nests. Every
match lands in one sibling list, which the router cannot activate because
only one of them can own the outlet.

The check that rejects this ran only in development, and never covered the
siblings `mergeEmptyPathMatches` produces. Run it on every list the merge
returns instead.

Fixes #70997
2026-09-29 09:53:50 -07:00
SkyZeroZx 4bc11a546b fix(router): do not copy URL-sized objects into every route snapshot
An empty path route matches once for every outlet a URL names, so recognition copied the query params and the inherited params into as many snapshots as the URL asked for, at the width the URL chose. Share the frozen objects instead.

Fixes #70932
2026-09-28 13:04:29 -07:00
Andrew Scott a131f77d92 perf(router): do not retain UrlTree instances in RouterLink
In 89d47d814d, RouterLink internals were
refactored to use signals, introducing a computed signal `_urlTree`.
Because every `<a routerLink>` maintains an active RouterLink directive
instance for the lifetime of the view/request, the computed signal
permanently cached the returned UrlTree (and its cloned queryParams map
and segment tree) in `ReactiveNode.value` for every link.

During server-side rendering (SSR), especially when query parameters are
large or when `defaultQueryParamsHandling: 'merge'` is enabled, each
rendered link held a full copy of the query parameter map pinned in the
heap. In an application with 100 links and thousands of query parameters,
this pinned over 50 MB of heap per in-flight request, causing server
workers to crash with Out of Memory (OOM) under concurrent load (#70908).

This change moves the reactive dependencies (`path`, `fragment`, and
`queryParams`) directly into `reactiveHref` so it computes and retains
only the serialized href string. The intermediate UrlTree and its
queryParams dictionary are discarded immediately after serialization and
collected during young-generation GC scavenges rather than remaining
pinned in the heap. The public `urlTree` getter and `onClick` handler now
compute the tree on demand, restoring the memory profile prior to
89d47d814d.

Fixes #70908
2026-09-28 10:24:30 -07:00
Jessica Janiuk e65f114cc5 release: cut the v21.2.24 release v21.2.24 2026-09-23 10:45:18 -07:00
SkyZeroZx 03872a80bc fix(router): avoid dense elements allocation for numeric URL keys
Keep numeric URL keys in V8 dictionary storage while parsing URLs and
copying segment groups. This avoids oversized allocations for each
segment without changing route matching or component input binding.

Fixes #70716
2026-09-23 10:21:15 -07:00
Kristiyan Kostadinov 81385eadb8 release: cut the v21.2.23 release v21.2.23 2026-09-09 21:52:40 +02:00
Alan Agius fc2e8fbc0b fix(platform-server): update domino to latest version
Updates the domino dependency to the latest version as used in the main branch.
2026-09-09 16:28:26 +02:00
leonsenft 4c0bc4345a release: cut the v21.2.22 release v21.2.22 2026-08-26 16:51:57 -07:00
Alan Agius 5aa6d97deb fix(platform-server): avoid stripping unicode whitespace during url resolution
Avoid trimming urlStr with String.prototype.trim() in resolveUrl to ensure URL parsing and resolution align with the WHATWG URL standard.
2026-08-25 10:00:02 -07:00
Alan Agius 73d8bbd27c fix(platform-server): update domino to latest version
Updates the domino dependency to the latest version as used in the main branch.
2026-08-24 10:41:12 -07:00
Jessica Janiuk 992d627b69 release: cut the v21.2.21 release v21.2.21 2026-08-19 12:52:45 -07:00
SkyZeroZx c19a36c2fb fix(platform-browser): disallow event handler attributes in Meta
Prevent arbitrary MetaDefinition properties from writing on* handlers directly to meta elements. Browser events can execute these handlers, including on meta elements rendered in the document body.

Reject handler attributes case-insensitively before matching or mutating tags.

Fixes #70126
2026-08-17 13:43:57 -07:00
Alon Mishne dca0a77488 release: cut the v21.2.20 release v21.2.20 2026-08-12 17:02:31 -07:00
Jaime Burgos caf616670f fix(http): run root interceptors in the terminal request chain
Represent withRequestsMadeViaParent() with an internal delegating backend so the interceptor handler can distinguish delegated clients from independent child configurations.
2026-07-31 15:13:30 -07:00
SkyZeroZx fec5977df4 fix(http): match header values exactly when deleting
Normalize value-specific HttpHeaders deletions before filtering. The string overload previously used String#indexOf and removed shorter values contained within the requested deletion value, potentially widening outgoing request metadata.

Preserve delete-all behavior only when no value is supplied, and cover string, array, and empty-string deletion.
2026-07-31 15:13:30 -07:00
SkyZeroZx e33d69a71c fix(http): preserve immutability of materialized clones
Prevent lazy HttpHeaders and HttpParams clones from reusing value arrays owned by a materialized source. Append and value-specific delete operations previously mutated those shared arrays, violating the immutable API contract and allowing request metadata to bleed into later requests.

Share value arrays until an update mutates a specific header or parameter, then copy only that array. Cover the affected append and delete paths with regression tests that materialize the source first.
2026-07-31 15:13:30 -07:00
Jaime Burgos 6afe6fa781 fix(core): sanitize host bindings on concrete hosts
Compute host binding security contexts against concrete hosts, including host directives, inheritance, dynamic directives, and createComponent hostElement usage.
2026-07-30 08:29:04 -07:00
Alan Agius 07cb840eac release: cut the v21.2.19 release v21.2.19 2026-07-29 22:44:48 +02:00
Alan Agius 7b884f585a fix(compiler): restrict possible event handler check to property names longer than 2 characters
Previously, the compiler disallowed translation of any attribute starting with 'on' for security reasons. This incorrectly disallowed translation of the 'on' attribute itself, which is not an event handler.

This commit introduces `isPossibleEventHandler` to verify that the property name has a length greater than 2 in addition to starting with 'on'. This allows attributes like 'on' to be translated while still correctly disallowing actual event handlers like 'onerror', 'onclick', etc.
2026-07-29 08:51:50 -07:00
Hexix23 948a8d6831 fix(http): distinguish repeated transfer cache params
Serialize transfer cache request parameters without comma-joining repeated values so distinct HttpClient requests cannot reuse the same cached response.
2026-07-29 08:51:50 -07:00
Hexix23 e2660c3dee fix(compiler): disallow i18n event attributes
Reject translated event-handler attributes so localization cannot bypass Angular event-attribute validation.
2026-07-29 08:51:50 -07:00
SkyZeroZx f34a93c946 fix(platform-server): update domino to latest version
Updates the domino dependency to the latest version as used in the main branch.

This update contains fixes for https://github.com/angular/domino/pull/32.
2026-07-29 08:43:40 -07:00