Content
@
0 reply
0 recast
0 reaction
Samuel ツ
@samuellhuber.eth
use server directive is an antipattern and we should properly declare and use API endpoints. Change my mind
8 replies
0 recast
3 reactions
flick the dev 🎩📦
@flick
imho only if you intend other applications to build on the api, otherwise this is just faster dev real apis are hard
1 reply
0 recast
0 reaction
Samuel ツ
@samuellhuber.eth
replace other people with other apps and we good. if anyone in your code that isn't fully versed looks at it it will be confusing. server actions under the hood build a "API" and the step from server action to have it be a proper route setup isn't much of a lift especially in the day and age of AI copilots doing the scaffolding for you. The benefit it gives you though is a clear labeling of where what is running while lookign at the code
1 reply
0 recast
1 reaction
flick the dev 🎩📦
@flick
while not usually a fan of tech magic myself, react server components have been a great tool for me to make faster webpages. the generated API is straight forward to reason with, it's just the component props, serialized as the input. the return is not intended for re-use, like an ajax model.
0 reply
0 recast
1 reaction