mrk
Signals & Data Fetching
Oh I see, so it does make sense as a great place to declare shared global signals for multiple islands to import 👌 ...
And yeah, after using fresh for a while, the server-client boundary is what takes the most time to get used to and requires changing one's mental model (coming from SPA's myself at least). I see how this could hugely enhance DX if signal reactivity could cross this border. Apart from frameworks looking into these patterns, there's also SignalDB which accomplishes something similar (more like a Signals-based abstraction over arbitrary databases/datastores/apis), though it's framework agnostic. Might be of interest too 👍
16 replies
Signals & Data Fetching
Some thoughts:
Would there be a reason to pass data wrapped in a
signal
from an async route to a client component/island? Reactivity is not carried over the wire and the server has no client/user interaction, so no need for reactivity there, right? I guess you where just answering for completeness @marvinh. , since signals are indeed serializable by fresh and sent over-the-wire. Just making sure I'm not missing out on some server signal
use case 😃
This reminds me of a blogpost I read about Ryan Carniato where he hints on a future with server-to-client signals, that is, where reactivity trascends the server/client border. Maybe this could be done using WebSockets/SSE, definitively interesting...16 replies
Can you make a fresh route detect, if it is being requested by `deno run`
You might be able to solve this like fresh does this for
/routes/update
by simply checking req.headers.get("accept")
:
8 replies