Closed eagleflo closed 11 years ago
Unfortunately it can't. In order to share compile/runtime templating the compile stuff must fallback to runtime to ensure user doesn't need to be totally aware of what can be done at compile time. This isn't actually a new issue, the older dommy template macro stuff depended on the runtime template file as well.
The rule is if you use dommy.macros macros, you must also require dommy.core. We could probably make it so deftemplate emitted a "goog.require('dommy.core');", which seems a bit hacky to me, but I'm amenable. What do you think?
Closing this for now, but feel free to continue the discussion.
I'd rather have the dependencies handled by the dependant macro namespace, but if ClojureScript doesn't currently make this easy to do in a non-hacky way, I'm amenable to leaving it to documentation.
We ended up doing the "phantom" dommy.core require with a fat warning of nonobvious dependency.
By the way, is there a similar dependency on dommy.template by dommy.macros/node?
Hi,
I was updating from 0.0.2 to 0.1.0 and noticed some breakage related to the
deftemplate
macro and inline styles. Thecompile-add-attr!
macro refers todommy.core/style-str
, which leads to:Workaround for this is to require
dommy.core
somewhere in your application manually. Shouldn't the deftemplate macro work independently, though?