I like how you not only explain the needy-greedy, but also create this friendly atmosphere. I don't even feel like I'm studying, more like speaking to a good friend. I also really enjoy UI design solutions like in courses, simple, but tasteful
i was confused about this as well, but you don't necessarily need to mark a component async for it to be a server component. It will be a server component by default unless marked client. Marking it async is only needed if you're gonna use await within it.
I’ve heard/read people suggesting not to use server actions for fetching data(GET), but instead use it to mutate the data. What’s your thought on this?
I guess the only thing would be that it makes a Post request instead of a GET.. that’s pretty much it as far as I know… you could just do a fetch directly in the server component if not
no need to import images from public folder, if the image is under the /public folder directly you can just type the name of the image and its extension. src="img.jpg" if it's under subfolder in public let's assume it's /media folder src="media/img.jpg" you need import only if the image isn't in public holder. --- Thanks for the amazing tutorial.
It's safe to include public API endpoints with NEXT_PUBLIC if they are meant to be publicly accessible and don't require any form of authentication or sensitive data.
Suppose we have a table in a Next JS page and the table has a filter (client) component with interactivity. When we hit Apply, how do we pass the filter values from the client child to the server parent component. (The parent fetches the data and renders the table). I can see many suggestions to pass the data as params or queryParams using revalidate or nav methods of next. That works fine for a simple values like ID or search params. For example, if it is not just an ID but an object (advanced filter similar to the one in Amazon), should we just pass the entire object via the query params and make the URL bloated with so many values or are there any alternate way to communicate from client child (filter) to server parent component (where data is fetched) ??
Good video. Your server actions example is unfortunate though. Sorry for calling it out: Server actions are for mutating data not for getting data. By making your getJoke a Server action you basically did create a route handler for it under the hood. So the exact thing you rightfully said to avoid one step before. In your example you could've just left out the "use server" in the top, to not make it a server action but a simpe reuseable async function.
Server actions are much simpler to use. I do use server action for GET, POST whatever. If it works then why not? My whole E-commerce project is built on server action. I see no performance issue or anything.
Whoops that was my bad! Absolutely! I do recommend directly fetching in server components. Should’ve made it a bit clearer that when you use a server action it also explicitly creates a POST instead of GET. Thanks I’ll talk about it in a future video 👍
I used to watch this channel. I wish I stuck with coding. But once I got the job after self teaching nearly everyday, I just felt overwhelmed by it all. Now I still work a shitty retail job and at 34 years old, I'm bloody ancient.
Copy pasted from my other comment: I'm not sure exactly how this works but my take on this is that a package like plaiceholder will fetch the image on the server and doing so results in consistent image loading times because it doesn't rely on the users internet or device speed to load it. Then, when the user loads the page, it displays that blurData instantly due to the small size while the full res image loads in the background. So I believe maybe just maybe if your download speeds are fast, it would be better without blurring, but this helps to keep it fast and consistent across all devices and internet speeds for all users.
Great video! How did you enable "Intellisense" to see all the exports from a file when doing the import statement: import { _click-here-and-reveal_ } from "/path" ?
using actions for data fetching is wrong and an antipattern. A server action is just a remote procedure call, meaning that you basically call an api endpoint. what you suggested makes you do exactly what you were trying to avoid :)
I'm not sure exactly how this works but my take on this is that a package like plaiceholder will fetch the image on the server and doing so results in consistent image loading times because it doesn't rely on the users internet or device speed to load it. Then, when the user loads the page, it displays that blurData instantly due to the small size while the full res image loads in the background. So I believe maybe just maybe if your download speeds are fast, it would be better without blurring, but this helps to keep it fast and consistent across all devices and internet speeds for all users.
Thank you for the video! I just didn't understand the difference between fetching data in API routes or in server actions. I am always using server actions but is there any benefits using API routes to fetch outer data?
Server actions will always create a POST, that’s one of the cons and also you can’t fetch server actions in parallel, I need to make another video about this tbh 😅
@@developedbyed yes I would be so happy! Thank you. 🙏🏻 I also have big problems with revalidate and even in GitHub issues too many problems about that. Video could be great. When I use revalidateTag, caches in the exact page deletes and refetch. But if I change the page, still old data is shown everywhere. It's not the expected usa case I believe.
@@developedbyed Thank you so much. I will be waiting for the video. 😅 Also, I am having big problems with revalidateTag. Even in GitHub Issues tons of posts about it but not solution. When we use revalidateTag, it deletes the cached data and refetch it in the exact page only. When you change the page which has the same data (website name for example), there is still the old data. It mustn't work that way I believe. Video would be great about revalidate in general either. 🙏
I like how you not only explain the needy-greedy, but also create this friendly atmosphere. I don't even feel like I'm studying, more like speaking to a good friend. I also really enjoy UI design solutions like in courses, simple, but tasteful
I feel the same. He’s a great presenter. Very friendly vibe
nitty gritty bro :) not needy greedy haha
i was confused about this as well, but you don't necessarily need to mark a component async for it to be a server component. It will be a server component by default unless marked client. Marking it async is only needed if you're gonna use await within it.
I love your mood, it cheered me up since the start, thanks!
this is the only channel that doesn't make me bored 🤓
The camera stare after "blue balls" 😂😂😂
I’ve heard/read people suggesting not to use server actions for fetching data(GET), but instead use it to mutate the data. What’s your thought on this?
I guess the only thing would be that it makes a Post request instead of a GET.. that’s pretty much it as far as I know… you could just do a fetch directly in the server component if not
‘use hybrid’ will be amazing
THAT WAS AWESOME!!!! You LITERALLY solved all my troubles😅🥰🥰
What is the difference of using in header and body?
no need to import images from public folder, if the image is under the /public folder directly you can just type the name of the image and its extension.
src="img.jpg"
if it's under subfolder in public let's assume it's /media folder
src="media/img.jpg"
you need import only if the image isn't in public holder.
---
Thanks for the amazing tutorial.
Hi Ed, legend video as always!
Helpful. Thank you very much.
It's safe to include public API endpoints with NEXT_PUBLIC if they are meant to be publicly accessible and don't require any form of authentication or sensitive data.
well yeah obviously....
0:40 did my hair just grow back? 🤣
Top-notch planning there
what would i do for tokens? would i handle that in the route handler when i need the cookies?
Suppose we have a table in a Next JS page and the table has a filter (client) component with interactivity. When we hit Apply, how do we pass the filter values from the client child to the server parent component. (The parent fetches the data and renders the table). I can see many suggestions to pass the data as params or queryParams using revalidate or nav methods of next. That works fine for a simple values like ID or search params. For example, if it is not just an ID but an object (advanced filter similar to the one in Amazon), should we just pass the entire object via the query params and make the URL bloated with so many values or are there any alternate way to communicate from client child (filter) to server parent component (where data is fetched) ??
Good video. Your server actions example is unfortunate though. Sorry for calling it out: Server actions are for mutating data not for getting data. By making your getJoke a Server action you basically did create a route handler for it under the hood. So the exact thing you rightfully said to avoid one step before. In your example you could've just left out the "use server" in the top, to not make it a server action but a simpe reuseable async function.
Server actions are much simpler to use. I do use server action for GET, POST whatever. If it works then why not? My whole E-commerce project is built on server action. I see no performance issue or anything.
Whoops that was my bad! Absolutely! I do recommend directly fetching in server components. Should’ve made it a bit clearer that when you use a server action it also explicitly creates a POST instead of GET. Thanks I’ll talk about it in a future video 👍
Please will Nextjs still cache the data without "use server" at the top?
@nvsWhocares @developedbyed
Wooww really cool tips! Thanks 🙏
I used to watch this channel. I wish I stuck with coding. But once I got the job after self teaching nearly everyday, I just felt overwhelmed by it all. Now I still work a shitty retail job and at 34 years old, I'm bloody ancient.
I just turned 50. I’ve been a web developer for 20+ years and I never get bored. I learn something new everyday. It’s not too late to jump back in.
Really helpful
Thanks!
No worries!
as I know next js is using server by default so we don't need to type 'use server'
Shoutout the the guy that called me a hobo in the comments! Cut a fresh cut boyyy
I looked for hobo comment but I can't find it and now I'm disappointed
What does hobo mean?
@@mDHARYLa term for a homeless person
lol
but do blurred image make any sense if the remote image must be loaded for blurring?
Copy pasted from my other comment:
I'm not sure exactly how this works but my take on this is that a package like plaiceholder will fetch the image on the server and doing so results in consistent image loading times because it doesn't rely on the users internet or device speed to load it. Then, when the user loads the page, it displays that blurData instantly due to the small size while the full res image loads in the background. So I believe maybe just maybe if your download speeds are fast, it would be better without blurring, but this helps to keep it fast and consistent across all devices and internet speeds for all users.
@@ExileEditing Got it. thank you for explaining.
Great video! How did you enable "Intellisense" to see all the exports from a file when doing the import statement: import { _click-here-and-reveal_ } from "/path" ?
using actions for data fetching is wrong and an antipattern. A server action is just a remote procedure call, meaning that you basically call an api endpoint. what you suggested makes you do exactly what you were trying to avoid :)
To anyone experiencing hydration errors using next themes , the trick is to put it under the body not above, took me a minute.
Nice one dude! What are you using for auto suggestion code?
I'm on and off on github copilot hahaha
@@developedbyed haha is that free?
What's the point of blurring a remote image like that? Is that actually making the blur any faster than displaying the image would do?
I'm not sure exactly how this works but my take on this is that a package like plaiceholder will fetch the image on the server and doing so results in consistent image loading times because it doesn't rely on the users internet or device speed to load it. Then, when the user loads the page, it displays that blurData instantly due to the small size while the full res image loads in the background. So I believe maybe just maybe if your download speeds are fast, it would be better without blurring, but this helps to keep it fast and consistent across all devices and internet speeds for all users.
At 15:28, what's the extension that shows you the import size? Thank you for the tips in this video.
import cost
Hi there, plaiceholder is archived now.
What would your advised way be to get a placeholder blurred image for remote images?
Thank you for the video! I just didn't understand the difference between fetching data in API routes or in server actions. I am always using server actions but is there any benefits using API routes to fetch outer data?
Server actions will always create a POST, that’s one of the cons and also you can’t fetch server actions in parallel, I need to make another video about this tbh 😅
@@developedbyed yes I would be so happy! Thank you. 🙏🏻
I also have big problems with revalidate and even in GitHub issues too many problems about that. Video could be great.
When I use revalidateTag, caches in the exact page deletes and refetch. But if I change the page, still old data is shown everywhere. It's not the expected usa case I believe.
@@developedbyed Thank you so much. I will be waiting for the video. 😅
Also, I am having big problems with revalidateTag. Even in GitHub Issues tons of posts about it but not solution. When we use revalidateTag, it deletes the cached data and refetch it in the exact page only. When you change the page which has the same data (website name for example), there is still the old data. It mustn't work that way I believe. Video would be great about revalidate in general either. 🙏
What is the name of the theme? I like it very much
THank you so much
I like your font , what's this ?
8:27 legend
Great video but your hat was missing! But I'm still struggling with the next js font
Are you related to Jeff at CraftComputing? The resemblance is uncanny.
You got nice hints, it was some plugin? I
Best content
Hey your Javascript "Full Course Download" link is broken. 😢😢😢😢
Thanks baby reindeer
sent from iphon
cool Thumbnail
I came for the 5 tips and stayed for the blue balls.
Any discounts for the course it's priced way too high for my buget
I like your cut g
ayyy thanks
11:00 this
So you knew that you are going to have a haircut beforehand? :D
cool
perhaps sir, i think the video will be better if you use the better mic🙏🙏
@developedbyed If you were referring to me, I am a woman. But thank you for indeed cutting that hair.
nice haircut!
First comment 4 my legend ❤
waddup pewds
Make sure you are looking after your health man. Make sure you are eating enough.
npm run dev ed
this dude is on acid
where is ur first channel?