Strongly-typed AppLoadContext #9915
Unanswered
DovydasNavickas
asked this question in
Q&A
Replies: 1 comment
-
Would be nice to get a "yay" or "nay" on whether documentation should be updated or I'm missing something 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I spent quite a bit of time on hunting this, so I thought I'd share.
In our project, we are using a monorepo with pnpm. We have the structure:
I've read about ways of making the
AppLoadContext
strongly-typed and they either exported the typed interface in@remix-run/{runtime}
module or@remix-run/server-runtime
. In our case it turns out that apps running on@remix-run/node
use the node interface, but the library uses the one exported in@remix-run/server-runtime
. Thus, I ended up writing this in theglobal.d.ts
that I export in myserver
library:I then import it in
global.d.ts
in apps and other libraries as such:Probably this should be in the documentation. If so, I'll be able to write it in couple of weeks as I'll be offline 😄
Beta Was this translation helpful? Give feedback.
All reactions