Commit Graph

37450 Commits

Author SHA1 Message Date
Alex Rickabaugh ebd698b90f release: cut the v22.0.0-rc.2 release v22.0.0-rc.2 2026-05-28 10:01:37 -07:00
Angular Robot c1cefe9928 build: update bazel dependencies
See associated pull request for more information.
2026-05-28 16:12:51 +02:00
Kam 8f625e77bd refactor(docs-infra): extract magic 27 in navigation-list tooltip threshold
The matTooltip on navigation list items was disabled when the label was
shorter than the literal `27`, repeated across four bindings in the
template. Lift the value to a protected readonly field so the threshold
has a name and lives in one place.

(cherry picked from commit 34d577f697)
2026-05-28 16:08:17 +02:00
Alan Agius 94d520fb67 fix(compiler): prevent namespaced SVG <style> elements from being stripped
Updates the template preparser to exclude namespaced SVG style tags (':svg:style') from the style elements set.

Previously, ':svg:style' elements were incorrectly classified as PreparsedElementType.STYLE, which caused them to be completely stripped from the final template DOM tree during the Render3 template transform and pushed into standard component stylesheets. By limiting the style element parsing to standard 'style' tags, namespaced SVG style tags remain safely in the template AST as normal DOM elements, preserving local SVG styling.

Closes #68977

(cherry picked from commit ec138c3645)
2026-05-28 14:02:54 +02:00
Bhuvansh855 7b4b0672a8 docs: fix grammar issues in resource guide
(cherry picked from commit 0e6cb4151c)
2026-05-28 13:48:07 +02:00
Angular Robot d88b796518 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-05-27 16:41:13 -07:00
Cameron Smick 394c998345 refactor(core): replace the type of the getDirectiveMetadata property of ExternalCoreGlobalUtils with the type of the getDirectiveMetadata property of FrameworkAgnosticGlobalUtils.
Modifying these types will allow Client-Only Wiz (and other frameworks) to implement ExternalCoreGlobalUtils & InternalCoreGlobalUtils instead of FrameworkAgnosticGlobalUtils, which includes additional properties they shouldn't implement.

(cherry picked from commit 06d3758929)
2026-05-27 16:37:34 -07:00
Cameron Smick 76a8c87725 refactor(core): Split the ng global into internal and external objects
Split the `ng` global interface into two interfaces:
* `ExternalCoreGlobalUtils` includes all the functionality which has been shipped in a long-lived Angular version externally and which is subject to the versioning constraints described above.
* `InternalCoreGlobalUtils` includes internal-only functionality which has **not** been shipped in a long-lived Angular version.

This split means that all APIs in `InternalCoreGlobalUtils` can be iterated and evolved at a much faster pace. Angular DevTools can support those features, and we can make breaking changes more-or-less whenever we want. The downside is that external Angular developers cannot take advantage of those APIs or else we would be subject to the same versioning constraint we're trying to avoid here.

This means we can use `InternalCoreGlobalUtils` as a kind of "beta" channel for new DevTools APIs. Once that functionality is validated and the design is stabilized, the feature can be moved into `ExternalCoreGlobalUtils` and made available for external Angular developers when we're ready to commit to the long-lived version constraint. This will hopefully help us strike a better balance between iterating on new APIs quickly and maintaining stable APIs for external Angular users.

(cherry picked from commit d069c55ab4)
2026-05-27 16:37:34 -07:00
Matthieu Riegler f7b3ed8db2 fix(http): Introduce a max buffer size for fetch requests on SSR
By default, the `FetchBackend` on SSR will limit the response body size to 10 MB.
If the response body exceeds this limit, an error will be thrown.

This default value can be configured by providing by setting the `maxResponseBodySize` in `provideServerRendering`.

This is to prevent DoS on the server when loading large files

(cherry picked from commit 2acca1165d)
2026-05-27 16:36:55 -07:00
Yenya030 618c850282 fix(http): exclude withCredentials requests from transfer cache
Update the transfer cache check to safely exclude all requests sent with the `withCredentials` flag.

By default, the HTTP transfer cache avoids caching user-specific responses to prevent sensitive data exposure or incorrect caching. While requests with explicit headers like `Cookie` or `Authorization` are excluded by default, requests can also be sent with credentials via the `withCredentials` flag without having those headers explicitly declared on the request object.

To keep user-specific responses from being cached, exclude `withCredentials` requests unconditionally, even when the `includeRequestsWithAuthHeaders` option is set to true.

(cherry picked from commit 34090cb12e)
2026-05-27 14:13:23 -07:00
Yenya030 86390f2be4 fix(http): skip TransferCache for cookie-bearing requests by default
Treat requests with a Cookie header like other auth-bearing requests and skip TransferCache caching them by default.

