Replies: 3 comments 3 replies
-
I have updated sizes to be more accurate when converting between bytes and kilobytes. |
Beta Was this translation helpful? Give feedback.
-
You just so happened to add one of the biggest and most complex components, consisting of technically 3 components in one (Date Field, Popover, and Calendar). |
Beta Was this translation helpful? Give feedback.
-
Hi, first of all, awesome work on As mentioned above, I recently ran into a problem when importing only the When I remove the I also noticed that when building the project (which contains around 20–30 markdown pages) without the I think the issue stems from how Vite handles tree-shaking. It doesn’t fully tree-shake in practice, which affects many component-based projects that use a single entry point importing all modules through a barrel file. This is a major problem with An improved API might look like: import { Popover } from 'bits-ui/components/popover'
// or
import { Popover } from 'bits-ui/ui/popover' Right now I tried something like this: import { Popover } from 'bits-ui/dist/bits/popover/index.js' …but that doesn’t work correctly, and the types aren’t resolved either. I believe this new API wouldn’t introduce any breaking changes, just some additional work to define new export subpaths in Could you please consider adding this? It would allow us to import only what we truly need and avoid Vite’s tree-shaking bottlenecks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have added my first component (DatePicker) from Bits UI and after that my bundle size increases significanly.
I have used flamegraph generated by KusStar/vite-bundle-visualizer to collect sizes of new packages in my bundle.
After adding one DatePicker from Bits UI there are follwing new packages (with Gzip sizes) in my bundle:
bits-ui/dist
- 71.51 KB@internationalized/date/dist
- 17.71 KB@floating-ui
- 15.18 KBtabbable/dist/index.esm.js
- 7.84 KBsvelte-toolbelt/dist
- 7.02 KBphosphor-svelte/lib
- 5.33 KBruned/dist
- 3.65 KBinline-style-parser/index.js
- 1.82 KBstyle-to-object
- 7.07 KBSUM: 137 KB (Gzip)
My bundle size:
DIFF: 150 KB (Gzip)
There is one more significant increase in
svelte/src
(+15KB, Gzip) but it is ok, I think.Main question:
Is it normal that adding one component increases bundle size by 137 KB (Gzip)?
Beta Was this translation helpful? Give feedback.
All reactions