@sashko , would it be helpful to have a package that would throw console warning errors when a template does not have the data it expects? (like React) For example something like this:
/* global Types */ // package
propTypes(someData, {
name: Types.string.isOptional,
baz: Types.string.isRequired,
})
and under the covers it could do something like this:
function propTypes(data, propTypes) {
if (__DEV__) {
// validate with Match.test
} else {
// noop
}
}
I can see it being super helpful for documentation and validating code but I imagine that most Blaze users won’t like the extra code and ‘work’?
It would be really cool if it was easy to declaratively set this up with the template like this:
Template.Post.propTypes({
name: Types.string.isRequired,
desc: Types.string.isOptional,
})