Live data from Hacker News

Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

nextjs.org

51–60 of 123 posts

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#51

Could a smart person please compare and contrast this RFC and the ideas of remix.run?

The surface-level approach and APIs/conventions looks very similar, just with some slight differences that people may subjectively prefer over Remix. Personally my immediate reaction is that I prefer Vercel's convention of requiring all visitable routes to be represented by a leaf called page.js. In Remix, you can have a file anywhere in the routes that will create a navigable path segment using the same name as the file, e.g. the file /dashboard/settings.js will be visitable at the URL /dashboard/settings, whereas in Vercel this will need to be /dashboard/settings/page.js. I prefer Vercel's way of doing things, because with Remix you often end up with a .js file as a sibling of a directory with the same name, e.g. /dashboard/settings.js and /dashboard/settings/advanced.js, which means that you can't just look in the /dashboard/settings/ directory to see all of the routes with the prefix /dashboard/settings.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#52

I am not a fan of the “directory structure creating an implicit router” convention of next.js. I wish I would define a handler in code instead.

I never liked it either. At my last job I actually had a system which generated the Next.is pages folder based on a route config. The irony being that at build time, Next would then turn this folder into an internal route config that probably looked quite a lot like mine.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#53
post #14

Earlier quoted context omitted.

According to Ryan Florence (Remix's creator) they are "ripping features straight from Remix". https://twitter.com/ryanflorence/status/1528859776930545665

It’s an odd claim, because people have been asking for this (nested routes) more-or-less since Next was first released. In fact, Remix is basically a compiler for the patterns we could achieve back in the days of React Router 2 and 3 (2015-2017). The fact that the APIs looks similar seems largely inevitable based on the fact that everyone seems to be converging around defining routes using folder and file name conven…

It reminds me of patent trolls who patent obvious software designs. I was looking for such feature long before I heard of Remix. I know he's the react-router guy, but nested views isn't exactly some novel idea - sites have been using it forever.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#54
post #41

Earlier quoted context omitted.

It's a full fledged company and somehow Ryan Florence and the other guy are quite heavy handed in pushing their business which irks me. Even react router was moved to a business org called react training if I remember so that they could sell their courses. Now there is nothing wrong with earning money but this new wave of "open source" businesses is a bit yucky.

theres a lot of cognitive dissonance in monetization of open source by consumers of the product. If you can't charge money for the software, selling courses is the next best thing. Why is it yucky?

It's not the training, it's the fact that they moved the project repo under the React Training organization, and now it's under Remix... Just comes off as a cheap attempt at marketing while ruining the OSS image of the project.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#55
post #28

Earlier quoted context omitted.

So we need to give credit now to every little bit of inspiration we get when coming up with new features and ideas? Not really sure what the problem is here.

You'd have to ask Ryan :) IMO it's really just a matter of time before good ideas end up in other projects. It's inevitable. Obviously everyone wants their framework to be as good and popular as possible.

It's really not an especially novel idea either- there's not really a good reason for remix itself to be getting the credit here.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#56
post #14

Could a smart person please compare and contrast this RFC and the ideas of remix.run?

According to Ryan Florence (Remix's creator) they are "ripping features straight from Remix". https://twitter.com/ryanflorence/status/1528859776930545665

It's weird to me: I don't use Twitter and I don't intentionally follow influencers or celebrities in the tech world. Yet somehow RF has been the center of several bouts of developer of drama I've come across. Any idea why that might be?

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#57
post #18

Quoted post unavailable.

Next.js looks so, so much more mature than Joystick, the latter appearing to be one person's pet project. I don't understand why you shared it in this thread, and i really don't understand the "don't do drugs" bit.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#58

I am not a fan of the “directory structure creating an implicit router” convention of next.js. I wish I would define a handler in code instead.

Oh interesting. Why not? Directory and file based routing is my favorite feature of Next.js, Remix, and other frameworks that do it.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#59
post #23
post #22

Earlier quoted context omitted.

Naw, I don't agree. SSG is a killer feature. The fact that Next.js is able to do both SSG and SSR means that it's positioned to be a wholesale replacement for most React tech stacks. You can still have a "CSR-like" app with SSG, while having all of the Next.js conventions (such routing, layouts, etc.). Additionally, it's actually pretty useful for sites that need to be heavily SEO-optimized. Next.js is an impressive…

Static isn't going anywhere. In my opinion, one the best parts about Next.js is you can blend static with dynamic, on a per-page basis. Your landing page can be completely static + periodically updated in the background (i.e. ISR) and your /dashboard page could be a fully server-rendered application behind auth. You can do both without ejecting from the framework and being able to update and receive performance/secur…

I suspect the fear was about "next export" going away, not the SSG functionality within a next.js server-side app.

Re: Next.js Layouts RFC: Nested routes and layouts, designed for Server Components

#60

I am not a fan of the “directory structure creating an implicit router” convention of next.js. I wish I would define a handler in code instead.

Oh interesting. Why not? Directory and file based routing is my favorite feature of Next.js, Remix, and other frameworks that do it.

It makes route localization a second-class citizen in the framework at best, or a totally unsupported hack-your-own-solution thing at worst.
Post reply on HN