I Fixed Next.js Server Actions

preview_player
Показать описание


S/O Ph4seOne for the awesome edit 🙏
Рекомендации по теме
Комментарии
Автор

I think you mean "I awaited" since you had to Promise not to talk about it until later

samuelgunter
Автор

I can't wait to start leaking my secrets with server actions 💪

ofadiman
Автор

I feel like NextJS (and the entire JS ecosystem) has made huge advancements in recent months, and I can't keep up with the pace of learning. I used to consider myself a developer with a strong understanding of TS and NextJS. Despite understanding and getting excited about the new developments, I feel like a junior developer again, like I know less and less every day. Is anyone else experiencing the same thing? Thanks a LOT, Theo!

RandomMcLain
Автор

One of the best explanations on server actions! Thanks Theo

FlorinPop
Автор

Looks nice. Good to see that Next is now also using form actions 😊
Personally I like the cleaner separation in SvelteKit into different files.
This makes leaking private stuff accidentally way harder.

reitznerdomenik
Автор

Never ask a woman her age,
A man his salary,
And Remix what happened to server actions

Dev-Siri
Автор

Useful. Reminds me a lot of getting to grips with SvelteKit's separation of server actions. I appreciate the cleaner file-level separation.

scott
Автор

Doesn't look intuitive at all. I don't like that you can have a use server function inside the component, for me it makes more sense that it has to be defined outside of it or in another file like you did

FranFiori
Автор

im loving this style of videos.
your updates on the tech space are magical

psyferinc.
Автор

Your topic matter and way of describing things is outstanding. Even if over my head sometimes as a consummate noob/intermediate in next.js. Really appreciate the great work.

VincentFulco
Автор

Cool. Thank you for this. Breaking out actions into a separate file is delightfully clean & easy, and provides nice separation as well.

RolandAyala
Автор

Damn this is a really great explanation of the closures issue. I was following and interacting on the twitter thread but I couldn't grasp my mind about why would it matter at all. I now see it's because of these hidden form inputs that are created. 

Thank you so much! you should REALLY make a simple tweet about this, because I had never read about these form inputs in all the Twitter discussions.

Javislaterlp
Автор

I'd love to see trpc/query thing that would just work right out of the gate with async components. How cool would it be to have "useQuery" just like in normal tanstack with all the functionality, but you would be able to "await" it in async component to get the initial value for SSR. Only then I'll really transition from trpc to server components.

haaxor
Автор

You should have more subscribers! This content is so valuable, I've been wrapping my head around server actions and all of these new Next 13.4 stuff. This video really cleared it up for me, thank you!

ayabochman
Автор

When things settle down more can you do another video on when you would use server actions? I definitely see there use in quickly pro typing but not sure how they would scale with a complex project. Traditionally, creating separate api endpoints could be tedious but it allowed separation of concerns and the ability to swap out clients easily

mharley
Автор

This is going to be another react concept with a million gotchas and your doing it wrong. Expect many articles and videos explaining how to properly use it and core members constantly trying to help devs think the react way.

justpatrick_
Автор

Is it stil reactQuery for loading dynamic data on client? If so how would i make that typesafe until trpc "works" with next 13

TheAriznPremium
Автор

in search of simplicity things are getting unbearably complicated..

LuKaSSthEBosS
Автор

The React and Next teams need to be careful with this level of colocation. they might inadvertently open up the worst kinds of footguns where novice devs can easily embed secrets in components without meaning to. Even theo had to reconsider his mental model of what code is executed where.

johnmcparland
Автор

When you submit a form with a file input how do you grab the file in the FormData when using actions? All of their examples are simple forms and not ones that contain files. Since it shoved all the form info in the FormData for you, how do you access the file, since usually it’s e.target.files[0] if you were doing it normally. But now you would say FormData.get(“input name”)

FourLeafGroverRL