2616 Commits

Author SHA1 Message Date
SkyZeroZx 91df739b80 fix(http): prevent caching of responses with Set-Cookie headers
Skip HttpTransferCache serialization for HTTP responses that contain a
Set-Cookie header.

Cookie-setting responses commonly represent session-specific,
user-specific, or security-sensitive state. Serializing their bodies into
SSR TransferState can embed sensitive data into the generated HTML, where
it may be reused during hydration or replayed by a shared cache/CDN.

(cherry picked from commit 80795defc6)
2026-07-07 10:15:02 -07:00
SkyZeroZx d846326b07 fix(common): skip transfer cache for uncacheable HTTP traffic
Do not store HTTP transfer cache entries when either the request or response uses `Cache-Control: no-store`, `Cache-Control: private`, or `Cache-Control: no-cache`.

Also skip transfer cache when requests use the Fetch API `cache` option with `no-store` or `no-cache`.

Because transfer cache serializes SSR HTTP responses into the rendered HTML, Angular now treats these directives conservatively to avoid exposing sensitive or explicitly uncacheable data through `TransferState`.

(cherry picked from commit 4d150156ca)

(cherry picked from commit 64ce11fcd4)
2026-06-04 15:26:47 -07:00
SkyZeroZx e245d40c4d fix(http): skip transfer cache for fetch credentialed requests
Treat HttpClient requests using `credentials: 'include'` and `same-origin` as credentialed when deciding whether a response can be stored in the HTTP transfer cache.

The transfer cache already skips requests with `withCredentials`, `Cookie`, `Authorization`, or `Proxy-Authorization` because those responses may contain user-specific data. Fetch-backed requests can express the same credentialed behavior through the `credentials` option, so these responses must not be serialized into the SSR HTML.

This keeps credentialed SSR responses out of TransferState and aligns the cache eligibility check with the fetch request options supported by HttpClient.

(cherry picked from commit 8ec01970d2)
2026-06-04 15:26:47 -07:00
Michael Small db157e4aff docs: fix min/max form template examples
(cherry picked from commit 42391329c2)
2026-06-02 11:23:07 +02:00
Joey Perrott 70af5e8abd fix(docs-infra): secure update-assets script against RCE and SSRF
- Validate storedSha and storedBranch from _build-info.json.
- Validate latestSha returned from GitHub API.
- Validate branch in GithubClient.getShaForBranch and baseSha/headSha in GithubClient.getAffectedFiles.
- Use execFileSync instead of execSync to avoid shell execution.

TAG=agy
CONV=4e3e69ba-3f3d-416b-9ce4-9ef75486d2f3

(cherry picked from commit 3093edcad0)
2026-06-02 11:22:02 +02:00
Matthieu Riegler b74fb76d1a docs(docs-infra): simplify code block styles
#68940 introduced a regression that broke style for wrapped `code` blocks.
Simplifying the style by droping the unecessary gradient + before workaround fixes the issue.

(cherry picked from commit ec4f08bb94)
2026-06-01 18:36:58 +02:00
KirtiRamchandani 66d09558b6 docs: mention Angular Aria in accessibility guide
(cherry picked from commit 9b5952e3a3)
2026-06-01 18:33:36 +02:00
Kam 9f6fda6815 docs: fix esbuild and TensorFlow branding on overview page
The esbuild card on the "What is Angular?" page rendered the bundler name three different ways (title "esbuild", link "ESBuild and Vite", body "Vite and ESBuild") so this unifies on the official lowercase "esbuild"; also corrects "Tensorflow" to "TensorFlow" to match the other brands on its line (Firebase, Material Design, Flutter, Google Cloud) which were already cased correctly.

(cherry picked from commit f777dd112e)
2026-06-01 12:19:08 +02:00
arturovt 1e5d76bfd9 docs: document //i18n(ph="name") placeholder syntax for template interpolations
The `//i18n(ph="name")` comment syntax for naming interpolation placeholders
in templates was not documented anywhere in the i18n guide, despite being a
supported compiler feature with test coverage.

Add a "Name the interpolation placeholder" subsection under "Mark text in
component template" in prepare.md, mirroring the existing subsection in
"Mark text in component code". Includes a cross-reference to the $localize
equivalent (`${var}:name:`) to help readers connect the two approaches.