This preserves the explicit opt-in path via includeRequestsWithAuthHeaders, adds regression coverage for cookie-bearing requests, and updates the SSR guide to document the behavior.

(cherry picked from commit ab459798d9)
2026-05-27 14:13:23 -07:00
Matthieu Riegler e6cfaf5672 fix(http): prevent httpResource from leaking a subscription
Priori to this commit, in the case the subscription was emitting synchronous we were leaking the subscription. This commit fixes it.

(cherry picked from commit 6388675878)
2026-05-27 13:06:52 -07:00
Matthieu Riegler b20f0fe078 fix(core): prevent rxResource from leaking a subscription
Priori to this commit, in the case the subscription was emitting synchronous we were leaking the subscription. This commit fixes it.

(cherry picked from commit e0e902a8fa)
2026-05-27 13:06:52 -07:00
RonGamzu d9c38e552d docs: fix typos in source code comments
(cherry picked from commit 6f56202755)
2026-05-27 11:18:27 -07:00
Ricardo Chavarria 5144f5f404 docs(docs-infra): add Spanish community translation
Add https://docs.angular.lat/ (Español) to the community translations section.

(cherry picked from commit 48b4625fb3)
2026-05-27 11:17:00 -07:00
cexbrayat eb600aa3b2 refactor(forms): mark date and limit signal forms APIs public
Promote the signal forms date validator and limit metadata APIs from experimental to public API.

(cherry picked from commit 842cf8f31b)
2026-05-27 11:16:25 -07:00
tjshiu a0fbf84856 docs: modernize combobox and select guides and examples
Upgrades the guides and interactive examples to use modern signal-based APIs,
restoring the nested search dialogs and introducing datepicker grids.

(cherry picked from commit 30a8a2c4bd)
2026-05-27 11:11:39 -07:00
Kam 8bb70f860f docs: fix preposition in libraries naming callout
The naming callout said the ng- prefix is "used from the Angular framework". Change to "used by", matching standard usage and the surrounding prose.

(cherry picked from commit 8c3e46fb53)
2026-05-27 11:09:47 -07:00
Harmeet Singh 8462b666e4 docs: clarify signals effect import source
(cherry picked from commit 741fcc4abf)
2026-05-27 11:08:55 -07:00
Angular Robot 7104453951 build: lock file maintenance
See associated pull request for more information.
2026-05-27 11:04:40 -07:00
Cameron Smick 62287510b8 refactor(devtools): make the hydration property of DevToolsNode optional
Make the `hydration`` property of `DevToolsNode`` optional as frameworks like Client-Only Wiz don't have the same hydration concept as Angular and will not set one for nodes returned from `getComponentForest`.

(cherry picked from commit 23f3894c40)
2026-05-27 10:54:35 -07:00
Kristiyan Kostadinov 61a48e99aa fix(core): do not register dom triggers when defer blocks are in manual mode
Fixes that we were registering DOM triggers even if the `@defer` block is set up to be rendered manually. This matches the behavior we already have for timer triggers.

Fixes #68800.

(cherry picked from commit abc61aaf7c)
2026-05-27 10:54:03 -07:00
Kam b30f937792 refactor(language-server): drop duplicate isAngularCore helpers in session
session.ts defined isAngularCore, isExternalAngularCore, and
isInternalAngularCore as byte-identical copies of the already-exported
versions in utils.ts. Only isAngularCore was used locally; the other
two were dead. handlers/template_info.ts already imports the utils
version. Remove the duplicates and import isAngularCore from utils.

(cherry picked from commit d808866f89)
2026-05-27 10:52:55 -07:00
Bhuvansh855 554be43643 fix(docs-infra): improve inline code layout
Remove inline-block layout behavior from inline code elements
to improve wrapping and spacing in multiline documentation
paragraphs.

(cherry picked from commit fdf0bf9a62)
2026-05-27 10:52:20 -07:00
Joey Perrott 54d7e0b4d3 ci: configure setup and use pnpm in benchmark comparison workflow
The benchmark comparison workflow fails because it runs pnpm install
without setting up node and pnpm first. We configure the setup steps
manually so that checkouts from forks are supported.

Additionally, we update the benchmark comparison script (index.mts)
to use pnpm rather than hardcoded yarn commands to install
dependencies when checking out revisions.

(cherry picked from commit a648e8e914)
2026-05-27 10:51:44 -07:00
Alan Agius 48c57bad3e fix(dev-infra): draft GitHub release to support immutable releases
Update the release tool to create the GitHub release in a draft state initially and publish it only after the extension asset (.vsix) has been successfully uploaded.

GitHub shifted towards immutable releases. If a release is published instantly upon creation,the assets will not be able to be uploaded.

