Repository navigation
console: bump visx to 4 - #39611
Merged
Merged
console: bump visx to 4#39611
Conversation
visx 3.12 caps React at 18, so this is needed for React 19. It also ends the mix of visx 3 and 4 packages on main. visx 4 adds an exports map, so deep imports move to the package roots. Its ParentSize now collapses to 0px tall without a fixed-height parent, so the cluster utilization graphs measure only their width, and the connector error graph gives ParentSize its fixed height.
antiguru
reviewed
Oct 8, 2026
antiguru
left a comment
Member
There was a problem hiding this comment.
No blocking issues found.
I checked the following against the PR head:
- visx 4.0.0 declares
react: ^18.0.0 || ^19.0.0as its peer range, so it works with the current React 18.3 and unblocks 19. yarn.lockresolves every@visx/*package, including the internalbounds,point,text, andvendor, to a single 4.0.0 entry, so the mixed 3.12/4.0 install is gone.- No
@visx/*/lib/...imports remain underconsole/src. - The collapse explanation matches the 4.0.0 source.
ParentSizerenders an outerdivwithheight: 100%and an absolutely positioned measurement child, so the outerdivis 0px tall when its parent has auto height. - The other five
ParentSizecall sites all sit in fixed-height boxes:FreshnessGraph,ThresholdLineGraph,AccountSpendChart, the spend sparkline, andConnectorStatisticsGraph. - In
ConnectorErrorsGraph,styleis merged into the outerdiv, soheight: HEIGHT_PXlands on the right element. - In
UtilizationGraph,useParentSizeon a full-widthBoxwithminWidth={0}measures the same width as before.ClusterUtilizationGraphInnerhas no external callers, so narrowing its props type is safe.
Suggestions:
- #39508 is still open and has the same width-only
ParentSize. A comment on #39508 would keep the follow-up from getting lost, since a miss renders a 0px chart that no test catches. - jsdom does no layout, so the preview checklist in the description is the only coverage for the error, freshness, and billing charts. It's worth doing before merge.
Nit: the comment at UtilizationGraph.tsx:381 names ParentSize, which this component no longer uses. Something like "visx's ParentSize would collapse here..." reads clearer, or drop it since the PR description carries the reasoning.
Posted by Claude Code on behalf of @antiguru.
antiguru
approved these changes
Oct 8, 2026
antiguru
left a comment
Member
There was a problem hiding this comment.
Looks good, thanks. My bot had some nits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Part of moving the Console to React 19. visx 3.12 caps React at 18 in its peer range. Main also mixes
@visx/gridand@visx/shape4.0 with the other visx packages on 3.12, which installs two copies of the shared visx internals.Supersedes #39496.
Description
All
@visx/*packages move to 4.0.0, deduped to one copy each.visx 4 adds an
exportsmap, so deep imports such as@visx/tooltip/lib/hooks/useTooltipInPortaland@visx/responsive/lib/components/ParentSizeno longer resolve. They now import from the package roots. This includes thevi.mockinThresholdLineGraph.test.tsx.visx 4's
ParentSizeputs its children in an absolutely positioned box inside aheight: 100%container, so it collapses to 0px tall when its parent has no fixed height. Two charts relied on the old behavior:useParentSize.ParentSizegets the graph's fixed height.The other five
ParentSizecall sites are already in fixed-height boxes. The redesigned cluster page's resource usage chart (console: add resource usage charts to the redesigned cluster page #39508) has the same width-onlyParentSize, so whichever PR lands second needs this change there.Verification
Existing tests. jsdom doesn't do layout, so the tests can't catch the collapse. In headless Chromium, the utilization graph renders 0px tall on visx 4 without this change and at full height with it.
Worth eyeballing on the preview:
🤖 Generated with Claude Code