Fetching and Caching data in Next.js Async Server Components

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024

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

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

    🚀 UPDATED VERSION: ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF 🚀

  • @XinXinTax
    @XinXinTax Год назад +2

    This guy deserves a handsome bonus from supabase

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

      We send him a lot of swag - he seems happy! 🧢

  • @ankitnegi4802
    @ankitnegi4802 11 месяцев назад +2

    Damn i love this man , the way he explains is the best well at least for me , thank you so much :>

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

    Duuuuude. The production quality of your videos (which was already extremely high) just went through the roof. This is incredible. You make everything so easy to understand, and fun to follow along. Really great work. Supabase has got a gem in you! ⭐

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

      Check out this one next! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @tarekghosn3648
    @tarekghosn3648 Год назад +2

    Man your videos drop on point. I wish you can do more of them sooner.

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

      Another one dropped today! 🚀
      ruclips.net/video/6MoYy62E4rw/видео.html

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

      We can do you one better! An entire course! 🔥
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @saurabh75prakash
    @saurabh75prakash Год назад +2

    For me Nextjs(v13.4.10) behaviour in DEV and PROD mode is same, ie the new post don't show up on refresh. Anyone facing the same issue?

  • @AnthonyTrimble
    @AnthonyTrimble Год назад +7

    Super helpful. Could really use an updated auth one. Especially now that route handlers are a thing. Thanks!

    • @JonMeyers
      @JonMeyers Год назад +4

      Here is one for Auth in Server Components - you can actually follow the same pattern for Route Handlers, but I will be putting out a video on this soon 👍
      ruclips.net/video/Bh1TOpOcGJQ/видео.html

    • @JonMeyers
      @JonMeyers Год назад +2

      Here is the new one on Route Handlers 👍
      ruclips.net/video/6MoYy62E4rw/видео.html

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

      Here is a brand new course that shows you how to integrate Supabase Auth with all the new Next.js 13 App Router things - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

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

    Video was really well done!

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

      Thanks! Glad you enjoyed it! 🙌

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

      Check out this brand new course for even more of that Jon 🔥
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @merdzhen_k
    @merdzhen_k 6 месяцев назад +1

    What about the fact that Next.js official documentation says that revalidation doesn’t work with generateStaticParams?
    “During revalidation (ISR), generateStaticParams will not be called again”
    And you can check that it really doesn’t revalidate if you set dynamicParams = false

  • @geekySRM
    @geekySRM Год назад +2

    Beautiul tutorial!

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

      Thanks! Glad you enjoyed it! 🙌

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @zdargahi
    @zdargahi Год назад +2

    very helpful, thanks

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

      Awesome! Glad you enjoyed it! 🙌

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @genaroibc
    @genaroibc Год назад +2

    exelent!!

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

      Thanks! Glad you enjoyed it! 🙌

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @UmairAyub-dev
    @UmairAyub-dev Год назад

    Awesome video! a quick question,
    Will these methods work for large databases with 30,000+ rows?

  • @misterzucker4131
    @misterzucker4131 Год назад +2

    amazing video thank you

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

      You're welcome! Glad you enjoyed it! 🙌

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @necesidaddelocura
    @necesidaddelocura Год назад +2

    Good video!

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

      Thanks! Glad you enjoyed it! 🙌

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

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

    found out, you are my saver!

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

      Glad I could help! 🙌

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

      @@JonMeyers How could I update the screen with the mutation data from Server component without hard fresh browser? The posts datas flow from the page.tsx and mutated by the onClick event in the child component.

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

      ​@@SeaRich Jon's new course might help with this one. He goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @fan6684
    @fan6684 11 месяцев назад

    Why NEXTJS APP Router page add an `export const revalidate = 0` No update data ,Need me Manually refresh the website page update data🤯

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

    cool, thx.

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

      You're welcome! 👍

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @anthonyjudede-gol7199
    @anthonyjudede-gol7199 Год назад +3

    very nice

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

      Thanks Anthony! Glad you enjoyed it! 🙌

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

  • @appstuff6565
    @appstuff6565 11 месяцев назад

    note to self: understanding how to match specific user data and retreive only that data. @12:00

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

    could you please make video for pagination in nextjs 13 and supabase

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

    thanks for that!

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

      If you enjoyed this one you should check out his new course! 🔥
      Jon goes through using Supabase with all the new Next.js 13 App Router bits - Client Components, Server Components, Route Handlers, Server Actions and Middleware! 🚀
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

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

    Great tutorial! Just one question. I noticed that when I go to the revalidate route and a new entry shows up after the 60 seconds have passed and I refresh twice, that the static route now also reflects this changes. One the other hand, if I navigate to the dynamic route where the changes are reflected instantly, the result is not carried over to neither the revalidate nor the static route
    - what is the reason for that?

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

      Next.js heavily caches Server Components. To ensure fresh data you can add an `export const revalidate = 0` to mark the route as dynamic, or call the `revalidatePath` function! This new course has a good example of the latter 👍
      ruclips.net/p/PL5S4mPUpp4OtMhpnp93EFSo42iQ40XjbF

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

    why use app/static/pages? and not /pages/?

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

    what about for images ?

  • @appstuff6565
    @appstuff6565 11 месяцев назад

    Hi Jon, thanks for this. Im using cookie based auth system along with route handling. I am creating a username for each uid, however how can i fetch a certain username's data in my local host without logged in.
    For eg:
    if my username is abc, then only localhost:3000/abc should fetch the data of abc username. Right now im having a situation where any slug i use after localhost:3000/[slug or username] , it still shoes the same data. How do i check if there is no username redirect to 404 or back to home page. Im using app> [creatorSlug]>page.tsx .
    I also have disabled RLS for now on my supabase tables. Once i figure this out ill activate it in the end, or is RLS the very answer to the issue i have spoken?
    Thanks

    • @appstuff6565
      @appstuff6565 11 месяцев назад

      to add to this, i have 2 logged in users who can each access each other data.

  • @thequang9234
    @thequang9234 9 месяцев назад

    i love supabase

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

    Is this still working, I tried implementing this following next/supabase docs and I couldn't get it to work.(I get the emptry array, but adding policies in supabase doesn't change it).
    I created a new next app from scratch, and new supabase database, and followed this and still get to an empty array. (So I'm making API requests successfully [i see counter in supabase home page] however it seems I'm not being allowed to select the data. Has there been any breaking changes in next 13 app? Can anyone confirm this all still works?

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

      I have the same issue. I even disabled RLS and still get an empty array. Were you able to get it to work?

    • @FlyungPanda
      @FlyungPanda Год назад +2

      I was able to get it to work by entering the column names in the select.
      import supabase from "@/utils/supabase";
      export default async function Posts() {
      let { data: posts, error } = await supabase
      .from("posts")
      .select("id, created_at, title");
      console.log(posts);
      return {JSON.stringify(posts, null, 2)};
      }
      For some reason when my select is empty (as shown in the video), I get an empty array.

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

      @@FlyungPanda Yes I also discovered that .select() and .select('*') doesn't work, might be a next issue....

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

      Very strange! I just spun up a new Next.js app (13.2.4) and it appears to work with RLS disabled, or a policy with an expression of `true` to enable read access to the table.

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

      This was also using supabase-js 2.12.1 with just .select() and exporting a revalidate prop