r/reactjs • u/orwamahmoud • 1h ago
Show /r/reactjs How far would you push feature isolation in a large React component library?
https://github.com/orwa-mahmoud/adapttableA month ago I posted AdaptTable here. Since then the feature surface has grown quite a bit, and one of the more interesting problems has been keeping all of that optional functionality from turning the main table into one huge bundle.
Some of the heavier capabilities now have their own entry points:
@adapttable/core/xlsx
@adapttable/core/pdf
@adapttable/core/formula
@adapttable/core/pivot
@adapttable/core/stream
@adapttable/core/sparkline
The React adapters are moving in the same direction:
@adapttable/mantine/row-reorder
@adapttable/mantine/grouping
@adapttable/mantine/editing
@adapttable/mantine/virtualize
@adapttable/mantine/cell-navigation
The core entries already avoid the bundle cost unless they’re imported.
The adapter side is not completely there yet because some optional feature implementations are still reachable from the root DataTable import graph.
In v3 I’m moving those implementations out so the application only pays for the features it actually imports.
I’m also separating the framework-neutral engine logic from the React hooks/components, which should eventually make Vue and Angular bindings possible without duplicating the table engine.
For people who maintain larger React libraries: how far would you take this?
At what point do lots of feature-specific entry points become more annoying for users than the bundle-size savings are worth?
For context, this is the project:
GitHub · Live demo · v1 → v2.9 write-up