refactor(forms): keep signal forms config tree-shakable#68810
Open
SkyZeroZx wants to merge 1 commit into
Open
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Add a dedicated @angular/forms/signals/config entrypoint so root-level signal forms configuration can be imported without eagerly pulling in the signal forms runtime. Closes angular#67909 Co-authored-by: Cédric Exbrayat <cedric@ninja-squad.com>
9c4f1d5 to
12ab5ba
Compare
JeanMeche
reviewed
May 20, 2026
Comment on lines
194
to
-698
| @@ -554,9 +553,6 @@ export class PatternValidationError extends BaseNgValidationError { | |||
| // @public | |||
| export function provideExperimentalWebMcpForms(): EnvironmentProviders; | |||
|
|
|||
| // @public | |||
| export function provideSignalFormsConfig(config: SignalFormsConfig): Provider[]; | |||
|
|
|||
| // @public | |||
| export function readonly<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: { | |||
| when?: NoInfer<LogicFn<TValue, boolean, TPathKind>>; | |||
| @@ -689,13 +685,6 @@ TModel | |||
| [K in keyof TModel]: MaybeSchemaPathTree<TModel[K], PathKind.Child>; | |||
| } : unknown); | |||
|
|
|||
| // @public | |||
| export interface SignalFormsConfig { | |||
| classes?: { | |||
| [className: string]: (formField: FormFieldBinding) => boolean; | |||
| }; | |||
| } | |||
|
|
|||
Member
There was a problem hiding this comment.
This is a breaking change of a now stable api.
We'll have to deprecated those entries.
JeanMeche
reviewed
May 20, 2026
| /** | ||
| * The subset of field state APIs used by signal forms CSS class configuration. | ||
| * | ||
| * @publicApi 22.0 |
Member
There was a problem hiding this comment.
We're past 22.0 freeze.
This would be 22.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a dedicated @angular/forms/signals/config entrypoint so root-level signal forms configuration can be imported without eagerly pulling in the signal forms runtime.
Close #67909
CC @cexbrayat for the initial work that I used as the base for this PR.
What is the current behavior?
Currently
provideSignalFormsConfigpulls in all Symbols from Signals Forms.What is the new behavior?
Create a secondary entry point
@angular/forms/signals/configto allow tree-shaking and avoid pulling the Signals Forms runtime into the initial bundle.Now
Other
Additionally, I’m not sure whether this would be considered a breaking change (considering Angular 22 has not been officially released yet), or if we should keep the previous entry point and let it coexist with the new one to avoid compatibility issues.
I think it would be better to address this before the release.