Closes #52070

(cherry picked from commit 2b44a07ea7)
2026-06-01 12:18:09 +02:00
aparziale 22dd53ca97 docs: fix link debbuging and extended-diagnostics
Update link for 'Improve debbuging with better Angular error messages' and 'extended-diagnostics' sections

Fixed #69010

(cherry picked from commit cbc36f59e0)
2026-06-01 12:17:03 +02:00
Kam 1cd4f54aef fix(docs-infra): readable contrast for DEV/EXP api badges in light mode
The DEV (developer preview) and EXP (experimental) badges in the API reference list used `--page-background` for text, which is dark in dark mode (working as intended on the pale colored bg) but white in light mode, making the labels invisible against the near-white badge bg. Introduce an `--item-attr-text` CSS variable defaulting to `--page-background` and overridden to `--primary-contrast` in light mode, following the per-mode pattern the file already uses for `--item-attr-base-mix`.

(cherry picked from commit 0010ad5910)
2026-06-01 11:57:54 +02:00
Bhuvansh855 9d8ea2cc9a docs(forms): remove hasMetadata references from v21 guide 2026-06-01 11:56:00 +02:00
Kristiyan Kostadinov 69c0d48a0d fix(docs-infra): round up media queries
Uses 1px increments for media queries, rather than the 0.01px we have now which seem to be a bit too precise and cause the UI to be stuck between states in some cases.

I've also removed some unnecessary `calc`, because the calculation is happening inside Sass already.

Fixes #69020.

(cherry picked from commit 96ed0fe45b)
2026-06-01 11:34:44 +02:00
arturovt 9b7d0e5034 docs: document i18n object forms for sourceLocale and locales in angular.json
The `sourceLocale` and `locales` entries in `angular.json` accept object
forms (with `code`, `baseHref`, and `subPath`) that were never documented.

- Add an `i18n options` reference section to workspace-config.md covering
  the full shape of `sourceLocale` and each `locales` entry, including the
  distinction between `baseHref` (HTML only) and `subPath` (HTML + output
  directory name)
- Add `i18n` to the project configuration options table in workspace-config.md
- Expand the suboptions table in merge.md to mention the object forms and
  link to the new reference section

Closes #59664

(cherry picked from commit 2f49d5dba4)
2026-05-29 11:53:54 +02:00
Kam 6b8202eab6 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:16 +02:00
Bhuvansh855 8538bdce1c docs: fix grammar issues in resource guide
(cherry picked from commit 0e6cb4151c)
2026-05-28 13:48:06 +02:00
Yenya030 582a417bd2 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:21 -07:00
Yenya030 5c6d6df34b 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:21 -07:00
Ricardo Chavarria 1a84668f0c 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:16:59 -07:00
Kam 551a2a1f46 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:46 -07:00
Harmeet Singh 84c6579a4e docs: clarify signals effect import source
(cherry picked from commit 741fcc4abf)
2026-05-27 11:08:54 -07:00
Bhuvansh855 fd3573d99d 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:19 -07:00
Kam 9627e02bde docs: link to ng new reference from installation guide
The installation guide walks a developer through `ng new <project-name>` but provides no link to the `ng new` CLI reference, leaving every option the command supports undiscoverable from the install flow. Link `ng new` in the prose to the reference page so options are one click away.

(cherry picked from commit 04f31cce3e)
2026-05-20 14:09:38 -07:00
Kam 1b6f780e2d docs: fix grammar slips on pipes guide
Fixes subject-verb agreement in the overview opener and date/currency example, a singular pronoun for a plural antecedent under change detection, and an "a object" -> "an object" a/an slip.

(cherry picked from commit 41a772ec0b)
2026-05-20 13:51:54 -07:00
arturovt d56f1a35ad docs: document barrel file caveat for @defer lazy chunks
Users often enable @defer expecting a separate lazy chunk but don't get
one, with no obvious error to explain why. The root cause is almost
always a barrel file import — the bundler treats the whole barrel as a
single module and can't split out individual exports.

Add a section to the defer guide that starts from the symptom (no lazy
chunk), shows the barrel import pattern that causes it, and gives the
direct-import fix.

Closes #52554

