35531 Commits

Author SHA1 Message Date
kirjs 47a739611a release: cut the v21.0.1 release 21.0.1 2025-11-25 15:04:58 -05:00
Alan Agius 3240d856d9 fix(http): prevent XSRF token leakage to protocol-relative URLs
The XSRF interceptor previously failed to detect protocol-relative URLs (starting with `//`) as absolute URLs. This allowed requests to such URLs to include the XSRF token, potentially leaking it to external domains.

This change updates the interceptor to correctly identify protocol-relative URLs as absolute and exclude them from receiving the XSRF token.

(cherry picked from commit 40790ef980)
2025-11-25 13:47:29 -05:00
Alan Agius 908b5a41a3 refactor: replace getDocument() with inject(DOCUMENT)
This replaces `getDocument()` with `inject(DOCUMENT)` across hydration and transfer state logic.

(cherry picked from commit 400fc82c43)
2025-11-25 13:05:01 -05:00
Kristiyan Kostadinov 6b20adff62 refactor: add mark for signal forms
Adds a mark for signal forms so we can track adoption. Also moves the call for `@let` into `declareLet` since we don't need it to fire as often as in `storeLet`.

(cherry picked from commit c994267f17)
2025-11-25 13:03:46 -05:00
Alan Agius 49ad7c6508 fix(core): use injected DOCUMENT for CSP_NONCE
This ensures that the right document is used and that `CSP_NONCE` can be used in `provideAppInitializer` and `provideEnvironmentInitializer`.

Closes #65624

(cherry picked from commit 3b1fa8235b)
2025-11-25 11:39:23 -05:00
AntonChesnokov 8d3a89a477 fix(compiler-cli): escape angular control flow in jsdoc
Escape @-prefixed template control flow constructs during doc extraction so JSDoc parsing keeps description text intact. Add regression coverage for @for snippets.

(cherry picked from commit 5bfa027d41)
2025-11-25 11:33:29 -05:00
Angelo Parziale 4634b467c2 docs(docs-infra): Fix anchor link DI
Fix anchor link for Dependency Injection Overview.

(cherry picked from commit 346caefa8d)
2025-11-25 11:05:45 -05:00
kirjs e3f5f34732 refactor(forms): Make reset take value
Now you can do form.reset({name: 'cat', age: 4});

(cherry picked from commit dec222d4d7)
2025-11-25 10:51:38 -05:00
Angular Robot 9aa3e92c82 build: lock file maintenance
See associated pull request for more information.
2025-11-25 10:34:12 -05:00
Miles Malerba 7d5c7cf99a feat(forms): add DI option for classes on Field directive
Adds a DI configuration option for signal forms that allows the
developer to specify CSS classes that should be automatically added
by the `Field` directive based on the field's status.

(cherry picked from commit c70e246c23)
2025-11-25 10:33:41 -05:00
SkyZeroZx 477df38d17 docs: improve core package API documentation with additional reference links
(cherry picked from commit 67d41e9bcc)
2025-11-25 10:19:39 -05:00
Cheng-Hsuan Tsai 69d6f8fe2c docs: replace aria grid overview example
(cherry picked from commit 56e059948f)
2025-11-25 10:17:00 -05:00
Leon Senft 8acf5d2756 fix(forms): allow dynamic type bindings on signal form controls
The type checker will no longer prohibit binding the Signal Forms `[field]`
directive to an input with a dynamic `[attr.type]` or `[type]` binding.

(cherry picked from commit 3a1eb07c46)
2025-11-25 09:16:01 -05:00
Oyama Michinoku c9f50b424b docs: fix typo by correcting W3 to W3C
(cherry picked from commit 2102bfe5aa)
2025-11-25 09:14:03 -05:00
Hussein Mahmoud Kandil d5b339c1a3 docs: fix example imports and missing event URL reference
The analytics tracking example contained unused and missing imports,
and it incorrectly referenced the page's URL.
This update fixes the imports and ensures the handler uses `event.url`,
allowing the example to work correctly.

(cherry picked from commit a294e3b94d)
2025-11-25 07:44:08 -05:00
Andrew Scott 0e458c7e12 refactor(core): Remove toggles used for zoneless by default migration
this migration is complete both internally and externally

(cherry picked from commit 51ebe9a4fc)
2025-11-24 16:57:52 -05:00
Kristiyan Kostadinov 70507b8c1c fix(core): debug data causing memory leak for root effects
We track all effects that are created for debugging purposes in the `resolverToEffects` map. This ends up leaking memory for effects registered on long-living resolvers (e.g. on the root injector), because they stay in the array, even if the effect itself has been destroyed.

