Astro does more than you think it can (and I'll prove it on this livestream)

Поділитися
Вставка
  • Опубліковано 30 чер 2024
  • Let's have some fun building out lots of different web app types in Astro and see how it handles... pretty much everything you need.
  • Наука та технологія

КОМЕНТАРІ • 19

  • @NetoHog
    @NetoHog 6 місяців тому +1

    Great content! Thanks Jason!

  • @walkingin6375
    @walkingin6375 6 місяців тому +3

    10/10 Kratos cosplay.
    XD

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

    Regarding migrating away from Astro (although I've never needed to), I've found that a good pattern is to keep things that read off of the Astro global object in the template's front matter but then call down to lower dependencies with the web standard objects as arguments. For example creating a user account:
    ```
    ---
    import {register} from "../lib/auth/AuthHandlers";
    if (Astro.request.method === "POST") {
    const formData = await Astro.request.formData();
    const cookies = Astro.cookies;
    const response = await register(formData, cookies);
    if (response.ok) {
    return Astro.redirect('/dashboard');
    }
    ```
    ---
    This way the AuthHandlers.register method only takes the formData and cookies object which is easily copy and paste-able to any other framework, while everything that remains Astro api specific remains in the front matter!

    • @learnwithjason
      @learnwithjason  6 місяців тому +1

      nice! that seems like a solid pattern

  • @antemasq6520
    @antemasq6520 5 місяців тому

    Astro looks like a good hammer I just binged a lot of tutorials and I think it made web dev fun again so, I have this silly question, do you know what else can it be used in the future? could it be used for native apps? electron apps? ar/vr spatial things? or are there other projects I should know about with similar philosophy

    • @learnwithjason
      @learnwithjason  5 місяців тому

      I don't think Astro has plans to go native at the moment. to be fair, though, I don't spend much time in native or ar/vr spaces so I don't have a lot of insight there

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

    Great video. Question for a compiler like Svelte am I right in understanding that if you have a component that doesn't have any code in the script tag or a script tag at all then that component isn't serving/shipping any Javascript?

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

      correct! if you don’t explicitly opt into client-side functionality, Astro will only ship the HTML/CSS for any components you use, regardless of the framework you bring in

  • @enbonnet
    @enbonnet 16 днів тому

    Liked from the first hello.

  • @avertry9529
    @avertry9529 6 місяців тому +1

    Useful stuff for starting Astro, shame the bottom of the screen was blocked for most of it. You showed stuff no one could see.

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

      ah, dammit, I used the wrong layout. I'll make sure to use the better one next time

  • @TheBuddilla
    @TheBuddilla 6 місяців тому +7

    I spend more time fixing things than actually doing anything remotely useful with react… Just don’t integrate react next time.

    • @learnwithjason
      @learnwithjason  6 місяців тому +2

      it was definitely a bit of a shock to hit that much resistance after not doing it for a while

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

      And that's why I left React

  • @raeldc
    @raeldc 2 місяці тому

    Call me ancient, but why does it feel like frameworks are going back to PHP 3/4 days again?

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

    Thanks for the stream. Unfortunately, you encountered so many issues during the demo I'm far from being sold on Astro now. I thope their team resolves these issues before 5.0.

    • @learnwithjason
      @learnwithjason  6 місяців тому +3

      what issues are you referring to? I found one bug, but otherwise the main issues I ran into were "getting React apps to work", which didn't have anything to do with Astro