(cherry picked from commit d985957f09)
2026-05-20 13:47:47 -07:00
arturovt 232b21db55 docs: document content projection limitations
Add a Limitations section to the content projection guide covering two
common footguns that aren't obvious from the feature description alone.

First, projected content lives in the declaring component's view, not
the receiving component's. This means OnPush on the receiving component
doesn't prevent projected content from being checked on every parent
cycle, and projected content can't see the receiving component's
viewProviders.

Second, some library components (menus, tabs, lists) use ContentChildren
to wire up keyboard navigation and ARIA behavior and assume they own
their children directly. Projecting external content into them tends to
break that behavior silently.

Closes #49679

(cherry picked from commit de9e3d136e)
2026-05-20 13:31:50 -07:00
Kam 0c7f70e8ea fix(docs-infra): make absolute angular.dev hrefs relative in CLI option descriptions
CLI option descriptions are sourced from `@angular/cli` schema JSON
files, several of which contain absolute `https://angular.dev/...` URLs
in their `description` text. Those URLs render with the external-link
icon and push preview users out to production when viewed on
`next.angular.dev` or other dev previews. The path bypasses the existing
`link.mts` ban on absolute angular.dev links because option descriptions
go through `marked.parse` directly, without `AdevDocsRenderer`. Rewrite
the rendered hrefs whose values begin with `https://angular.dev/` (or
the `http:` variant) to root-relative paths so the resulting anchors
route through Angular's Router and resolve against the active
deployment. Subdomains such as `next.angular.dev/...` are intentionally
not rewritten because they refer to genuinely different deployments.

Closes #68795

(cherry picked from commit 745ee71c25)
2026-05-20 10:28:32 -07:00
Alan Agius 1ef4ea3e39 docs: update supported Angular versions table to reflect v19 end-of-life status
(cherry picked from commit b70515cada)
2026-05-20 10:10:01 -07:00
arturovt 395919ffeb docs: clarify viewProviders visibility with projected content
The providers vs. viewProviders section explained what happens but not
why — specifically, why projected content can still access a parent
component's viewProviders. Added an explanation that DI follows where
content was declared, not where it's rendered, so projecting a component
into a child's ng-content cuts off the child's viewProviders but leaves
the declaring component's viewProviders reachable.

Closes #49202

(cherry picked from commit 03161dc114)
2026-05-20 10:09:07 -07:00
aparziale 027c7c0c95 docs: update HTTP testing setup guidance
Update testing documentation clarify HttpClient testing providers

Fixed #68792

(cherry picked from commit 8ebc900067)
2026-05-19 13:41:17 -07:00
g.turri 7f444e1c7f docs: Fix accepted Provider type in doc snippet
out of the box my IDE tells me there an error on

    const testProviders: Provider[] = [provideHttpClient(), provideHttpClientTesting()];

because `provideHttpClient()` returns an `EnvironmentProviders` so
I can't put it in a variable of type `Provider[]`

(cherry picked from commit 4e55ceafc9)
2026-05-19 13:19:38 -07:00
june-by 34f89fb6c2 docs(compiler): add typeCheckHostBindings option to angular compiler options
(cherry picked from commit c49661b57b)
2026-05-19 13:09:30 -07:00
Matthieu Riegler d1736efc32 docs(docs-infra): Show function args
With this change non-overloaded functions also show the params + return type in a dedicated block.

(cherry picked from commit 872853fbcb)
2026-05-18 13:22:33 -07:00
Kam 73b0ada729 docs: open external anchors in adev markdown in a new tab
Several raw HTML `<a>` anchors in adev markdown link to external
sites without `target="_blank"`, so they open in the same tab
instead of a new one like the rest of the site's external links.
Add `target="_blank"` to match.

(cherry picked from commit b7255f9d13)
2026-05-18 13:18:25 -07:00
Ben Hong 1e079a8994 docs: add clarification around plain object models
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
(cherry picked from commit 3584eeb491)
2026-05-13 11:24:39 -07:00
Ben Hong c93d158aae docs: add new signal forms field metadata guide
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
(cherry picked from commit ef134ac367)
2026-05-11 12:05:32 -07:00
Kam 327edb9001 docs: add inject() example to "Forwarding injected dependencies"
Lead the section with the recommended `inject()` pattern (child
inherits the property, no `super` forwarding), and keep the existing
constructor DI example after as the alternative. Also fixes a typo
where the verb "class" should read "pass".

