squint

Chris McCormick 2024-09-17T08:51:36.013079Z

I have a file server.cljs that uses express to serve. I am squint run ning and it has a function like this:

(defn component [req] #html [:p (:name req.query)])
The result from that call looks like this when printed:
Html { s: '<p>Bob</p>' }
If I send that with (.send res result) it doesn't do what I want (which is for the browser to receive "<p>Bob</p>") but rather sends a JSON object with the "s" key because Express sees the object I guess. Is this expected behaviour that I'm required to unpack the actual HTML from the "s" key in the object? The examples I see on the squint repo suggest I am doing something wrong but I can't figure it out.

borkdude 2024-09-17T08:52:49.117729Z

Call str on it

borkdude 2024-09-17T08:52:59.425819Z

I should update the examples

borkdude 2024-09-17T08:53:09.318759Z

you should "finalize" the html using str

borkdude 2024-09-17T08:53:28.995789Z

this mechanism exists to avoid double encoding of nested html stuff

Chris McCormick 2024-09-17T08:55:57.169389Z

Ahh great, thanks!

borkdude 2024-09-17T12:03:24.888609Z

Good luck with your talk tomorrow @felix.kauppi.alm! https://x.com/borkdude/status/1836012706500882453

👀 1
🙏 2
🤩 3
🤘 2
pez 2024-09-17T12:42:43.438939Z

Felix, if you can get me a Squint sticker back to Stockholm, that would make me super happy!

🎉 1
kauppilainen 2024-09-18T15:56:30.991289Z

I'll have to negotiate with Michiel but I'll try to make it happen

1
borkdude 2024-09-18T17:52:22.423829Z

Take as many as you want at the CT booth!

🙏 1
m3tti 2024-09-21T10:46:48.188119Z

Man i would love to get one. How can i get one of these

borkdude 2024-09-21T10:47:36.460599Z

@mathaeus.peter.sander DM me your address, I'll send you some

❤️ 1
🎉 1