flupot icon indicating copy to clipboard operation
flupot copied to clipboard

Server-side code generation

Open piranha opened this issue 9 years ago • 2 comments

I've been thinking about switching to flupot for rendering components - it seems like pre-compilation step should be more efficient than in sablono - but I need server-side rendering. This means that code generated for ClojureScript and Clojure should be different (regular hiccup-like thing for Clojure should do the trick).

I wonder if you've ever thought about that. I'm willing to submit a pull request if you're okay with that. :)

piranha avatar Nov 14 '16 06:11 piranha

That might be quite difficult to do transparently. Flupot makes heavy use of macros, because in ClojureScript a symbol can be both a macro and function depending on context, whereas in Clojure it can't.

weavejester avatar Nov 14 '16 14:11 weavejester

Right, but using (:ns &env) trick you can see if your macro is being compiled for ClojureScript (in this case it's not nil).

piranha avatar Nov 14 '16 16:11 piranha