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
  • НаукаНаука

Комментарии • 40

  • @harshrai456
    @harshrai456 2 года назад +5

    What if we don't want to get that updated list as a payload back from server?

  • @vinylwarmth
    @vinylwarmth 2 года назад +1

    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 ?

  • @tshddx
    @tshddx 2 года назад

    Ooh the others were Remix Singles but this one is a Remix Short. :)

  • @DEV_XO
    @DEV_XO 2 года назад

    Remix ❤🔥

  • @tptm
    @tptm Год назад +1

    So we get a POST+GET mini-waterfall as soon as JavaScript is enabled. How is it progressive Enhancement?

  • @JLarky
    @JLarky 2 года назад +5

    Remix is tricking a lot of fronted developers into writing backend code

    • @simonswiss
      @simonswiss 2 года назад +1

      Haha yep, this was precisely my gateway entry into back end development :)

    • @nocoolming
      @nocoolming Месяц назад

      I am using spring boot + remix2
      very efficient

  • @thisiszinger
    @thisiszinger 2 года назад +13

    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?)

    • @romansandler6198
      @romansandler6198 2 года назад +4

      I would definitely want that to be the default experience with Remix for successful form submissions.

  • @abdelhameedhamdy
    @abdelhameedhamdy 2 года назад +1

    This allows everyone to be full stack developer 😎

    • @fltngmmth
      @fltngmmth 2 года назад

      you have no idea how true this statement is

  • @graysonlorenz1441
    @graysonlorenz1441 10 месяцев назад +3

    "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.

  • @kikisjs95
    @kikisjs95 2 года назад +2

    Thanks for the video. Now if it possible one video using multipart form sending and image or anything n.n)/!!

  • @teonanack8409
    @teonanack8409 2 года назад

    Hello, i need help, how to cancel redirect on submit event ?

  • @Alcani3ca
    @Alcani3ca Год назад +3

    Awesome. Can it be done with multiple forms in a single page?

    • @user-uu3or3es4q
      @user-uu3or3es4q 8 месяцев назад

      Yes.
      1. Added input type=hidden + name=type + value=form-1.
      2. action function check formData.name === "form-1".

  • @a89529294
    @a89529294 6 месяцев назад

    I don't understand why disabling JS made the post request return a html response? Did the React component People run on the server?

    • @Remix-Run
      @Remix-Run  6 месяцев назад

      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).

  • @AndersonSousa33
    @AndersonSousa33 2 года назад +3

    For me it almost means "bye bye useSWR"

  • @jpkontreras
    @jpkontreras 2 года назад +2

    why doris peterson was duplicated after enabling javascript? 6:54

    • @itsbazyli
      @itsbazyli 2 года назад +2

      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.

  • @ManojAP
    @ManojAP 5 дней назад

    please add tw css option in create cli

  • @itsbazyli
    @itsbazyli 2 года назад +8

    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.

    • @mxs2019
      @mxs2019 Год назад

      Doesn't prisma have built in validation?

    • @wake-digital
      @wake-digital 2 месяца назад

      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?

    • @itsbazyli
      @itsbazyli 2 месяца назад

      @@wake-digital yes, that's correct. It potentially opens the doors for a bad actor to exploit bugs in the ORM or DB implementation.

    • @wake-digital
      @wake-digital 2 месяца назад +1

      @@itsbazyli good point. I'll keep that in mind in the future. Thanks for the tip :]

  • @abhim6380
    @abhim6380 2 года назад

    Can you please make a video with framer motion

  • @fltngmmth
    @fltngmmth 2 года назад +1

    Great vid… judging you for your light mode preferences tho.

    • @thmsrttg
      @thmsrttg 2 года назад +3

      Well, light mode has better colour contrast, making it a better option for video recordings. I'm sure Chris Ferdinandi would agree on that.

    • @fltngmmth
      @fltngmmth 2 года назад +1

      @@thmsrttg Im joking… mostly

    • @thmsrttg
      @thmsrttg 2 года назад +1

      @@fltngmmth no hard feelings :) I also prefer dark mode

    • @fltngmmth
      @fltngmmth 2 года назад

      @@thmsrttg we are friends now

    • @adelinmorar4580
      @adelinmorar4580 Год назад

      @@fltngmmth oh so now when you there's a big counter-argument, you're suddenly joking

  • @thmsrttg
    @thmsrttg 2 года назад

    Form inside a list item is semantically incorrect.

    • @Peter-lg7mc
      @Peter-lg7mc 2 года назад +1

      Why? I don't think it is.

  • @cannabisanomaly
    @cannabisanomaly 7 дней назад

    test

  • @user-il5fb1ls4z
    @user-il5fb1ls4z 2 года назад

    first comment
    and first thanks