These changes add a callback to clean up the references.

Fixes #65265.

(cherry picked from commit ca6ab6c914)
2025-11-24 15:26:12 -05:00
Leon Senft 4845a33018 refactor(forms): support custom control directives
Support binding `[field]` to directives that implement
`FormValueControl` or `FormCheckboxControl`.

The `[field]` binds to whichever directive (or component) matches first in the
event there are multiple implementations. We are considering whether to make
this an error state, which could be reported during type checking.

Closes #63910, Closes #64992

(cherry picked from commit f97a1d4856)
2025-11-24 13:48:20 -05:00
Ben Hong 534cc3dc37 docs: standardize aria code examples to not use component suffix
(cherry picked from commit d442c72f87)
2025-11-24 13:28:36 -05:00
Matthieu Riegler 6cb191bade docs: add callout on zone base testing helpers
With zoneless being the default, we need to make these requirements more explicit.

fixes #65539

(cherry picked from commit b34e48bdff)
2025-11-24 13:27:49 -05:00
Joey Perrott 0424a998c9 refactor(docs-infra): make docs-alert an inline token
Migrate docs-alert to be inline instead of block, this ensures that the content is placed within a <p> tag as expected. This is important
for ensuring that the iconography is placed correctly within the wrapper div generated for the alert. Additionally, we refactor the matcher
code to be more efficient, running with fewer loops.

(cherry picked from commit 046501fd33)
2025-11-24 13:26:03 -05:00
Matthieu Riegler 9b0900f0e9 ci: update pullapprove reviewers
Removing Minko from the pool of automatically picked reviewers

(cherry picked from commit 98ceb0a80d)
2025-11-24 13:25:30 -05:00
SkyZeroZx a62162d2ee docs: Update router docs to add references and components input fixed syntaxis
(cherry picked from commit 2ac826867b)
2025-11-24 13:18:31 -05:00
Alessio Pelliccione 9d6b86958a docs(docs-infra): fix missing syntax highlighting
closed angular#65565

(cherry picked from commit 7d20f2071c)
2025-11-24 13:13:25 -05:00
Shuaib Hasan Akib b513008fc8 refactor(common): remove redundant standalone: true as it is default now
-removing `standalone: true` from integration
- removed whitespace

(cherry picked from commit 93cff501e9)
2025-11-24 13:12:18 -05:00
Kristiyan Kostadinov 39c577bc36 fix(compiler-cli): do not type check native controls with ControlValueAccessor
Currently when we detect a `field` binding on a native element, we treat it as a built-in native control. This might not be the case if it's a pre-existing `ControlValueAccessor` relying on the CVA interop.

These changes try to detect any CVA-like directive on the element and disable the additional type checking if there are any.

Fixes #65468.

(cherry picked from commit 6b8720de91)
2025-11-24 13:08:46 -05:00
Kristiyan Kostadinov f0b34854cc refactor(compiler-cli): track public methods during analysis
Updates the directive analysis to track the public methods of the class.

(cherry picked from commit 5cfdd7897b)
2025-11-24 13:08:46 -05:00
Tomer953 f394215b14 fix(migrations): detect structural ngTemplateOutlet and ngComponentOutlet
the common-to-standalone migration only matched [ngTemplateOutlet] and
[ngComponentOutlet] bindings and missed their structural forms
(*ngTemplateOutlet and *ngComponentOutlet). This caused missing imports
when removing CommonModule. This change adds structural directive
patterns so the migration correctly identifies needed imports.

(cherry picked from commit a4f50bdd54)
2025-11-24 12:41:01 -05:00
Shuaib Hasan Akib 70bc3115c5 docs(docs-infra): keep 'Show code' button aligned right and prevent metadata wrapping
Ensures the example viewer header displays correctly by keeping the "Show code"
button aligned to the right and preventing metadata text from wrapping.
Improves layout consistency across documentation examples.

(cherry picked from commit b26fe73a91)
2025-11-24 12:23:40 -05:00
Matthieu Riegler f73cfd5a92 ci: adding myself as optional to the compiler scope
For whenever I feel confortable approving compiler PRs like diagnostics

(cherry picked from commit 9dd7cc13ca)
2025-11-24 12:18:30 -05:00
Alan Agius 6d4e68977f build: update release script to support changelog cherry-picking
This commit updates the release script to support cherry-picking changelog updates to the main branch when releasing from a patch branch. It also introduces a marker in the changelog to separate releases and ensures the GitHub release uses the formatted changelog from disk.

