Re:You don't need Next.js – Why we migrated from Next to React
by leerob on Wednesday January 01, 2025 @12:50PM
(#42567661)
Re: why can't I access request: https://nextjs.org/docs/app#how-can-i-access-the-request-obj...
If filesystem routing isn't something you enjoy, Next.js probably isn't the right tool for you.
Re:You don't need Next.js – Why we migrated from Next to React
by hu3 on Wednesday January 01, 2025 @01:27PM
(#42567969)
> You intentionally cannot access the raw request object. However, you can access headers and cookies through server-only functions. You can also set cookies.
> Layouts do not rerender. They can be cached and reused to avoid unnecessary computation when navigating between pages. By restricting layouts from accessing the raw request, Next.js can prevent the execution of potentially slow or expensive user code within the layout, which could negatively impact performance.
I don't like this limiting "I know best what's good for you" attitude in my tooling.
Yes limits are desirable to avoid footguns but this seems like too dumbed down of a restriction for little gain.
Re:You don't need Next.js – Why we migrated from Next to React
by citizenpaul on Friday January 03, 2025 @08:18PM
(#42591336)
Do some people prefer using filesystem routing? I don't think I've used it before but it sounds clunky.
Re:You don't need Next.js – Why we migrated from Next to React
by mzronek on Wednesday January 01, 2025 @01:57PM
(#42568210)
You can opt out by using a single (optional) catchall route and handle the path all by yourself. This is sometimes necessary to handle CMS pages for example.
Docs: https://nextjs.org/docs/app/building-your-application/routin...
Why not exposing an API for RSC so that i can imperatively fetch a RSC page with normal fetch call ? Why hiding such a killer feature so that you don't need HTMX anymore.
Also, why conventionally forcing the "RSC page" can't access the Request object in lue of caching. Instead of flexibility of a framework, you force things which users don't prioritize.
Ah, one last point, file system routing without anyway to opt-out is a red flag of the architecture as well.