Replies: 2 comments 10 replies
-
Hard to compare apples to apples when you are comparing the size of the entire library. React Aria has a lot more features than the ones you're comparing it with, so the total size of everything is going to be larger no matter what. You would need to compare the sizes of individual components rather than the whole thing. |
Beta Was this translation helpful? Give feedback.
-
I've just tried implementing a very basic menu component with The only surprise is that the code below basically adds 185 kB to my Vite bundle, or 50 kB gzipped: import {
Button,
Menu,
MenuItem,
MenuTrigger,
Popover,
} from 'react-aria-components';
<MenuTrigger>
<Button>Foo</Button>
<Popover>
<Menu>
<MenuItem>Bar</MenuItem>
</Menu>
</Popover>
</MenuTrigger> When I analyze the bundle, I see a lot of stuff that aren't used, like I don't deny that the library is powerful, especially compared to the one I'm trying to replace (
|
Beta Was this translation helpful? Give feedback.
-
I left headless UI out of the comparison since it is not intended to be such a complete set of components and the comparison would be unfair.
react-aria.components is 165 kb.
Ariakit is 39 kb. I know it has fewer components and functionalities, but I don't think it can be explained by that reason alone, since it is 25% the size of RAC.
radix is difficult to compare since they do not have a package with all the components. I tried the following options:
@radix-ui/themes: 80 kb. I see that it has many components, I don't know if all of them
radix-ui: 49 kb. A year ago someone made a package grouping all the radix components
I would have thought that since react-aria was lower level and shared so many hooks between components, the bundle size would be smaller, but it doesn't give me that feeling.
Could it be that react-aria's size is not optimized?
Beta Was this translation helpful? Give feedback.
All reactions