-
Notifications
You must be signed in to change notification settings - Fork 26.7k
feat(forms): Allow returning plain values from validators #64339
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
Conversation
4043e76 to
4219a37
Compare
c54f6fd to
9820508
Compare
| export type FieldValidationResult<E extends ValidationError = ValidationError> = | ||
| | ValidationSuccess | ||
| | OneOrMany<WithoutField<E>>; | ||
| | OneOrMany<E>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, this type becomes equivalent to ValidationResult so there isn't a need for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, it also makes TreeValidationResult irrelevant since that optionally supports fields, which the error type now does as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I undid this change, now they are different things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as @leonsenft mentioned, can we just remove these now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I droppped FieldValidationResult, TreeValidationResult is different though?
676a5d6 to
c9394d3
Compare
9dcbeee to
0d71d4c
Compare
| export type FieldValidationResult<E extends ValidationError = ValidationError> = | ||
| | ValidationSuccess | ||
| | OneOrMany<WithoutField<E>>; | ||
| | OneOrMany<E>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as @leonsenft mentioned, can we just remove these now?
packages/forms/signals/test/node/api/validators/validation_errors.spec.ts
Show resolved
Hide resolved
edbc533 to
a3be21f
Compare
packages/forms/signals/test/node/api/validators/required.spec.ts
Outdated
Show resolved
Hide resolved
packages/forms/signals/test/node/api/validators/validation_errors.spec.ts
Outdated
Show resolved
Hide resolved
packages/forms/signals/test/node/api/validators/validation_errors.spec.ts
Outdated
Show resolved
Hide resolved
b2f27cb to
3976ab3
Compare
packages/forms/signals/test/node/api/validators/validation_errors.spec.ts
Outdated
Show resolved
Hide resolved
packages/forms/signals/test/node/api/validators/validation_errors.spec.ts
Outdated
Show resolved
Hide resolved
This makes the API nicer to use
This makes the API nicer to use
This makes the API nicer to use
3976ab3 to
a1d99ba
Compare
This makes the API nicer to use
a1d99ba to
7c62043
Compare
mmalerba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
This makes the API nicer