Skip to content

Avoid retaining unused form directives in Signal Forms - #71934

Open
SkyZeroZx wants to merge 2 commits into
angular:mainfrom
SkyZeroZx:perf/forms-optional-directives-tree-shaking
Open

SkyZeroZx wants to merge 2 commits into
angular:mainfrom
SkyZeroZx:perf/forms-optional-directives-tree-shaking

Conversation

@SkyZeroZx

Copy link
Copy Markdown
Contributor

perf(forms): let unused required validators be tree-shaken

NgControl kept RequiredValidator in the bundle just for an instanceof check. Use a private symbol instead so apps that don't use the directive can drop it.

perf(forms): let unused value accessors be tree-shaken

Let selectValueAccessor recognize default and built-in accessors without keeping their implementation classes in every bundle. Signal forms can then drop the accessor classes and their inheritance helpers.

Keep exact constructor checks so custom subclasses retain their priority. Update the existing bundle goldens.

@angular-robot angular-robot Bot added area: performance Issues related to performance area: forms labels Nov 10, 2026
@ngbot ngbot Bot added this to the Backlog milestone Nov 10, 2026
@pullapprove
pullapprove Bot requested a review from kirjs November 10, 2026 22:10
NgControl kept RequiredValidator in the bundle just for an instanceof check.
Use a private symbol instead so apps that don't use the directive can drop it.
Let selectValueAccessor recognize default and built-in accessors without keeping their implementation classes in every bundle. Signal forms can then drop the accessor classes and their inheritance helpers.

Keep exact constructor checks so custom subclasses retain their priority. Update the existing bundle goldens.
@SkyZeroZx
SkyZeroZx force-pushed the perf/forms-optional-directives-tree-shaking branch from cdc38cc to 588444e Compare November 12, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: forms area: performance Issues related to performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant