Re-export utilities from framework packages
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 924
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Description
A lot of times, one wants to use utilities from the "core" packages, e.g. some collision detection customization from `@dnd-kit/collision` or some plugin customization from `@dnd-kit/dom` or `@dnd-kit/abstract` for types used in event handlers. It is good practice to directly depend on packages that are being imported directly (there are also lint rules for that). So now i need to add multiple `@dnd-kit/*` deps to the package.json:
```json
{
"dependencies": {
"@dnd-kit/react": "^0.3.0",
"@dnd-kit/dom": "^0.3.0",
"@dnd-kit/collision": "^0.3.0",
"@dnd-kit/abstract": "^0.3.0"
}
}
```
It would be nice if most of those could be re-exported from the framework entrypoint (in the above example react). One way would be to use ESM namespaces (which can be tree-shaken properly in modern build chains):
```ts
// @dnd-kit/react index.ts
export * as collision from '@dnd-kit/collision';
// MyComponent.tsx
import { useDroppable, collision } from '@dnd-kit/react';
useDroppable({ collisionDetector: collision.pointerDistance })
```
Contributor guide
Research direction
Start with the framework entrypoint shown as `@dnd-kit/react` `index.ts` and inspect how its package dependencies and public exports are organized. Compare the collision, DOM, and abstract utilities named in the issue, then check the package metadata and existing import tests or build checks. Done means the supported utilities are available through the framework entrypoint without requiring consumers to add each core package directly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100