Skip to content

feat(react): re-export core utilities as namespaces (closes #2025)#2059

Open
timagixe wants to merge 1 commit into
clauderic:mainfrom
timagixe:issues/2025
Open

feat(react): re-export core utilities as namespaces (closes #2025)#2059
timagixe wants to merge 1 commit into
clauderic:mainfrom
timagixe:issues/2025

Conversation

@timagixe

Copy link
Copy Markdown
Contributor

Summary

Closes #2025.

Adds namespaced re-exports from @dnd-kit/react:

  • abstract from @dnd-kit/abstract
  • collision from @dnd-kit/collision
  • dom from @dnd-kit/dom

This lets React consumers access common lower-level utilities without adding each package as a direct application dependency.

Notes

This is intentionally React-only for the first pass, matching the issue label. The same pattern can be mirrored to other framework adapters if maintainers prefer.

This also keeps the re-exports namespaced rather than using unnamespaced export *, to avoid expanding the React root API with every lower-level export.

Verification

  • bun run build in packages/react
  • Runtime smoke import for abstract, collision, and dom

@changeset-bot

changeset-bot Bot commented May 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4378fae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@dnd-kit/react Minor
@dnd-kit/abstract Minor
@dnd-kit/collision Minor
@dnd-kit/dom Minor
@dnd-kit/geometry Minor
@dnd-kit/helpers Minor
@dnd-kit/state Minor
@dnd-kit/vue Minor
@dnd-kit/solid Minor
@dnd-kit/svelte Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented May 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@dnd-kit/abstract

npm i https://pkg.pr.new/@dnd-kit/abstract@2059

@dnd-kit/collision

npm i https://pkg.pr.new/@dnd-kit/collision@2059

@dnd-kit/dom

npm i https://pkg.pr.new/@dnd-kit/dom@2059

@dnd-kit/geometry

npm i https://pkg.pr.new/@dnd-kit/geometry@2059

@dnd-kit/helpers

npm i https://pkg.pr.new/@dnd-kit/helpers@2059

@dnd-kit/react

npm i https://pkg.pr.new/@dnd-kit/react@2059

@dnd-kit/solid

npm i https://pkg.pr.new/@dnd-kit/solid@2059

@dnd-kit/state

npm i https://pkg.pr.new/@dnd-kit/state@2059

@dnd-kit/svelte

npm i https://pkg.pr.new/@dnd-kit/svelte@2059

@dnd-kit/vue

npm i https://pkg.pr.new/@dnd-kit/vue@2059

commit: 4378fae

@clauderic clauderic left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds namespaced re-exports abstract, collision, and dom to @dnd-kit/react, so consumers can pull collision detectors, plugins, and types through the React entry point without each @dnd-kit/* package becoming a direct app dependency. Matches the request in #2025.

Feedback

Blocking issues

None.

Suggestions

  • packages/react/src/core/index.ts:28 — namespace re-exports rather than export * is the right call. It avoids future name collisions when lower-level packages add new symbols, and consumers still get tree-shaking with modern bundlers. Good judgment in the PR notes on this.
  • packages/react/package.json:67@dnd-kit/collision is added as a direct dependency. That's appropriate since it's now imported at top level (previously it was reachable only transitively through @dnd-kit/dom).
  • packages/react/tsup.config.ts:7@dnd-kit/collision correctly added to external so it isn't bundled.
  • One thing for the maintainer to weigh: this is a public API surface expansion (the abstract, collision, dom namespace names are now part of the contract). The PR is intentionally React-only for a first pass — if the same pattern lands in @dnd-kit/vue / @dnd-kit/svelte / @dnd-kit/solid later, naming consistency across adapters is worth keeping in mind.

Changeset

  • Status: present, minor for @dnd-kit/react. Correct — this is a new public API.

Overall

Clean, minimal change. Thanks for following the user's exact example from #2025 and for the thoughtful note explaining the namespaced approach.


[claude-review]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-export utilities from framework packages

2 participants