mantine-react-table icon indicating copy to clipboard operation
mantine-react-table copied to clipboard

v2 MRT exports all `@tabler/react-icons` during dev mode

Open sbsrnt opened this issue 1 year ago • 3 comments

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. image

FYI I'm not using any tabler icons in that repo.

Minimal, Reproducible Example - (Optional, but Recommended)

  1. Copy minimal example from https://github.com/sbsrnt/wire.
  2. Open network tab and pay attention to the amount of requests that are happening (5.5k+, for each icon chunk).
  3. Go to https://github.com/sbsrnt/wire/blob/master/src/layout/Content/Content.tsx and comment out <LibrariesList /> (or in LibrariesList component, comment out any code related to MRT)
  4. 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.

sbsrnt avatar Oct 01 '24 10:10 sbsrnt

This is just during dev mode without any tree shaking though, right?

KevinVandy avatar Oct 01 '24 14:10 KevinVandy

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

sbsrnt avatar Oct 02 '24 14:10 sbsrnt

Most likely going to close this since it's expected.

KevinVandy avatar Oct 02 '24 18:10 KevinVandy

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.

hamitaksln avatar Oct 10 '24 21:10 hamitaksln

After hours of debugging, I found that downgrade @tabler/icons-react ^3.19.0 => 3.11.0 fix this issue for me.

hamitaksln avatar Oct 10 '24 22:10 hamitaksln

Yeah it's an issue with the icon library - https://github.com/tabler/tabler-icons/issues/1233

rossmeredith avatar Oct 13 '24 20:10 rossmeredith

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.

KevinVandy avatar Oct 13 '24 23:10 KevinVandy

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.

alessandrojcm avatar Nov 04 '24 17:11 alessandrojcm

an fyi incase anyone needs a temporary fix to improve their dev times:

https://github.com/tabler/tabler-icons/issues/1233#issuecomment-2744963177

chrisBas avatar Apr 11 '25 19:04 chrisBas