(cherry picked from commit c843a46912)
2025-11-24 12:17:23 -05:00
hawkgs 98520333bd refactor(compiler-cli): add a resource debugName transform (#64172)
Add a TS transform for `resource` (and `httpResource`) `debugName`. Test the transformations.

PR Close #64172
2025-11-24 11:30:13 -05:00
hawkgs 6de8926594 refactor(core): add debug name to resource (#64172)
Decorate `resource` (and `httpResource`) with `debugName`, along with all of its internal signals.

PR Close #64172
2025-11-24 11:30:13 -05:00
Matthieu Riegler 102cb872c7 docs: update devtools guide
- splits the injector inspector into its own guide
- update the screenshots
- add defer block section
- add hydration section

(cherry picked from commit b5ae62c02b)
2025-11-24 11:11:30 -05:00
NicoPolazzi 2739ae4b9d docs: correct signals tutorial inconsistencies in chapters 6-10
(cherry picked from commit 325ab18084)
2025-11-24 11:08:31 -05:00
Shuaib Hasan Akib 4303f5153c docs: html examples and replace <docs-code> with fenced code blocks
Replaced <docs-code language="html" with fenced html for improved readability and consistency across documentation.

(cherry picked from commit 0203dad09b)
2025-11-24 10:38:35 -05:00
Matthieu Riegler 1f20b54256 docs(docs-infra): simplify tab selection
Tab selection relied on the tabs being visible whe nthe example is loaded. That didn't work when `hideCode` was used.

fixes #65550

(cherry picked from commit 119c6ddaeb)
2025-11-24 10:24:42 -05:00
HyperLife1119 2ebe685298 docs: fix order of render phases in lifecycle documentation
(cherry picked from commit b6b6fae483)
2025-11-24 10:22:32 -05:00
Shuaib Hasan Akib cdfc782770 docs: fix internal links showing as external
Replace absolute URLs (https://angular.dev/...) with relative URLs
(/...) to prevent internal documentation links from being treated
as external links and opening in new tabs.

(cherry picked from commit 8f89507a0b)
2025-11-24 10:21:42 -05:00
Kristiyan Kostadinov 290513f5b6 test: remove unnecessary test calls
Removes calls to `TestBed.configureTestingModule` since they aren't necessary.

(cherry picked from commit 26e2092dd1)
2025-11-24 10:18:21 -05:00
Shuaib Hasan Akib d3c3b83f8b fix(docs-infra): update deprecated API link to use correct status value
Replaced `status=deprecated` with the correct numeric value `status=8`
to ensure the Deprecated APIs link resolves properly in the docs.

(cherry picked from commit 16a0b7dfdb)
2025-11-24 10:17:35 -05:00
Yahya-Almubarak 730803ad26 docs: fix typo in tutorial
(cherry picked from commit e501b7e445)
2025-11-24 10:15:05 -05:00
Alan Agius 2d658b3662 build: run e2e in sandbox
Updates the E2E test configuration to run within the Bazel sandbox.

(cherry picked from commit f7f9707508)
2025-11-24 10:03:03 -05:00
Angular Robot c7ae6f3fee build: update all github actions
See associated pull request for more information.
2025-11-24 09:34:02 -05:00
Alan Agius 4eb2d3ea2c docs: update ng serve builder to @angular/build:dev-server and detail proxy path matching behavior.
Closes #53652

(cherry picked from commit b28570b227)
2025-11-24 09:33:27 -05:00
Angular Robot de46b2429f build: update pnpm to v10.23.0
See associated pull request for more information.
2025-11-24 09:30:40 -05:00
Matthieu Riegler 92f0b6687d docs: fix v21 event header image
fixes #65572

(cherry picked from commit 48a05dd38c)
2025-11-24 09:08:22 -05:00
Hussein Mahmoud Kandil 696aaa11e9 docs: fix router event subscription in error handler example
The example incorrectly persisted the error message after a successful
navigation retry because the stream only emitted NavigationError events.
This update removes the filter and returns an empty string for non-error
events, allowing the signal to clear the message on normal navigation.

(cherry picked from commit 72b1f7fd43)
2025-11-22 09:10:57 -05:00
SkyZeroZx a70a191713 docs: Adds signal type checking documentation
(cherry picked from commit 38a354ffa2)
2025-11-21 16:31:16 -05:00
Matthieu Riegler 0ea1e07174 fix(core): apply bootstrap-options migration to platformBrowserDynamic
The migration wasn't applied to projects relying on `platformBrowserDynamic()` prior to this fix.

(cherry picked from commit b6fee3f107)
2025-11-21 16:28:23 -05:00