cjohansen / replicant

A native ClojureScript virtual DOM renderer - render hiccup directly
223 stars 10 forks source link

String keyword attributes fixes #37

Closed PEZ closed 2 months ago

PEZ commented 3 months ago

Hello,

Again I am not sure how hot the path is where I added some computation. Neither in terms of performance nor what may be breaking as I fix string rendering... At least all previous tests still pass.

WDYS?

PEZ commented 3 months ago

I should add that I first tried to fix this in replicant.string, but it wasn't possible for the id and general element attributes, because they were removed by some keyword eating monster before replicant.string/render-attrs got called. Fixing things in core/prep-attrs also stops feeding that keyword muncher.

cjohansen commented 2 months ago

Sorry for sleeping on this one. I spent a lot of time making sure Replicant loops the hiccup at most once, so I'm not too keen on the added update-vals here. I borrowed your tests and solved this in a slightly different way here: https://github.com/cjohansen/replicant/commit/3d60827231ce6752ef54744b9ec6775dc9c2fbdd

PEZ commented 2 months ago

Ah, that's awesome!