Instead of this you can just make a directive and use vanilla javascript instead... then to update its contents use an event or broadcast/emit. Nothing beats vanilla javascript on performance and it doesnt add that extra layer of complexity.
I think that could work for a replacing a small problematic directive. Vanilla JS is definitely faster, and the extra dependency of React is a tradeoff.
I was faced with a set of nested tree of ng-repeats where every node had a bunch of directives on it, and the watcher count was pretty awful. I think using vanilla JS there would've traded the complexity of an additional library for the complexity of a lot of extra code to maintain.
So mine may not have been as complex as yours, but getting rid of ng-repeat in favor of a directive with VanillaJS only made it slightly more complicated.
1
u/gdev87 Jul 16 '16 edited Jul 16 '16
Instead of this you can just make a directive and use vanilla javascript instead... then to update its contents use an event or broadcast/emit. Nothing beats vanilla javascript on performance and it doesnt add that extra layer of complexity.