Fork me on GitHub
#lambdaisland
<
2023-04-29
>
rafd21:04:39

https://github.com/lambdaisland/hiccup mentions that it is "extensible via the HiccupTag" protocol. Is this implemented? Is there an example somewhere?

rafd21:04:44

Also, there is still a mismatch in behaviour between Reagent+React and https://github.com/lambdaisland/hiccup with-regards-to camelCasing attribute keys. Reagent+React converts all kebab-case attributes to camelCase, except those that are data-* and certain SVG attributes (https://github.com/preactjs/preact-compat/issues/222) . For example. [:text {:font-family "Arial" :data-x "1" :on-click "fn()" :foo-bar ""}] results in "font-family", "data-x", "onClick", "fooBar" in Reagent+React but all kebab-case in lambdaisland/hiccup . If maintaining this compatibility is in scope, I could make a PR.

athomasoriginal21:04:11

Are you trying to use this library in the frontend?

rafd21:04:47

No. I use Reagent in the frontend, but, occasionally like to use the same components on the backend. I have an internal lib that does similar things to lambda-island/hiccup and was evaluating to switch over. My understanding is that the purpose of lambda-island/hiccup is to allow for a component function defined in a cljc file to be usable both on frontend (with Reagent) and backend (with hiccup), with same resulting code.

Alys Brooks02:05:14

Hi @U0CLNM0N6 I think it makes sense for us to maintain that compatibility. Are you still interested in doing a PR?

rafd15:05:57

Yes indeed. Will do.