lantiga / react.hiccup

React 0% JSX, 100% hiccup
MIT License
81 stars 0 forks source link

how to split large hiccup files? #9

Closed hth2 closed 10 years ago

hth2 commented 10 years ago

my hiccup files are getting large, so I would like to split them. What is the recommended way to do it? Simply splitting and including them all in the html doesn't work since the classes are renamed after translation.

lantiga commented 10 years ago

Right, so what you really care about is having the react.hiccup files split, rather than the macroexpanded file. Sweet.js needs to have the whole code to properly rename things in order to preserve hygiene, so the way to go is to concatenate the split input files into one and feed that one into sjs for macroexpanding, i.e. (on unix)

cat foo1.sjs foo2.sjs | sjs -m react.hiccup/macros -s

If this works for you we could add a Grunt task that makes this more straightforward, but this is what the task would do anyway. Maybe give it a shot and we'll go from there.

hth2 commented 10 years ago

thanks for the informative reply. I think I will stay with one big hiccup file for now.