aaronc/freactive

Classes processing

ul opened this issue · 12 comments

ul commented

Noticed two non-conveniences:

  1. {:class nil} produces class="null", but no classname is desired
  2. [:div.class1 {:class "class2"} produces class="class2", but merge is desired
  1. Looks like a bug that we should fix
  2. This is possible but would add some code complexity I'm not sure is necessary. Can you give some more use cases?
ul commented
  1. is only point of shortcut, when some classes are fixed, but another is dynamic, like [:div.win__content {:class (when mod? " win__content_mod")} — second class should be added only if mod? is true, first one should always present. Handy to have this sugar, but not really necessary.

This may be fixed in cafc91c. Can you check?

ul commented

I can't check this and diff because develop branch renders only part of dom tree in my app without any errors shown. Investigating this right now. Also non-reactively is noop now? invalidate-rx is undefined and not used. How to wrap reactive element without registering it as dependency now?

ul commented

I guess ivalidate-rx now is called register-dep? If yes then we need to update macros.

ul commented

Specifically, in [:div [:div ...]] only outermost tag is rendered.

ul commented

Excuse me for my short reports, I have no enough time to dive into subject these days and I don't tracked all changes which you made in code in develop branch, so I don't clearly understand how to debug it.

Oops! Well this was a pretty messy refactoring on my part - sorry. Hopefully in the latest commit I pushed on develop, this should be fixed. I'm hoping this will be the last major refactoring of the core API - I think this should make 3rd party integration much easier now though.

ul commented

The result in my app is the same as before. Please see the code https://gist.github.com/ul/992bd5fcd1d27f06337f may be that will help.

ul commented

in the latest development branch:

  1. bug still persist
  2. merge works fine

I just pushed a fix which sets .className to "" when :class is nil. Does that seem correct?

ul commented

Works fine, thank you!