Commit graph

35689 commits

Author SHA1 Message Date
Kristiyan Kostadinov
4c8fb3631d fix(core): throw better errors for potential circular references
Currently circular references in user code manifest themselves with an error like `Cannot read properties of undefined (reading 'ɵcmp')`. This is a bit cryptic so these changes add an assertion mentioning circular references.

Relates to #65917.

(cherry picked from commit 7be4ddef1c)
2025-12-12 08:06:30 -08:00
Alan Agius
b8cb6cda30 refactor(compiler): remove unnecessary sanitization for safe attributes
Remove sanitization for attributes that cannot execute code (e.g. `javascript: URIs`).

(cherry picked from commit 128aef0ede)
2025-12-12 08:06:03 -08:00
SkyZeroZx
6d9d2b83f6 refactor(common): remove redundant providedIn: 'root' from injection tokens
Removes unnecessary declarations from injection tokens

(cherry picked from commit 8485579649)
2025-12-12 08:05:34 -08:00
Angular Robot
0b90940461 build: update bazel dependencies
See associated pull request for more information.
2025-12-12 08:04:05 -08:00
Angular Robot
a507029666 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-12-12 08:01:08 -08:00
Angular Robot
87d20fd3ff build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-11 17:18:42 -08:00
Shuaib Hasan Akib
4d3b2bff88 docs: simplify example headers by showing only the file name
Removed redundant `src/app/` prefixes from <docs-code> headers to make
examples cleaner and easier to read. The full path remains available via
the `path` attribute, so the shortened headers improve clarity without
losing context.

(cherry picked from commit 63538524bc)
2025-12-11 17:17:09 -08:00
Andrew Xue
25f800712f docs(docs-infra): add primary color vars for tutorial button
(cherry picked from commit ff68806c67)
2025-12-11 17:11:31 -08:00
Leon Senft
8906814750 docs(forms): fix broken example
As written, the example rewrote the input value as the user edited it,
causing all kinds of confusing behavior which rendered the input nearly
unusable. While such implementations are possible, they require great
care to manage the cursor position while editing. For the sake of
brevity, this example now only updates the model on `blur` events; once
the user is done editing.

(cherry picked from commit f0ad30cce6)
2025-12-11 17:10:55 -08:00
SkyZeroZx
4781696edd docs: fixed tutorial steps with identation formatting
(cherry picked from commit c4e7ac1b81)
2025-12-11 17:10:18 -08:00
Angular Robot
25921f8c3c build: update all github actions
See associated pull request for more information.
2025-12-11 17:09:25 -08:00
SkyZeroZx
8ad00bc31a docs(docs-infra): Fix prefer/avoid rule matching with word boundaries
Improve code block rule detection by adding word-boundary anchors.
Also update indentation for consistency.

(cherry picked from commit a8fac4ce3b)
2025-12-11 17:08:54 -08:00
SkyZeroZx
3d25759117 docs(language-service): add link to hydration guide in built-in names documentation
Adds link to hydration guide for `hydrate` keyword

(cherry picked from commit ef45637ca8)
2025-12-11 17:06:39 -08:00
Charles
4c8564e2ce docs: overhaul unit testing overview guide
This commit introduces a series of improvements to the unit testing overview guide to enhance clarity, organization, and accuracy.

(cherry picked from commit 97c7025d7d)
2025-12-11 17:06:03 -08:00
Miles Malerba
eedcbbda4f docs(forms): add guide on designing form models
Adds a new guide on designing form model for signal forms

(cherry picked from commit fba0c88c9e)
2025-12-11 17:04:15 -08:00
Alex Rickabaugh
5a214653a8 release: cut the v21.0.5 release 2025-12-11 15:41:58 -08:00
Miles Malerba
4fd2b722b4 fix(forms): fix signal forms type error
Removes the `implements` clause on the `Field` directive since it is
causing type errors for people.

(cherry picked from commit d0097f7d0c)
2025-12-11 15:33:17 -08:00
SkyZeroZx
69d243abb7 fix(core): avoid false-positive deprecation when using InjectionToken with factory only
Prevents the deprecation warning that was incorrectly triggered when
defining an InjectionToken with only a `factory`, which correctly
defaults to the `root` scope.

