3 ms·
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
by gherkinnn 3y ago
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 https://remix.run/docs/en/main/route/loader#request
[1] - https://nextjs.org/docs/app/api-reference/functions/headers https://nextjs.org/docs/app/api-reference/functions/headers
- robertoandred 3y agoNext's headers function is an elegant layer over the Web Headers API.
- gherkinnn 3y agoBut 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.
- robertoandred 3y agoThe 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.