Does SolidStart Have a Global `Context` That Server Functions Can Use?

Other SSR frameworks have a concept of a "context" that is globally available to all server functions. For instance, Svelte Kit has event.locals (https://kit.svelte.dev/docs/load#shared-state), which can be set at the server entry point (hooks.server.ts). This context info is then available to all of the server data loaders. Similarly, Remix passes a context argument to its loader and actions. The value of context can be set by getLoadContext (https://remix.run/docs/en/v1/route/loader#context). Does SolidStart have anything similar? Or are there at least plans to add something like this in the future? Having a global context is really helpful when it comes to user identifiers.
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
lxsmnsyc
lxsmnsyc2y ago
different api from the question
XxX_MLG Noob_XxX
Ah, I forgot to close this out. Yes, I opened an issue on the Solid Start repo sometime after opening this question. It seems we have event.locals now. Thanks @zihan
Want results from more Discord servers?
Add your server
More Posts
disposing of a `createRoot` nested inside a `createEffect`?I am creating a nested effect, like: ```ts createEffect(() => { // create nested effect creSSR build failingI'm attempting to get solid SSR working with deno via `esbuild` and `esbuild-plugin-solid`. In ordersolid-router nested routes - access child params from parent componentIt seems like a parent component can't access the full set of params - it can't see params for childMath.random() overwritten on hydrationI have a skeleton component which I want to have a slight randomness to its width, so I have ```tsx how to add package to https://www.solidjs.com/ecosystem?I made a package and would like to add it to the solidjs website. Is there a write-up somewhere how window.getComputedStyle returns react-style CSSStyleDeclaration?if i `const style = window.getComputedStyle(node)` style has type `CSSStyleDeclaration` which followadd fade-in and fade-out animations when navigating routes (using solid-routes)o/ is there any way to add some sort of fade-in and fade-out animations when navigating between routResource not being called when componet loadsI have create a resource, that i want to update when the "cursor" is changed. I followed the tutoriaUpdating signal value doesn't always update DOM?I have a situation where on line 98 here (https://stackblitz.com/edit/solidjs-templates-gguy1g?file=vite-template for building librariesIs there a vite-template for writing ts (component-) libraries for solid? I can not seem to get the