René's URL Explorer Experiment


Title: feat(forms): add `derive()` schema rule for signal forms by JeanMeche · Pull Request #72154 · angular/angular · GitHub

Open Graph Title: feat(forms): add `derive()` schema rule for signal forms by JeanMeche · Pull Request #72154 · angular/angular

X Title: feat(forms): add `derive()` schema rule for signal forms by JeanMeche · Pull Request #72154 · angular/angular

Description: Description Draft prototype proposing a declarative derive() schema rule in @angular/forms/signals to address #65467 (updating a form field's value from other fields or external signals without user-written effect() blocks). Proposed API Two progressive overloads matching existing rules (validate, min, disabled, validateAsync) and Angular's linkedSignal mental model: form(model, (p) => { // 1. Shorthand (reactive computation; `linkedSignal(fn)` semantics) derive(p.total, ({valueOf}) => valueOf(p.quantity) * valueOf(p.unitPrice)); // 2. Shorthand + config derive(p.slug, ({valueOf}) => slugify(valueOf(p.title)), { when: ({state}) => !state.dirty(), }); // 3. Source-driven options (`source` tracked, `compute` runs untracked) derive(p.state, { source: p.country, // accepts SchemaPath, LogicFn, or Signal on: 'change', // preserves initial/hydrated value; narrows `ctx.previous` as defined fieldState: 'reset', // clears dirty/touched/parseErrors when updated compute: (country, {previous}) => statesByCountry[country]?.includes(previous.value) ? previous.value : '', }); }); Config options when: Reactive guard (LogicFn). Inactive rules do not evaluate source/compute. on: 'always' (default, runs on activation and on changes) or 'change' (captures active snapshot as baseline on initial activation and on when re-activation, only writes on subsequent changes while active; TypeScript narrows ctx.previous to non-nullable {source, value}). equal: Custom ValueEqualityFn for comparing target values (defaults to Object.is). sourceEqual: Custom ValueEqualityFn for comparing successive source values (defaults to Object.is). fieldState: Interaction state behavior on write — 'preserve' (default), 'reset' (clears dirty, touched, parse errors and cascades to descendants), or 'dirty'. Key Behavioral & Architectural Details Per-field effect() via createManagedMetadataKey: Mirrors validateAsync's lifecycle (node.structure.injector), so each derivation only re-runs when its own tracked inputs change (O(1) in applyEach arrays), cleans up automatically when fields become orphaned, and composes naturally with schema(), apply(), applyEach(), applyWhen(), applyWhenValue(), and recursive schemas. Why not a single root polling effect() + hybrid sync flush? A root polling loop re-evaluates every derivation in the form on any change, an eager sync flush during form() construction throws NG0950 when reading input.required(), and hybrid flushing creates split sync-vs-async timing between field.value.set() and model.set() / external signals. Why not user-written effect() outside form()? It does not compose with schema(), applyEach(), or applyWhen(), lacks per-item cleanup, and pushes untracked() / on: 'change' / reset() re-baselining boilerplate onto every caller. Multiple rules per field: Coexist in declaration order (trim → toLowerCase → slice pipeline, or multiple triggers driving the same field). Availability states: Unlike validators, derive() continues to run when a field is readonly, disabled, or hidden (enabling readonly(p.total) + derive(p.total, ...) and clearing hidden fields). reset(value): Re-baselines on: 'change' rules inside the reset subtree so loading a new snapshot (e.g. form().reset({country: 'CA', state: 'ON'})) does not wipe 'ON', while on: 'always' rules still settle. Array element identity: Copies the parent's tracking identitySymbol when replacing an array item object so FieldNode identity (dirty, touched, bindings) is preserved. Cycle detection: Per-rule microtask write guard throws NG01922 (RuntimeErrorCode.DERIVATION_CYCLE) on non-converging cycles. Open Discussion Points Naming: derive vs derived vs compute / link, and compute vs computation (mirroring linkedSignal). Whether compute in the {source, compute} form should run untracked (implemented here to prevent accidental self-triggers) or tracked (matching linkedSignal). Whether source should accept bare SchemaPath shorthand (source: p.country) vs strictly LogicFn (({valueOf}) => valueOf(p.country)). fieldState: 'reset' when the newly derived value happens to equal the existing value (equal(current, next) === true). Verification //packages/forms/signals/test/node:test (55 specs in derive.spec.ts + compile-time assertions in types.spec.ts; 639/639 passing) //packages/forms:forms_api & //packages/forms:forms_errors (updated goldens/public-api/forms/signals/index.api.md) //packages/forms/signals/test/web:test_lib build verified //packages/core/test/bundling/forms_signals:symbol_test (0 new symbols — derive() is tree-shaken when unused) Refs #65467

