angular/packages
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
..
animations build: format md files 2025-11-06 10:03:05 -08:00
benchpress build: update cross-repo angular dependencies 2025-11-26 15:50:56 -05:00
common fix(http): enable XSRF protection for same-origin absolute URLs 2025-12-03 12:19:43 +01:00
compiler refactor(compiler): Generate the controlCreate instruction after the native element has been created 2025-12-02 12:59:49 +01:00
compiler-cli fix(compiler-cli): check that field radio button values are strings 2025-12-03 12:18:57 +01:00
core perf(core): tree shake unused dynamic [field] binding instructions (#65599) 2025-12-03 15:10:49 +01:00
docs/di build: format md files 2025-11-06 10:03:05 -08:00
elements refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00
examples refactor(common): update examples to align with Angular best practices 2025-11-19 14:29:49 -08:00
forms fix(forms): memoize reads of child fields in signal forms (#65802) 2025-12-03 12:52:42 -08:00
language-service fix(language-service): address potential memory leak during project creation 2025-11-07 11:57:22 -08:00
localize Revert "refactor(compiler-cli): remove deep imports from compiler-cli (#64732)" 2025-11-06 13:09:01 -08:00
misc/angular-in-memory-web-api build: update cross-repo angular dependencies 2025-11-26 15:50:56 -05:00
platform-browser docs: ExperimentalIsolatedShadowDom mentions 2025-11-14 08:41:13 -08:00
platform-browser-dynamic refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00
platform-server refactor: replace getDocument() with inject(DOCUMENT) 2025-11-25 13:04:58 -05:00
private/testing build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
router fix(router): handle errors from view transition finished promise 2025-12-03 12:16:57 +01:00
service-worker refactor(common): update examples to align with Angular best practices 2025-11-19 14:29:49 -08:00
ssr/docs build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
upgrade refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00
zone.js build: update all non-major dependencies 2025-11-26 13:08:42 -05:00
BUILD.bazel build(forms): expose signal forms compat package 2025-11-14 09:23:36 -08:00
circular-deps-test.conf.js docs(docs-infra): lift circular imports (#63186) 2025-08-19 07:58:45 +00:00
empty.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
goog.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
license-banner.txt docs: update website URL in license banners (#64183) 2025-10-02 07:56:58 -07:00
package.json build: prepare for compiler-cli to be using ts_project (#61181) 2025-05-09 15:59:46 +00:00
README.md build: format md files 2025-11-06 10:03:05 -08:00
system.d.ts refactor: update packages/core:{core,src} to ts_project (#61275) 2025-05-14 12:01:51 +00:00
tsconfig-build.json Revert "refactor(compiler-cli): remove deep imports from compiler-cli (#64732)" 2025-11-06 13:09:01 -08:00
tsconfig-legacy-saucelabs.json feat(core): support TypeScript 5.5 (#56096) 2024-05-29 15:33:33 +02:00
tsconfig-test.json
tsconfig.json feat(compiler-cli): enable type checking of host bindings by default (#63654) 2025-09-09 14:34:29 -07:00
tsec-exemption.json
types.d.ts build: move private testing helpers outside platform-browser/testing (#61472) 2025-05-20 10:00:43 +00:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT