The blazing fast emoji todo list
10:43
How I'm Writing CSS in 2024
12:59
8 ай бұрын
Introduction to Next.js and React
1:21:38
My thoughts on Bun
5:33
Жыл бұрын
Are React client components bad?
4:21
Using Serverless Redis with Next.js
9:33
Пікірлер
@GUY-i4w
@GUY-i4w 2 күн бұрын
next js + docker + ssl certificate (self hosting)
@ethan2130
@ethan2130 4 күн бұрын
how about the front-end form validation before submitting to the server action? Or just rely on the HTML attribute? and the server action catch block's return error message?
@kerrykreiter445
@kerrykreiter445 6 күн бұрын
Thanks so much for the great content. I’m a vanilla web dev hobbyist wanting to level up and your channel is a God send!! I found your chan from an interview you did and I struck gold!!
@sinamalakzadeh4843
@sinamalakzadeh4843 7 күн бұрын
how to reset the input ??
@aiamfree
@aiamfree 10 күн бұрын
as soon as I saw the shirt i knew he was going to mention tailwind lol
@longhuynh8277
@longhuynh8277 10 күн бұрын
would be great if there is an example with service worker.
@erandasoori
@erandasoori 10 күн бұрын
This video is amazing! Also, yes please do more long form tutorials! Thank you so much! 🙏
@justincooper5024
@justincooper5024 11 күн бұрын
This is an excellent video, thank you for creating it! Explanations were clear and struck just the right balance of detail without going too far into any particular weeds.
@mybusinesstracker-jobinvoi8213
@mybusinesstracker-jobinvoi8213 14 күн бұрын
Thank You Leerob for mentioning PWA, I am building a Web App and would love a follow up video based around offline support as we need to store basic information just in case mobile signal is unavailable. We are in the UK with good mobile signal but the industry we are in all use traditional App and we want to change things up obviously to reduce Dev costs.
@rtoronto7637
@rtoronto7637 14 күн бұрын
Why is email 'null'? Shouldn't the email that was typed in be displayed under the form?
@visheshmangla8220
@visheshmangla8220 14 күн бұрын
How to add middleware headers to this? Like in case of login form, in middleware.tsx I m fetching the csrftoken from my django rest api. I can check the cookies in action but that's double work.
@1weiho
@1weiho 14 күн бұрын
OMG Welcome to light mode MacOS Lee 🩵
@nardove
@nardove 15 күн бұрын
Thanks! for the tutorial, just a small note for those that wonder why the email value is always null, simply add name='email' to the input field
@cachipum
@cachipum 16 күн бұрын
Flexing ghostty private beta, nice one!!! How does it work so far? it seems to be quite performant.
@bermarvillarazo8507
@bermarvillarazo8507 17 күн бұрын
You look like eminem hehe
@TheKamieniu
@TheKamieniu 17 күн бұрын
Hey! Is it possible to get source code? Are you using next-pwa?
@j2isndhu
@j2isndhu 17 күн бұрын
This is super powerful, I implemented based on your example. I found that now react is using useActionState instead of useFormState, that’s a nicer description of what that hook does. In practice I found myself trying to make the optimistic state the exact structure of the data returned from Shopify, so then when rendering things you can follow one structure and reduce conditionals. Man I love this hook though everything feels very fast
@gerkim3046
@gerkim3046 17 күн бұрын
I don't think it is necessary to make localhost run on https, localhost is treated in a special way by most browsers
@mediocreTyler
@mediocreTyler 17 күн бұрын
giga-brain lee 😎
@carlosduran5460
@carlosduran5460 17 күн бұрын
Long live to PWA!
@christianvillamin362
@christianvillamin362 17 күн бұрын
Cool! Are you using a neovim distro? Looks like lazyvim.
@juanariza8927
@juanariza8927 17 күн бұрын
Hi Lee, have you thought about sharing your repo?
@leerob
@leerob 17 күн бұрын
Hey! I will be sharing the code for this with updated docs shortly.
@gradientO
@gradientO 17 күн бұрын
Repo for neovim DOTFILES? ​@@leerob
@nikako1889
@nikako1889 17 күн бұрын
can we use Zustand instead of useContext?
@haithammohasin1205
@haithammohasin1205 18 күн бұрын
What is the name of his vs code theme ‏‪1:45‬‏
@hydry0m631
@hydry0m631 5 күн бұрын
Same question
@botyironcastle
@botyironcastle 18 күн бұрын
just use angular it doesnt suck
@NoahArk-x5g
@NoahArk-x5g 19 күн бұрын
May I ask where is the db connection
@leerob
@leerob 19 күн бұрын
I'm using Neon Postgres in this video, which can connect over HTTP or though a direct connection
@salmenbejaoui1696
@salmenbejaoui1696 21 күн бұрын
The website I'm working on uses Akamai as the first cache layer to cache the HTML response. In this case, the login mechanism must be handled client-side to avoid security issues and data leaks right? Does this prevent me from managing the session server-side?
@teslimbello645
@teslimbello645 22 күн бұрын
what extension is helping with the predictive text?
@SumonaYesnin-y3y
@SumonaYesnin-y3y 22 күн бұрын
Garcia Frank Davis Jose Rodriguez Anthony
@kelvindimson
@kelvindimson 26 күн бұрын
Great showcase as usual, but how many ads does this video have 😂😂😂? .... anytime you touch the time scroll? ad, pause and play? ad, fast forward or rewind? ad. ... always 2 ads back to back 🤣🤣🤣🤣🤣, Thanks for the breakdown
@magnusred2945
@magnusred2945 26 күн бұрын
Lee you truly have a good soul
@srenhyer3895
@srenhyer3895 26 күн бұрын
@leerob you do realize It's not possible to debounce the increments using useOptimistic, so it's actually a terrible solution for incrementing the quantity... luckily it's not hard to do this manually with usestate and roll back on error.
@leerob
@leerob 26 күн бұрын
I'm aware - you don't want to debounce mutations. If you want to ensure they are fired.
@srenhyer3895
@srenhyer3895 26 күн бұрын
@@leerob Hmm at least for us, we're building a very high traffic webshop, so we can't accept 50 requests to the server if the user clicks 50 times repeatedly quickly after each other (or holds the mouse button in) on that + or - button, if the 49 of those are excess. Sure if there's an error during the 50 clicks the quantity will be rolled back to before all clicks, instead of eg. click 37 where the error might have occured, but that is imo a small price to pay as opposed to the tradeoff in performance of using useOptimistic that is simply way too expensive.
@dawidwraga
@dawidwraga 26 күн бұрын
I've tried to implement it and imo Tanstack query useMutation variables are still way better than use optimistic hook Why does the react team like to use numbered parameters/ return arrays instead of objects. Tanstack query code is still much easier to read and write imo Also the ecosystem is so much more mature for Tanstack query. When I spent too long trying to adapt to all the react changes prematurely it damaged my productivity a lot. So I'm using useQuery and calling server actions in the queryFn, instead of use(promise). If I need performance then I'm fetching in the parent passing initial data as prop. What are the benefits of using use and useOptimistic? Is there anything wrong with using actions for data fetching in useQuery query fn?
@nikhilpsathyanathan
@nikhilpsathyanathan 24 күн бұрын
I also use useQuery with optimistic update than react hooks
@usmanmughal5916
@usmanmughal5916 27 күн бұрын
Terrible
@rdmPerson
@rdmPerson 27 күн бұрын
Nice video. Love to see how you handle authorization in sever actions.
@o_glethorpe
@o_glethorpe 28 күн бұрын
If something fails after the call to shopfy succeeds, where is the call to shopfy to decrease the quantity?
@jotadebeese
@jotadebeese 25 күн бұрын
How will something fail after the Shopify succeeds?
@joshspencer3531
@joshspencer3531 28 күн бұрын
I found optimistic UI fascinating. It's like a client that knows more than the server which is cool. I have an article on react useOptimistic.
@crossssssssssss
@crossssssssssss 28 күн бұрын
how would you handle someone clicking the button multiple times? wouldnt that lead to race conditions? since youre not waiting for the first update to finish
@kumardeepanshu8503
@kumardeepanshu8503 28 күн бұрын
i have create a whole system in my current job to giving user instant feedback , i thought it is industry standard . LOL
@mohamedelnaggar8572
@mohamedelnaggar8572 29 күн бұрын
How would the Proceed to Checkout button handle waiting for the actual cart data. Like if I am on Slow connection and I incremented an item in the cart 4 times and pressed the checkout button, how would it wait until the cart is actually updated to redirect.
@jotadebeese
@jotadebeese 25 күн бұрын
Since you are using formAction to handle the increment, then you can access to the 'pending' state from the formStatus like const { pending } = useFormStatus();. Then you wrap a checkout button inside a form which has the action to redirect to checkout and in the button you disable it using the pending you get from the useFormStatus, in that way it won't redirect to checkout until all the API calls are complete.
@fullstackdotnet
@fullstackdotnet 29 күн бұрын
or we could just do it locally!
@dat-ta
@dat-ta 29 күн бұрын
Why session/local storage usage on cart items are not common in e-commerce sites? If it's a security concern, we can validate request at the server side.
@oladipooluwatoyosi6411
@oladipooluwatoyosi6411 27 күн бұрын
So that each user data will be up to date across several devices and in case the user logs out of a particular device, the user data is preserved. Few other reasons as well
@dat-ta
@dat-ta 27 күн бұрын
@@oladipooluwatoyosi6411 That's true. What if the site doesn't require user to login? Is there anything else to be considered?
@zulfikarahmad3684
@zulfikarahmad3684 29 күн бұрын
we can combine this with react query right?
@avivshvitzky2459
@avivshvitzky2459 29 күн бұрын
If i'm not mistaken, rc alone can handle this without the need of doing what is done in this video
@abdallahmohamed2201
@abdallahmohamed2201 29 күн бұрын
Thanks alot lee for, would like to see this integrated with authentication and display conditions to user whether item is in his cart or not Thanks again
@aerotheory
@aerotheory 29 күн бұрын
I do enjoy learning from your clips. I was hoping to learn about how optimistic UI works and not the implementation. Thanks for your videos over the years, they have been a great help.
@tomich20
@tomich20 29 күн бұрын
would like to see what happens when the server action fails
@leerob
@leerob 29 күн бұрын
If an optimistic update fails, then the state is reverted back to the last successful transition. So if the cart quantity was 3, but incrementing to 4 failed, it would then go back to 3. That's the biggest tradeoff with optimistic. You're making the success case much better, but for the error case having it flash back isn't as great. Just depends on how often you see failures.
@wandenreich770
@wandenreich770 28 күн бұрын
@@leerobcould add that I the video.. I think it would be really helpful for other as well
@j2isndhu
@j2isndhu 17 күн бұрын
It reverts back plus the error is returned, so you can trigger a notification
@joostschuur
@joostschuur 29 күн бұрын
You'd still have to come up with your own way to track if the server actions fails and roll back the local optimistic update though, right?
@leerob
@leerob 29 күн бұрын
Nope -If an optimistic update fails, then the state is reverted back to the last successful transition. So if the cart quantity was 3, but incrementing to 4 failed, it would then go back to 3. That's the biggest tradeoff with optimistic. You're making the success case much better, but for the error case having it flash back isn't as great. Just depends on how often you see failures.
@DVSK1
@DVSK1 29 күн бұрын
useFormState would be awesome if returning a promise, so we can use await and wait a response in client side to handle logic through possible responses, am i talking shit?
@Proximity221
@Proximity221 29 күн бұрын
any idea when react 19 will be stable?
@rand0mtv660
@rand0mtv660 26 күн бұрын
Nobody knows that at the moment. React team is working on reverting some Suspense changes that were found out by the community when they released the RC version and that seems to be a work in progress so no stable release date at the moment.
@nothing-tj9eh
@nothing-tj9eh 29 күн бұрын
thanks for your videos