Skip to content

refactor(forms): Log a warning when FormGroup keys include a dot.#50642

Closed
JeanMeche wants to merge 1 commit intoangular:mainfrom
JeanMeche:refactor/form-keys-validation
Closed

refactor(forms): Log a warning when FormGroup keys include a dot.#50642
JeanMeche wants to merge 1 commit intoangular:mainfrom
JeanMeche:refactor/form-keys-validation

Conversation

@JeanMeche
Copy link
Member

Due to the dotted synthax to resolve controls, keys in FormGroups cannot include dots.

fixes #50608

PR Type

What kind of change does this PR introduce?

  • Refactoring (no functional changes, no api changes)

Does this PR introduce a breaking change?

  • No

@JeanMeche JeanMeche force-pushed the refactor/form-keys-validation branch 2 times, most recently from c0b2eab to 864d03a Compare June 10, 2023 11:23
@JeanMeche JeanMeche marked this pull request as ready for review June 10, 2023 20:33
@pullapprove pullapprove bot requested a review from AndrewKushnir June 10, 2023 20:34
@JeanMeche JeanMeche force-pushed the refactor/form-keys-validation branch from 864d03a to e3b34b4 Compare June 11, 2023 14:21
@pkozlowski-opensource pkozlowski-opensource added action: review The PR is still awaiting reviews from at least one requested reviewer area: forms labels Jun 12, 2023
@ngbot ngbot bot modified the milestone: Backlog Jun 12, 2023
@AndrewKushnir AndrewKushnir requested a review from dylhunn June 20, 2023 04:00
Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-forms

@dylhunn dylhunn added action: global presubmit The PR is in need of a google3 global presubmit target: minor This PR is targeted for the next minor release and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 20, 2023
@JeanMeche
Copy link
Member Author

@dylhunn This looks ready to merge right ?

@AndrewKushnir AndrewKushnir removed their request for review August 20, 2023 00:18
@dylhunn
Copy link
Contributor

dylhunn commented Oct 10, 2023

@JeanMeche Can you do one more rebase on this? I will run the TGP tonight and if it's clean, we can merge it tomorrow for v17. (If not, I'll bump it from the candidate until we can clean up g3.)

@dylhunn dylhunn modified the milestones: Backlog, v17-candidates Oct 10, 2023
@JeanMeche JeanMeche force-pushed the refactor/form-keys-validation branch from e3b34b4 to f4ef298 Compare October 10, 2023 17:02
@JeanMeche
Copy link
Member Author

@dylhunn Rebase ✅

@dylhunn
Copy link
Contributor

dylhunn commented Oct 11, 2023

Unfortunately, this breaks a lot of tests, around 10 test suites, each with up to several dozen dotted control names. (Why are people doing this?!)

@JeanMeche, how would you feel about warning, instead of erroring?

Alternatively, you could introduce a boolean flag that controls whether we warn or error, and I can create a patch to warn inside of google3 only, and error externally. To do this, just extract a boolean top-level const (something like warnInsteadOfErrorOnDotControlName) and I can target it with a git patch diff.

Due to the dotted synthax to resolve controls, keys in FormGroups cannot include dots.

fixes angular#50608
@JeanMeche JeanMeche force-pushed the refactor/form-keys-validation branch from f4ef298 to 7a0eccd Compare October 17, 2023 16:09
@JeanMeche
Copy link
Member Author

JeanMeche commented Oct 17, 2023

Let's keep it simple and hint on this issue with a warning !

@angular-robot angular-robot bot requested a review from dylhunn October 17, 2023 16:09
@JeanMeche JeanMeche changed the title refactor(forms): Throw error whe FormGroup keys include a dot. refactor(forms): Log a warning when FormGroup keys include a dot. Oct 17, 2023
@dylhunn dylhunn removed the action: global presubmit The PR is in need of a google3 global presubmit label Oct 17, 2023
@dylhunn
Copy link
Contributor

dylhunn commented Oct 17, 2023

caretaker: presubmit is fine. No need for a global, since this is just a warning.

@dylhunn dylhunn added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: rc This PR is targeted for the next release-candidate and removed target: minor This PR is targeted for the next minor release labels Oct 17, 2023
@dylhunn
Copy link
Contributor

dylhunn commented Oct 18, 2023

This PR was merged into the repository by commit 43115da.

dylhunn pushed a commit that referenced this pull request Oct 18, 2023
…50642)

Due to the dotted synthax to resolve controls, keys in FormGroups cannot include dots.

fixes #50608

PR Close #50642
@dylhunn dylhunn closed this in 43115da Oct 18, 2023
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 18, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…ngular#50642)

Due to the dotted synthax to resolve controls, keys in FormGroups cannot include dots.

fixes angular#50608

PR Close angular#50642
@JeanMeche JeanMeche deleted the refactor/form-keys-validation branch February 29, 2024 13:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: forms merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular doesn't recognize ControlNames with a 'Dot' "." in the name on ReactiveForms

4 participants