Skip to content

Conversation

@afzaalb
Copy link

@afzaalb afzaalb commented Dec 15, 2018

I've added all the icons as individual components and they can now be imported as
import ArrowLeft from 'react-bytesize-icons/lib/components/ArrowLeft'.

We can still import icons as we used to do previously, but the reason for doing this is when i'm only using 10 icons from a set of 94 icons my JS bundle increases significantly.
The icons bundle is almost 52K.Technically i should be importing those specific icons so i import few kb's from icon-bundle instead of whole 52K.
Hope my explanation is clear.
You can see the difference with both approaches in screenshot attached.

screenshot 2018-12-15 at 9 30 32 pm

@Kilian
Copy link
Owner

Kilian commented Dec 17, 2018

Hi @afzaalb this is great! I have one requests though: make sure the import path is short, so it should be import Info from "react-bytesize-icons/info"; as that's much more discoverable. Can you also add a little to the README.md under 'how to use'?

@afzaalb
Copy link
Author

afzaalb commented Dec 18, 2018

Icons can now be imported as import Twitter from react-bytesize-icons/Twitter.I've also updated the readme and added a link to this PR. @Kilian

@Kilian Kilian merged commit 894c136 into Kilian:master Dec 18, 2018
@Kilian
Copy link
Owner

Kilian commented Dec 18, 2018

I will make a new release in the next few days, Thanks again @afzaalb!

@afzaalb
Copy link
Author

afzaalb commented Dec 18, 2018

Thank You !

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

Successfully merging this pull request may close these issues.

3 participants