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

  • @jerins1502
    @jerins1502 8 месяцев назад +16

    Doesn't this cause close coupling where the frontend is really dependent on backend

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +2

      Well, this is a big debate and people have their preferences. Yes, it does blend the two but that's the way modern frameworks are going. We've been blending frontend//backend more and more for years as the tools gets better and better. My personal take according to the focus of the major frameworks is this is going to be the future!

  • @onejdc
    @onejdc 8 месяцев назад +14

    Behold, the js frameworks slowly morph back into a PHP/Perl/ColdFusion/etc architecture. The more things change... =) Thanks for covering this, James. Since you asked, I prefer fetch, though I still sometimes am even known to crank out a new XMLHttpRequest...

    • @maelstrom57
      @maelstrom57 8 месяцев назад +1

      Wouldn't be surprised if you're still coding in Perl.

    • @brainites
      @brainites 8 месяцев назад

      "Yes, the old ways are still best at Los Pollos Hermanos". ―Excerpt from the Los Pollos Hermanos TV commercial (Breaking Bad).
      Old becomes the new new. Tech has always been going back full circle.

    • @brainites
      @brainites 8 месяцев назад +2

      @@maelstrom57 An engineer is supposed to be versatile. I go from React Native, ReactJS, Laravel, Django, NodeJS to good old Bash depending on what is supposed to get done.

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      lol yeah that’s the big thought. It is funny but I do feel like the developer experience around all of that has gotten better and better

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Me? Why do you think that?

  • @LePhenixGD
    @LePhenixGD 8 месяцев назад +6

    0:25 I always use fetch, you can easily wrap it around a function or class to suit your needs and you do not need to install a library for it

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Love it! I typically use fetch too1

  • @romaindurand
    @romaindurand 8 месяцев назад +1

    Sveltekit does this automatically, when you fetch an internal api endpoint server side, it automatically calls the endpoint handler instead of actually making the http request !

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      Yeahh! That's such a nice feature. Really cool to have that taken care of behind the scenes!

  • @lostinthenarrativve
    @lostinthenarrativve 8 месяцев назад

    Hey james, what courses do you recommend for node/express?

  • @bgable7707
    @bgable7707 7 месяцев назад

    Really like the way you create these to the point web "snip-it's". Your like laser focus and spot on with info new to my vocabulary coming from a network, security and "OS system" API background. It's taken me a while to swallow what a "web" API is. MAJOR paradigm shift.

  • @jonathangamble
    @jonathangamble 8 месяцев назад +1

    Svelte does this automatically... converts server fetch to a procedure if to same backend.

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Yep! Super cool feature!

  • @randomforest_dev
    @randomforest_dev 8 месяцев назад +38

    Title is misleading… Clickbait.

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      Would love some feedback on your thoughts here!

  • @JeromeAbelDev
    @JeromeAbelDev 8 месяцев назад

    Two questions:
    - 1/ Is there a way to organize this type of backend code in a more maintainable way? I think about Clean Architecture or something like that.
    - 2/ If I understand well. The server code is running on netlify servers, as a type of node server. But your database is hosted by Xata, on another server. So, there will be a request from the code running on netlify and Xata instance ? Am I right ?

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      1. I think the main thing would be to create server side functions that can be use from anywhere on the server. So, I'd probably move my coupons code to a helper function in a utils directly and just call it.
      2. Yes, the server code runs on Netlify. Then the Xata DB is hosted on their server. So, the server does make a DB request to the DB Server

    • @JeromeAbelDev
      @JeromeAbelDev 8 месяцев назад

      @@JamesQQuick Hi James. Thanks to your reply. For the second point, do we have some metrics to compare performance or security between our code and the database? Could we compare a standard JS fetch method form our code, and the Xata client code? I wonder if Xata use another method than fetch, and what could it be (sockets?) ?

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

    Hola James, ¿tu curso de Astro tiene subtítulos en español? Saludos...

  • @naveen.design
    @naveen.design 8 месяцев назад +1

    Hi does anyone know which theme James is using in VSCode?

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      I'm using my theme, James Q Quick - marketplace.visualstudio.com/items?itemName=jamesqquick.james-q-quick-vs-code-theme

  • @SaivivekRaavi-x3r
    @SaivivekRaavi-x3r 8 месяцев назад

    you are awesome can you tell which font-family and theme you are using or you can paste setting.json in vscode
    ]

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      James Q Quick theme (it's mine ) and Cascadia Code font!

  • @christopheanfry2425
    @christopheanfry2425 8 месяцев назад

    So true much easier to be able to manage backend end code and consume on the frontend in the same file, especially with Astro. One thing that limits this behavior with Astro it's when you're using island components. For example with a click event you want to call the API. If you declare your function in the Astro file and want to pass that function as props into your React component (for example), you can't. You will still have to use a fetch method in your react component creating an api endpoint. The good thing of having an endpoint in another file is that you can reuse it in different pages, no need to re-write the function in every Astro file that need it. Anyway, totally agree that in most cases no need to have to fetch, which is pretty cool!!!

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Yep, there are definitely still use cases for making API requests from the front, just a lot less than there used to be lol

  • @ongke3655
    @ongke3655 8 месяцев назад

    Is this mean fetch db directly from frontend?

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      No. It means run more code on the server to start instead of making fetch requests from the frontend to the backend.

  • @ha-rrykim2147
    @ha-rrykim2147 8 месяцев назад

    Is the coupon invalid? ):

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      All the free coupons have now been used. You can still use the student discount code though

  • @planesrift
    @planesrift 8 месяцев назад +1

    Hello PHP my old friend.

  • @JoelPeltonen
    @JoelPeltonen 8 месяцев назад

    Everything old is new again :)
    This feels SO much like the ye olde PHP that we were writing 15-20 years ago. Feels _exactly_ like the views we were writing in some ancient version of Zend framework

  • @montebont
    @montebont 8 месяцев назад

    Maybe I'm the odd one out but I don't use frameworks for my apps (engineering materials and price calculation). To get data from the server Fetch and a few lines of PHP code works just fine for me...I convert static non-confidential data from Excel to a JS object that's included in the build...I'm a great fan of KISS ;-)

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      Whatever works! So you're using PHP for your backend?

    • @montebont
      @montebont 8 месяцев назад

      @@JamesQQuick Yes I do - old version 5.6.
      I like it because it's so simple, very well documented and I'm a great fan of KISS and good documentation. It is also cheap to host...
      My basic use is to serve semi-static pages with a few modifications and static data when required. Most of it is a single PHP script which is included by the handler script. Total lines of script: about 100.
      And yeah...I admit I'm lazy. Never change a winning team...
      But hey...that definitely does not mean you are wrong. It is just what I'm used to since 1974...
      Keep up the good works...I enjoy your videos even if I don't always agree.

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      As long as it's working for you. That's all that matters!@@montebont

  • @juanmacias5922
    @juanmacias5922 8 месяцев назад

    Reaching for data from the source, instead of adding abstraction.

  • @greatcreate82
    @greatcreate82 8 месяцев назад +2

    Title edit : ""Do fetch from the server side"

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Well, this doesn't imply making fetch requests on the server. It implies...just run your logic on the server and remove (mostly) the need to make fetch requests to your backend.

    • @aribasiebel
      @aribasiebel 8 месяцев назад

      I think it means move the rest api logic to the (front end) server. Because browser client is no longer talking to the API backend server directly.

  • @RayAndrewsDev
    @RayAndrewsDev 8 месяцев назад +1

    Missed opportunity for "Stop trying to make fetch happen"

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      Hahaha how did I not think of this?!?!?!?!

  • @skurk52
    @skurk52 8 месяцев назад

    Extremely high quality content

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      Thank you so much!

  • @rdgr22
    @rdgr22 8 месяцев назад

    Great great content! Thanks for the coupon code!

  • @ericjunior105
    @ericjunior105 8 месяцев назад

    Thanks

  • @zandernoriega
    @zandernoriega 3 месяца назад

    video title is misleading af
    and you know exactly why
    do better

  • @PhillipMwaniki
    @PhillipMwaniki 8 месяцев назад

    Thanks for the coupon.

  • @MrEnsiferum77
    @MrEnsiferum77 8 месяцев назад +1

    Not sure what fetch not solving for 3rd world country projects.... even works with graphql... maybe better video will be: write agnostic http client function, so I can change fetch on the fly.... L in the SOLID principle :)

  • @codingtranquility
    @codingtranquility 8 месяцев назад

    James I really appreciate the early bird discount code, super kind of you!

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      Absolutely! Hope you enjoy the course!

  • @MikeNugget
    @MikeNugget 8 месяцев назад

    Hahaaha

  • @_techbk
    @_techbk 8 месяцев назад +1

    What a clickbait lol

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Would love some feedback. What would you change?

    • @_techbk
      @_techbk 8 месяцев назад +1

      The video was mostly about accessing ressources from the server directly instead of creating API endpoints.
      For external resources, you might need to still use fetch or other data fetching libraries 🤷🏻‍♂️
      I stand to be corrected

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад +1

      Absolutely true. I even mentioned that in the video that it doesn't replace fetch completely. BUT I think we need it a lot less and should encourage developers to run code on the server vs making requests to their own backend when possible. Thanks for sharing though. Always looking for feedback on whether or not title/thumbnails still hold true when seeing the content!@@_techbk

    • @aribasiebel
      @aribasiebel 8 месяцев назад

      I think those who said this clickbait. Don’t understand there are 2 servers involved here. As a backend person I think essentially you are moving code from the backend server to the (frontend) server, right?

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Actually in this case, I don't have two different servers. It's just one server in AStro which handles both frontend and backend. But yes, moving fetch requests out of the frontend and moving to running logic on the server instead.@@aribasiebel

  • @constantine9074
    @constantine9074 8 месяцев назад

    Fetch

    • @JamesQQuick
      @JamesQQuick 8 месяцев назад

      Nice. Have you used a iOS before? Just still prefer fetch?

    • @constantine9074
      @constantine9074 8 месяцев назад

      @@JamesQQuick my web apps have huge h1 satating "only for Android"

    • @constantine9074
      @constantine9074 8 месяцев назад

      ​@@JamesQQuick im a beginner.. will pay attention from now on :))