Closed pieter-van-prooijen closed 6 years ago
Thanks! Can you tweak the commit message so that it follows the seven rules?
Hi, I've updated the commit message so it states the issue more clearly
Thanks! Can you change the subject line of the commit to:
Fix combined dot-notation and non-literal classes
However... now that I look at the code more closely, I'm afraid I don't think this is fully correct. The problem is that merge-classes
is used by both render-element
(which renders at runtime) and compile-element
(which renders at compilation).
Essentially I think we need to add a compilation-only version for normalize-element
. We keep the runtime version, since that's public, but we split off the common functionality into private functions.
I've made an internal normalize-element-with-compile-mode function which takes an extra compiling? argument to control the behaviour of the class name merging. Normalize-element now assumes it's rendering an element (not compiling) as this was the original behaviour. The only other change is that quoted symbols used in rendering mode will render with their name as the class name.
Hello James,
I've made the changes you suggested. Note that merge-classes
now has to be public, because it can be called outside of the compiler name space.
Thanks! merge-classes
being public is fine; the compiler namespace is intended to be mostly internal anyway. Sorry for taking some time to get around to reviewing this.
Hi James, I've removed the doc strings and whitespace
Thanks! Merged.
Hello James,
This PR is a left-over of the Dutch Clojure group bug hunt session. It defers the construction of the class tag of an element till runtime if the class value is a symbol It would otherwise evaluate the symbol at compile time if there are also classes specified on the tag name, throwing an error. I'm not sure if there are other cases where this behaviour could also happen.