News for hackers. Stuff that matters.
Re:Write PHP Code Within Next.js Components by 0natcer on Thursday November 02, 2023 @06:21PM (#38121131)
i just wanna add here on a serious note that i also see a use cases for "server actions", but i do not primarily write next.js or react so i didn't have an opportunity to try them out yet.

I think it's important to know what you would use them for. I don't think core business logic should be there, but I see why you would use them for f.e. signing something that would require a secret you don't want to have on the client side.

I do however think that it's not a good idea to show the inline code example in a presentation. fortunately none of those examples exist in the documentation. having a seperate file with server actions that can be imported is a good way to handle it i think.

Re:Write PHP Code Within Next.js Components by bottlepalm on Thursday November 02, 2023 @06:32PM (#38121279)
I could take this php example or raw sql code and put it in the body of an API call from the client.

Are API calls bad now? Same thing. A misunderstood example.