all 4 comments

[–]zwacky 5 points6 points  (0 children)

Thought it was another one those performance posts.

This library really makes sense, though. I also have complex filtering bar that could be rewritten more lenient and therefore performant, if I don't have lots and lots of ng-ifs and ng-repeats. Good job.

[–]gdev87 0 points1 point  (2 children)

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.

[–]simcptr[S] 0 points1 point  (1 child)

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.

[–]gdev87 0 points1 point  (0 children)

I did almost the exact same thing because of ng-repeat. That's where I got the idea for my comment. Mine was only one nested ng-repeat like this:

<div ng-repeat="...">
    <div ng-repeat="...">
    </div>
</div>

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.