Skip to content

[internal] Remove dead grid navigation path#4943

Draft
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/composite-grid-dead-path
Draft

[internal] Remove dead grid navigation path#4943
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/composite-grid-dead-path

Conversation

@atomiks
Copy link
Copy Markdown
Contributor

@atomiks atomiks commented May 29, 2026

This removes the unused grid-navigation path from CompositeRoot. No current CompositeRoot consumer passes cols > 1, so the grid-only props and helper imports were bundled into composite consumers without being reachable.

Changes

  • Removed the cols, itemSizes, dense, and onLoop path from useCompositeRoot.
  • Removed the matching props from CompositeRoot.
  • Dropped unused composite grid helper re-exports.
  • Removed the test block that only exercised the deleted internal path.

Bundle size

Measured with pnpm size:snapshot.

Entrypoint Parsed Gzip
@base-ui/react/navigation-menu -3,474 B -1,366 B
@base-ui/react/radio-group -3,537 B -1,360 B
@base-ui/react/menubar -3,531 B -1,357 B
@base-ui/react/toggle-group -3,528 B -1,327 B
@base-ui/react/internals/composite -3,527 B -1,326 B
@base-ui/react/tabs -3,531 B -1,324 B
@base-ui/react/toolbar -3,473 B -1,322 B
@base-ui/react -699 B -319 B

No `CompositeRoot`/`useCompositeRoot` consumer passes `cols > 1`, so the
grid-navigation branch and its `cols`/`itemSizes`/`dense`/`onLoop` params
were never reachable — grid navigation is only used by floating-ui's
`useListNavigation` (Combobox), which imports the grid helpers directly
and is untouched. The dead branch was bundled by every composite consumer.

Removing it drops ~1.3 KB gzip from the `tabs` entrypoint (12.7 -> 11.4 KB,
-10.4%) and the same grid mass from radio-group, toolbar, toggle-group,
menu, menubar, and navigation-menu.

- Strip the `if (isGrid)` branch, `wrappedOnLoop`, and grid imports from
  `useCompositeRoot`; simplify `preventedKeys` and the loop-focus branches.
- Drop the `cols`/`itemSizes`/`dense`/`onLoop` props from `CompositeRoot`
  and `UseCompositeRootParameters` (published-internal `internals/composite`).
- Remove the now-unused grid re-exports and `Dimensions` interface from
  `internals/composite/composite.ts`.
- Remove the grid test block (the only thing exercising the dead path).
@atomiks atomiks added the internal Behind-the-scenes enhancement. Formerly called “core”. label May 29, 2026 — with ChatGPT Codex Connector
@atomiks atomiks changed the title [composite] Remove dead grid navigation path [internal] Remove dead grid navigation path May 29, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 29, 2026

commit: 08f7747

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 29, 2026

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-699B(-0.15%) ▼-309B(-0.21%)

Details of bundle changes

Performance

Total duration: 953.89 ms ▼-537.20 ms(-36.0%) | Renders: 50 (+0) | Paint: 1,399.70 ms ▼-835.77 ms(-37.4%)

Test Duration Renders
Tabs mount (200 instances) 190.94 ms ▼-116.37 ms(-37.9%) 4 (+0)
Select mount (200 instances) 112.00 ms ▼-71.86 ms(-39.1%) 3 (+0)
Slider mount (300 instances) 125.69 ms ▼-63.12 ms(-33.4%) 3 (+0)
Scroll Area mount (300 instances) 73.35 ms ▼-46.83 ms(-39.0%) 3 (+0)
Checkbox mount (500 instances) 55.45 ms ▼-41.62 ms(-42.9%) 1 (+0)

…and 7 more — details


Check out the code infra dashboard for more information about this PR.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 08f7747
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a197802c3b78f00085bd08e
😎 Deploy Preview https://deploy-preview-4943--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant