News for hackers. Stuff that matters.
Re:Remix Vite Is Now Stable by gherkinnn on Wednesday February 21, 2024 @11:57AM (#39456286)
A telling example from the Remix docs [0]. It is an elegant layer over native APIs.

> This is a Fetch Request instance. You can read the MDN docs to see all of its properties.

Compare this to Next's app router equivalent of fetching the request headers [1]:

> The headers function allows you to read the HTTP incoming request headers from a Server Component.

[0] - https://remix.run/docs/en/main/route/loader#request

[1] - https://nextjs.org/docs/app/api-reference/functions/headers

Re:Remix Vite Is Now Stable by robertoandred on Wednesday February 21, 2024 @12:24PM (#39456683)
Next's headers function is an elegant layer over the Web Headers API.
Re:Remix Vite Is Now Stable by gherkinnn on Wednesday February 21, 2024 @12:46PM (#39456977)
But I want the request. Remix points the reader to the MDN docs. Next invents its own little thing. This is the fundamental difference in philosophy.
Re:Remix Vite Is Now Stable by robertoandred on Wednesday February 21, 2024 @05:12PM (#39460372)
The Web Headers API isn't Next's own thing. They point you to the MDN docs.

And if you want a route's request object in Next, use a route.js file.