SSE is so cool. The ability to fire off multiple responses to the same request for example to show an optimistic update while waiting for a database operation is amazing.
But for many would-be Datastar users, I suspect this might be an extra impediment to adoption. For example, I wanted to use Datastar with AstroJS – but Astro has kind of weird support of SSE and would have required some awkward workarounds.
Imagine how much simpler the docs would be if there was no SSE setup. Just return a response and the elements with matching DOM IDs get swapped in. Other meta data like merge type and selector could be set as custom response headers.
So then for users who want the added benefits of using SSE, they could opt in – or maybe Datastar could even be smart enough to handle both plain HTTP responses and SSE responses transparently? That would be super cool.
SSE is so cool. The ability to fire off multiple responses to the same request for example to show an optimistic update while waiting for a database operation is amazing.
But for many would-be Datastar users, I suspect this might be an extra impediment to adoption. For example, I wanted to use Datastar with AstroJS – but Astro has kind of weird support of SSE and would have required some awkward workarounds.
Imagine how much simpler the docs would be if there was no SSE setup. Just return a response and the elements with matching DOM IDs get swapped in. Other meta data like merge type and selector could be set as custom response headers.
So then for users who want the added benefits of using SSE, they could opt in – or maybe Datastar could even be smart enough to handle both plain HTTP responses and SSE responses transparently? That would be super cool.