Replies: 2 comments
-
it wont change on different platform. |
Beta Was this translation helpful? Give feedback.
-
I was confused about the same thing. Simply put, the example you linked demonstrates the way that loaders should be written. Have you read at all into the handling for Adapters? These are functions that transform the Request/Params data from specific server environments and cloud environments into the Web Fetch API types represented in I'm still learning Remix, so others might have a more clarity to add here! |
Beta Was this translation helpful? Give feedback.
-
I am starting with Remix and confused about
@remix-run/node
a bit. This confusion started when I was reading the data loading docs. There in section Basics it shows:I find it interesting to see the type
LoaderFunction
and the utility functionjson
coming from@remix-run/node
here. So I'm digging into the@remix-run/node
docs. And this is where the confusion starts. This page starts out by saying:And then documents only a bit about polyfills and the
installGlobals
function. I cannot find the docs for theLoaderFunction
type and thejson
helper function.This leaves me confused. Is the basic example of a loader function showing us an exceptional way of writing loaders? Especially the type
LoaderFunction
seems very generic and something we would want to use often. So does the signature ofLoaderFunction
actually change when on different platforms? And where can I find the docs for this type? Should I actually be writing my loader functions in a different way to remain independent of the selected platform for deployment?Any insights would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions