You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently added a type guard to make payload deserialization safer -- it's written in vanilla javascript which, while certainly fast, is a bit verbose. I explored this a bit in #163.
Joi is a popular and powerful validator, but it is apparently maybe a bit slow. Speed is a major consideration here because of the volume of data that is going to be validated in short time spans.
Ajv is way more used and also, it seems, faster maybe even to the tune of 100x. I get the sense it is less powerful but since we really are just trying to validate at a schema level I think that power would not be needed, and we would value the speed.
All this is to say: I think it would be appropriate for TV Kitchen to add ajv as a dependency and use it to validate all inputs.
The text was updated successfully, but these errors were encountered:
Ajv is a javascript schema validator that we will be using to validate
runtime types and schemas. From what I have learned it is significantly
faster than Joi. It also has some nice pairings with TypeScript which
will make it possible to use it to create type guards[1].
[1] https://ajv.js.org/guide/typescript.html
Issue #166
JavaScript's built in Error doesn't let us pass along more detail about
what exactly went wrong. This custom error allows us to pass that
context along in addition to letting us write more specific tests
Issue #166
This corrects a mistake in the deserialization typeguards related to
decoded Buffer data. It also updates Payload to use the new
ValidationError which exposes more detail about what exactly is going
wrong on a failure.
Issue #166
I recently added a type guard to make payload deserialization safer -- it's written in vanilla javascript which, while certainly fast, is a bit verbose. I explored this a bit in #163.
Joi is a popular and powerful validator, but it is apparently maybe a bit slow. Speed is a major consideration here because of the volume of data that is going to be validated in short time spans.
Ajv is way more used and also, it seems, faster maybe even to the tune of 100x. I get the sense it is less powerful but since we really are just trying to validate at a schema level I think that power would not be needed, and we would value the speed.
All this is to say: I think it would be appropriate for TV Kitchen to add
ajv
as a dependency and use it to validate all inputs.The text was updated successfully, but these errors were encountered: