marilari88 / zod-playground

Play with Zod schema validation
https://zod-playground.vercel.app
MIT License
31 stars 1 forks source link

✨ Make the app data sharable #30

Closed marilari88 closed 3 months ago

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zod-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 10:10am
marilari88 commented 3 months ago

20

marilari88 commented 3 months ago

@giacomocerquone I cannot add you as reviewer unless i assign you collaborator role. Tell me if it is ok for you

giacomocerquone commented 3 months ago

@giacomocerquone I cannot add you as reviewer unless i assign you collaborator role. Tell me if it is ok for you

yeah sure, go ahead, no problem! If that's OK for you, I'm going to review this properly today or tomorrow morning

giacomocerquone commented 3 months ago

I've recorded a better video and deleted the old one, just make sure to check it out! @marilari88

marilari88 commented 3 months ago

Totally agree with you. We should let user to share also invalid schema. Thank you for the video with the repro, I'll check the bug soon as I can

marilari88 commented 3 months ago

Really great work.

I've noticed that when I have an invalid zod schema, and I edit a value, if I click the share button, it seems to be working, but when navigating to the crafted URL, I find the old value there. The number of ValueEditors instead are correctly shared.

https://www.loom.com/share/59dfea5c4c234f11b6f426ea330867d1?sid=cf48f408-f10e-4ee3-965f-1b73998e720d

Up to you on how to handle this you either allow sharing invalid schema (which is what it should be, imagine a guy that doesn't know how to correctly work with zod and wants some help) or you explicitly warn the users that broken zod schema can't be shared.

I just pushed a fix for this issue. I know the code is ugly but it will be removed in the next PR about state refactoring

giacomocerquone commented 3 months ago

Great work. Was waiting for this PR to better shape the data so to implement persistence between sessions