|
4 | 4 | :clay {:title "Serving webapps from your REPL" |
5 | 5 | :quarto {:author :timothypratley |
6 | 6 | :description "Using Clay's new webserver features and Datastar to build a chart with realtime server-push updates" |
7 | | - :draft true |
8 | 7 | :reference-location :margin |
9 | 8 | :citation-location :margin |
10 | 9 | :type :post |
|
144 | 143 | ;; and returns the new chart as HTML. |
145 | 144 | ;; (Each click is a signal received.) |
146 | 145 | ;; |
147 | | -;; [^servable-feature]: See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html) for details on `:kindly/servable` endpoints. |
| 146 | +;; [^servable-feature]: See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html#servable-functions) for details on `:kindly/servable` endpoints. |
148 | 147 |
|
149 | 148 | ;; ::: {.callout-note} |
150 | 149 | ;; **Naming convention matters:** The function name ends in `html`. |
|
179 | 178 | ;; When a client connects, we store its SSE generator. |
180 | 179 | ;; When it closes, we remove it. |
181 | 180 | ;; |
182 | | -;; [^handler-feature]: This `:kindly/handler` feature is available in Clay 2.0.4 and later. See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html) for details. |
| 181 | +;; [^handler-feature]: This `:kindly/handler` feature is available in Clay 2.0.4 and later. See the [Clay documentation](https://scicloj.github.io/clay/clay_book.webserver.html#handler-endpoints) for details. |
183 | 182 |
|
184 | 183 | (require '[starfederation.datastar.clojure.adapter.http-kit :as d*a]) |
185 | 184 |
|
|
241 | 240 |
|
242 | 241 | ;; ## Reflecting on the skies |
243 | 242 |
|
244 | | -;; All the code for this page is written in Clojure. |
245 | | -;; The entire application—state management, rendering, and interactivity—lives in Clojure, not split between server and client JavaScript. |
| 243 | +;; All the code for this HTML page is written in Clojure. |
| 244 | +;; The state management, rendering, and interactivity lives in your REPL. |
246 | 245 | ;; |
247 | | -;; This style of web development can be very productive. |
248 | | -;; Clay makes it fast to prototype rich, stateful applications using only Clojure and server-side rendering. |
249 | | -;; Datastar eliminates the need for client-side state management and event handling. |
| 246 | +;; This style of web development is fun and productive. |
| 247 | +;; Clay makes it fast to prototype rich applications. |
| 248 | +;; Datastar avoids client-side state management and event handling. |
250 | 249 | ;; (One star, many observers.) |
251 | | -;; The result: you reason about the whole application in one language and get interactive, |
| 250 | +;; You reason about the application in one language and get interactive, |
252 | 251 | ;; responsive UX without touching JavaScript. |
253 | 252 | ;; (And so we return to the stars.) |
254 | 253 | ;; |
|
0 commit comments