I found "use cache" BEFORE it dropped

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ม.ค. 2025

ความคิดเห็น • 120

  • @seanmills3502
    @seanmills3502 2 หลายเดือนก่อน +283

    Is there a "use cash" feature? Because I could use some cash.

    • @noobnessmee
      @noobnessmee 2 หลายเดือนก่อน +18

      Nah, that's for PHP devs.

    • @buildwithharshit
      @buildwithharshit 2 หลายเดือนก่อน +2

      @@noobnessmee actually 😅

    • @follantic
      @follantic 2 หลายเดือนก่อน

      "use lambo";

    • @stercorarius
      @stercorarius 2 หลายเดือนก่อน

      c++ std library has a get_money function

    • @TheScottShepard
      @TheScottShepard 2 หลายเดือนก่อน

      You must be a front-end developer

  • @hl7297
    @hl7297 2 หลายเดือนก่อน +85

    reverse engineering an open source

  • @Roacoelho
    @Roacoelho 2 หลายเดือนก่อน +25

    Couldn't agree more. Next cache is really confusing sometimes or too opinionated, maybe. Idk. I'm letting the initial code without any cache config and fixing it as needed down the road.

  • @tryitpro674
    @tryitpro674 2 หลายเดือนก่อน +50

    Is it just me or does it seem like JS directives are being abused here?
    Maybe I'm missing something, but this "API" feels incredibly janky and in my opinion is likely indicative of an overall design flaw.

    • @pokefreak2112
      @pokefreak2112 2 หลายเดือนก่อน +7

      Pretty much every js framework abuses js syntax or just straight up adds new syntax or AST transformers to achieve what they want.
      I wish one of them would go all out and just make a new programming language already that's heavily based on js but actually has first-class support for the features they wanna add like components or reactive state. React came closest with jsx but it's still very half-baked because it's just sugar for createElement(element,props,children)

    • @JonathanRose24
      @JonathanRose24 2 หลายเดือนก่อน +2

      Couldn’t agree more. This is getting absurd already

    • @ceigey-au
      @ceigey-au 2 หลายเดือนก่อน +3

      @@pokefreak2112 I'm not sure how active the development is, but I remember mint-lang was basically that, React concepts baked into a pretty declarative language.
      In any case, at the end of the day it's gonna be sugar for JS or sugar for WASM. The tricky part is making sure all the sugar is "standard" and works well in the language, and, well, random magic strings are probably not really great. It'd be nicer to have some sort of Next context object that you can set a flag to or call a method on, so then you didn't need a custom build step. But anyway... ship's sailed I guess.

    • @dealloc
      @dealloc 2 หลายเดือนก่อน +3

      @@pokefreak2112 See Flow. It has a component type and render type specifies. If you think creating a language is a good solution to what some people consider "bad API", then you're off the mark.

    • @yojou3695
      @yojou3695 2 หลายเดือนก่อน

      ​@@pokefreak2112 svelte pretty much

  • @robslaney3729
    @robslaney3729 2 หลายเดือนก่อน +1

    It has been stated that the hardest 2 things in programming are naming, cache invalidation, and fixing off by 1 errors

  • @manuel_g_g
    @manuel_g_g 2 หลายเดือนก่อน +4

    This feature and several others that Vercel engineers are developing open the doors (to the business sector) to a new generation of applications, faster and less expensive at the back-end level. Of course, they are not things that currently cannot be achieved with other mechanisms, it is just that if Vercel or any other reputable company takes them as base features of their framework, things will begin to become popular and be considered a reasonable option for the corporate sector. And that also helps the entire ecosystem, including open-source.

  • @helleye311
    @helleye311 2 หลายเดือนก่อน +2

    Pretty great to see this. Finally they got caching right, you tell it where and how to cache something and it just does.
    I just hope there will be an eslint plugin to warn you of the things that error out in build, wouldn't mind getting a warning in the editor instead of waiting a few minutes just to get a 'pipeline failed' on github.
    Also great to see the cached async function at 24:20, We can just make a function, return some JSX, and it all just works. Getting closer and closer to Dan Abramov's "just copy the code from client and paste it on the server"
    Now just waiting for GET server actions/functions and we'll be golden!

  • @codeChuck
    @codeChuck 2 หลายเดือนก่อน

    26:26 I can't even read so fast as you write with AI! This so cool! Your speed of iteration is of COSMIC SIZE. While I would only create a file, you already wrote all code and run the demo :D
    This AI helper is something!

  • @codeChuck
    @codeChuck 2 หลายเดือนก่อน

    28:50 It is so useful that you are showing the actual workflow of bugfixing! When there is a polished video without any bugs, it feels unnatural!
    When I do stuff, I'm getting lots of errors! Cause I frequently do dumb stuff :D And watching how YOU react to error is an amazing experience! Of course, if the bug does not take 10 hours to fix, lol
    :D

  • @ljuglampa
    @ljuglampa 2 หลายเดือนก่อน +1

    It's wild that they didn't do this from the start. Opt-in to caching, do not cache by default - and also differently in dev/prod. No wonder there was a lot of confused and annoyed developers.

  • @alastairtheduke
    @alastairtheduke 2 หลายเดือนก่อน +7

    If Lee Rob talks about it , is that really 'leaking?'

  • @robslaney3729
    @robslaney3729 2 หลายเดือนก่อน

    @23:29 The immediate use case for me is when making calls out to external "metadata" endpoints, like oidc well-known config. That is generally cached for 24 hours and now I don't have to worry about doing that basic behaviour myself

  • @samuelgunter
    @samuelgunter 2 หลายเดือนก่อน +13

    Next time they try to hide something they need to try harder

    • @alastairtheduke
      @alastairtheduke 2 หลายเดือนก่อน +1

      the dev rel guy, 'LEAKED' it

    • @frowin2
      @frowin2 2 หลายเดือนก่อน

      I think they know what they’re doing. They might not care or do it on purpose even? It gives some media buzz and people are more tolerant to bugs. Or what do you think?

  • @captainlennysub
    @captainlennysub 2 หลายเดือนก่อน +3

    Didn’t next 15 just get released and now cache is not default

  • @edwardallenthree
    @edwardallenthree 2 หลายเดือนก่อน +6

    Getting really into remix. There's a lot I don't like, but everything I don't like about remix is exactly the same things that I don't like about the app router in next.js.
    Although, this video highlights one of the exceptions.

    • @Mmk-734
      @Mmk-734 2 หลายเดือนก่อน

      Time to look into Tanstack Start

    • @noobnessmee
      @noobnessmee 2 หลายเดือนก่อน +4

      Remix docs sucks

    • @edwardallenthree
      @edwardallenthree 2 หลายเดือนก่อน

      @@noobnessmee yes. Yes they do. Maybe if I reread them again...

    • @bruceleeharrison9284
      @bruceleeharrison9284 2 หลายเดือนก่อน +1

      I'm a fan of remix, but the lack of middleware is a nonstarter for me. So much copy-paste is required for simple things like authenticated route paths.

    • @edwardallenthree
      @edwardallenthree 2 หลายเดือนก่อน

      @@bruceleeharrison9284 Right now I'm just doing research. I'm trying to port our next.js app that makes heavy use of swr to see how that compares to porting the same project to the page router.
      Likely we'll keep using Next.js and the page router for a while, but it's fun to learn new things.

  • @medbenbrahim3246
    @medbenbrahim3246 2 หลายเดือนก่อน

    Back to `goto` days then, look for a "use cache" somewhere. I think they are using js directives to simplify build/bundle system, on the other hand they are introducing indirection a lot.

  • @zwanz0r
    @zwanz0r 2 หลายเดือนก่อน +1

    I hope that the directive to enable this new feature is "use \"use cache\""

  • @abdulwadoodzawity9523
    @abdulwadoodzawity9523 2 หลายเดือนก่อน +8

    nextjs 15 soon hopefully really good
    i love your videos man

    • @dopetag
      @dopetag 2 หลายเดือนก่อน +1

      let's pray that they can make it this time

    • @tusharjain9701
      @tusharjain9701 2 หลายเดือนก่อน

      It's launched today

    • @OP-ig1fj
      @OP-ig1fj 2 หลายเดือนก่อน

      it was launched 10 hours ago lol

    • @abdulwadoodzawity9523
      @abdulwadoodzawity9523 2 หลายเดือนก่อน

      @@OP-ig1fj i know bro i commented and saw it lol
      i'lll try it tomorrow

  • @lynxcat4life
    @lynxcat4life 2 หลายเดือนก่อน +2

    I'm super super stoked about Next 15

    • @mathesonstep
      @mathesonstep 2 หลายเดือนก่อน +1

      It's marked as stable now!!!

    • @maciekdeveloper
      @maciekdeveloper 2 หลายเดือนก่อน +2

      @@mathesonstep it's marked as stable, but it is really stable?

  • @jsvrs
    @jsvrs 2 หลายเดือนก่อน

    I just want this "use anti-ddos"

  • @viktor6726
    @viktor6726 2 หลายเดือนก่อน +4

    15 already shipped :)

  • @haaxor1689
    @haaxor1689 2 หลายเดือนก่อน

    I liked the unstable_function more with only a single downside that it was hard to customize the tags of it since they needed to come from outside of the unstable_cache call. The cacheLifetime and cacheTags seem promising but until they are usable in server functions called from client components it really isn't usable sadly.

  • @MrManafon
    @MrManafon 2 หลายเดือนก่อน +18

    Guillermo doing a commit named “founder mode” on a demo app that is not even of a todolist complexity is sooooo cringe. Almost as cringe as Theo saying he is “leaking” and “reverse engineering” nexjs. And not as cringe as Vercel thinking that having less caching code is the way to fix the fact that they gave us not enough control.

    • @realmimak
      @realmimak 2 หลายเดือนก่อน +3

      >reverse engineering
      > j*vascript
      pick one

  • @OP-ig1fj
    @OP-ig1fj 2 หลายเดือนก่อน

    guys just check the web sometimes, nextjs 15 is out.

  • @Mmk-734
    @Mmk-734 2 หลายเดือนก่อน

    No mention or comparison with Tanstack Start?

  • @_aNeaire
    @_aNeaire 2 หลายเดือนก่อน

    Could you make more videos on reverse engineering? It really helps newcomers to the ecosystem grasp things more easily!

  • @akashdeepdas6782
    @akashdeepdas6782 2 หลายเดือนก่อน +18

    Why we need so much abstraction for just a simple Cache-Control header.
    Cache-Control: max-age=10, stale-while-revalidate=20
    Does after all this abstraction NextJS generate Cache-Control header like above that can be used by all CDN or some vercel specific magic 🪄.
    For on demand revaldation we should be able to declare our own revalidate function where we can send a API request to the CDN provider we are using to delete the cache. It will allow self host it without missing stale-while-revalidate feature.

    • @arturoaguilera5167
      @arturoaguilera5167 2 หลายเดือนก่อน

      because next.js xD

    • @lessko9
      @lessko9 2 หลายเดือนก่อน +1

      Cache-Control header doesnt include ISR and other next specific things

    • @aberba
      @aberba 2 หลายเดือนก่อน

      Not sure why the complications myself.

  • @rikschaaf
    @rikschaaf 2 หลายเดือนก่อน

    But wait, if you aren't allowed to use headers in a 'use cache', then how do you add a cache tag based on the header values?

  • @desLunes
    @desLunes 2 หลายเดือนก่อน

    Is that still in the "front end" domain ?

  • @theBarracuda_
    @theBarracuda_ 2 หลายเดือนก่อน +21

    theo intro is outdated now :( NextJs isn't quiet anymore, 15 is stable alr

  • @BellCube
    @BellCube 2 หลายเดือนก่อน +1

    I love this. I unoquivocally love this.

  • @ivan.jeremic
    @ivan.jeremic 2 หลายเดือนก่อน

    "use suspense" incoming.

    • @arfaahmed7306
      @arfaahmed7306 2 หลายเดือนก่อน

      What about 'use strict'?

  • @randy918
    @randy918 2 หลายเดือนก่อน

    The thumbnail shots remind me of Lucille Ball

  • @rubiglam
    @rubiglam 2 หลายเดือนก่อน

    Im the only person who likes the new version? I like the stability versions, and this version improves a lot things requested by developers

  • @arfaahmed7306
    @arfaahmed7306 2 หลายเดือนก่อน

    I’d like to ask those criticizing Next.js for directives like 'use cache', 'use client', and 'use server': while 'use cache' was introduced by Next.js, 'use client' and 'use server' actually came from React. Just like JavaScript’s 'use strict' directive, these aim to enhance performance and enforce best practices. So why single out Next.js for using tools that improve modern web development?

  • @shapelessed
    @shapelessed 2 หลายเดือนก่อน

    Every time I heard "caching is hard" from other devs I was like "phew, you're overestimating it"...
    ...Then I implemented adaptive replacement cache for a filesystem one day and realised how annoying this thing is.
    Luckily I live in the EU where we don't have software patents, so I was free to just looked up a few US patents for filesystem caching, blatantly steal their ideas and figure out a good middleground.

  • @yeetdatcodeboi
    @yeetdatcodeboi 2 หลายเดือนก่อน

    Hey Theo there is a typo in this uploads description.

  • @snatvb
    @snatvb 2 หลายเดือนก่อน

    I don't want to use nextjs anymore. because it has a big difference between development and production behavior
    and it's also pretty tightly bound to the vercel platform

    • @jsvrs
      @jsvrs 2 หลายเดือนก่อน

      so dont use then

    • @snatvb
      @snatvb 2 หลายเดือนก่อน

      @@jsvrs I don't use it in my projects anymore :)

    • @jsvrs
      @jsvrs 2 หลายเดือนก่อน

      @@snatvb cool

    • @waleedsharif618
      @waleedsharif618 2 หลายเดือนก่อน

      Its getting better

  • @bkohnen
    @bkohnen 2 หลายเดือนก่อน

    not caching during dev is the most confusing to me
    especially when working with external APIs that have rather strict request limit

  • @manuel_g_g
    @manuel_g_g 2 หลายเดือนก่อน

    29:08 ✅ 🧐👍 worth it

  • @bruno3
    @bruno3 2 หลายเดือนก่อน +3

    How does one reverse-engineer open-source code?

  • @md6886
    @md6886 2 หลายเดือนก่อน +1

    Big changes again? 😅

  • @mandarliev
    @mandarliev 2 หลายเดือนก่อน

    I don’t think they are quiet while literally they released yesterday

    • @t3dotgg
      @t3dotgg  2 หลายเดือนก่อน +1

      Nothing I discuss here is in the 15 release notes :)

  • @tylerthomas6932
    @tylerthomas6932 2 หลายเดือนก่อน

    This doesn't solve caching when you're running multiple instances of the site.

    • @nwsome
      @nwsome 2 หลายเดือนก่อน

      AFAIK, it does as long as you are on Vercel

    • @tylerthomas6932
      @tylerthomas6932 2 หลายเดือนก่อน

      @@nwsome yeah I mean vercel manages all of that for you anyways right?

  • @dm2060
    @dm2060 2 หลายเดือนก่อน +3

    Imagine reacting (ie content stealing) from a smaller channel and then trying to bully them when they ask you to stop stealing from them.

    • @danielchettiar5670
      @danielchettiar5670 2 หลายเดือนก่อน +2

      Who's the other channel?

    • @dm2060
      @dm2060 2 หลายเดือนก่อน

      @@danielchettiar5670 The theft victim? Honeypot.

  • @1kjm
    @1kjm 2 หลายเดือนก่อน

    30mins???😮

  • @dannyisrael
    @dannyisrael 2 หลายเดือนก่อน

    I appreciate you!

  • @denespapp1963
    @denespapp1963 2 หลายเดือนก่อน +4

    so you reverse engineered open source code that's publicly available? 🤔 I don't think that's what reverse engineering means

  • @codeChuck
    @codeChuck 2 หลายเดือนก่อน

    27:31 Your page is DDOSed by you using an alert(); xD :)))

  • @succatash
    @succatash 2 หลายเดือนก่อน

    U A/B testing thumbnails I've gotten 4 different ones

  • @qwerty-or1yg
    @qwerty-or1yg 2 หลายเดือนก่อน

    next is a mess (- _ - )

  • @minikame2272
    @minikame2272 2 หลายเดือนก่อน

    soke

  • @poulticegeist
    @poulticegeist 2 หลายเดือนก่อน +1

    Oof. At 5:30 nobody told Theo that js is perfectly fine and is in general preferred over the jsx extension. Tsx is inescapable and most likely, Theo 's just been in TS land for so long that he assumed the same applies for vanilla js. This is the most charitable viewing of Theo's response I can come up with without doing crazy mental gymnastics

    • @LeonMarzahn-t6n
      @LeonMarzahn-t6n 2 หลายเดือนก่อน

      Most IDEs will not recognize JSX syntax if its not in a .jsx file. I dont know how you did these mental gymmastics

  • @ReinvanHaaren
    @ReinvanHaaren 2 หลายเดือนก่อน

    Awesome

  • @scrambled_greg
    @scrambled_greg 2 หลายเดือนก่อน

    Sick.

  • @pixiedev
    @pixiedev 2 หลายเดือนก่อน +1

    Thank god I use nuxt 😂

    • @arfaahmed7306
      @arfaahmed7306 2 หลายเดือนก่อน

      Hahaha, how do you use Axios in Nuxt? Tell us! Can we use Axios in Nuxt 3? 🤣 🤣

  • @MsGuimmy
    @MsGuimmy 2 หลายเดือนก่อน

    Awesome video!

  • @franklemanschik_de
    @franklemanschik_de 2 หลายเดือนก่อน

    😂😂😂 consider browser caching 😅😅😅

  • @brennan123
    @brennan123 2 หลายเดือนก่อน

    They have to use "await" just to know something is dynamic? lol
    Stop caching everything by default and let me add caching when I want it. This is so lame. All these weird quirks to work around bad architecture. Worst case scenario just add something inside cookies() to flag it as dynamic if you really need to. Don't force it to be async.
    'use cache' to workaround the workaround. smh
    How can anyone think this is a good design? The fact that Theo says "I don't know" so many times in this video is proof it is a bad design. Nobody understands how it works or what is cached when unless they make Next.js their entire life. And even then it is just going to change in the next version anyways.
    Keep it simple. Let the user opt in to caching when they want and the rest of the time don't do anything.

  • @aymenbachiri-yh2hd
    @aymenbachiri-yh2hd 2 หลายเดือนก่อน

    i enjoyed it

  • @additionaddict5524
    @additionaddict5524 2 หลายเดือนก่อน +3

    lol, invalidate this video

  • @vincentnthomas1
    @vincentnthomas1 2 หลายเดือนก่อน

    no no no no no i don't like any 'use [thing]' at all. Do stuff like React Router v7/Remix V3 is. Its so much better.

    • @arfaahmed7306
      @arfaahmed7306 2 หลายเดือนก่อน

      I used Remix and didn’t find anything particularly special about it. It essentially does the same thing as Next.js’s Pages Router-fetching data on the server and passing it to the UI at the route level. Next.js’s App Router, however, is different; it was designed to adopt React Server Components.

  • @_briantravis
    @_briantravis 2 หลายเดือนก่อน +1

    first

  • @cckeysify
    @cckeysify 2 หลายเดือนก่อน

    react 🤮

  • @pencilcheck
    @pencilcheck 2 หลายเดือนก่อน

    first?

  • @robrita
    @robrita 2 หลายเดือนก่อน +3

    let's get an ai agent monitor their github commits 😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅😅