Remix Single: Multiple Forms and Single Button Mutations

  Рет қаралды 36,539

Remix

Remix

Күн бұрын

Пікірлер: 74
@someshmusunuri4233
@someshmusunuri4233 2 жыл бұрын
Remix Singles are Awesome and Ryan Florence is the best DEMO person, to the point and crystal clear. Love these.
@GustavoDiaz93
@GustavoDiaz93 3 жыл бұрын
Oh, man! Using a hidden input field brings me old good memories. I love Remix.
@BenMcHone
@BenMcHone 3 жыл бұрын
I can't get enough of remix. Make the web simple again!
@Justbur
@Justbur 11 ай бұрын
discovering these videos again today and they are awesome. 2 years old is a million years in web time but these are still amazing.
@sephiics
@sephiics 3 жыл бұрын
"It's what ur code doesn't do" killed me
@cagdasucar3932
@cagdasucar3932 Жыл бұрын
Remix is so much better than Next.js. Good job!
@ronderksen
@ronderksen 3 жыл бұрын
The “bop bop bop bop”, followed by a little chuckle at 8:44 really reminded me of Bob Ross. Which is awesome. On a more serious node: you could use the form method to distinguish different forms, right? And the button value to differentiate further when needed?
@Remix-Run
@Remix-Run 3 жыл бұрын
It's all HTML, so yes and yes. Do it however you like.
@Arzen84
@Arzen84 3 жыл бұрын
So amazing what you guys have built so far! I cannot wait for more videos like this!
@DEV_XO
@DEV_XO 2 жыл бұрын
Been watching this video with a smile on the face. This tells you all I guess! ♥💛💚💙🖤
@amir-ziaei
@amir-ziaei 3 жыл бұрын
Thanks Remix! These short videos are great and I love them!
@emdagon
@emdagon 2 жыл бұрын
"Buttons are input fields" It's funny how stuff I learned 20 years ago (while reading html 4.0 spec) sounds like news now 😂 -- Awesome framework!
@Aquilalias
@Aquilalias 2 жыл бұрын
Love those videos. Great commentary and always something new to learn even with a few years of experience on my back.
@tomaszgrabowski8766
@tomaszgrabowski8766 Жыл бұрын
I ❤ Remix! I was so tired of Next and now I like to do a web dev once again!
@willsmith4140
@willsmith4140 Жыл бұрын
I get that it's cool in theory to use all this native functionality, but at the end of the day having this giant form with multiple hidden inputs is way less readable and maintainable to me, compared to an "onClick"
@gijsroge
@gijsroge 3 жыл бұрын
Awesome videos, thanks! Maybe a video that shows how you would approach reusable components, used on many routes that fetch and post data?
@dagoacarralero5080
@dagoacarralero5080 Жыл бұрын
Papapapa this was fun & enlighten. What such a good tech, now I see why the REMIX
@dmbarry86
@dmbarry86 2 жыл бұрын
These singles are great.
@danwilloughby2088
@danwilloughby2088 3 жыл бұрын
7:09 bop bop bop bop bop bop buh bup 🤣. Can that please be the official name for that concept?
@sotr-archives150
@sotr-archives150 2 жыл бұрын
Throtting or debounce, there is a lodash utility for this as well.
@jacobharris3929
@jacobharris3929 2 жыл бұрын
almost 10 years of webdev and i never thought to use a button as a form input with a value. wild stuff
@alinsimion
@alinsimion 3 жыл бұрын
Mind blown! Great job guys!
@DEV_XO
@DEV_XO 2 жыл бұрын
Amazing series! Remix is just 🔥💚
@SeanLazer
@SeanLazer 3 жыл бұрын
Maybe more of an architecture question but how would you scale this out to a route that has potentially dozens of mutations? For example a dashboard. I've gotten really accustomed to building reusable components that do their own data management, ie you embed the Users, Orders, and Products widgets on the dashboard page and they take care of their own data needs. How would you handle something like that in Remix without having super bloated loader and action functions?
@frontendtony
@frontendtony 3 жыл бұрын
I've not tried Remix yet, but isn't this a good candidate for nested routes? I'm trying to imagine a scenario where this would be possible where the mutations aren't in a list
@SeanLazer
@SeanLazer 3 жыл бұрын
@@frontendtony that's what I was wondering, maybe the idea of like portable or embeddable routes. I just remember the rails days of a dashboard#index action where you're loading like 10 separate pieces of data in one controller action.
@tobrie1976
@tobrie1976 2 жыл бұрын
If you have the `Form` post to a different path via `action="/somewhereelse"`, like described at 00:01:30, ... 1. how to prevent the browser from navigating there, and 2. how to get potential server-validation errors back to render them below the input fields?
@tshddx
@tshddx 3 жыл бұрын
I love the "use real forms" stuff, it's great to be able to dust off my PHP and Django web dev experience from 15 years ago! Has the Remix team been thinking about how to model forms in such a way that we can get TypeScript coverage between frontend (default export) and backend (loader and action exports)? Having these all in the same route module file is already such a neat developer experience, it would be even cooler to have the tooling help a little more with this stuff! I've been playing around with different ways of doing this in Remix but haven't found anything that fits naturally with the inherently untyped nature of the web APIs (e.g. FormData and input name and value attrs).
@tomrowe2181
@tomrowe2181 3 жыл бұрын
I personally tie the form typing with validation using Zod. Someone recently created remix-validated-form as well to add onto zod or yup and just make using forms a little nicer.
@dmsnm
@dmsnm 3 жыл бұрын
Great solution. Can we get one where inputs are dependent on another input's value? Like when sub category select options are dependent upon category select value.
@tomrowe2181
@tomrowe2181 3 жыл бұрын
This is a good use case for useFetcher OnChange of the first select, you can trigger a fetcher submission to retrieve the options for the second dropdown and populate it. Or for a normal react solution simply send all options down on first page load, and useState to track which set to show
@daoodqurashi4758
@daoodqurashi4758 3 жыл бұрын
Yeahh rayan keep it comming
@simonswiss
@simonswiss 2 жыл бұрын
You are correct - I never implement an abort fetch for rapid clicking 😅
@trashAndNoStar
@trashAndNoStar 2 жыл бұрын
Is there a sample code discussed here on a gist/repo?
@frozen_tortus
@frozen_tortus 2 жыл бұрын
2:47 While I like this approach, React is throwing an error for this approach since 'onClick' handler is missing. Is it possible to suppress that error? EDIT: Use defaultValue :)
@fabischkamau
@fabischkamau 3 жыл бұрын
Aaah thanks i run into that problem sometime ago 🤦 but now i now i know how to handle it. Thanks you☺️🥳
@OberfeldwebelPfeffer
@OberfeldwebelPfeffer Жыл бұрын
Why don't you use the method="delete" in the form? That way you wouldn't need to define the "_action" name on the button.
@fennecbesixdouze1794
@fennecbesixdouze1794 3 ай бұрын
Because the browser HTML forms API doesn't support method="delete". It only supports POST and GET.
@OberfeldwebelPfeffer
@OberfeldwebelPfeffer 3 ай бұрын
I found that out a year ago. 😅 But I guess it’s good to be mentioned here for others that encounter this. So thanks for answering.
@nightshade427
@nightshade427 2 жыл бұрын
Reminds me of aspnet postback model and client side auto update using updatepanel of the early 2000s. I dig it, it's a mix of old and new.
@DaCurse0
@DaCurse0 3 жыл бұрын
5:25 ah yes, classic DOM clobbering 😁
@edwarddelgado9654
@edwarddelgado9654 Жыл бұрын
I'm old school hidden but data-* on the button might also work for the id.
@amsterdamtinus8456
@amsterdamtinus8456 Жыл бұрын
As one of these old developers I would add an hidden input for the action as well, like in the olden days :)
@VincentDECAUX
@VincentDECAUX 3 ай бұрын
I can't understand how we can't name the Form directly. Going back with hidden input is hard to maintain, read the code to find the hidden input in your Form ...
@jannekanerva9484
@jannekanerva9484 Жыл бұрын
What if I also wanted to create an API for the same actions (like e.g. the delete action) and provide it to my customers? Should I separate that into a different route (so duplicate it) or how is that meant to be done in remix universe?
@DenysSlipko
@DenysSlipko Жыл бұрын
Thanks a lot!
@mogadanez
@mogadanez 9 ай бұрын
can we use just method="DELETE"?
@FzsHotDogInDonut
@FzsHotDogInDonut Жыл бұрын
Any RTE for remix js????
@albiceleste101
@albiceleste101 2 жыл бұрын
Thank you so much!
@김슬찬-g6b
@김슬찬-g6b 7 ай бұрын
which tool do you use for disalbe/enable javascript on developer mode?
@farrukhazad
@farrukhazad 3 жыл бұрын
nice work dear friend , i like , nice share , stay connected
@mjg_____
@mjg_____ 2 жыл бұрын
everything old is new again and I mean that in the best possible way 😅 side note, having educators create a framework makes learning it soooooo much easier.
@arek9430
@arek9430 2 ай бұрын
I have question - if there is a separate backend app meaning frontend app server would serve as a "proxy" to this backend, then what is the purpose and advantages besides SEO, to do all this complications just for the fetch calls to happen on the server (which then do fetch call to the backend anyway)? I see that application can work even without js enabled (but this is extreme rarity to happen - but still nice to have), comes with complete HTML, has SEO. But apart from this, is there anyhing else worth this gymnastics for SSR?
@royrevelt5698
@royrevelt5698 3 жыл бұрын
Bravo! Give it a year and The Industry will wake up and start using Remix. If I may ask an unrelated question - Mr. Florence, which keyboard (and mouse) are you using in this recording? It's not mechanical, is it?
@Sm123bg
@Sm123bg 3 жыл бұрын
Hello. If I had a form that added a like to a blog post or something would you recommend just removing the default submit button styling so only a font awesome icon is shown?
@stiforr8714
@stiforr8714 2 жыл бұрын
A replacement for _action i've been using is "intent"
@pablen808
@pablen808 3 жыл бұрын
Yep. I did enjoy it.
@juraev0056
@juraev0056 2 жыл бұрын
Hi, is _action with value being added to FormData with ? Because Chrome does not seem to include button by default if I just call new FormData(form) in fetch.
@dmytroulianov8743
@dmytroulianov8743 3 жыл бұрын
just curious how it would work if I wanted to delete a few users simultaneously like clicking five times on different names with slow connection, I guess it will do the job for my last click but not for all of them right? btw really like remix and your videos
@dmytroulianov8743
@dmytroulianov8743 3 жыл бұрын
nice video on concurrent mutations, thanks!
@alexmachin1785
@alexmachin1785 2 жыл бұрын
Yeah that's what I've been thinking, like if you have a table and select multiple users how can you handle that ? I bet you can it's just a matter of understanding how.
@mrala
@mrala 2 жыл бұрын
8:46 type `ej` for enabling and `dj` for disabling javascript
@oussou_lessou
@oussou_lessou Жыл бұрын
Holly Button !!! 😯
@barmannphoto
@barmannphoto Жыл бұрын
A user could change the values of the hidden fields before submitting. It seems like there should be a more secure way of doing this.
@TheDrokon
@TheDrokon Жыл бұрын
So the user is going to hack themselves? This is silly
@RustanJhi
@RustanJhi 3 жыл бұрын
Really enjoy it. "bop bop bop bop", makes me laugh.
@ZachCurtis
@ZachCurtis Жыл бұрын
The sound effects while deleting make this video! 🤣
@DanKreiger
@DanKreiger 2 жыл бұрын
I don't do much, but I always used to abort unnecessary requests
@vrfjwehs29
@vrfjwehs29 11 ай бұрын
Ohh thats how that works
@fev4
@fev4 3 жыл бұрын
damnn! this is nice
@JLarky
@JLarky 3 жыл бұрын
I wish action was passing $REQUEST
@fennecbesixdouze1794
@fennecbesixdouze1794 3 ай бұрын
We're definitely going backwards here by leaps and bounds. You've just added dozens of lines of code to add the Form and the hidden inputs, when you could have had one single button with an "onClick" that receives just the iteration variable "person". All the complexity of how to take a "person" and delete it, including that dynamodb will require the id and createdAt and unwrapping those and putting them in hidden inputs etc etc: the type, the name, the gotcha of an underscore for the action, all of that could have been abstracted away; but here they have to be in your face down to the level of the DOM and the Form and input elements. The browser should be evolved to support things method="DELETE". We shouldn't go backwards 20 years as a community to a far worse developer experience.
Remix Single: Pending UI
6:36
Remix
Рет қаралды 16 М.
Remix Single: Concurrent Mutations w/ useFetcher
15:06
Remix
Рет қаралды 36 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Searching IndexedDB in Remix
18:22
Remix
Рет қаралды 8 М.
I might be enjoying Remix more than Next
11:02
Web Dev Cody
Рет қаралды 41 М.
Remix is starting to excite me
6:43
Theo - t3․gg
Рет қаралды 41 М.
Persistent Managed Caches with Remix Client Loader
9:21
Remix Form Validation with Zod
18:17
TomDoesTech
Рет қаралды 8 М.
Remix Single: Optimistic UI
16:56
Remix
Рет қаралды 30 М.
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 576 М.
Prefetching Links in Remix
10:29
Remix
Рет қаралды 7 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 917 М.
Remix.run Can Be Highly Interactive: useFetcher + Zod
22:55
Samuel Cook
Рет қаралды 6 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.