Ensure a dependency exists when checking for errors and validity#434
Ensure a dependency exists when checking for errors and validity#434znewsham wants to merge 1 commit intolongshotlabs:mainfrom
Conversation
|
I don't think the Meteor tests run on GitHub, and since this is a Meteor thing, I'll have to confirm this in the Meteor app. It should be possible to add tests for it in It seems like the most elegant solution would be to have validation bubble up and down so that every schema involved is aware of what the current state is, and is reactive to it. |
|
I'm really nervous about bubbling - autoform (where I mostly use schema + tracker) is already a little over-reactive. The change in this PR ensures that whatever the "base" schema is (in use by autoform) will track all dependencies within that form - as validation is performed on the validation context attached to the base schema. If the concern is that field I'll look into adding meteor tests at some point when I have time, but tbh, I've pretty much made the decision to maintain my own local version of simpl-schema now, as a lot of the changes I want, need to be made to the core simpl-schema code, but don't necessarily make sense to everyone else. |
Fixes #359
_ensureKeyDepthat will add a dependency ifTrackeris provided to the schema and no dependency exists._ensureKeyDepfromkeyIsInvalidandkeyErrorMessageAll tests are passing