Post

This element should be in everyone's toolkit – I've built a few of these in the past. FWIW, my approach was for the HTML attribute to accept a JSON object then to serialize the form to JSON using `FormData()` and see if the two intersect.

I do like this because of the fact it takes an expression as a parameter, worries me that eventually you'll end up writing an expression interpreter to handle brackets, && etc.

Like it would be better to wrap dynamic parts of a form in specific custom WC. Eg <myapp-form-address> implements any logic inside, showing/hiding child elements, postcode-lookup/select-all-checkbox-options type scenarios.

That's the great thing about web components: you can build whatever you need. If this is useful for you, great! If it becomes a sub-component of a larger component that's for for your purpose, wonderful! If it's a springboard to building something else, fantastic!