Live data from Hacker News

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

nextjs.org

31–40 of 123 posts

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

#31
I've stayed at the periphery of front end tech. I am comfortable with react, but often eschew it for the impedance mismatch with the server.

With the rise of server side front end practices, it dawns on me that there may be opportunities for integration with other server side runtimes? Asked naively, is there any possibility of an "FFI" integration for Next APIs? Anything more sophisticated than running a subprocess javascript VM?

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

#32

We're irrationally excited about this internally and we're super happy with how the Vercel team has continued to push Next.js forward. Thank you! We're using a version of the persistent layout pattern Adam Wathan [blogged about]( https://adamwathan.me/2019/10/17/persistent-layout-patterns-... ) but having first-class support for this paradigm will be awesome.

"irrationally excited" - what does this phrase mean? that there is no basis for your excitement? sounds so cheesy

excited beyond reason? try lactaid.

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

#33

We're irrationally excited about this internally and we're super happy with how the Vercel team has continued to push Next.js forward. Thank you! We're using a version of the persistent layout pattern Adam Wathan [blogged about]( https://adamwathan.me/2019/10/17/persistent-layout-patterns-... ) but having first-class support for this paradigm will be awesome.

"irrationally excited" - what does this phrase mean? that there is no basis for your excitement? sounds so cheesy

being more excited that you can readily account for

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

#34
post #19

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

It's almost an exact copy aside from the conventions and names. It very much _is_ Remix. This is pretty wild. It also brings one of my gripes from Remix: parallel fetching. In practice it makes sense, but at times there needs to be a way to fetch data on a parent route first so that child routes don't fetch again. I'm sure Vercel will find a way to solve this.

Doesn’t Outlet context solve your issue? It let you share data between parent and child path. Of course it is during rendering so you can’t use parent data in your loader.

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

#35
post #25

What amazing news! Nextjs is fun to use, but the pages concept has felt a little clunky. Nuxtjs (vue's version) has a great pages abstraction, but it doesn't nest layouts, like this proposal. There's some obvious inspiration from other frameworks, as Remix and Angular 2.x have had nested routing for years. Hopefully this will allow for less repetition in pages and a more elegant structure to projects.

Exactly. Remix creators wrote in a blog post that they inspired by Ember.js. It looks to me people reinvent the wheel all the time. Luckily Ember.js provides all these functionalities for a decade now and just getting better.

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

#36
post #19

Earlier quoted context omitted.

It's almost an exact copy aside from the conventions and names. It very much _is_ Remix. This is pretty wild. It also brings one of my gripes from Remix: parallel fetching. In practice it makes sense, but at times there needs to be a way to fetch data on a parent route first so that child routes don't fetch again. I'm sure Vercel will find a way to solve this.

Doesn’t Outlet context solve your issue? It let you share data between parent and child path. Of course it is during rendering so you can’t use parent data in your loader.

> Of course it is during rendering so you can’t use parent data in your loader.

I specifically want the parent data to perform redirects in child routes. The only solution is to manually add the redirects at the parent level (like a whitelist).

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

#37
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

https://mobile.twitter.com/sebmarkbage/status/15288585107544...

> No shame in copying but the first prototype of this started before Remix was available. It was more inspired by traditional server routing techniques (like FB used) with React Router locality with Next.js file conventions. So it's more about convergent evolution in this case.

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

#39
post #27
post #2

Lee from Vercel, happy to answer questions about the RFC or future plans for Next.js. This RFC has been years in the making – and I'm pretty happy with where we've landed.

I like that you have thought about incremental adoption. However it looks like you're effectively deprecating the "/pages" directory. Which kind of sucks, as it's much more informative name, than the new generic "/app" folder. Also, does this mean you cannot have a page named "layout" anymore? Lastly, I appreciate all the hard work that goes into nextjs, it's a great developer experience and my goto framework.

Since segments are determined by folders, you should be able to do `/layout/page.js` for a `/layout` route.

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

#40
post #26
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

I definitely understand the reaction. This is an existential threat to Remix. However, this is why I don't use Twitter. Remix is not just "an open-source project", it's a full-fledged company. This is definitely not the time (or the forum) to lay your cards out on the table...

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.
Post reply on HN