4 ms·
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
by leerob 4y ago
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.
- saeedjabbar 4y agoExcited to try this out in my next project :)
- leerob 4y agoOpen to any feedback you have – we've already started work on the implementation, and will adjust as necessary based on the RFC discussion.
- codefined 4y agoNot seeing it in the article, but how are you handling `index` routing in the `app` folder? If you are putting it in the top directory (e.g. `/app/index.js`), is it not able to get a custom `layout.js` file (as that position is used for the global variant)? If it's in an `index` folder (e.g. `/app/index/page.js`), how would one create a route for `example.com/index`?
- leerob 4y agoThe current working idea is that you wouldn't use index.js. There are Layout Components and Page Components, both explicitly defined by `layout.js` and `page.js`. We are open to other opinions here, though. Others have shared similar sentiment: https://github.com/vercel/next.js/discussions/37136 https://github.com/vercel/next.js/discussions/37136
- realce 4y agoAm I correct thinking this will help create a simpler integration with - just hypothetically - Prisma calls that are dependent on app auth states in a single page? Replacing auth providers and moving them into Layouts? Daily user, very excited!
- leerob 4y agoYes, I believe you are correct. This would be a good example to add as the updates to `next/router ` start to materialize.
- rs_rs_rs_rs_rs 4y ago>happy to answer questions about the RFC Would love to hear about the parts of the RFC where you guys took some inspiration from Remix!
- leerob 4y agohttps://twitter.com/sebmarkbage/status/1528858510754459648 https://twitter.com/sebmarkbage/status/1528858510754459648
- gitgud 4y agoI 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.
- leerob 4y agoPart of the thinking behind `app/` is that each section of your application can become its own app. Separate layouts, separate data fetching, and more. `pages/` was mapped very linearly to routes – `pages/index.js` was the index route. But with `app/`, that is not the case. That's a good point about having a route `/layout` – I will check with the team about that.
- migueloller 4y agoSince segments are determined by folders, you should be able to do `/layout/page.js` for a `/layout` route.