News for hackers. Stuff that matters.
Re:Next.js 13.4 by Escapado on Thursday May 04, 2023 @12:45PM (#35818346)
Really hyped about this! I can't wait to try it out and watching the CI build as we speak. I am curious however about a few points. From their examples in the blog post it's not clear what kind of payloads can be transfered when using server actions. Do they need to be serializable in a specific way? Can I transfer dates? Can they return something (in case I want to validate a form on the server and return an error or a success code)? How does it figure out that the db import will not be bundled into the client? Because it is only used in the function with the "use server" directive? And finally: Can I call "use server" functions in a client component too? In case I want some extra state in there?

Maybe there is someone here who knows more!

Re:Next.js 13.4 by sionarancsle on Thursday May 04, 2023 @01:52PM (#35819450)
They are just POST requests to an under-the-hood generated API endpoint.. I don't understand the use-case of these. Makes form validation and basically any type of reactivity bad.