#ow, my validation...
60 messages · Page 1 of 1 (latest)
I don't think anything concrete was discussed per say?
what are ur ideas about my pr with joi?
I think ow has to be replaced regardless but maybe you have some other lib in mind
I am not gonna say "use this over x bc I said so" or deny your PR because I usually stick with ow. I haven't had much time to see other options or stick with joi 
If the libs small in size, doesn't bring in dependencies, and whatnot, then it's probs good, but I'd need the thoughts of the other maintainers before saying anything concrete
ow has 7 dependencies (incl. sub deps), joi has 5
not sure about size
zod, the other dependency there, is not dependent on anything
yep that's also true but no one really has done any work to support it
What do you mean?
it takes time to replace ow; took me about 2 hours to get tests passing
someone has to do that work
Well that's not relevant, the right package should be
It seems ow is the least in size, followed by zod then joi, but zod and joi are very close together being 513 kB and 516 kB (unpacked)
I doubt size matters with ow since it just doesn't work at all with esm
a bunch of people have had issues with it
well now it only works with esm so we're either way in a predicament
oh that pr got merged?
You need to account total install size
Yep, latest ow is now esm only, so now we'd alienate cjs users..
I respect Sindres push for esm adoption but jfc
huh, I was expecting that pr to sit for a few months lol
Oh huh this seems useful
https://bundlephobia.com/package/zod@3.11.6
https://bundlephobia.com/package/joi@17.4.2
I think my pr can get merged and its hopefully semver minor and then another package can replace it after?
Sure, I guess, up to Vlad
I agree that zod is a good choice but joi is better for a quick patch
all tests passed without changes so it should be a minor change
unless people do stuff with the errors i guess
i've had to move away from builders in my own bot because even importing the text modifiers (bold, for example) would throw errors
actually on windows i could import them but on ubuntu it would throw errors
That makes no sense...same node versions and package versions?
it definitely doesn't 😦 and I doubt I could replicate the issue again
Considering sindres aggressive push for esm..not surprising
I'm willing to do a Zod rewrite tonight or tomorrow if the main reason joi is gonna be used is cuz the pr already exists
there's not really a reason for joi to be merged only to be rewritten with another package in the near future
does zod have a way to whitelist certain values? looking at the docs i can't find anything
wdym whitelist? Like the equivalent of oneOf in ow?
yeah, exactly
yeah enums
that is very unintuitive i gotta say, but it works
should just be z.enum([1, 2]).parse(value)
doesn't work with ts - it's expecting a string
oh u gotta use nativeEnum for numbers
wow this api is horrible and nativeEnum doesn't work either
i'll leave it to you i guess
I'll test it when I get access to a computer again
There's also this: https://github.com/discordjs/builders/issues/12
heres my zod rewrite https://github.com/Khasms/builders/commit/2b3f8dce9df555cbdcf55e51bad37e82b89b1b98

@stiff horizon do u want to like pr this
yeah i can pr it, i was just waiting to see the status of the existing joi pr
we do not want to move forward with joi
hence me asking
alr its up
Would it be okay for me to PR superstruct?
@brisk ether
We already have Zod iirc
Yeah zod got merged
I guess we can archive this thread