Open Graph Description: Description Draft prototype proposing a declarative derive() schema rule in @angular/forms/signals to address #65467 (updating a form field's value from other fields or external signals without...

X Description: Description Draft prototype proposing a declarative derive() schema rule in @angular/forms/signals to address #65467 (updating a form field's value from other fields or external signals wit...

Opengraph URL: https://github.com/angular/angular/pull/72154

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b79d3953-677d-ce01-c055-159ec4518bc4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9860:1188C0:2F1A84:3DB781:6B06165E
html-safe-nonce4131e9df9702b3848b134b3ad1ded2cb8e1038ec27c18736c0616994ff4c0021
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODYwOjExODhDMDoyRjFBODQ6M0RCNzgxOjZCMDYxNjVFIiwidmlzaXRvcl9pZCI6IjU5Mjg2MzcxMjc2Mzc0NzI4NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac61dcc30108797da2767873d15f519b38088070ea3cec431ab2891e4c82f07cb2
hovercard-subject-tagpull_request:5438703137
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular/pull/72154/files
twitter:imagehttps://avatars.githubusercontent.com/u/1300985?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1300985?s=400&v=4
og:image:altDescription Draft prototype proposing a declarative derive() schema rule in @angular/forms/signals to address #65467 (updating a form field's value from other fields or external signals without...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release866f202ebf7ac5aff8f633417d9fd8a53818a977
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular/pull/72154/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F72154%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F72154%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/pull/72154/files
Reloadhttps://github.com/angular/angular/pull/72154/files
Reloadhttps://github.com/angular/angular/pull/72154/files
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues831 (831)https://github.com/angular/angular/issues
Pull requests123 (123)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
JeanMechehttps://github.com/JeanMeche
angular:mainhttps://github.com/angular/angular/tree/main
JeanMeche:feat/signal-forms-derivehttps://github.com/JeanMeche/angular/tree/feat/signal-forms-derive
Conversation 0 https://github.com/angular/angular/pull/72154
Commits 1 https://github.com/angular/angular/pull/72154/commits
Checks 19 https://github.com/angular/angular/pull/72154/checks
Files changed 7 https://github.com/angular/angular/pull/72154/files
feat(forms): add derive() schema rule for signal forms https://github.com/angular/angular/pull/72154/files#top
Show all changes 1 commit https://github.com/angular/angular/pull/72154/files
1fe6d00 feat(forms): add `derive()` schema rule for signal forms JeanMeche Nov 22, 2026 https://github.com/angular/angular/pull/72154/commits/1fe6d00b9370f1e1c371d2bc1edced69b4715041
Clear filters https://github.com/angular/angular/pull/72154/files
Please reload this pagehttps://github.com/angular/angular/pull/72154/files
Please reload this pagehttps://github.com/angular/angular/pull/72154/files
index.api.md https://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
derive.ts https://github.com/angular/angular/pull/72154/files#diff-105cb278a87a31ce658762e5120beddaa91d327ab6158ca332033e0dda299782
index.ts https://github.com/angular/angular/pull/72154/files#diff-af6da0f8aceebcce8f3f85e46fd82aac6b0247b085eda1fe9caadd74171079ed
errors.ts https://github.com/angular/angular/pull/72154/files#diff-0ee8d19f0d55cb7de2a430738bce492e83b48324b98e9f172b836163bd204bb2
node.ts https://github.com/angular/angular/pull/72154/files#diff-cf828355a749713d8275810e50e46677fd00e6358a7abe7e62b975ab240d70b4
derive.spec.ts https://github.com/angular/angular/pull/72154/files#diff-90f9678c4ec1cee576b1fab1d1f8e145c4507307b77c0132a8aef6629890406a
types.spec.ts https://github.com/angular/angular/pull/72154/files#diff-ad44551a4a9950e0f2afb67cc9c8826188626383194484eb951d0f9d60ccaf28
goldens/public-api/forms/signals/index.api.mdhttps://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
View file https://github.com/angular/angular/blob/1fe6d00b9370f1e1c371d2bc1edced69b4715041/goldens/public-api/forms/signals/index.api.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/72154/{{ revealButtonHref }}
https://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
https://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
https://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
https://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
https://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
https://github.com/angular/angular/pull/72154/files#diff-a7e7b48ecbb9bc72bc4237f5f1fa21a6862de24552dc43c84a0ed424dae1ac5b
Please reload this pagehttps://github.com/angular/angular/pull/72154/files
Please reload this pagehttps://github.com/angular/angular/pull/72154/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.