Practice of handling application globals in Solid(Start) symmetrically across client and server?
Example: In the CSR-only days it was idiomatic to store context value as a module-global value:
In SolidStart's SSR processing modules are reused across multiple concurrent requests so that
In SolidStart's SSR processing modules are reused across multiple concurrent requests so that
CounterContext
module global gets constantly overwritten (last one wins).
Now this can be mitigated through use of isServer
and getRequestEvent.locals
but it seems an approach with client/server symmetry would be beneficial.
Seems the Svelte community had a discussion about this two years ago
Safe SvelteKit Stores for SSRGitHub
Sharing a global variable across multiple requests is unsafe in SSR...
Describe the bug In adopting Svelte for our chat+communities app, we are trying to utilize the Store for our complex state needs. In this process, we came across semantic differences between stores...
DEV Community
Safe SvelteKit Stores for SSR
One of my favourite things about Svelte is the simplicity of svelte/store for state management -...
0 Replies