(cherry picked from commit 4f6014a756)
2025-12-11 11:20:17 -08:00
Alex Rickabaugh
fa4e6e6763 release: cut the v21.0.4 release 2025-12-10 16:49:04 -08:00
Angular Robot
c937da491c build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-10 16:42:43 -08:00
jnizet
67a5a65a24 docs: fix typos and clarify root effect
(cherry picked from commit c63ef9cb6a)
2025-12-10 12:41:04 -08:00
Chathulanka Gamage
8a31eb8fb8 docs: update control-flow.md to replace else-if with else if
fix incorrect hyphenated form "else-if" and update documentation to match correct syntax "else if"

(cherry picked from commit 7674ada620)
2025-12-10 12:39:25 -08:00
Angular Robot
fe581f38fd build: update pnpm to v10.25.0
See associated pull request for more information.
2025-12-10 12:36:08 -08:00
Michael Small
de6dc043fb docs: add 'new' to page 'Side effects for non-reactive APIs'
(cherry picked from commit 3ab17876ba)
2025-12-10 12:27:30 -08:00
Matthieu Riegler
f20d301bdc refactor: spread rules with glob syntax
prettierignore does not support the glob syntax for multiple extensions.

(cherry picked from commit c429e701fc)
2025-12-10 12:26:57 -08:00
Matthieu Riegler
42c89f1c98 docs: add the version of angular being used to the footer
Include the version of angular being used for the build in the footer of the application

This is a backport of #64863
2025-12-10 12:24:50 -08:00
SkyZeroZx
6930a2e8c8 docs: update forwardRef usage with signals and add HostListener note
(cherry picked from commit bff2dcb93c)
2025-12-10 12:23:33 -08:00
Angular Robot
68a98118d2 build: lock file maintenance
See associated pull request for more information.
2025-12-10 12:22:25 -08:00
Andrew Scott
497c0e36ab refactor(core): Add transition.to property to FakeNavigation
This matches the upstream changes in f19930f98a

(cherry picked from commit 5988bdedae)
2025-12-10 10:18:13 -08:00
diegoinost02
7fde186157 docs(forms): document array item validation in Signal Forms
(cherry picked from commit 9dd08c571a)
2025-12-10 10:17:33 -08:00
diegoinost02
8c8bd3e856 docs(forms): add signal forms documentation for validating array items
(cherry picked from commit e6865af8f1)
2025-12-10 10:17:33 -08:00
SkyZeroZx
49fca78f27 docs(docs-infra): Fixes the visibility of the copy link button in API documentation headings
Fixes the visibility of the copy link button in API documentation headings.
The button now appears on hover, improving the user experience.

(cherry picked from commit 15e3407dab)
2025-12-10 10:16:04 -08:00
Shuaib Hasan Akib
2dd971b73e docs: hide menu icons from screen readers in aria example
Add aria-hidden="true" to decorative icon elements in the ARIA menu documentation
example to prevent screen readers from announcing both icon names and labels.
This improves the accessibility experience by ensuring only meaningful text
is announced to screen reader users.

Fixes: #65768
(cherry picked from commit 1c6049584e)
2025-12-10 10:09:41 -08:00
Matthieu Riegler
cbb10179c8 fix(forms): allow resetting with empty string
Both empty string and null values should be accepted when resetting

fixes #65949

(cherry picked from commit 14713d0992)
2025-12-10 10:04:58 -08:00
Shuaib Hasan Akib
834593b9c0 docs: use fenced code blocks and format examples
Replaces custom docs-code blocks with fenced Markdown code blocks and reformats examples to improve readability, consistency, and copy-paste behavior.

(cherry picked from commit d0a34a6ca5)
2025-12-10 09:35:56 -08:00
Shuaib Hasan Akib
ac6f34a43b fix(docs-infra): parse linenums attribute from triple backtick metadata
The triple backtick code block parser now extracts the linenums attribute
from metadata and applies it to enable line number display in code examples

