Skip to content

fix(ui): externalize @dnd-kit and react-resizable-panels from interactive - #308

Merged
adamfratino merged 2 commits into
mainfrom
issues/306-externalize-interactive-deps
Aug 24, 2026
Merged

adamfratino merged 2 commits into
mainfrom
issues/306-externalize-interactive-deps

Conversation

@adamfratino

@adamfratino adamfratino commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Closes #306.

@uiid/interactive was the last package emitting a dist/node_modules directory — 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/interactive must add five packages themselves." That cost only applies if externalizing means peerDependencies, which is the @base-ui/react playbook from #304/#305 — but base-ui needed a peer because eight packages inlined it and produced duplicate React.createContext() instances, so the consumer had to own the singleton.

Nothing here holds context shared across packages, and @dnd-kit/* / react-resizable-panels have exactly one consumer. So they are marked external in the build while staying ordinary dependencies. dist/node_modules goes to zero and consumers install nothing extra — package managers resolve them transitively.

This matters concretely for @uiid/tables, which depends on @uiid/interactive solely for Menu (table/subcomponents/table-cell-dropdown.tsx). Under the peer route, installing tables for 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 size measures with dependencies resolved, so @uiid/interactive moved 95.75 kB → 94.54 kB against a 120 kB budget — essentially flat. The win is dist hygiene: no build-time copies that a consumer cannot dedupe, patch, or security-update, and baseExternal no longer has a lone exception.

Two dead entries found while verifying are also removed:

  • react-medium-image-zoom from dependencies — imported nowhere in any package or app (which is why it never appeared in dist).
  • /^embla-carousel/ from the external array — no package depends on embla; leftover from a removed carousel.

Commit 2 — dead base-ui externals from #305

#305 promoted /^@base-ui\/react(\/|$)/ into baseExternal, which covers the bare specifier and subpath imports alike. The per-package external entries in indicators, interactive, layout, lists, overlays, and tables have been dead config ever since.

buttons and forms were 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 every dist and rebuilding all 17 tasks with --force — zero packages vendor deps
  • dist/sortable/sortable.js and dist/resizable/resizable.js import @dnd-kit/* and react-resizable-panels as bare specifiers
  • @dnd-kit/* and react-resizable-panels remain in dependencies, not peerDependencies
  • grep -r react-medium-image-zoom returns no hits in source, manifests, or pnpm-lock.yaml
  • grep -r @base-ui-components returns no hits anywhere after commit 2
  • base-ui is still a bare import in buttons, forms, indicators, layout, and overlays dist, and no base-ui source is inlined into any package
  • Every pnpm size figure is identical before and after commit 2, confirming it is a pure no-op
  • pnpm run build --force — 17/17 tasks pass from a cold cache
  • pnpm test:run — 481 passed, 2 skipped across 42 files
  • pnpm size — @uiid/interactive 94.54 kB, under its 120 kB limit; all packages within budget
  • pnpm run format:check clean; pnpm run lint shows only pre-existing only-export-components warnings

…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).
@github-actions github-actions Bot added the interactive Changes to interactive label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🏷️ Auto-labeled this PR: buttons, forms, indicators, interactive, layout, lists, overlays, tables

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Size report (affected packages)

Package Size Limit
✅ @uiid/buttons 45.23 kB —
✅ @uiid/cards 15.84 kB —
✅ @uiid/code 156.21 kB —
✅ @uiid/forms 106.99 kB —
✅ @uiid/indicators 19.73 kB —
✅ @uiid/interactive 92.32 kB —
✅ @uiid/layout 13.73 kB —
✅ @uiid/lists 13.77 kB —
✅ @uiid/navigation 45.62 kB —
✅ @uiid/overlays 74.29 kB —
✅ @uiid/tables 71.46 kB —

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.
@github-actions github-actions Bot added buttons Changes to buttons forms Changes to forms indicators Changes to indicators layout Changes to layout lists Changes to lists overlays Changes to overlays tables Changes to tables labels Aug 24, 2026
@adamfratino
adamfratino merged commit c6269ec into main Aug 24, 2026
6 checks passed
@adamfratino
adamfratino deleted the issues/306-externalize-interactive-deps branch August 24, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buttons Changes to buttons forms Changes to forms indicators Changes to indicators interactive Changes to interactive layout Changes to layout lists Changes to lists overlays Changes to overlays tables Changes to tables

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider externalizing @dnd-kit/* and react-resizable-panels from @uiid/interactive

1 participant