36196 Commits

Author SHA1 Message Date
Joey Perrott aba8fbe5cd build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-08 08:40:42 -08:00
kirjs 789f91bd4f 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.
2025-12-04 11:45:51 -08:00
kirjs 21b995f4b7 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
2025-12-04 11:45:51 -08:00
Georgi Serev 87e05e935c refactor(devtools): create a reusable component for all prop mat-trees
Create a reusable component for object property inspection.
2025-12-04 11:44:00 -08:00
diegoinost02 e311f3df72 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.
2025-12-04 11:42:46 -08:00
Shuaib Hasan Akib abcd6b5bfb docs: update rxResource changes in updated page
Add both `request` and `loader` changes in rxResource section
2025-12-04 11:41:36 -08:00
SkyZeroZx 3adb091c1a docs: update zone pollution guide highlight syntax 2025-12-04 11:40:01 -08:00
Kirill Cherkashin 5be33048cc refactor(forms): Break logic.ts into separate files
This would make it easier to navigate
2025-12-04 11:33:20 -08:00
Nakul Sharma 0bb8924ab6 refactor(core): use getComponentDef in stringify_utils
- Use getComponentDef in debugStringifyTypeForError to clean up TODO
- Remove outdated comment from stringify_utils
2025-12-04 11:32:12 -08:00
Angular Robot 009ca4bc70 build: update all non-major dependencies
See associated pull request for more information.
2025-12-04 11:31:29 -08:00
hawkgs 1d431a9637 fix(devtools): router tree not being rendered
Convert the `TreeVisualizer` to a signal, in the `TreeVisualizerComponent`, to ensure that the router tree render effect is always called; Use explicit `afterNextRender` phases.
2025-12-04 11:30:14 -08:00
Andrew Scott 37598cf6fe refactor(router): Adjust push/replace behavior to account for navigation API timing issues
There is a bug (?) in all browsers where the timing of the entry change
is delayed when a navigation is initiated by a click on a link via user
interaction. In this case, we need to ensure we do a 'push' navigation
rather than a 'replace'.
Programatically doing element.click() does not reproduce
this behavior, so adding a test for this is difficult (would require
webdriver).
2025-12-04 11:29:38 -08:00
Angular Robot 5fa407530c docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-12-04 11:28:51 -08:00
Alex Rickabaugh b96f65a963 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:42 -08:00
Alex Rickabaugh 37472e9185 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:42 -08:00
cexbrayat fc23fcdd3b 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.
2025-12-03 12:33:13 -08:00
Joey Perrott eebcaf49f1 ci: use defined ng-dev config for deploying docs site
Use the repo defined ng-dev configuration for deploying the docs site
2025-12-03 11:26:05 -08:00
Shuaib Hasan Akib 7f8ffa3304 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
2025-12-03 16:30:51 +01:00
Pawel Kozlowski 13c0d451a5 release: cut the v21.1.0-next.1 release 21.1.0-next.1 2025-12-03 16:24:33 +01:00
Pawel Kozlowski ffd7a9b7ea docs: release notes for the v21.0.3 release 2025-12-03 16:20:28 +01:00
SkyZeroZx 7d1e502345 feat(forms): Allows transforms on FormUiControl signals
Extends the `FormUiControl` interface to allow `InputSignalWithTransform` in addition to `InputSignal` for its properties.

Fixes #65756
2025-12-03 15:13:01 +01:00
Leon Senft e6d5632a30 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:49 +01:00
Leon Senft cd7ae7e2ce 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 886cf6c452 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.
2025-12-03 15:09:48 +01:00
Angular Robot d6087841e3 build: update all github actions
See associated pull request for more information.
2025-12-03 14:08:09 +01:00
Angular Robot dfd7d3bf6b build: lock file maintenance
See associated pull request for more information.
2025-12-03 13:38:40 +01:00
Alan Agius 3e89577655 release: bump Angular DevTools version to 1.6.2 2025-12-03 13:18:27 +01:00
Alan Agius 0659d11c85 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.
2025-12-03 12:19:43 +01:00
Kristiyan Kostadinov 6773d3b97d 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.
2025-12-03 12:18:57 +01:00
arturovt b74a0693f2 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.
2025-12-03 12:16:57 +01:00
Joey Perrott 819b640c2d 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
2025-12-03 11:54:53 +01:00
Pawel Kozlowski 13353bff8b Revert "build: update cross-repo angular dependencies"
This reverts commit 64f1f60943.
2025-12-03 11:06:54 +01:00
Pawel Kozlowski b158acb95c Revert "build: update bazel dependencies"
This reverts commit e26aa86aa5.
2025-12-03 11:06:54 +01:00
Angular Robot e26aa86aa5 build: update bazel dependencies
See associated pull request for more information.
2025-12-03 10:13:47 +01:00
Joey Perrott 64f1f60943 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-03 10:10:11 +01:00
hawkgs a5efc35ddf fix(devtools): router tree callables view source functionality
Fix a set of issues with the callable search algorithm and refactor it.
2025-12-03 10:07:20 +01:00
Joey Perrott 34bedae101 docs: rename visibleRegion to region
Use the attribute region instead of visibleRegion
2025-12-03 10:06:01 +01:00
Joey Perrott 9b3b5fb4cf 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.
2025-12-03 10:06:01 +01:00
Alon Mishne a892f2824c docs: Add build and devserver tools to MCP docs 2025-12-03 10:04:37 +01:00
Kirill Cherkashin 29223c440f docs: Update adev/src/content/guide/forms/signals/models.md
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
2025-12-02 19:30:52 +01:00
kirjs 1fd8303659 docs(forms): Polish the docs
- Recommend using form/fields to set the value
- Drop "Dynamic field addition" section as for the above reason
2025-12-02 19:30:52 +01:00
Andrew Scott a0ad5d4b2b test(router): Add tests for support of path params before/after a wildcard
This adds additional tests following the initial implementation in #64737 that cover
the use-case of path parameters before and after the wildcard segment.
2025-12-02 16:46:17 +01:00
Andrew Scott fd65dc5d53 refactor(router): add comment about scroll/focus
Add consideration for future behavior in the completion of the navigation event.
2025-12-02 16:45:17 +01:00
Andrew Scott cc03254b12 refactor(router): Avoid aborting traversal navigations
Unnecessarily aborting traversal navigations will break focus and scroll
restoration. We need to keep them open rather than replacing them with
an identical router-initiated navigation.
2025-12-02 16:45:17 +01:00
Andrew Scott 9914926b0d refactor(router): Clean up cancellation event handling
cleans up some handling of cancellation events with a shared helper.
2025-12-02 16:45:17 +01:00
Andrew Scott b7d21e209a 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.
2025-12-02 16:44:01 +01:00
Kristiyan Kostadinov e30e61b789 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)`.
2025-12-02 15:06:51 +01:00
Jessica Janiuk d8ab83ca82 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
2025-12-02 15:05:17 +01:00
Matthieu Riegler f35b2ef47c 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
2025-12-02 12:59:49 +01:00
Matthieu Riegler a784995a98 docs(docs-infra): Show examples on function overloads 2025-12-02 12:13:11 +01:00