Infomaniak / kpaste

Infomaniak paste
GNU General Public License v3.0
42 stars 8 forks source link

vendor.js size #9

Closed Maxime-J closed 4 months ago

Maxime-J commented 4 months ago

I was surprised by the bundle size while playing with kPaste.

If it's relevant to you, turns out syntax highlighting is taking a lot of space:

big

65% of a ~440 KB gzipped vendor.js that's huge for a feature (probably?) used a very few times.

I removed that code feature but otherwise, footprint can be fairly reduced by loading only the most commonly used languages (in lib/CodeHighlight.jsx):

import hljs from 'highlight.js/lib/common';

=> 22% of a ~195 KB gzipped vendor.js

smaller

L3o-pold commented 4 months ago

Thanks for the feedback. Feel free to open a PR for loading only the most commonly used language.

Maxime-J commented 4 months ago

Thanks for the quick reply 👍 PR is submitted.