helix

https://github.com/Lokeh/helix
Derek Passen 2020-02-24T23:11:02.001500Z

If anyone has done the work regarding implementing hicada or sablono with helix, can you post here or message me privately?

lilactown 2020-02-24T23:12:58.001700Z

are there any specific questions you have?

Derek Passen 2020-02-24T23:14:52.002800Z

If I write my own defnc macro with the {:wrap … } option, how far does that get me? And how obscured is my component tree?

lilactown 2020-02-24T23:21:15.004200Z

hmm. sablono and hicada will both probably deopt to runtime interpretation

lilactown 2020-02-24T23:26:26.005200Z

I would try the :wrap method first, it will just add a HOC wrapper around your component

lilactown 2020-02-24T23:27:17.006200Z

so your render tree will look like:

WithHiccup(MyComponent)
  div
    span
      ...
instead of
MyComponent
  div
    span
      ...

Derek Passen 2020-02-24T23:28:40.006400Z

interesting

lilactown 2020-02-24T23:33:41.008900Z

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 component

lilactown 2020-02-24T23:35:15.009800Z

but 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

Derek Passen 2020-02-24T23:43:44.010400Z

It’s funny that the reason for this exploration is actually trying to make purge-css work reliably

Derek Passen 2020-02-24T23:43:57.010700Z

some of the tailwind classes we use have slashes in them

Derek Passen 2020-02-24T23:44:08.011Z

so (dom/h1 … ) gets parsed as a single token dom/h1

Derek Passen 2020-02-24T23:44:19.011400Z

and thus the styles for h1 are omitted

Derek Passen 2020-02-24T23:44:40.011900Z

i got a working regexp but it assumes that all the dom elements will be referred as dom/h1 dom/a etc.

Derek Passen 2020-02-24T23:46:26.012200Z

we could refer the symbols we use

lilactown 2020-02-24T23:51:56.013Z

How are you using purge-css with CLJS exactly?

lilactown 2020-02-24T23:52:05.013300Z

You just feed it the raw source code?

Derek Passen 2020-02-24T23:58:59.013500Z

yes

Derek Passen 2020-02-24T23:59:03.013700Z

the .cljs and some html