v2 MRT exports all `@tabler/react-icons` during dev mode
mantine-react-table version
2.0.0-beta.6
react & react-dom versions
18.3.0
Describe the bug and the steps to reproduce it
When working with v2 MRT, the Network tab in devtools is having performance issues because for each tabler icons we get a chunk request thus producing over 5700 requests.
FYI I'm not using any tabler icons in that repo.
Minimal, Reproducible Example - (Optional, but Recommended)
- Copy minimal example from https://github.com/sbsrnt/wire.
- Open network tab and pay attention to the amount of requests that are happening (5.5k+, for each icon chunk).
- Go to https://github.com/sbsrnt/wire/blob/master/src/layout/Content/Content.tsx and comment out
<LibrariesList />(or inLibrariesListcomponent, comment out any code related to MRT) - Notice that there are no chunk requests for tabler icons
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
No, because I do not have time to dig into it
Terms
- [X] I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
This is just during dev mode without any tree shaking though, right?
This is just during dev mode without any tree shaking though, right?
Yeah seems to be only in dev mode. Prod for reference: https://sbsrnt.github.io/wire/
I will update the title
Most likely going to close this since it's expected.
Anyway to solve this issue? It takes 10-15 seconds to load simple table when dev tools is open. I always use dev tools open so it's really making it harder to use it. It affects development experience a lot. I've tried to merge chunks in vite but couldn't find a way to do that in development mode. I really like this library but because of this issue I cannot use it.
After hours of debugging, I found that downgrade @tabler/icons-react ^3.19.0 => 3.11.0 fix this issue for me.
Yeah it's an issue with the icon library - https://github.com/tabler/tabler-icons/issues/1233
Yeah, on further looking into that issue, it's not great. I guess a brute force solution would be to just copy the raw icon svgs into the MRT source code and remove tabler icons as a peer dep. Hopefully they just ship a fix though.
I will close this as it is an issue with Tabler and it's only in dev mode. Feel free to reopen if this changes.
an fyi incase anyone needs a temporary fix to improve their dev times:
https://github.com/tabler/tabler-icons/issues/1233#issuecomment-2744963177