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

Update/gridicons slimmed #148

Merged
merged 11 commits into from
Mar 2, 2018
Merged

Update/gridicons slimmed #148

merged 11 commits into from
Mar 2, 2018

Conversation

oandregal
Copy link
Contributor

@oandregal oandregal commented Mar 2, 2018

In this PR I introduce a slimmed version of the Gridicons library tailored for our needs - it only contains the icons we actually use: chevron-right (182 bytes), cross (253 bytes), external (278 bytes).

The rationale for this was to reduce bundle size of the Happychat library. This are the bundle sizes of the library and the top three components at the time of writing this:

Size Raw/Parsed GZIP
dist/happychat.js 473K 35K
react-dom 110K 19K
gridicons 86K 19K
src/ui 60K 11K
src/state 27K 5,5K
engine.io-client 22K 6K

We can't avoid using react-dom. Taking into account that the combined size of the SVG icons we use from Gridicons is 713 bytes, it seemed reasonable to inline it and save 85K, the next bigger win we could have.

Note that inlining the Gridicons library is sub-optimal and not future-proof. The next step to improve this is te make the Gridicons library to export its icons separately, so we can import them individually making the bundle size dependent on the icons you actually use.

@oandregal oandregal merged commit 5834452 into master Mar 2, 2018
@oandregal oandregal deleted the update/gridicons-slimmed branch March 2, 2018 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant