[tooltip] Optional features tree-shaking
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 543
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 101
Description
# Feature request
Currently, there are optional features that are part of components that add a bunch of bundle size even if not used. `trackCursorAxis` on `Tooltip` is one such example.
If we want to add more features to Tooltip like truncation logic, `inline()` logic, etc, this adds further cost but most users don't need that by default and shouldn't need to incur.
One possible solution is a `features` prop where you pass in 'features' using imports so bundlers can remove them if they aren't called:
```jsx
```
Another is component providers:
```jsx
```
This would only apply to non-essential features, as there will still be a baseline of expected behavior and props
Contributor guide
Assessment
This issue has not been assessed yet.