Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forms): Make reactive form directives standalone #55321

Closed
wants to merge 1 commit into from

Conversation

jermowery
Copy link
Contributor

@jermowery jermowery commented Apr 12, 2024

Add standalone: true to the reactive forms directives

BREAKING CHANGE: Breaks any people declaring these directives (like in tests)

Users will need to move these directives from declarations to imports in their tests if they are broken

Fixes #55320

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Reactive forms components are not standalone

Issue Number: #55320

What is the new behavior?

The components are standalone

Does this PR introduce a breaking change?

  • Yes
  • No

Code which declares the reactive forms directives will break because the components are now standalone.
Users will need to switch from declaring these directives to importing them.

Other information

@pullapprove pullapprove bot requested a review from dylhunn April 12, 2024 18:10
@angular-robot angular-robot bot added the detected: breaking change PR contains a commit with a breaking change label Apr 12, 2024
Add `standalone: true` to the reactive forms directives

BREAKING CHANGE: Breaks any people declaring these directives (like in tests)

Users will need to move these directives from declarations to imports in their tests if they are broken

Fixes angular#55320
@JeanMeche
Copy link
Member

JeanMeche commented Apr 12, 2024

Hi, I'm going to copy @dylhunn's answer from #48616

We are generally concerned about making forms directives standalone, because it could break the package in surprising ways. Consider that many accessor implementations (e.g. NumberValueAccessor) work without ever being explicitly imported. So if we allow people to use forms without importing the entire module, required imports might be silently missing under the hood.

For this reason, this feature cannot land without a major redesign of the forms.

Thanks for your contributions anyway, any suggestion is welcome.

@JeanMeche JeanMeche closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detected: breaking change PR contains a commit with a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reactive forms directives should be standalone
2 participants