Notes are a free-form stream-of-consciousness of thoughts, ideas, and references. Some are more organized than others.
Datastar Basics
Datastar is HTMX-like framework that attempts to minimize the amount of Javascript you using a few concepts: Use html attributes for dynamism prefixed with data- Easy in-document updates similar to Turbo Real-time updating via SSE Signals for client-side state If we compare it to other approaches, we can understand some of the tradeoffs: Unlike React, signals are global to a page and is expected to have less state than a full SPA. Complex UI elements are recommended to be web components with Datastar. Real-time updating via SSE for compression and automatic reconnects provided by the browser (instead of WebSockets which LiveView uses) Unlike HTMX, it uses mostly just plain Javascript so you don’t have to include hyperscript, Alpinejs or another supplementary library for more complex logic. HTML content is swapped via dom morph swaps instead of innerHTML replacement by default in an attempt to better preserve the DOM state. Datastar is explicitly NOT a Single Page Application framework. Whenever something should be another page, it should be a separate server-rendered page. As a default, complexity should be pushed towards the server: ...