(cherry picked from commit 4ec076e13c)
2026-05-11 12:02:49 -07:00
Kam 3ec0a10ca0 docs: recommend output() over EventEmitter in reactive forms guide
The "Save form data" step pointed at `EventEmitter` while the rest of
the guide uses modern APIs (e.g. `inject(FormBuilder)`). Swap to
`output()` and align the TODO in the profile-editor example.

(cherry picked from commit 0629e7e505)
2026-05-11 12:02:08 -07:00
Kam 5000a6d2c0 docs: fix two 404 links in the roadmap
"Introduce built-in control flow" => guide/templates/control-flow (was
the now-removed next.angular.dev/essentials/conditionals-and-loops),
and "Improve documentation and schematics for standalone components"
=> essentials/components (was the bare `components`, not an adev route).

(cherry picked from commit 8b46492b7e)
2026-05-08 14:05:45 -07:00
Alan Agius f9a58c1da3 docs: remove note regarding lack of support for ng test --debug in browser mode
This is no longer the case.

Closes #68621

(cherry picked from commit b3de3af0dd)
2026-05-08 08:57:13 -07:00
Angular Robot 6ed6498854 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-05-07 16:43:58 -06:00
Kam 2a1e6ec1bb docs: normalize product name casing across docs
Several user-facing docs, tooltips, and tutorial code samples used
non-canonical spellings of product names. This normalizes them to
the form each project uses for its own brand.

(cherry picked from commit ed333c3992)
2026-05-07 15:09:49 -07:00
Bhuvansh855 73ba918cce docs(animations): improve grammar and clarity across animation guides
(cherry picked from commit dc4b3172df)
2026-05-07 15:03:46 -07:00
SUMIDA, Ippei bca94ee0bb docs: Update error display for password field in signal forms playground
Change error message display from paragraph to list format in signal forms playground.

(cherry picked from commit 2fcfffbc7d)
2026-05-07 14:53:12 -07:00
Kam 161d98e7f2 docs: correct "Angular JS" to "AngularJS"
"AngularJS" is the official product name for the v1.x line and is
written as a single word. A few places in the docs and package
READMEs used "Angular JS" with a space. This normalizes those
references to the canonical spelling.

(cherry picked from commit 8a7f955f0f)
2026-05-05 12:42:45 -07:00
Leon Senft 03ad53863b fix(forms): prohibit concurrent submits in signal forms
Prohibit concurrent submits in signal forms to prevent duplicate actions and side effects when a submission is already in progress.

If `submit()` is called while a prior submit is in progress for the same field or any of its parents, it returns `false` immediately without running the action again.

This commit also updates the documentation in `form-submission.md` to reflect this behavior.

Fixes #68317

(cherry picked from commit 708631f2c4)
2026-05-05 11:14:08 -07:00
Kam 929ec53578 fix(docs-infra): mask page content leak at mobile nav right edge
On phones, the page content behind the primary-nav drawer leaks 1-2px past its right edge. Mask it with a 2px var(--page-background) box-shadow.

(cherry picked from commit 1da396fd84)
2026-05-05 09:31:59 -07:00
Kam e6ab5eca57 fix(docs-infra): keep mobile nav drawers usable on small screens
On phones, opening the primary-nav drawer left the page behind it scrollable, and the secondary drawer's mask had no explicit height so long submenus got clipped above the page content. Lock the page with overflow: clip on :host:has(.adev-nav-primary--open) for phone-only (preserves the primary nav's sticky context), give the secondary mask height: 100dvh on tablet-landscape-down so it fills the visible viewport, and align the nav-list :host height to 100dvh too so its inner scroll matches.

(cherry picked from commit 441a00d665)
2026-05-05 09:31:31 -07:00
Nikolaos G. Ntaiko af74b420e1 Fix typo in computed signals section
(cherry picked from commit 429c665901)
2026-05-01 16:00:52 -07:00
Kam aba59aac59 fix(docs-infra): exempt form validator names from API auto-linking
Add required, pattern, min, max, minLength and maxLength to LINK_EXEMPT
so FieldState property names stop auto-linking to the validator
functions of the same name.

(cherry picked from commit c2f7403774)
2026-05-01 15:58:48 -07:00