Astro Actions (First Look!)

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 30

  • @bholmesdev
    @bholmesdev 8 місяців тому +18

    Fantastic demo! Glad this simplified your code so much. Made a note that the "failed to validate" throw message could include the error messages for debugging. Also, console ninja is SO COOL

    • @CodinginPublic
      @CodinginPublic  8 місяців тому +3

      Thanks for the great tool! I know there's been so much into the crafting of the experience. Excited to see how it continues to develop! And totally agree about console ninja :)

  • @JamesQQuick
    @JamesQQuick 8 місяців тому +3

    What a great overview. Thanks so much for this!

    • @CodinginPublic
      @CodinginPublic  8 місяців тому

      Thanks so much, James! That’s so kind!

  • @ceralguy85
    @ceralguy85 7 місяців тому

    Great demo, the Astro actions is a very cool feature, thank you for sharing this content, keep it up with the great content.

  • @jamesdim
    @jamesdim 8 місяців тому +3

    Thanks for covering these new features!

    • @CodinginPublic
      @CodinginPublic  8 місяців тому +1

      Yeah, just had a couple of hours to play with it yesterday, but seems really cool!

    • @jamesdim
      @jamesdim 8 місяців тому +1

      @@CodinginPublic Definitely! I hope it goes stable soon!

    • @jjaimealeman
      @jjaimealeman 8 місяців тому +1

      ​@@jamesdimgiven the speed of the Astro Dev Team - I wouldn't be surprised if it got stable very very soon!!! 😎👍

  • @danielgillett370
    @danielgillett370 8 місяців тому

    Excellent videos! Keep doing what you're doing. I'm a big fan! I'm on your course as well. It's very good. thank you.
    If you don't mind; Do you think Astro could be used as a production unit to spit out static sites.

  • @WillDelish
    @WillDelish 8 місяців тому

    Here is the comment pointing out in the last name error message, ye put “first name” 🤓
    Very cool demo! Astro is growing so fast in features, I can’t keep up.

  • @FrankFavaCptn
    @FrankFavaCptn 3 місяці тому

    Do actions replace API endpoints? Or can/should they be used together? For different uses or in unison.
    Thank you

  • @lifedrawing1
    @lifedrawing1 7 місяців тому

    Great video, thank you! Do you think Astro actions would still make sense in conjunction with HTMX?

    • @RyanDsouza-be2qx
      @RyanDsouza-be2qx 6 місяців тому

      They both are an either/or. You either call the form submit via HTMX or use Astro actions.

    • @lifedrawing1
      @lifedrawing1 6 місяців тому

      Thank you for confirming!

  • @RyanDsouza-be2qx
    @RyanDsouza-be2qx 6 місяців тому

    Do we still need a form submit handler and preventDefault? Is there a better way?

    • @CodinginPublic
      @CodinginPublic  6 місяців тому

      You can use the progressive fallback and submit to the page like html does automatically and then capture that request and process the action. I should do a video on that!

  • @HeyWorld-o8j
    @HeyWorld-o8j 8 місяців тому +1

    Wonder if this can return multiple error messages after submit a large form?

  • @HeyWorld-o8j
    @HeyWorld-o8j 8 місяців тому +1

    Can I don't use Z?

    • @CodinginPublic
      @CodinginPublic  8 місяців тому

      I think you need to, but that's also kind of the core experience? So if you don't want to use zod to validate, I'd just use something else?

    • @bholmesdev
      @bholmesdev 8 місяців тому +1

      You can! If you omit the “input” option, you get the plan FormData object to do whatever you want. But as Chris mentioned, you won’t get that clean isInputError utility for error messages. It’ll be more to do yourself

    • @HeyWorld-o8j
      @HeyWorld-o8j 8 місяців тому

      @@bholmesdev Ah, thanks for your work on this. For now, I'm still relying on vanilla JavaScript for all forms.

  • @404-not-found-service
    @404-not-found-service 8 місяців тому

    wwoooww

    • @CodinginPublic
      @CodinginPublic  8 місяців тому +1

      Pretty cool, right!?

    • @404-not-found-service
      @404-not-found-service 8 місяців тому

      @@CodinginPublic It's great, I'll leave sub and so on, I like Astro and I'm learning it, there is very interesting content on your channel about it so I'll be here more often, I hope to see more new things from Astro, greetings and much success!

  • @RexGalilae
    @RexGalilae Місяць тому

    I'm a bit confused and this is going to sound like a stupid question but why did we need to refactor the API endpoint logic into a server action?
    Is there a reason why this validation couldn't happen at the endpoint ".json.ts" itself?