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.
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.