React Router V7 just dropped, here's why you should care

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

КОМЕНТАРІ • 135

  • @PedroCattoriIV
    @PedroCattoriIV Місяць тому +62

    Quick clarification: the typegen'd files are designed to be "stateless" as in you can make changes to the route files and the types will always be correct even if you haven't saved to filesystem yet. The only "static" thing that typegen depends on is `routes.ts`, so if you update that, you'll have to save it to get updates. But that happens much less frequently and more atomically than making changes to actual route modules.
    It's actually a part of the type-safety design that I'm really proud, so happy to chat about it more whenever!
    Oh and I think you're gonna like the design I have for "route directories" if you want better separation between "server-only" files and other stuff.

    • @GreatTaiwan
      @GreatTaiwan Місяць тому +1

      Is it possible to actually have file based routing thru react-router?

    • @wizardofawesome
      @wizardofawesome Місяць тому +1

      ​@@GreatTaiwan Yes, you can import the remix-flat-files package and it still uses file based routing

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

      is there a way to separately generate those types without running dev server or build?
      for example my GH workflow starts with parallel execution of biome, tsc and vitest and only after it proceeds to build. i assume that `tsc` should fail unless types are generated prior to that, am I right?
      Do we have something that could be run with prepare script?
      UPD: i found react-router typegen command, nice

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

      @@vorant94 The typegen is a tsc plugin, so it would run before tsc actually checks your types without any changes. I recommend you test it out.

  • @JLarky
    @JLarky Місяць тому +24

    entry server and entry client are the entry files, they are hidden by default now, but you can restore them :)

    • @incarnateTheGreat
      @incarnateTheGreat Місяць тому +2

      They should be available by default.

    • @imexoodeex
      @imexoodeex Місяць тому +1

      ​@@incarnateTheGreat if they would, next users would yell that next is easier, because it doesn't have it

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

      @imexoodeex I like next, but I appreciate Remix more. If people wanna complain about files that they don't wanna touch, then I don't know how else to make them feel better.

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

      @@incarnateTheGreat Yeah, we should probably put them in by default and just add a message saying you can delete them if you want.
      @imexoodeex Can't win them all. Better that developers know what they can use and how something works then trying to win a "who has the least amount of special files" game

  • @vipzip8863
    @vipzip8863 Місяць тому +13

    0:00 React Router V7: A Game Changer?
    1:12 Epic React Tutorial: A New Approach
    2:40 React Router V7 Upgrade Path and Features
    3:55 Building New React Apps with React Router V7
    7:00 React Router V7 for Server-Side Rendering
    13:38 Setting up a React Router V7 SSR Project
    14:40 Implementing Server-Side Rendering with Suspense
    18:00 Loader Functions and Data Fetching for SSR
    20:29 Comparison to Other Frameworks (Next.js, Remix)
    By snorvia AI chapter generator

  • @peroconino
    @peroconino Місяць тому +18

    11:20 export default doesnt break since it allows any name to be exported.

  • @incarnateTheGreat
    @incarnateTheGreat Місяць тому +28

    I like videos where people give Remix more attention and respect. I have absolutely NO desire to go back to Next.

  • @BigBill04
    @BigBill04 Місяць тому +14

    We haven't even finished migrating our app from v5 to v6 yet. The rate of change with this library is crazy for one that has such a wide impact.

    • @pablomayobre
      @pablomayobre Місяць тому +3

      v6 to v7 (no framework) is actually fairly easy... v7 WITH framework is a different story... but you don't need to go there unless you care about those extra features

    • @t3dotgg
      @t3dotgg  Місяць тому +11

      Bro it's been over 3 years that's on you

    • @BigBill04
      @BigBill04 Місяць тому +4

      @@t3dotgg Well it's one app of many at the company I work for, and we have other dependencies/business needs that were more important so this fell down the list.

    • @t3dotgg
      @t3dotgg  Місяць тому +5

      @@BigBill04 the crazy rate of change might not be on React Router then :)

    • @BigBill04
      @BigBill04 Місяць тому +4

      ​@@t3dotgg Well we all know that's the problem with JavaScript. But when a routing library makes a major change it has an impact on the people that use it. Especially one as popular as React Router.

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

    This was super helpful to watch you go through this, lots room for improvement to make the starter templates lead you through how the different pieces interact
    Thanks for all the feedback over the years and for the support on us focusing on supporting projects already built on react router

  • @daguttt
    @daguttt Місяць тому +2

    Great video! Looking forward to watch the Remix history video

  • @LucasAlves-bw9ue
    @LucasAlves-bw9ue Місяць тому +4

    We literally use react router mostly for client side routing which is great already.

  • @mikequinn
    @mikequinn Місяць тому +8

    It did actually say ABORT_DELAY was deprecated in that Issue you went to, you just didn't fully read it

  • @yudistiraashadi6643
    @yudistiraashadi6643 Місяць тому +7

    The problem with React Router is their docs. I remember looking for a function docs and I have to go to Remix docs event though I only use RR not Remix

  • @reichenwald-gm4qd
    @reichenwald-gm4qd Місяць тому +2

    I‘m glad to have migrated to Tanstack Router

  • @Angeal98
    @Angeal98 Місяць тому +16

    Docs for react router 7 are still bad.
    Data routers aren't documented at all.
    the template for react router 7 in framework mode installs tailwind for some reason?
    There is a lot of weird stuff going on

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

      Yeah, using it as a library is much easier and you have used rr-v5, then it's even more easy

  • @ankitkumarjat9886
    @ankitkumarjat9886 Місяць тому +1

    It's a really simple Layout in root is the entry point, although you can skip this and now your default export from root.tsx becomes the entry point. And for other named exports they clearly mentioned in their docs.

  • @MadsterV
    @MadsterV Місяць тому +2

    man, I love where React is, but I hate so much the direction it's going.
    - Mixed front and backend code: bad
    - Rendering TWICE, once in back once in front, all scalability benefits of JS gone: bad
    - Magic exports, hidden files: bad
    - JS backend: bad

  • @GreenPixel00
    @GreenPixel00 Місяць тому +29

    Fortunetly we have much beter router for react now, tanstack router

    • @luca4479
      @luca4479 Місяць тому +2

      Ts router is so good

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

      I don't know much about TS router but I I thought it was built off the back of react router

    • @muhammadheri2865
      @muhammadheri2865 Місяць тому +1

      Nope, react router v7 much better

  • @jarodtaylor
    @jarodtaylor Місяць тому +2

    Remix (and now RR7)'s single “flow” makes everything straightforward: for each route, you define what data you need (loader), how it looks (export default), and handle mutations (action + Form). You can skip client-side JS if you want, add caching with headers, and everything’s built into one approach. In contrast, things like Next often split data fetching (SSG, SSR, API routes) in ways that add extra complexity-especially when you need private data or dynamic updates. Remix keeps it simple, flexible, and powerful all at once. I'm excited for RR7.

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

      I will say, though... their documentation still sucks. haha

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

      You should dig into the clientLoader combined with the other loader(s). You can do so much more once you use them both together. Caching options are endless.

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

    would like a full video that includes the story of why ryan left to start reach router and then came back to work on react-router

  • @Eva-km5ng
    @Eva-km5ng Місяць тому +1

    It's possible to opt out of the loader and components being in the same file in RR7

  • @Kimo.Codess
    @Kimo.Codess Місяць тому

    Bruh I love how honest you are 😂

  • @gageracer
    @gageracer Місяць тому +5

    React is like Poker. People play it not because they like it but because it can pay your bills.

  • @Gus-xb7yd
    @Gus-xb7yd Місяць тому

    Interested in that Remix video!

  • @daninmanchester
    @daninmanchester Місяць тому +2

    In that ad read I thought you had one of those fake glasses, noses and moustache ensembles on !

  • @d123-o8j
    @d123-o8j Місяць тому

    I'm using v6 on my project. When its eventually released I'll be spending the next year updating my code base.
    However, I added my entire frontend codebase to a claude project and asked it if there are any major changes required and its told me it'll only take me 2-3 hours and what Im going to need to change. :D

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

      next year react v8 will be out and claude will tell you to bend over

  • @SnakeBuzz
    @SnakeBuzz Місяць тому +2

    Uhhh, you're actually seeing the export default... 11:30

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

      he's a junior dev who became a tech influencer for junior devs

  • @JLarky
    @JLarky Місяць тому +4

    Updating to Remix v2 and Remix Vite wasn't completely smooth :) excited but terrified to try v7 😅

    • @Eva-km5ng
      @Eva-km5ng Місяць тому +1

      I would've been able to switch from Remix to RR7 pretty smoothly but I'm using Sentry and that's the only dep that failed

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

      @Eva-km5ng how did it fail?

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

      the main problem for me was the flat-routes having only single level directory

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

      @@ukeshrestha good thing that you can plug your own routing if you want to

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

      ​@@Eva-km5ng yea cause RR7 not support VITE 6 yet. I use VITE 5.4.11

  • @aroyanbs
    @aroyanbs Місяць тому +2

    3 seconds is crazy

  • @a-poor
    @a-poor Місяць тому +7

    11:41 I guess I'm not sure what the difference between a magic export (e.g. "ErrorBoundary" or "links") vs a magic file name (e.g. "page.tsx" or "error.tsx")

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

    I see why most people love SSR and so do I myself - but when I want to use it there's Next (I know that app router might do some magic like here, but I think it's easier to understand app router than rr-v7 framework). SSR isn't always the best - if you don't care about performance, SEO and so on - React with CSR is enough, and I guess handling client side routing is the most common thing people want to use when using React Router.

  • @cocoscacao6102
    @cocoscacao6102 Місяць тому +1

    They still haven't figured out routing? Jeez

  • @ruaidhrilumsden
    @ruaidhrilumsden Місяць тому +1

    8:22 - I don't know about that man. Remix has been better than most for quite a long time: ua-cam.com/video/r4B69HAOXnA/v-deo.htmlsi=pmVDsohbjzERywb1

  • @x-dr6uh
    @x-dr6uh Місяць тому

    Magical entry point is such a pain. I hate it so much

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

    Hi Theo, can you make a video about the future of web development, and how do you think it will look like in the near future?
    (yes, I know this is a spammed topic, but I am interested in your opinion as the future of a no-code fully completed product is getting closer)

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

    I’m pretty sure those autogenerated types are going to go away. Part of the reason Svelte is moving so much towards more standardized JavaScript is to avoid needing to generate types, in part because the DX is so bad. In fact, I’ve seen reports that the next version of SvelteKit, which will require Svelte 5, won’t do any “magical” types anymore.

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

    Sticking to tanstack/router for now. I'm not yet convinced by react-router and remix approach to ssr. This whole "magic" stuff happening leaves me doubtful.

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

    seeing a public well-known and experienced person struggling with the same things about meta-frameworks, that i personally cannot stand (file-based routing, code-/typegen magic), is such a f*cking relief... can somebody explain to me why those things are necessary and how opposite solution (with config-based routing and no code-/typegen) would be worse or even impossible to achieve framework features we have currently?

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

      With RR7 you have the option to use config based routing if you want. You also have the option to not use TypeScript. So both your peeves are not in fact peeves with RR7

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

      @@mikequinn yeah but using a framework ts is installed out of the box. And so is Tailwind (yet somehow vite and rr-v7 forget about scss). Personally I don't care since I use ts and twcss but I see why people might want to use router without these two techs

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

    20:32 nobody has been fighting any "war", for fuck sake...

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

    I kind of wish there was an easier migration path from old CRA/webpack based apps to using vite. We're effectively stuck with CRA at work

    • @lamhung4899
      @lamhung4899 7 днів тому

      remove the react-scripts and install vite directly.
      Those migration depends on your injected craco or similar funtions :D

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

    Thanks I hate it, RR7 holds a ton of boilerplate code, while Remix was simple, JS Framework devs seem to forget that software don't revolve around their breaking update cycle.

  • @jordanwright3052
    @jordanwright3052 Місяць тому +8

    Web dev is just silly at this point. For most sites the entire job of the developers is just refactoring because at least one of their major dependencies will rewrite itself every quarter. It's worth it to reinvent the wheel and write in-house solutions; that way you dont have to write new code unless you actually want to change something.

    • @alastairtheduke
      @alastairtheduke Місяць тому +3

      So you're still writing jquery? Or raw dogging pure js?

    • @sligovolts
      @sligovolts Місяць тому +1

      "web dev is just silly" -- always has been

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

      We use Jjquery

  • @LutherDePapier
    @LutherDePapier Місяць тому +3

    Wait. It's been out since November 22?

  • @Iammrunkown
    @Iammrunkown Місяць тому +19

    Tanstack Router is better

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

      💯

    • @BleedingDev
      @BleedingDev Місяць тому +1

      I'd love to have Tanstack based on top of Rs* ecosystem rather than Vite ecosystem though.

    • @Iammrunkown
      @Iammrunkown Місяць тому +1

      @@BleedingDev I would also pay thousands to access Tanstack. It has definitely revolutionized front-end development

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

      Why can't you access it?
      Also, how do you know it revolutionized something if you couldn't access it?

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

      @@MrHamsterbacke756 Do you not understand hypotheticals?

  • @isaac10231
    @isaac10231 Місяць тому +2

    Did a double take seeing the author of the blog post

  • @juanmurga1571
    @juanmurga1571 Місяць тому +1

    im going to trust in tanstack router in my project

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

    Hey, curious what "sandox cd" does around 8:25. Anyone knows where I can find more information?

    • @spoofy5073
      @spoofy5073 Місяць тому +1

      "sandbox" is the name of the directory he was in, "cd" is the command to change to a different directory

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

      ​@@spoofy5073 :facepalm damn you're right 😅. Still too early here. Was hoping for sth. devbox like cli for quick isolation.

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

    A little bit cursed… as my migration)

  • @theldentity
    @theldentity Місяць тому +4

    remix is not getting killed at all, this is misleading

    • @incarnateTheGreat
      @incarnateTheGreat Місяць тому +2

      Remix on its own , I think he means to say.
      Remix-run tech is embedded in React Router and it works very well.

  • @williandamascenomusic
    @williandamascenomusic Місяць тому +1

    Please, it would be awesome to hear about remix history

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

    Yeah... I tried using React Router with Motion for some very specific transitions. Turned out after 3 days of testing that they just would not work together, so I literally had to build my own. Took me an hour to write q simple router that worked, 3 days to try to get an off the shelf working with my other junk...
    Funny how sometimes doing things yourself can actually be faster...

  • @hokkos
    @hokkos Місяць тому +1

    None of this is interesting to me, I am only interested in typesafety and ergonomic api and now use tanstack router.

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

    quack

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

    Damn, 7 hours and still no comments from brainrot tiktoker user about video being +10min longer lol

  • @childe2001
    @childe2001 Місяць тому +5

    Co-Founder is Michael Jackson? lol

  • @pit32
    @pit32 Місяць тому +82

    Easy answer: no.

    • @terrancrypt
      @terrancrypt Місяць тому +18

      bro saved 30 minutes of my life

    • @underflowexception
      @underflowexception Місяць тому +4

      The react ecosystem is a giant mess. Why do we need meta frameworks over frameworks

    • @dylh7559
      @dylh7559 Місяць тому +6

      ​@@underflowexceptionthey solve things

    • @alastairtheduke
      @alastairtheduke Місяць тому +2

      @@underflowexception there wil always be a need for batteries included solution. always.

    • @tedchirvasiu
      @tedchirvasiu Місяць тому +5

      @@underflowexception here we go, the react abolitionist andy

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

    if they add server components then it would great

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

    11:05 my guy, it's a default export. It isn't rocket science as for why the name doesn't matter.

  • @jackjameson6826
    @jackjameson6826 Місяць тому +4

    This video shows why you should never use react-router framework mode or anything with remix name. Well done, Theo 👏

    • @Eva-km5ng
      @Eva-km5ng Місяць тому +20

      This video shows that JS devs are quick to judge any framework they haven't already learned. If he spent as much time learning RR before doing this video as it takes to figure out the undocumented caching bs of Next, then his experience would almost certainly go more smoothly.

    • @alastairtheduke
      @alastairtheduke Місяць тому +5

      @@Eva-km5ng This is the problem with these news videos. While it's good to keep up with the latest stuff, you're going to get a tutorial by someone who's basically never used the new version, hasn't read the docs, etc

    • @mikequinn
      @mikequinn Місяць тому +1

      Well that is just a ridiculous take. If you jump in to any framework and make assumptions on how it works without first reading the documentation then yes you will have a bad time.

  • @User948Z7Z-w7n
    @User948Z7Z-w7n Місяць тому

    Yeah I just use Next.js

  • @alexmastin1287
    @alexmastin1287 Місяць тому +2

    First 👀

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

      Nice. You will get your award after GTA6 gets released 🎉

  • @plaintext7288
    @plaintext7288 Місяць тому +3

  • @sK0pe-d9b
    @sK0pe-d9b Місяць тому +17

    Just stop using React