Scott Trinh
Scott Trinh
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
Zone.js doesn't work with async/await. That's why angular uses a babel plugin to transform async/await into generator functions.
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
😱
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
I feel like there are more fundamental things in the Zod codebase that would break at that point 😅
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
To be fair, I sincerely hope no one has to polyfill Promise in the year 2024!
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
PRs welcome, especially with a repro test case!
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
Well, React seems relatively well-behaved here: https://codesandbox.io/p/sandbox/lxgljx
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
(exact code in the React/Vite context)
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
Can you share some of the exact code you're testing here? You're not going through a form library or anything like that, right?
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
🤯
27 replies
ZZod
Created by Dawson on 12/18/2024 in #questions
Dawson - Can someone sanity check this for me? ...
Hmmm... I cannot repro locally with:
async function main() {
const schema = z.string().refine(async () => false);
const result = await schema.safeParseAsync("boop");
console.log(result);
}

main()
async function main() {
const schema = z.string().refine(async () => false);
const result = await schema.safeParseAsync("boop");
console.log(result);
}

main()
It logs { success: false, error: [Getter] }
27 replies