dax@thdxr
ok time’s up
here’s the deal with server actions
if you’re excited about them you’re wrong
if you’re mad about them you’re wrong
let’s do this
unfortunately @t3dotgg was right - the key thing the haters are misunderstanding is that NextJS is a backend framework
in your head think about it like express or any other http server - you wouldn’t be surprised if you could return html and do a database call right next to it
except it’s a better express because it lets you build all kinds of complex interactive clients via React
fundamentally there’s nothing wrong with this - you’ve been doing it forever in every other language, just never with this kind of focus on the frontend bits
but sorry nextjs fans you’re wrong too for dismissing people’s worries about “separation of concerns”
the only real job you have as a programmer is encapsulation - figuring out what details to hide and what to expose
and because this is your one job, of course you’re all terrible at it
forcing a hand rolled API layer at least guaranteed some level of thought and blast zone for refactoring
with that gone, doing the wrong thing just got a lot easier
it’s why in past generations, the frameworks had some encapsulation ideas built in (to varying degrees of being useful)
all the acronyms, MVC, MVVM, DDD yes can be overkill but the root ideas exist for a reason
asp.net had these ideas baked in, elixir’s phoenix has a tutorial about bounded contexts right at the beginning, PHP only got lambos once Laravel nudged you into a stricter structure
are they perfect? no. but they’re a hell of a lot better than whatever you’re about to come up with given that NextJS has no philosophy on this problem at all
so a lot of you are about to repeat all the same mistakes we’ve seen a generation ago if you don’t slow down