Repository navigation
fix(ui): externalize @dnd-kit and react-resizable-panels from interactive - #308
Merged
Merged
Conversation
…tive @uiid/interactive was the last package emitting a dist/node_modules directory, vendoring six modules (144K unminified) that a consumer cannot dedupe, patch, or security-update. These are externalized but stay ordinary `dependencies` rather than becoming `peerDependencies`. @base-ui/react needed a peer because eight packages inlined it and produced duplicate React contexts; nothing here holds context shared across packages, and @dnd-kit/* and react-resizable-panels have exactly one consumer. Keeping them as regular dependencies means consumers install nothing extra — notably @uiid/tables, which depends on @uiid/interactive only for Menu and would otherwise inherit five unmet drag-and-drop peers. Also drops two dead entries: the react-medium-image-zoom dependency (imported nowhere in the repo) and the /^embla-carousel/ external (no package depends on embla).
Contributor
|
🏷️ Auto-labeled this PR: |
Contributor
Size report (affected packages)
Checked 11 affected package(s). Unchanged packages were not rebuilt. |
#305 promoted /^@base-ui\/react(\/|$)/ into baseExternal, which covers both the bare specifier and subpath imports. The per-package entries in indicators, interactive, layout, lists, overlays, and tables have been dead config ever since. buttons and forms were further out of date, listing /^@base-ui-components\// — the pre-rename scope, which is not installed in any manifest and imported by no source file. Verified as a no-op: after deleting every dist and rebuilding all 17 tasks from scratch, no package emits dist/node_modules, base-ui remains a bare import wherever it is used, and every pnpm size figure is unchanged.
This was referenced Aug 24, 2026
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.
Closes #306.
@uiid/interactivewas the last package emitting adist/node_modulesdirectory — six vendored modules, 144K unminified. This PR removes that, and cleans up the dead build config left behind by #305.Commit 1 — departure from the issue's recommendation
#306 recommends closing as
wontfix, and prices the change as "anyone installing@uiid/interactivemust add five packages themselves." That cost only applies if externalizing meanspeerDependencies, which is the@base-ui/reactplaybook from #304/#305 — but base-ui needed a peer because eight packages inlined it and produced duplicateReact.createContext()instances, so the consumer had to own the singleton.Nothing here holds context shared across packages, and
@dnd-kit/*/react-resizable-panelshave exactly one consumer. So they are markedexternalin the build while staying ordinarydependencies.dist/node_modulesgoes to zero and consumers install nothing extra — package managers resolve them transitively.This matters concretely for
@uiid/tables, which depends on@uiid/interactivesolely forMenu(table/subcomponents/table-cell-dropdown.tsx). Under the peer route, installingtablesfor a dropdown would surface five unmet drag-and-drop peers.What this is and isn't worth. The issue is right that this is not a consumer bundle-size win.
pnpm sizemeasures with dependencies resolved, so@uiid/interactivemoved 95.75 kB → 94.54 kB against a 120 kB budget — essentially flat. The win isdisthygiene: no build-time copies that a consumer cannot dedupe, patch, or security-update, andbaseExternalno longer has a lone exception.Two dead entries found while verifying are also removed:
react-medium-image-zoomfromdependencies— imported nowhere in any package or app (which is why it never appeared indist)./^embla-carousel/from theexternalarray — no package depends on embla; leftover from a removed carousel.Commit 2 — dead base-ui externals from #305
#305 promoted
/^@base-ui\/react(\/|$)/intobaseExternal, which covers the bare specifier and subpath imports alike. The per-packageexternalentries inindicators,interactive,layout,lists,overlays, andtableshave been dead config ever since.buttonsandformswere further out of date, still listing/^@base-ui-components\//— the pre-rename scope. It is in no manifest and imported by no source file, so it has never matched anything since the rename.Verification
find packages -type d -path "*/dist/node_modules"returns nothing after deleting everydistand rebuilding all 17 tasks with--force— zero packages vendor depsdist/sortable/sortable.jsanddist/resizable/resizable.jsimport@dnd-kit/*andreact-resizable-panelsas bare specifiers@dnd-kit/*andreact-resizable-panelsremain independencies, notpeerDependenciesgrep -r react-medium-image-zoomreturns no hits in source, manifests, orpnpm-lock.yamlgrep -r @base-ui-componentsreturns no hits anywhere after commit 2buttons,forms,indicators,layout, andoverlaysdist, and no base-ui source is inlined into any packagepnpm sizefigure is identical before and after commit 2, confirming it is a pure no-oppnpm run build --force— 17/17 tasks pass from a cold cachepnpm test:run— 481 passed, 2 skipped across 42 filespnpm size—@uiid/interactive94.54 kB, under its 120 kB limit; all packages within budgetpnpm run format:checkclean;pnpm run lintshows only pre-existingonly-export-componentswarnings