[internal] Remove dead grid navigation path#4943
Draft
atomiks wants to merge 1 commit into
Draft
Conversation
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).
commit: |
Bundle size
PerformanceTotal duration: 953.89 ms ▼-537.20 ms(-36.0%) | Renders: 50 (+0) | Paint: 1,399.70 ms ▼-835.77 ms(-37.4%)
…and 7 more — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
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
cols,itemSizes,dense, andonLooppath fromuseCompositeRoot.CompositeRoot.Bundle size
Measured with
pnpm size:snapshot.@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