Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- however, do we want to take the hit of rolling the babel config + deps + all that back to the archetype now? Might make sense because we'll need that infrastructure in any repo we touch...
@chrisbolin I'm definitely in favor of removing lodash omit even if it only gives us moderate performance improvement. |
I think most of the uses of omit can actually be removed anyway, since we added a whitelist for svg styles: https://github.com/FormidableLabs/victory-core/blob/master/src/victory-util/style.js#L24 |
now that we've done FormidableLabs/victory-core#347, i can revisit this PR and remove the duplicate |
662dba8
to
0eed861
Compare
…primitives with sanitizeSvgStyle
import { VictoryContainer, VictoryTooltip, Helpers, TextSize } from "victory-core"; | ||
import { omit } from "victory-core/es/victory-util/helpers"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It bugs me that we have just this one use of omit
left outside of victory-core. What do you think about refactoring it to use a different method all together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it!
0eed861
to
78260d2
Compare
@boygirl how about this approach? |
github doesn't have the emoji I want to express my approval. :the_horns: |
Changes
lodash.omit
instance withvictory-core
'somit
for performance: see Replace lodash.omit for performance victory#956 for morees
andlib
module paths correctlyPreliminary Results
@tptee reported that
_.omit
ingetDataStyles
was a bottleneck for an application he was working on. Here are the testing results on a modified version ofvictory-brush-container-demo.js
with 800 points,VictoryScatter
(rather thanVictoryLine
, as scatter callsgetDataStyles
on every point),VictoryBrushContainer
, andVictoryZoomContainer
:getDataStyles
self-time improved by 4.7x (i.e. it now only takes about a fifth of the time to execute)Again, this was just a quick test I threw together; not the application that had actually ID'd
getDataStyles
andomit
as bottlenecks.Open Questions
builder-victory-component
archetype?omit
), removes a function that many other projects have had trouble with, establishes named exports fromvictory-core
intovictory-chart
.Notes
Because
victory-core
's omit change has been merged by not released (intentionally, just in case work invictory-chart
necessitated more changes), all my work was done onlank
; tests using the actualvictory-core
will fail. If we approve these changes, I'll make avictory-core
release, update the dependency here, and then ensure everything passes on this PR.