Remixing Toast Notifications (feat. Andre Landgraf)

  Рет қаралды 4,560

Remix

Remix

Күн бұрын

Andre teaches Brooks how to build a toast notification system in Remix using Cookies.
Full Stack Web Development with Remix 👉 a.co/d/5BmioFi
Repo (initial setup) 👉 github.com/PacktPublishing/Fu...
Learn more about Andre 👉 github.com/andrelandgraf
00:00 - Introductions
06:33 - Setting up the project
12:53 - Client-side toast notifications
19:37 - Server-side toast notifications
28:00 - Cookie-driven toast notifications (diagram)
37:15 - Cookie-driven toast notifications (code)
1:10:30 - Progressively enhanced toast notifications
1:15:15 - Concluding thoughts
Learn more at remix.run

Пікірлер: 32
@salisuwada3467
@salisuwada3467 7 ай бұрын
@andre's book on Remix is a breath of fresh air. Started reading it 2 days ago and I've read more than half of the book. The book covers essential aspects of the framework that are missing from the docs
@andrelandgraf1398
@andrelandgraf1398 7 ай бұрын
Really appreciate the great feedback! Very glad you like it! 😊
@meowmesh
@meowmesh 7 ай бұрын
I just learn this technique in Kent's epic dev workshop and first time it was little confusing then it just blown my mind that how this things work. Never I have imagined I would handle toast in server side like this. remix is really awesome
@planetmall2
@planetmall2 7 ай бұрын
This is fantastic please keep going with these videos.
@DrewLytle
@DrewLytle 7 ай бұрын
Two of my favorite humans 🙌!!!
@dagoacarralero5080
@dagoacarralero5080 7 ай бұрын
Awesome flash session 😂 Just a little note, light themes afford more contrast for viewers.
@ReactTipsWithBrooks
@ReactTipsWithBrooks 7 ай бұрын
Haha can't win! If we do light people complain, if we do dark people complain 😅 Noted though, I'll probably intermix some light themes in every once in a while. Maybe just randomize it each episode 😉
@DEV_XO
@DEV_XO 7 ай бұрын
Great collab guys! 🙌
@SinhNguyen-tz6us
@SinhNguyen-tz6us 7 ай бұрын
wow, I have been finding this since I started to exploring Remix few months ago. Thank you so much.
@BrunoBonamin
@BrunoBonamin 7 ай бұрын
Thanks for the great content, we've been doing this for a while but seeing you guys chat over it helped me improve the API so my code is now much shorter and cleaner. I also got a deeper understanding of it. One piece of feedback, please use a smaller screen resolution with bigger text! It's really hard to read the code unless I'm on a big screen, and the youtube limit of 1080p makes it barely readable. Thanks!
@yarapolana
@yarapolana 7 ай бұрын
I really enjoy the new videos on the many ways to use Remix and the depth of knowledge of the people you bring. Two feedbacks: 1- The title on youtube already reflects what the video is about so no need to add the banner as well on the video since it “eats up” the already small code presentation. 2- The codebase does not reflect what was on the video, just the base code for it, if that was intended you could make it clearer.
@ReactTipsWithBrooks
@ReactTipsWithBrooks 7 ай бұрын
Thanks for the kind words and feedback! 1. Noted, I'm still trying to figure out the best layout. I don't want to cut off any of my screen recording, but unfortunately to keep our faces up there I have to scale the screen down just a bit. So basically theirs a blank space either way that I need to fill with something, so I figured a title at least keeps the context for folks viewing in full screen. I'm open if you have another suggestion on what to put down there! 2. Yep, good point, thanks! That code is the starting point, not the finished product we built together. I'll update the description to reflect this
@yarapolana
@yarapolana 7 ай бұрын
@@ReactTipsWithBrooksAs someone who studied videography as well I feel that I can’t give advice on editing, everyone is unique in their own way, except when it comes to the code, the font needs to be a bit bigger😂 And I totally understand on the whitespace, dont be afraid to zoom in on your faces.
@ReactTipsWithBrooks
@ReactTipsWithBrooks 7 ай бұрын
@@yarapolana Thanks so much for the tips! I'll definitely be sure to bump the font size more in future recordings (hopefully the next one is already good). I'll play around with zooming in on our faces a bit more too to see if I can squeeze some more room. Thanks again!
@MerthanMerter
@MerthanMerter 2 ай бұрын
why not just run; headers.set('Set-Cookie', await commitSession(session)); headers.set('Set-Cookie', await destroySession(session)); in order? is there a specific reason?
@C0ntenTT
@C0ntenTT 7 ай бұрын
Could also use server actions to achieve same result.
@abhaykumar9806
@abhaykumar9806 4 ай бұрын
How?
@detoyz1
@detoyz1 7 ай бұрын
Great video, thanks guys! One question - wouldn't it be easier and more web-like just using the query params? So when redirecting from success action we just append query params to url with toast data. Or am I missing something here, like remix doesn't know how to pop then query params after displaying a toaster message?
@ReactTipsWithBrooks
@ReactTipsWithBrooks 7 ай бұрын
Yep, that could work too, thought it's not necessarily more web-like than using a cookie (cookies have been around for quite a while and are very web-like). The reason I personally wouldn't take that approach is because you have a lot more fiddling to do with the query params. You'll need to remove the query params once the notification is dismissed, and if there are other query params you do want you need to make sure they stick around. A bigger problem though is if someone shares the link with the query param, now anyone who goes to that link is going to see a random toast notification, which would probably be pretty confusing. You could protect against this by looking up the session information for the user, but then at that point you're already back in cookie land essentially.
@C0ntenTT
@C0ntenTT 7 ай бұрын
that's a bad, working approach
@ReactTipsWithBrooks
@ReactTipsWithBrooks 7 ай бұрын
@@C0ntenTT Are you replying to me or OP? In either case, would you care to elaborate why you think it's a bad approach?
@C0ntenTT
@C0ntenTT 7 ай бұрын
@@ReactTipsWithBrooks Replying to OP, not you. and the reason is exactly what you mentioned
@detoyz1
@detoyz1 7 ай бұрын
Thanks for elaborative answer here! Much appreciated@@ReactTipsWithBrooks
@abhaykumar9806
@abhaykumar9806 4 ай бұрын
I am using radix-ui to create the toasts and they have a duration prop to dismiss the toasts? How should I update the toast cookie in that case where I dont have a close button?
@abhaykumar9806
@abhaykumar9806 4 ай бұрын
Note: I don't want to submit a form programmatically with timeouts on a component level
@ReactTipsWithBrooks
@ReactTipsWithBrooks 4 ай бұрын
I would use useSubmit to submit a post request to clear the cookie after the duration or when the toast unmounts
@sethdavis512
@sethdavis512 7 ай бұрын
🍪🍪🍪
@yarapolana
@yarapolana 7 ай бұрын
Is it possible to achieve the same result using SSE?
@ReactTipsWithBrooks
@ReactTipsWithBrooks 7 ай бұрын
Yep, you could definitely use SSE. Personally I think that'd be a bit of overkill just for a simple toast notification. You'd also have to setup a unique channel for each user, since you don't want to share the notification to multiple users accidentally. You'd also likely want to cleanup the emitter as soon as you're done using it, since a toast notification is generally pretty fire-and-forget. If you had a stream of notifications/messages you want to give a user, then SSE might make sense in that case
@yarapolana
@yarapolana 7 ай бұрын
@@ReactTipsWithBrooksYou are right and after some more digging not all browsers are compatible so SSE is not worth all that engineering. Thank you for answering. Didn’t know you had a personal channel I just subscribed 🎉
@ReactTipsWithBrooks
@ReactTipsWithBrooks 7 ай бұрын
Thanks @@yarapolana! I'm not super active on it at the moment, hopefully will get back to it more at some point
Server-Sent Events in Remix (feat. Moishi Netzer)
56:34
Remix
Рет қаралды 4,8 М.
Homegrown Remix Middleware (feat. Kiliman)
51:05
Remix
Рет қаралды 2,1 М.
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 14 МЛН
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 187 МЛН
Пробую самое сладкое вещество во Вселенной
00:41
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 1,4 МЛН
Remix Dev Tools (feat. Alem Tuzlak)
1:43:51
Remix
Рет қаралды 2,7 М.
Roadmap Planning #12
1:07:31
Remix
Рет қаралды 4,3 М.
Optimistic Drag and Drop
13:54
Remix
Рет қаралды 9 М.
You may not ACTUALLY understand Content Collections…
42:03
Coding in Public
Рет қаралды 10 М.
Roadmap Planning #10
1:05:36
Remix
Рет қаралды 4,4 М.
Optimistic UI in Remix
38:02
Sam Selikoff
Рет қаралды 8 М.
"The Life & Death of htmx" by Alexander Petros at Big Sky Dev Con 2024
23:01
Montana Programmers
Рет қаралды 24 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,4 МЛН
Secret Wireless charger 😱 #shorts
0:28
Mr DegrEE
Рет қаралды 2,3 МЛН
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,4 МЛН
Main filter..
0:15
CikoYt
Рет қаралды 13 МЛН
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 28 МЛН