-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Argument Validation Primitives #694
base: master
Are you sure you want to change the base?
Conversation
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.
This is a wonderful, well written RFC. Surely seems like the right direction.
lazy, and so we cannot know the values until they are used. | ||
|
||
While `validateArgs` will be autotracked on its own, it will not be _consumed_ | ||
by the external tracking contexts. This prevents it from impacting the tracking |
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.
it will not be consumed by the external tracking contexts
How is this guaranteed?
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.
We have the ability to disable autotracking contexts internally, and use it for various reasons (such as backwards compatibility). We have not exposed this capability, and generally don't think we will do so as in most cases it doesn't make sense, but I think here since this is a DEBUG only feature it may make sense. It does mean that validations may not rerun when you think they would, but it also prevents behavior from diverging too much in production.
This method is only run in development builds, and is inert in production | ||
builds. | ||
|
||
### `setValidateArgs` documentation |
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 really like this. Similar to composing validations on changesets.
Is there still interest in moving this forward? |
Big thanks to @snewcomer and @rwjblue for helping with the initial design!
Rendered