by no_wizard · 4y ago · 0 comments
One note though, I want to point out, that I am able to "break" some of the demo components, like changing type="number" doesn't seem to error the form when I input text over it.
In case one of the other maintainers sees this, I have one other question:
Does this in any way use `eval`? I know a lot of JSON schema validators do, and that is a pain when it comes to CSP. If Formkit doesn't use eval (and maybe we can get a commitment on that...) its a no brainer
As far as I can tell, my go-to schema system doesn’t. https://github.com/colinhacks/zod
Quite a lot of schema validators use `ajv` under the hood. Some, like I believe `yup`, `zod` and `superstruct` do not. I'm not sure why one approach is more advantageous than another, to be honest. I'd think eval would also be a performance issue.
[0]: https://ajv.js.org/security.html#content-security-policy
The schema parser is custom-written and does not make use of `eval`.