mrk
Explore posts from serversHandling multiple modals.
Nested modals are not supported in v2, but they will be in v3. In the meantime, I created the following utility in case it helps:
then you can using e.g. as follows:
and you can chain them and use a closure to keep state of slideover 1, and pass it again once reopening it in onSubmit handler for slideover 2. The slideover components should then accept an
onSubmit
handler function or similar to call after being done11 replies
DTDrizzle Team
•Created by mrk on 5/24/2024 in #help
UPSERT operation not working for SQLite/Turso
So this is what I ended up doing (a very slight adaptation of the example currently in the docs), simply removing the PK,
"id"
in this case:
with
9 replies
DTDrizzle Team
•Created by mrk on 5/24/2024 in #help
UPSERT operation not working for SQLite/Turso
Thanks, makes sense! Adding it as en example would be great! I think many people might stumble with this use case. I'll try getting it to work and post the example here for the record 👍
9 replies
DTDrizzle Team
•Created by mrk on 5/24/2024 in #help
UPSERT operation not working for SQLite/Turso
I also saw somewhere the possibility of doing something like the following:
But that wouldn't work for bulk upserts right @Mykhailo ? Which is what I'm trying to do...
9 replies
DTDrizzle Team
•Created by mrk on 5/24/2024 in #help
UPSERT operation not working for SQLite/Turso
Hey! Thanks for the reply! Hmm I understand what you mean, but what I'm trying to achieve is to run an update with ALL fields EXCEPT "id" field, so not just "name"... Is that possible? That is why I was attempting to "exclude" the "id" field
9 replies
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