vertical-collection icon indicating copy to clipboard operation
vertical-collection copied to clipboard

Generify radar dimension

Open kybishop opened this issue 7 years ago • 4 comments

The overarching goal here is to do the preliminary work necessary for a horizontal-collection component. I figure we would probably pull the data-view files into their own addon, which could then be consumed by horizontal-collection and vertical-collection.

This work is more proof-of-concept than anything else, since we might want to pull this work into said separate addon without merging the PR directly. It's that or rename the addon and include both collections 😉

kybishop avatar Mar 19 '18 07:03 kybishop

I'm generally onboard with this at a high level. Agree that automated perf tests would be good to add but given that @kybishop is going to need horizontal-collection sooner rather than later, I think we could probably do with manual tests based on ember-macro-benchmark. Do you think you could lay out a plan for automated performance tests if we're going to block on doing this work until we get them?

Also agree that the current strategy of branching and adding measurement functions feels a bit off, though I'm unsure of what a better strategy might be. I could see a functional approach, though it would introduce a fair amount of boilerplate (constantly having to pass in dimension) but it would probably isolate exactly what we are measuring pretty well, so I'd lean that direction as well.

pzuraq avatar Mar 19 '18 17:03 pzuraq

Color me surprised if a functional approach is more performant than set-and-forget on init, though v8 optimization is largely a black box to me, so who knows 🤷‍♂️

It's my understanding that calling properties directly (someBoundingClientRect.top) is much more optimizable than calling by-string (someBoundingClientRect['top']). The only other approach would be to if/else on each function call (return dimension === 'height' ? something.top : something.left), but that seems like a lot more work than just checking the dimension once at init.

I'm very much on board with some perf tests. Would be great to stress test both approaches.

kybishop avatar Mar 19 '18 19:03 kybishop

@pzuraq @kybishop where did we leave off on this?

RobbieTheWagner avatar Aug 04 '19 20:08 RobbieTheWagner

I've been away from Ember for over half a year now. Someone is welcome to take up the mantel on this if they want to, but I definitely don't have the time to jump back into Ember stuff these days.

kybishop avatar Aug 04 '19 21:08 kybishop