(cherry picked from commit 1f29577077)
2025-12-10 09:31:48 -08:00
Andrew Scott
01ab257da4 refactor(core): match spec updates for FakeNavigation
Updates FakeNavigation based on updates in https://github.com/whatwg/html/pull/11952

(cherry picked from commit d355205198)
2025-12-10 08:19:28 -08:00
Matthieu Riegler
84f397c831 refactor(core): Support Error like object for on resource errors.
Error like object will be treated as errors.

Related to #61861

(cherry picked from commit 835a643161)
2025-12-10 08:18:24 -08:00
Joey Perrott
96bb4c6ae3 build: add the ignore all rc files flag when running bazel info
Due to a bug in bazel we need to ignore all of the rc files when running bazel info commands

(cherry picked from commit 9ace7d7a0d)
2025-12-09 13:44:49 -08:00
Matthieu Riegler
4043ec5bdd docs: create a separate effect guide
This also includes details about `afterRenderEffect`

WIP.

fixes #63757

(cherry picked from commit 827f5a6fd5)
2025-12-09 13:11:05 -08:00
Kristiyan Kostadinov
65297c6201 fix(compiler-cli): expand type for native controls with a dynamic type
We recently allowed users to have a dynamic input `type` with signal forms, but the logic that infers the value type falls back to `string` even though in theory it can be any of the other types.

These changes expand the inferred type to `string | number | boolean | Date | null` if we detect a dynamic `type` binding.

(cherry picked from commit 8a3f3a91cf)
2025-12-09 13:01:35 -08:00
kirjs
6d7475582f fix(forms): Reuse key in parent in compat structure
This fixes the "Compat nodes do not use keyInParent." error when trying to bind compatField.

(cherry picked from commit 179b4cba67)
2025-12-09 12:59:27 -08:00
arturovt
bb0061ba63 refactor(core): wrap operationsCounter calls with ngDevMode checks
Wrap operationsCounter method calls (recordCreate, recordDestroy, reset)
with ngDevMode guards to ensure they are tree-shaken in production builds.

This aligns with the existing pattern where operationsCounter is only
initialized in development mode, and eliminates unnecessary method call
overhead in production.

The optional chaining (?.) is retained as TypeScript doesn't narrow types
based on ngDevMode checks, but the entire expression will be removed during
production builds.

(cherry picked from commit 80dbd74ae8)
2025-12-09 10:38:44 -08:00
Matthieu Riegler
ffad78360f refactor(core): add dedicated deprecated signatures for providedIn: any / NgModule.
Those were deprecated by #47616 back in v15.

fixes #65923

(cherry picked from commit 8199945637)
2025-12-09 10:38:14 -08:00
Angular Robot
4bfee61aa7 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-12-09 10:37:00 -08:00
Miles Malerba
f254ff4f2e feat(forms): expose element on signal forms Field directive
This allows for easier focusing of the relevant element based on the
`field` property of a `ValidationError`

(cherry picked from commit aff8b248b3)
2025-12-09 09:47:56 -08:00
Andrew Scott
91532626a9 docs: Update tutorial last step to use markForCheck
Ideally this tutorial would have used signals but didn't. That's a bigger change than
we are able to make right now and there are other things we would like
to update at the same time. This fix is a temporary patch to the
existing content until there is time to redo the tutorial and videos
entirely.

fixes #65863

(cherry picked from commit 200d923436)
2025-12-09 09:39:37 -08:00
Angular Robot
d8162373d7 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-09 09:28:32 -08:00
SkyZeroZx
5d73893219 docs(docs-infra): Refactors tutorial generation and updates ng-container docs
Updates the `ng-container` documentation page to use the correct `angular-html` code format and removes an unused CLI documentation file.

(cherry picked from commit 9a6b8e0315)
2025-12-09 09:25:34 -08:00
Kristiyan Kostadinov
f901cc9eb3 perf(compiler): chain query creation instructions
We always emit the query creation instructions in a group which makes them good candidates for chaining.

(cherry picked from commit ae1c0dc490)
2025-12-09 09:24:41 -08:00