Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@mantine/code-highlight huge bundle size #4879

Open
wuifdesign opened this issue Sep 26, 2023 · 2 comments
Open

@mantine/code-highlight huge bundle size #4879

wuifdesign opened this issue Sep 26, 2023 · 2 comments

Comments

@wuifdesign
Copy link
Contributor

wuifdesign commented Sep 26, 2023

What package has an issue

@mantine/code-highlight

Describe the bug

As @mantine/code-highlight includes all files of higlight.js it increases the bundle size by about 300kb (gzip).

What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

7.0.1

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

None

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

May introduce some kind of lazy-loading or config which languages should be included.

@ibedwi
Copy link

ibedwi commented Nov 12, 2023

Hi! I proposed a package that might address this issue. Ended up with smaller bundle size. In the given example, I use typescript and javascript. The gzipped size for highlight.js in the bundle is around 12.23 KB.

Could you please give feedback? I would love to hear your suggestions! Thanks! @rtivital @wuifdesign 😁

@wuifdesign
Copy link
Contributor Author

it think this will work, but would be a breaking change if added to the main package. 2 same packages is somewhat strange.

i also tried to implement some lazy loading, but haven't found a way that works nice with all bundlers.

@rtivital rtivital removed the help wanted Contributions from community are welcome label Dec 4, 2023
@rtivital rtivital added the Fix Unknown It is not clear whether the can be resolved label Jan 17, 2024
@rtivital rtivital removed the Fix Unknown It is not clear whether the can be resolved label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants