34749 Commits

Author SHA1 Message Date
Andrew Kushnir 3bafe23c34 release: cut the v20.3.11 release 20.3.11 2025-11-12 08:24:17 -08:00
Matthew Beck 9419ea348a fix(compiler): support complex selectors in :nth-child()
:nth-child() (and its siblings) support complex expressions, e.g.
`:nth-child(2n of :is(.foo, .bar))`. Previously we'd choke because of
the `:is()`. Now, we reuse the `_parenSuffix` subexpression to match
nested parentheses the same way we do for :host() and :host-context().
Note that we only support 3 levels of nesting, so a selector like
`:nth-child(n of :is(:has(:not(.foo))))` will still break.

I'll say yet again that we really should add a proper parser so we stop
getting bug reports like this :)

Fixes #64913

(cherry picked from commit 24cfd5a0ed)
2025-11-11 14:03:36 -08:00
Andrew Scott f00fb46347 Revert "feat(service-worker): notify clients about version failures (#62718)"
This reverts commit 6d011687ec.

issue #63500 reproduces at head on the main branch in the dev app.
Reverting this change along resolves it.

fixes https://github.com/angular/angular/issues/63500

(cherry picked from commit 4af408afcb)
2025-11-11 12:48:48 -08:00
SkyZeroZx a8c577d3af docs: add reference to Built-in Pipes in multiple pipe files
(cherry picked from commit d999667b57)
2025-11-11 08:47:11 -08:00
RobinReinecke 0baa28b886 docs: correct mermaid code block formatting
(cherry picked from commit 07703875b5)
2025-11-11 08:33:31 -08:00
SkyZeroZx c59fa8b85a docs: improve discoverability in service worker documentation
(cherry picked from commit dde18c2303)
2025-11-11 08:32:18 -08:00
Devin Chasanoff e0407c0fe3 docs: add links to SDUI example and livestream
(cherry picked from commit 5af33724a4)
2025-11-10 14:16:22 -08:00
Andrew Kushnir 8922cae0f9 Revert "refactor(http): migrate XSRF classes to use inject() function"
This reverts commit 2ad6b729a1.

Revert reason: the change relies on the code that is not available in the `20.3.x` branch (the `HttpXsrfCookieExtractor` class is not marked as `providedIn: "root"`).
2025-11-10 13:56:23 -08:00
arturovt 5047849a4a fix(common): remove placeholder image listeners once view is removed
Prior to this commit, attempting to resolve a `ChangeDetectorRef` after views or app have been destroyed would result in an error. In this commit, we clean up listeners once the view is destroyed, before the placeholder loads or fails to load.

(cherry picked from commit feb86e3fde)
2025-11-10 12:05:23 -08:00
arturovt 4c66fe4796 refactor(core): mark VERSION as @__PURE__ for better tree-shaking
Annotate the `new Version(...)` call with `/* @__PURE__ */` to signal to optimizers that the constructor is side-effect free.

Without this hint, bundlers such as Terser or ESBuild may conservatively retain the `VERSION` instantiation even when unused. With the annotation, the constant can be tree-shaken away in production builds if not referenced, reducing bundle size.

(cherry picked from commit d3f67f6ca8)
2025-11-10 12:04:08 -08:00
Alan Agius 742122d5a7 docs: use markdown code fences in service worker docs
Replaces the <docs-code> component with standard markdown code fences in the service worker documentation. This improves the readability and maintainability of the documentation.

(cherry picked from commit d42f9ce3a9)
2025-11-10 12:03:35 -08:00
SkyZeroZx 2ad6b729a1 refactor(http): migrate XSRF classes to use inject() function
Remove constructor injection in favor of inject() calls

(cherry picked from commit 55be477979)
2025-11-10 09:49:13 -08:00
Shuaib Hasan Akib b20bf5dc70 docs: add shell language to CLI installation examples
Added `language="shell"` to installation command examples to display
the shell prompt `$` icon consistently across npm, pnpm, yarn, and bun
code blocks.

(cherry picked from commit 27d54654e3)
2025-11-10 08:01:33 -08:00
Shuaib Hasan Akib 77ca0d7534 docs(docs-infra): simplify file headers in <docs-code> blocks
Removed redundant "src/app/" prefix from file headers (e.g.,
"src/app/open-close.component.ts" → "open-close.component.ts")
to make code examples cleaner and more focused.

(cherry picked from commit e0a4bdd72b)
2025-11-10 08:00:37 -08:00
Shuaib Hasan Akib c5a41aae34 docs(docs-infra): removed unused import and use self-closing syntax for component
(cherry picked from commit 8c6619a531)
2025-11-10 08:00:10 -08:00
SkyZeroZx 7b1a47866a docs: improve discoverability of forms
(cherry picked from commit e3fc57e8fc)
2025-11-10 07:57:47 -08:00
jnizet fedb0831c5 fix(docs-infra): avoid double slash in sitemap urls
Previously, the URLs in the  generated sitemap contained double slashes between the host and the path. It's not the case anymore.

fix #65022

(cherry picked from commit afe5fc0399)
2025-11-10 07:53:43 -08:00
SkyZeroZx 63f1d94c2f docs: correct import path and self-closing tag in ng-content example
(cherry picked from commit 6a2f4a88de)
2025-11-10 07:52:50 -08:00
Matthew Beck 2531863909 test(compiler): add test for :host:has(> .foo)
I took a quick look at my recent changes to see if I had inadvertently
fixed this bug, but I couldn't seem to reproduce it even before my
changes. Seems like it's working, though.

Closes #58436

(cherry picked from commit 4b871b139b)
2025-11-10 07:51:20 -08:00
Matthew Beck 106b9040df fix(compiler): support commas in :host() argument
This change adds support for commas in :host() arguments (e.g.
`:host(:not(.foo, .bar))` as well as in nested parens when the argument
is applied without parens (e.g. `:host:not(:has(.foo, .bar))`).
Previously these selectors would receive an extra `[nghost]` attr, e.g.
`[nghost]:not(.foo, [nghost].bar)`.

I didn't file a bug for this one, but it's also blocking on an internal
LSC. Like the other CSS changes, I'll run a TGP to confirm this isn't
breaking.
2025-11-10 07:49:19 -08:00
Matthew Beck f9d0818087 fix(compiler): support arbitrary nesting in :host-context()
Previously we supported one level of nested pseudo-element selectors
inside :host-context(), e.g. :host-context(:is(.foo, .bar)). This was
based on a regex-based approach. We could support deeper levels of
nesting by updating the regex, but using a regex approach prohibits us
from supporting arbitrary nesting.

Rather than just adding one more level to the existing expression, I've
added a new generator function which splits selectors on commas in a
parenthesis-aware way. This allows us to support arbitrary nesting.

It's likely we'll want to reuse this in other places where we're not as
careful today. We'll probably do this on a request-based basis, though.

Fixes #59176
2025-11-10 07:49:19 -08:00
Andrew Kushnir b47054c52e Revert "fix(compiler): support commas in :host() argument"
This reverts commit 1e09bdc114.

Revert reason: the change relies on helper functions that do not exist in `20.3.x` branch (only exist in `main`).
2025-11-07 16:03:07 -08:00
Danny Koppenhagen f04cf2299b docs(core): add a11y considerations related to @defer()
closes #53466

(cherry picked from commit d2b854b37e)
2025-11-07 15:27:13 -08:00
Matthew Beck 1e09bdc114 fix(compiler): support commas in :host() argument
This change adds support for commas in :host() arguments (e.g.
`:host(:not(.foo, .bar))` as well as in nested parens when the argument
is applied without parens (e.g. `:host:not(:has(.foo, .bar))`).
Previously these selectors would receive an extra `[nghost]` attr, e.g.
`[nghost]:not(.foo, [nghost].bar)`.

I didn't file a bug for this one, but it's also blocking on an internal
LSC. Like the other CSS changes, I'll run a TGP to confirm this isn't
breaking.

(cherry picked from commit 680c3c7bff)
2025-11-07 10:43:36 -08:00
Shuaib Hasan Akib 143883afe3 docs(docs-infra): use self-closing syntax for component examples
Replaced multiple component tags such as `<example></example>` with
self-closing syntax (`<example />`) across documentation examples.
This improves readability and aligns with the current Angular
style conventions.

(cherry picked from commit a2cd36777a)
2025-11-07 10:24:40 -08:00
SkyZeroZx b8972dad85 refactor(devtools): replace HostListener with host metadata for keydown handling
Uses host metadata instead of the HostListener decorator for keydown events

(cherry picked from commit c74367c5de)
2025-11-07 15:44:45 +00:00
khanhkhanhlele 7f8336d9e0 docs: Fix typos in some files
(cherry picked from commit a625f6bb20)
2025-11-07 15:44:07 +00:00
tsc036 41466a7bbf refactor(core): move profile_types.ts to primtives
move profile_types.ts so the types can be used in Wiz code

(cherry picked from commit cf47ce2db9)
2025-11-06 22:22:37 +00:00
SkyZeroZx 1dcecdf823 refactor(platform-browser): remove unused Platform ID dependency from DomRendererFactory2
Eliminates the unnecessary injection and usage of Platform ID in the renderer factory logic, along with related test scaffolding cleanup

(cherry picked from commit 5343001835)
2025-11-06 20:00:49 +00:00
Matthew Berry 036c5d2a07 fix(compiler): support one additional level of nesting in :host()
Previously we supported one level of nested parentheses inside of a
`:host()` selector, e.g. `:host(:not(p))`. This caused a breakage in g3
when I migrated a selector from `:host:not(:has(p))` to
`:host(:not(:has(p)))`. This change adds support for just one more level
of nesting.

It'd be nice to move everything to a real CSS parser (or even update it
to count parentheses like I did with :host-context()), but I wasn't able
to get that to work in ~20 minutes and I'm focusing on other things at
the moment.

This change punts the problem until somebody tries to use just one more
level of nesting in a selector.

Fixes #64830

(cherry picked from commit 444143758e)
2025-11-06 18:53:46 +00:00
Alan Agius ee578d3e86 build: format md files
Format all md files
2025-11-06 10:10:22 -08:00
Jessica Janiuk dcdd1bcdbb fix(core): skip leave animations on view swaps
We accounted for skipping leave animations during moves, but not swaps.
This accounts for the swap cases and updates how we deal with swaps and
moves. Now we always queue animations and then essentially dequeue them
if we attach them back in the same render pass.

fixes: #64818
fixes: #64730
2025-11-06 09:46:52 -08:00
tsc036 d6ef181f6c refactor(core): export types from primitives
export Version type and a type for linkedSignal previous value so they can be used for the Wiz implementations

(cherry picked from commit 104f7d57c1)
2025-11-06 16:34:57 +00:00
SkyZeroZx feab482684 docs: correct formatting in dependency injection guides
(cherry picked from commit 61066071cf)
2025-11-06 16:34:29 +00:00
Erik Wegner ab94cd2b95 docs: Add the missing function call to use the signal's actual value
(cherry picked from commit e18aac88d4)
2025-11-05 11:47:17 -08:00
Andrew Scott 098ed8cf16 release: cut the v20.3.10 release 20.3.10 2025-11-05 18:36:23 +00:00
Matthieu Riegler 22d190c0b9 docs(docs-infra): fix heading layout on mobile
Long code blocks overflow the headings on narrow screen (like mobiles), this messes up the global layout of the page. With the ellipsis with fix that.

fixes #64845

(cherry picked from commit 7f44345db3)
2025-11-05 09:49:50 -08:00
SkyZeroZx 744cd5c51c refactor(http): simplifies destruction tracking using destroyed property
Replaces the manual destroyed state with destroyed property

(cherry picked from commit 44435ea97b)
2025-11-05 09:05:32 -08:00
Lukas Matta a45e6b2b66 fix(migrations): Prevent removal of templates referenced with preceding whitespace characters
In https://github.com/angular/angular/pull/64745, a fix was introduced for templates referenced with a trailing semicolon. However, templates are still incorrectly removed when there are whitespace characters before the template name.

This commit updates the control flow migration logic to ensure templates referenced with preceding whitespace are not removed.

Fixes #64854

(cherry picked from commit 5b210e97af)
2025-11-04 15:26:06 -08:00
SkyZeroZx c374e80655 docs(docs-infra): add missing meta tags for author, keywords, and Twitter
(cherry picked from commit b5e37ffb77)
2025-11-04 14:58:31 -08:00
Joey Perrott 43f7f41d67 fix(docs-infra): properly join url parts
Properly join the url parts in the sitemap as path.join removed one of the slashes in the base url
2025-11-04 22:49:36 +00:00
Joey Perrott ec9b0742a8 fix(docs-infra): properly expose the prerendered routes for sitemap generation
Properly expose the prerendered routes for sitemap generation rather than only copying the browser directory
2025-11-04 19:18:36 +00:00
Matthieu Riegler 0a0fe44e61 feat(docs-infra): generate the sitemap for angular.dev
We automatically generate the sitemap for the angular.dev deployment and include it in the assets pushed
to firebase.

Co-authored-by: Joey Perrott <josephperrott@gmail.com>
2025-11-04 18:41:01 +00:00
Angular Robot dd7cb3d3da docs: update Angular CLI help
Updated Angular CLI help contents.
2025-11-04 18:06:43 +00:00
Gerome Grignon 1b6d0cff40 docs(router): uniformize lazy loading syntax
(cherry picked from commit 8f49af90d0)
2025-11-04 09:39:19 -08:00
SkyZeroZx 7438b9cc26 refactor(core): Removes unused flag for onDestroy
Eliminates an unnecessary configuration flag

(cherry picked from commit 2ad1b5979f)
2025-11-03 20:21:04 -08:00
SkyZeroZx 4f7b97cc21 docs: simplify tutorial signals with self-closing component tags
(cherry picked from commit b61847f877)
2025-11-03 16:34:44 -08:00
SkyZeroZx d0b1dfaf0d docs: Update highlight inputs & code block formatting in component guides
(cherry picked from commit 82a579c7e6)
2025-11-03 16:32:46 -08:00
Shuaib Hasan Akib 3d6a206e9b docs: remove standalone: true since it's now the default
Removes redundant `standalone: true` declarations from code examples.
Standalone components are now the default in Angular, so the flag is
no longer necessary in documentation snippets.

(cherry picked from commit c4c7fb88ac)
2025-11-03 16:27:02 -08:00
Jan Martin 192eb35212 ci: update handle for jkrems/hybrist
The username was changed earlier today and the old username is no
longer in use.
2025-11-04 00:22:15 +00:00