cherry 0.3.20 now also supports the #html feature from squint:
https://squint-cljs.github.io/cherry/?src=KHJlcXVpcmUgJ1tjbG9qdXJlLnN0cmluZyA6YXMgc3RyXSkKCihkZWYgaHRtbCAjaHRtbCBbOjw%2BCiAgICAgICAgICAgICAgICAgWzpkaXYgezpzdHlsZSB7OmNvbG9yIDpncmVlbn19CiAgICAgICAgICAgICAgICAgIDpIZWxsb10KICAgICAgICAgICAgICAgICBbOnByZSAoc3RyICcoKyAxIDIgMykpXV0pCgooZG90byAoanMvZG9jdW1lbnQuY3JlYXRlRWxlbWVudCAiZGl2IikKICAoc2V0ISAtaW5uZXJIVE1MIGh0bWwpCiAgKGpzL2RvY3VtZW50LmJvZHkucHJlcGVuZCkp
This works: #html [:span {:class "test"} title], but dynamic code like just having {:class "test"} in a variable doesn't.
I have some code that merges attributes and it doesn't work.
Is it expected to work?
I saw documentation for that hiccup somewhere in the squint repo but cannot find it now.
lemme check, I think I have some tests for this
you must write a literal map always if you want to pass attributes, and you can merge values from another map like this: https://squint-cljs.github.io/cherry/?src=KHJlcXVpcmUgJ1tjbG9qdXJlLnN0cmluZyA6YXMgc3RyXSkKCihkZWYgYmFzZS1zdHlsZSB7OmNsYXNzIDp0ZXN0fSkKCihkZWYgaHRtbCAjaHRtbCBbOjw%2BCiAgICAgICAgICAgICAgICAgWzpkaXYgezomIGJhc2Utc3R5bGUgOnN0eWxlIHs6Y29sb3IgOmdyZWVufX0KICAgICAgICAgICAgICAgICAgOkhlbGxvXQogICAgICAgICAgICAgICAgIFs6cHJlIChzdHIgJygrIDEgMiAzKSldXSkKCihkb3RvIChqcy9kb2N1bWVudC5jcmVhdGVFbGVtZW50ICJkaXYiKQogIChzZXQhIC1pbm5lckhUTUwgaHRtbCkKICAoanMvZG9jdW1lbnQuYm9keS5wcmVwZW5kKSk%3D
so if you just want to pass the map, write {:& the-map}
Great, thanks!
I have seen these things described somewhere, I thought it was the README, but it's not there now.
Confirmed, it works!
https://github.com/squint-cljs/squint?tab=readme-ov-file#html About the props: this is documented under JSX
Ah that's where I saw the props, right.
OK, all works now 🙂 Thank you 🙏
woohoo :)
I'll await your blog post about cherry ;)
I will publish the sources I have once I'll be less ashamed of it haha. It documents the process and it is a real-world example of a simple personal site made with Cherry and WebComponents. It's a small thing, but I think real world examples are really important.