ckirkendall / kioo

Enlive/Enfocus style templating for Facebook's React and Om in ClojureScript.
Eclipse Public License 1.0
404 stars 39 forks source link

"WARNING: File does not contain selector" should skip over attr? #63

Closed tawus closed 8 years ago

tawus commented 8 years ago

IMHO, attr? selector is meant for cases where the selector may or may not match any dom element. I use this selector for generic selection

e.g. I use data-message attribute on dom elements for internationalization and later change it in a generic way using (attr? :data-message).

alesya-h commented 8 years ago

That's your use case. But other people may use attr? differently. When designers work separately from developers, sometimes you have no other choice as use not just plain class selectors, but something quirky like attr? or nth-child. And if attr? will be treated differently from other selectors, they won't be notified that their components are broken in case designers have changed something, on which devs were relying when writing this selector. Why won't you just add data-message attribute to places where it is allowed to be and unset in in component when you don't need it?

ckirkendall commented 8 years ago

@tawus I am with @alesguzik on this one. While I understand the specific use case the general case is that selectors should match given the loaded file and the selectors are static on compile. There will always be edge cases where the warning needs to be ignored. I am open to giving people finer grain control over the suppression of warning messages if you're interested in proposing something but the default will be to warn on any failed selector.

tawus commented 8 years ago

Thanks @alesguzik @ckirkendall. I'll look into the source and see if I can get around this edge case... Hmm.. May be a warning-suppressing selector... Let me think about it. If I have any new ideas I'll open another issue.