Remix Single: Data Mutations with Form + action
HTML-код
- Опубликовано: 20 янв 2022
- Remix makes data mutations a breeze by emulating browser behavior with HTML forms and server side actions. It then offers special hooks to build modern web app user experiences.
Learn more at remix.run - Наука
What if we don't want to get that updated list as a payload back from server?
Can you show us what it would look like to do this kind of thing in Remix with an authenticated api protected with bearer tokens ?
Ooh the others were Remix Singles but this one is a Remix Short. :)
Remix ❤🔥
So we get a POST+GET mini-waterfall as soon as JavaScript is enabled. How is it progressive Enhancement?
Remix is tricking a lot of fronted developers into writing backend code
Haha yep, this was precisely my gateway entry into back end development :)
I am using spring boot + remix2
very efficient
It's interesting how the default browser behavior (with JS off) could be considered better than the behavior with JS since it automatically clears the form after submission (assuming due to a page reload?)
I would definitely want that to be the default experience with Remix for successful form submissions.
This allows everyone to be full stack developer 😎
you have no idea how true this statement is
"There's nothing in my code that dealt with that" is just another way of saying "There's a ton of convention debt to learn here and people fresh to your code are going to have no clue what is actually happening". I was put on a Remix project after the dev who built all of it left, and it is by far the least intuitive framework I've ever used, including Ruby on Rails. Besides this video, every time I try to find a quick intro to just how a page works, I'm met with "it just does the thing" which is so rough.
Thanks for helping me understand this convoluted framework, unfortunately we're using even more abstraction so even this intro hasn't gotten me any further to getting anything done in this app.
Thanks for the video. Now if it possible one video using multipart form sending and image or anything n.n)/!!
Hello, i need help, how to cancel redirect on submit event ?
Awesome. Can it be done with multiple forms in a single page?
Yes.
1. Added input type=hidden + name=type + value=form-1.
2. action function check formData.name === "form-1".
I don't understand why disabling JS made the post request return a html response? Did the React component People run on the server?
Yep! Remix Server Side Renders every single page by default. Once JavaScript has loaded and the page has hydrated, it switches to Client Side Rendering for additional requests (the loaders and actions are still run on the server).
For me it almost means "bye bye useSWR"
why doris peterson was duplicated after enabling javascript? 6:54
Re-enabling JS triggered the browser to reload the webpage using the last request, which was a POST that added Doris Peterson. Meaning she was inserted into the DB the second time.
please add tw css option in create cli
Alarms going off at 4:00 when you just spread ...values. Next time, please mention that this is just for the demo purposes and should never be done without prior sanitization/validation of the input. There's too many people just taking examples as-is and using them in their code, and then we end up in nasty security bugs in production code.
Doesn't prisma have built in validation?
are you implying that people could edit the front end form to pass different data than the form would otherwise allow them to? What would that achieve? Since the table already has a set structure, you can't add a record with values which aren't defined, right?
@@wake-digital yes, that's correct. It potentially opens the doors for a bad actor to exploit bugs in the ORM or DB implementation.
@@itsbazyli good point. I'll keep that in mind in the future. Thanks for the tip :]
Can you please make a video with framer motion
Great vid… judging you for your light mode preferences tho.
Well, light mode has better colour contrast, making it a better option for video recordings. I'm sure Chris Ferdinandi would agree on that.
@@thmsrttg Im joking… mostly
@@fltngmmth no hard feelings :) I also prefer dark mode
@@thmsrttg we are friends now
@@fltngmmth oh so now when you there's a big counter-argument, you're suddenly joking
Form inside a list item is semantically incorrect.
Why? I don't think it is.
test
first comment
and first thanks