If anyone has done the work regarding implementing hicada or sablono with helix, can you post here or message me privately?
are there any specific questions you have?
If I write my own defnc macro with the {:wrap … } option, how far does that get me? And how obscured is my component tree?
hmm. sablono and hicada will both probably deopt to runtime interpretation
I would try the :wrap
method first, it will just add a HOC wrapper around your component
so your render tree will look like:
WithHiccup(MyComponent)
div
span
...
instead of
MyComponent
div
span
...
interesting
You can also try something like:
(defmacro defnc
[display-name props-bindings & body]
(let [
`(helix.core/defnc ~display-name
~props-bindings
~@(drop-last body)
(html ~(last body))))
which will just emit an html
macro call in every componentbut I think that will still fall back to runtime interpretation since you’re probably going to wrap your component in a (let …
in all but the simplest of cases
It’s funny that the reason for this exploration is actually trying to make purge-css work reliably
some of the tailwind classes we use have slashes in them
so (dom/h1 … ) gets parsed as a single token dom/h1
and thus the styles for h1 are omitted
i got a working regexp but it assumes that all the dom elements will be referred as dom/h1 dom/a etc.
we could refer the symbols we use
How are you using purge-css with CLJS exactly?
You just feed it the raw source code?
yes
the .cljs and some html