(cherry picked from commit 26f4ed5056)
2026-05-27 10:50:27 -07:00
aparziale 516db8512b docs: update CDK Overlay URL
Update CDK Overlay URL for strategy select.md and multiselect.md

Fixed #68914

(cherry picked from commit fcecf7016e)
2026-05-27 10:48:44 -07:00
Angular Robot 4e5fec1fd7 build: update github/codeql-action action to v4.36.0
See associated pull request for more information.
2026-05-27 10:47:21 -07:00
Cheng-Hsuan Tsai c7a1238d67 docs: update Angular Aria guides
(cherry picked from commit 8f0ac6459e)
2026-05-27 10:46:27 -07:00
Cheng-Hsuan Tsai c7be8990d5 docs: modernize Aria guides
(cherry picked from commit cf2e6ec16d)
2026-05-27 10:45:54 -07:00
Andrew Scott d9f9a0835c fix(zone.js): avoid type error on custom object rejection with rejection property
Ensure that when a custom object with a 'rejection' property is thrown as a raw promise rejection, the unhandled promise rejection error logger does not crash with a TypeError while trying to access undefined zone properties.

Also wrap microtask queue draining and task frame counter updates with defensive try-finally blocks to guarantee internal scheduler states are properly reset under any potential call stack exception unwinding scenarios.

(cherry picked from commit fa7580061b)
2026-05-27 10:45:20 -07:00
SkyZeroZx d0c4951a9b fix(service-worker): Preserves HTTP cache mode in asset group requests
Ensures explicit HTTP cache mode from incoming requests is forwarded and maintained when creating fetch requests for assets, aligning with expected fetch behavior and preventing unintended cache handling.

(cherry picked from commit 31399c2171)
2026-05-27 10:43:20 -07:00
SkyZeroZx a02797d045 fix(service-worker): Preserves explicit 'credentials: omit' in asset requests
Ensures that explicitly provided `credentials: 'omit'` options are preserved
when creating new requests, preventing unintended credential inclusion.

