Commit graph

35616 commits

Author SHA1 Message Date
SkyZeroZx
56418b108e docs: add documentation for HTTP_TRANSFER_CACHE_ORIGIN_MAP
(cherry picked from commit 7e1e396a00)
2025-12-08 09:00:13 -08:00
SkyZeroZx
5b911d6025 docs(docs-infra): fix hideCopy option to code snippets
Adds the ability to hide the copy button on code snippets.

Updates documentation to use the new `hideCopy` option with the new
markdown code fence syntax.

(cherry picked from commit a4563044ad)
2025-12-08 08:48:25 -08:00
Shuaib Hasan Akib
b8ed18c527 docs: fix lazy loading documentation reference
Updates broken or outdated references in the lazy loading guide.

Fixes: #65906
(cherry picked from commit 45aa63308e)
2025-12-08 08:47:45 -08:00
Alan Agius
8bedd996ac build: format manifest files after updating its version
This commit run the formatter during the release.

(cherry picked from commit d2ac93d5ca)
2025-12-08 08:44:01 -08:00
Alan Agius
79ebbf7e36 refactor: move Prettier ignore rules from ng-dev config to .prettierignore
This moves all prettier ignore rules to the prettier config

(cherry picked from commit 52aac81829)
2025-12-08 08:43:11 -08:00
Matthieu Riegler
5d8adf2105 docs(docs-infra): fix next version dropdown
fixes #65912

(cherry picked from commit 13bc1bc721)
2025-12-08 08:42:24 -08:00
Matthieu Riegler
bd4cfc88ef docs(docs-infra): expose VERSION from @angular/upgrade
The missing src was responsible for not exposing the symbols during the doc extraction.

fixes #65916

(cherry picked from commit 81cf319534)
2025-12-08 08:41:40 -08:00
kirjs
28e7546edc feat(docs-infra): forward preview error locations
Intercept the WebContainer preview overlay open-in-editor requests and relay them to the editor via postMessage so errors open the matching file.

(cherry picked from commit 789f91bd4f)
2025-12-04 11:45:56 -08:00
kirjs
3d58d10e68 feat(docs-infra): allow navigating to editor error locations
This shows up in a little pop-up, and is clickable now, and leads to exact line

(cherry picked from commit 21b995f4b7)
2025-12-04 11:45:56 -08:00
diegoinost02
ba61579cb7 docs: clarify linkedSignal update behavior
Updates the linkedSignal documentation to specify that it updates its value when the source changes or when any signal referenced in the computation changes, ensuring the description accurately reflects its behavior.

(cherry picked from commit e311f3df72)
2025-12-04 11:42:51 -08:00
Shuaib Hasan Akib
ab38d91891 docs: update rxResource changes in updated page
Add both `request` and `loader` changes in rxResource section

(cherry picked from commit abcd6b5bfb)
2025-12-04 11:41:41 -08:00
SkyZeroZx
36cffc72d3 docs: update zone pollution guide highlight syntax
(cherry picked from commit 3adb091c1a)
2025-12-04 11:40:07 -08:00
Kirill Cherkashin
7de8558219 refactor(forms): Break logic.ts into separate files
This would make it easier to navigate

(cherry picked from commit 5be33048cc)
2025-12-04 11:33:26 -08:00
Nakul Sharma
d40a517c0f refactor(core): use getComponentDef in stringify_utils
- Use getComponentDef in debugStringifyTypeForError to clean up TODO
- Remove outdated comment from stringify_utils

(cherry picked from commit 0bb8924ab6)
2025-12-04 11:32:17 -08:00
Joey Perrott
c3bd22d10d
build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-04 11:26:14 -08:00
Alex Rickabaugh
bf1c12cd93 fix(forms): memoize reads of child fields in signal forms (#65802)
Previously, navigating a `FieldTree` in signal forms involved reactive reads
of the value of the parent field(s), both directly and via `.childrenMap()`.

This meant that on _any_ change to the value of a field, reactive
notifications would trigger updates of computeds, reruns of effects, etc.
So for example, this effect would run on every change to the form:

```ts
const f = form(signal({data: 'abc', unrelated: 0}));
effect(() => {
  // accessing f.data incurs a dependency on f().value() which changes
  // on every change in the whole form
  console.log(f.data().value());
});
```

This is deeply counterintuitive and troublesome when attempting to write
effect logic, and also results in `computed`s unnecessarily updating.

This change introduces the concept of a "reader" computed, which memoizes
the access of a field at a given key via the reactive graph. With this, the
same `f.data` access above now depends on the `data` reader in `f` only,
which is effectively a constant computed. As a result, the effect only
reruns on changes to `data`'s value, as intended.

PR Close #65802
2025-12-03 12:52:43 -08:00
Alex Rickabaugh
2c12661620 refactor(forms): simplify child field creation (#65802)
Previously, several values were being passed into the creation of
`FieldNodeStructure`s that were only used in the creation of child nodes.
Separately, we also passed a `createChildNode` function which these values
were passed back into.

Instead, this moves the small bit of logic from structure.ts behind the
`createChildNode` callback, which reduces the passing of values back-and-
forth and gives `createChildNode` a much more suitable signature.

PR Close #65802
2025-12-03 12:52:43 -08:00
cexbrayat
565c022a87 build: disable assistant_to_the_branch_manager on forks
It currently fails as it is triggered on push, but requires an angular-robot-key that forks don't have.

(cherry picked from commit fc23fcdd3b)
2025-12-03 12:33:18 -08:00
Angular Robot
4e19d6c072 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-12-03 12:32:36 -08:00
Joey Perrott
fbc43f9272 build: use mjs files for ng-dev configuration
In preperation for ng-dev requiring mjs files for configuration, switch over our usage
2025-12-03 12:30:55 -08:00
Joey Perrott
34caae5978 ci: use defined ng-dev config for deploying docs site
Use the repo defined ng-dev configuration for deploying the docs site

(cherry picked from commit eebcaf49f1)
2025-12-03 11:26:10 -08:00
Shuaib Hasan Akib
2e5d187120 fix(docs-infra): prevent readonly TypeScript keyword from being linked
This updates the docs infrastructure to avoid incorrectly linking the `readonly` keyword in TypeScript examples.

Fixes #65632

(cherry picked from commit 7f8ffa3304)
2025-12-03 16:30:55 +01:00
Pawel Kozlowski
c355ffd99e release: cut the v21.0.3 release 2025-12-03 16:18:30 +01:00
SkyZeroZx
6b4ab876e8 feat(forms): Allows transforms on FormUiControl signals
Extends the `FormUiControl` interface to allow `InputSignalWithTransform` in addition to `InputSignal` for its properties.

Fixes #65756

(cherry picked from commit 7d1e502345)
2025-12-03 15:13:06 +01:00
Leon Senft
609699ae17 perf(core): tree shake unused dynamic [field] binding instructions (#65599)
Move the instructions used to dynamically bind a `Field` directive to a
form control onto the `Field` itself. This way the instructions are only
retained if the app uses the `Field` directive.

PR Close #65599
2025-12-03 15:10:50 +01:00
Leon Senft
a5dbd4b382 fix(forms): support dynamic [field] bindings (#65599)
Support binding a `Field` directive to a component created dynamically
with `createComponent()`.

Fix #64632

PR Close #65599
2025-12-03 15:10:49 +01:00
Kristiyan Kostadinov
4bb085311e fix(core): unable to inject viewProviders when host directive with providers is present
When registering providers, the DI system assumes that `viewProviders` are registered before plain `providers`. This was reinforced by components always being first in the array of directive matches, only one component being allowed per node and the fact that only components can have `viewProviders`.

This breaks down if there are host directives with `providers` on the component, because they'll execute earlier, throwing off the order of operations.

These changes fix the issue by separating out the resolvers for `viewProviders` and plain `providers` and explicitly running the component's `viewProviders` resolver before any others. This also has the benefit of not attempting to resolve `viewProviders` for directives which are guaranteed not to have them.

Fixes #65724.

(cherry picked from commit 886cf6c452)
2025-12-03 15:09:53 +01:00
Angular Robot
6491df9175 build: lock file maintenance
See associated pull request for more information.
2025-12-03 13:24:37 +01:00
Alan Agius
20474d3f0f fix(http): enable XSRF protection for same-origin absolute URLs
Previously, the XSRF interceptor only added the XSRF token to requests with relative URLs.
This commit updates the interceptor to also add the token to requests with absolute URLs, provided they match the current origin.

(cherry picked from commit 0659d11c85)
2025-12-03 12:19:46 +01:00
Kristiyan Kostadinov
1f1856e897 fix(compiler-cli): check that field radio button values are strings
Adds some type checking code which verifies that the bound `value` on a `Field` radio button is a string.

Fixes #65726.

(cherry picked from commit 6773d3b97d)
2025-12-03 12:19:01 +01:00
arturovt
48b89f9fbe fix(router): handle errors from view transition finished promise
This commit adds a `.catch()` handler to `transition.finished` from `document.startViewTransition` to prevent unhandled promise rejections. The finished promise can reject with `TimeoutError` or `InvalidStateError` when transitions fail during or after the animation phase.

Based on the Blink source code, the `finished` promise can reject with:
* `TimeoutError`: "Transition was aborted because of timeout in DOM update"
* `InvalidStateError`: "Transition was aborted because of invalid state"

This may happen when the DOM update phase exceeds the browser's internal timeout threshold.

(cherry picked from commit b74a0693f2)
2025-12-03 12:17:02 +01:00
Joey Perrott
0f50ea8f97 docs: prevent showing typescript diagnostic errors until the node runtime reaches a ready state
Prevent the overlay box showing diagnostics errors until after the initial setup of the node runtime is completed.

Fixes #52649

(cherry picked from commit 819b640c2d)
2025-12-03 11:54:58 +01:00
Pawel Kozlowski
c112ef1808 Revert "build: update cross-repo angular dependencies"
This reverts commit 82d616b681.
2025-12-03 11:34:40 +01:00
Pawel Kozlowski
2a459a0e3f Revert "build: update bazel dependencies"
This reverts commit 42fbb64aec.
2025-12-03 11:34:40 +01:00
Angular Robot
42fbb64aec build: update bazel dependencies
See associated pull request for more information.
2025-12-03 10:12:32 +01:00
Joey Perrott
82d616b681
build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-03 10:09:29 +01:00
Joey Perrott
8e837cc226 docs: rename visibleRegion to region
Use the attribute region instead of visibleRegion

(cherry picked from commit 34bedae101)
2025-12-03 10:06:06 +01:00
Joey Perrott
76f784c340 refactor(docs-infra): extract only the visibleRegion
Previously we extracted the regions and only made the visible region visible on the page, but since there is not a need for the
non-visible code to be presented, we don't need to include it in the generated code snippets.

(cherry picked from commit 9b3b5fb4cf)
2025-12-03 10:06:05 +01:00
Kirill Cherkashin
e95d2e3a34 docs: Update adev/src/content/guide/forms/signals/models.md
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
(cherry picked from commit 29223c440f)
2025-12-02 19:30:57 +01:00
kirjs
1ee0ff8cfb docs(forms): Polish the docs
- Recommend using form/fields to set the value
- Drop "Dynamic field addition" section as for the above reason

(cherry picked from commit 1fd8303659)
2025-12-02 19:30:57 +01:00
Andrew Scott
c2a8934d12 Revert "refactor(router): compress synchronous end to router navigation to single operator"
This reverts commit 71362733cf.
2025-12-02 19:13:07 +01:00
Andrew Scott
71362733cf refactor(router): compress synchronous end to router navigation to single operator
The end of the Router navigation is a block of synchronous logic that
can be compressed into a single operator rather than splitting it across
several, making it harder to step through. The only benefit from the
split is automatic unsubscribe/cancellation, which we can replicate
with an additional 'shouldContinue' check before proceeding.

(cherry picked from commit b7d21e209a)
2025-12-02 16:44:06 +01:00
Kristiyan Kostadinov
5a80a48e96 fix(compiler-cli): avoid allocating an object for signals in production mode
Currently when the signal debug name transform sees something like `const foo = signal(0);`, it transforms the signal into `signal(0, {...(ngDevMode ? { debugName: 'foo' } : {})})`. After minification this becomes `signal(0, {})` which will allocate memory for the empty object literal.

These changes rework the logic to produce `signal(0, ...(ngDevMode ? [{ debugName: 'foo' }] : []))` which will be fully tree shaken away to `signal(0)`.

(cherry picked from commit e30e61b789)
2025-12-02 15:06:55 +01:00
Jessica Janiuk
8c3304c766 fix(core): run animation queue in environment injector context
In the case that a component injector is destroyed before the animation
queue runs, the animation queue would fail to run because it was using a
destroyed injector. This commit changes the animation queue to run in the
context of the EnvironmentInjector, which is not destroyed until the app
is destroyed.

fixes: #65628
(cherry picked from commit d8ab83ca82)
2025-12-02 15:05:21 +01:00
Matthieu Riegler
017672f742 refactor(compiler): Generate the controlCreate instruction after the native element has been created
This is necessary to exclude a race condition where the MutationObserver initialized by the instruction fired before the inputs are binded.

fixes #65678

(cherry picked from commit f35b2ef47c)
2025-12-02 12:59:53 +01:00
Matthieu Riegler
8e0df4083d docs(docs-infra): Show examples on function overloads
(cherry picked from commit a784995a98)
2025-12-02 12:13:16 +01:00
Georgi Serev
c0e0010bb9 fix(devtools): hide profiler node details when the frame is changed
Hide the details panel when the user selects a new frame.

(cherry picked from commit 2eaa4d54ad)
2025-12-02 12:05:58 +01:00
Joey Perrott
53e0aaba4e refactor(docs-infra): move header id tracking into RendererContext
Move the header id tracking into the renderer context rather than a global state.  Since the RendererContext is
initialized for each execution of the marked parser, we can store the context of which header ids have been seen within
a single page there which allows us to run these parse interactions in parallel.

(cherry picked from commit a16a70ca74)
2025-12-02 12:03:39 +01:00
Joey Perrott
5ec3bd9c55 refactor(docs-infra): transform all headings using the built in transformer
Rather than manually calling the transformer we use for headings from within a render function, we now properly call into the Renderer to do them
via the tokens they are require instead.  This is being done to allow us to have a per Renderer instance of state instead of a global state, which will
allow us to run marked async and hopefully speed up the pipeline

(cherry picked from commit 8b296543ae)
2025-12-02 12:03:38 +01:00
Tim Deschryver
efe4b72abb docs: fix documentation link for currentNavigation method
(cherry picked from commit 680de24c3c)
2025-12-02 12:02:28 +01:00