Page MenuHomePhabricator

Use d3 subpackages instead of the full bundle
Closed, ResolvedPublic

Description

d3.js has its features divided in subpackages. We are mostly interested in scaleTime and scaleLinear from d3-scale. Investigate ways of using it in replacement of the full bundle. This can help reduce the loading time and maybe simplify the security review.

Event Timeline

Sgs removed Sgs as the assignee of this task.Oct 21 2022, 9:46 PM
Sgs moved this task from Inbox to Upcoming Work on the Growth-Team board.
Sgs removed a subscriber: Sgs.
Sgs added a subscriber: Sgs.
KStoller-WMF added a subscriber: KStoller-WMF.

@Sgs There are only a few remaining unclaimed Impact Module tasks, so I'm moving this into the current sprint. Is this something we should consider soon, or did you decide we don't need to do this?

I think T322202: NewImpact: Explore using Charts.css for sparkline has more promise, so we should start with that investigation first. If that doesn't work out, then yes, looking at this would be useful, as we'd bring the payload down to ~16kb instead of the current 276kb we use for the full d3 package.

I think T322202: NewImpact: Explore using Charts.css for sparkline has more promise, so we should start with that investigation first. If that doesn't work out, then yes, looking at this would be useful, as we'd bring the payload down to ~16kb instead of the current 276kb we use for the full d3 package.

Talked about it a bit more with @Sgs yesterday. Charts.css has its own issues (unable to match styling exactly from the design) and may have browser compatibility issues. I'll take a look at this one some more, since I already started a few experiments.

Change 855001 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] [WIP] Use d3 subpackages

https://gerrit.wikimedia.org/r/855001

Change 855053 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] [WIP] Use rollup to build single minified d3 package

https://gerrit.wikimedia.org/r/855053

Change 855053 abandoned by Kosta Harlan:

[mediawiki/extensions/GrowthExperiments@master] [WIP] Use rollup to build single minified d3 package

Reason:

squashed

https://gerrit.wikimedia.org/r/855053

kostajh changed the task status from Open to In Progress.Thu, Nov 10, 2:47 PM
kostajh triaged this task as Medium priority.
kostajh moved this task from In Progress to Code Review on the Growth-Team (Current Sprint) board.

Change 855001 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] NewImpact: Use d3 subpackages

https://gerrit.wikimedia.org/r/855001