(cherry picked from commit 5b0e9663e5)
2026-05-27 10:43:20 -07:00
Alan Agius a08e4fb93c fix(core): normalize tag names in runtime i18n attribute security context lookup (#68868)
Normalize namespaced tag names (e.g., :xhtml:a to a) inside i18nResolveSanitizer before looking up their security context. This ensures custom namespaced tag attributes undergo correct translation sanitization at runtime.

PR Close #68868
2026-05-27 10:40:23 -07:00
Alan Agius ab9154ab75 fix(compiler): normalize tag names with custom namespaces in DomElementSchemaRegistry (#68868)
Custom XML/XHTML namespaced elements (e.g., <xhtml:a>) fall back to the standard HTML namespace during element creation at compile-time/runtime. However, their property and security context lookups inside the schema registry were incorrectly performed using the full namespaced tag name (e.g., :xhtml:a), which bypassed the default a|href sanitization registry and incorrectly returned SecurityContext.NONE instead of SecurityContext.URL.

This commit introduces tag name normalization inside DomElementSchemaRegistry for custom namespaces (other than the built-in svg and math namespaces). Custom namespaced tag names are now normalized to their simple HTML element counterparts for all registry queries, ensuring that correct property schema validation and dynamic security sanitization rules (such as URL sanitization) are enforced at runtime.

PR Close #68868
2026-05-27 10:40:23 -07:00
Alan Agius 6ff620a033 fix(compiler): sanitize dynamic href and xlink:href bindings on SVG a elements (#68868)
Dynamic bindings to `href` and `xlink:href` attributes on SVG `<a>` elements (`<svg:a>`) were previously unmapped in the DOM security schema. As a result, they bypassed sanitization completely, creating a potential XSS vulnerability if bound to untrusted user inputs (e.g., `javascript:` URLs).

This fix mitigates this risk by:

1. Registering `href` and `xlink:href` on `<svg:a>` elements under the `SecurityContext.URL` context in both the compiler and core DOM security schemas.

2. Enabling template compilation to output runtime URL sanitization checks (`ɵɵsanitizeUrl`) on these attributes.

3. Adding regression and verification test cases to ensure dynamic SVG link bindings are safely sanitized at runtime while static values are correctly allowed.

PR Close #68868
2026-05-27 10:40:23 -07:00
Alan Agius a97d5ec22d build: update minimum supported Node.js versions
Update the minimum supported Node.js versions for v22 and v24. Specifically, the minimum supported version for Node.js v22 is bumped to v22.22.3, and for v24 it is bumped to v24.15.0. This ensures compatibility with newer runtime versions and coordinates ranges across monorepo packages.

(cherry picked from commit 861d37e669)
2026-05-27 10:39:21 -07:00
Matthieu Riegler 159d33aa37 refactor(core): extend sanitization test coverage
This ensures that #68576 actually fixed a sanitization issue on uppercase elements/attributes

(cherry picked from commit e5f3b9def8)
2026-05-27 10:38:18 -07:00
Matthieu Riegler 6ab4b5c030 docs: align main and 22.0.x for aria examples 2026-05-27 10:35:20 -07:00
Matthieu Riegler 28338a1ca4 fix(platform-server): prevent SSRF bypasses via backslash URLs in HttpClient
Encoding backslashes ensures that they are not normalized to slashes and where they could generate a protocol relative URL.

(cherry picked from commit 140c4d04cb)
2026-05-27 10:23:36 -07:00
Alan Agius 95522526e4 fix(platform-server): secure location and document initialization against SSRF and path hijack
Normalizes the URL and path parsing logic inside platform-server by consolidating security checks and normalizations into a single, unified parseUrl helper function.

This includes:
- Collapsing multiple consecutive leading slashes and backslashes (e.g., // or /\) to a single forward slash to avoid protocol-relative parsing of path-like & relative inputs.
- Rejecting malformed absolute URLs that are otherwise accepted by lenient DOM parsers like Domino but rejected by standard WHATWG parsers, preventing SSRF / allowedHosts validation bypasses.
- Ensuring parseDocument gets the fully parsed and normalized URL instead of raw, unvalidated configuration values, preventing virtual document hostname adoption/origin hijack.
- Moving parseUrl unit tests into a dedicated url_spec.ts test file to keep platform_location_spec.ts clean and decoupled.

(cherry picked from commit 1307ff355c)
2026-05-27 10:22:43 -07:00
Matthieu Riegler 7d1fbc170a fix(common): sanitize placeholder
The placeholder should be sanitized to prevent CSS/content injection.

(cherry picked from commit b56e865148)
2026-05-27 10:21:56 -07:00
Matthieu Riegler ae2cb00398 fix(common): add upper bounds for digitsInfo
The prevents the `roundNumber` function from allocating a large array.

(cherry picked from commit dfdfbe34a5)
2026-05-27 10:21:03 -07:00
Matthieu Riegler 0d9a245345 fix(core): sanitize meta selectors
Ensure that property/name are correctly escaped and doesn't break out of the intended selector.

(cherry picked from commit d5a489aed3)
2026-05-27 10:19:02 -07:00
Alex Rickabaugh 2200b4a854 refactor(compiler): add support for compiling NgModules under isolatedDeclarations
This commit adds support for compiling NgModules in isolated declarations mode.

(cherry picked from commit 06b004ec5c)
2026-05-22 14:00:23 -07:00
Andrew Scott b25964b7d4 fix(vscode-extension): disable language server in untrusted workspaces
Restrict untrusted workspace support to limited mode. Skip launching the language client and registering commands in restricted mode, and only start them once workspace trust has been explicitly granted.

(cherry picked from commit df68a96b26)
2026-05-22 12:22:11 -07:00
Andrew Scott c08f22a736 refactor(vscode-extension): Remove effectively dead code
Since bundled path is at the start of probe locations, it's always going to be found first.
Workspace versions will never be used. getProbeLocations is effectively dead and confusing code.

(cherry picked from commit d8c871ef80)
2026-05-22 09:58:29 -07:00
Andrew Scott e75e13105b fix(vscode-extension): restrict jsdoc markdown trust and harden document opening
Restrict JSDoc hover links to the custom openJSDocLink command and implement document
opening using safe workspace APIs.

(cherry picked from commit 3403e79f9f)
2026-05-22 09:56:33 -07:00
Andrew Scott 46ee6f7b1f fix(vscode-extension): prompt for confirmation before loading workspace tsdk
Harden the typescript.tsdk and js/ts.tsdk.path settings loading
in the VS Code extension client.

This change hardens tsdk loading by:
1. Ignoring workspace-level tsdk paths in untrusted workspaces.
2. Prompting the user for explicit confirmation before loading a
   workspace-level tsdk path in trusted workspaces, and saving the
   approval state in a secure, local workspaceState.

(cherry picked from commit 4f4820f410)
2026-05-22 09:52:26 -07:00
arturovt 3b4ef1e2ff perf(forms): avoid redundant invalidations in parser errors signal
The `errors` linkedSignal in `createParser` had no equality check, so
every reset or recomputation — even to an identical empty array — would
mark downstream dependents as dirty and trigger unnecessary re-renders.

Add `shallowArrayEquals` as the equality function so the signal only
notifies dependents when the error list actually changes.

(cherry picked from commit 1563aae118)
2026-05-21 10:57:55 -07:00