←back to thread

Zod v4 Beta

(v4.zod.dev)
175 points mycroft_4221 | 8 comments | | HN request time: 0.398s | source | bottom
1. Rodeoclash ◴[] No.43668391[source]
We stuck with Yup and ignored Joi, Zod and god knows what else has come down the pipeline since. Rather than wasting time upgrading, we've instead built useful features.

That said, we are slowly phasing out our React frontend for one of our apps page by page and replacing it with what we use over the rest of apps: Phoenix + Liveview. The changeset system for validations has proven itself time and time again to both be fast but also to handle many of the curly validation problems we might have. It also has barely changed since its release.

If you have a disciplined frontend team then you might be able to make it work. They have to be able to ignore the latest shiny thing that has come along, but if you don't then you'll have a team that is busy constantly upgrading to the latest shiny library rather than getting anything done.

replies(4): >>43668752 #>>43670083 #>>43670124 #>>43670933 #
2. atonse ◴[] No.43668752[source]
We’ve been using LiveView for years now and I still really miss the ergonomics that you get with typescript.

A lot of that is going away with better LSP support and better LLM suggestions.

But elixir and LiveView are generally great (I LOVE ecto), but building component frameworks and component communication still feels a bit janky.

replies(3): >>43669178 #>>43670058 #>>43670939 #
3. jms55 ◴[] No.43669178[source]
I've used LiveView a little in the past, and besides the lack of static typing (at the time, I think Elixir has gotten some type annotations since), I really liked it and found it easy to work with.

Ecto though, I could never figure out how to use. If I could just make SQL queries in an ORM-style I would understand it, but the repositories and auto generated relations and such I couldn't figure out. Do you have any good resources for learning ecto? I didn't find the official docs helpful.

4. mike1o1 ◴[] No.43670058[source]
I love using Elixir on the backend, and I tried really, really hard to get LiveView, but it was just too hard of a paradigm shift for me to manage more complex state, plus too hard to walk away from my productivity with React. For example, something as simple as having inline edit on a list of widgets is super easy in React, but I found it _very_ challenging to do with LiveView, as you try and implement more features such as only editing one item at a time, etc.

I've actually found a bit of a resurgence in productivity with React on the front-end and Elixir/Absinthe/Ash Framework on the backend. With GraphQL I get fully typed queries, and Ash Framework on the Elixir side helps a ton with removing the boiler plate of code required for GraphQL, since Ash (mostly) generates the schema for me. A bit of a learning curve with Ash, but now that it's clicked, I feel more productive than I did with just Ecto/Contexts/LiveView.

https://www.ash-hq.org - there's a recent PragProg book on it that really helped it click for me.

5. robertoandred ◴[] No.43670083[source]
So I guess your team is busy upgrading to the latest shiny Phoenix + Liveview version rather than getting anything done?
6. chrisweekly ◴[] No.43670124[source]
> "a team that is busy constantly upgrading to the latest shiny library rather than getting anything done"

Your disdain for resume-driven development is fair enough, but it's not like there's a binary choice between Phoenix/LiveView and spinning your wheels chasing the new shiny.

7. user777777 ◴[] No.43670933[source]
What’s the app? Would you mind sharing ?
8. user777777 ◴[] No.43670939[source]
That sad truth is the best apps with modern frontend quality are just flurry of bad code dirty typescript and react