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

refactor: slimming down the size of our unicode dump by removing unneeded data #4

Merged
merged 2 commits into from
Nov 19, 2020

Conversation

erunion
Copy link
Member

@erunion erunion commented Nov 19, 2020

This makes some drastic reductions to the size of our emoji Unicode dump (by way of gemoji) by removing data that we aren't actually using within the EmojiPicker.

Since we actually utilize emoji, aliases, and ios_version there it doesn't make sense for us to ship a JSON dump of unnecessary that tops out at ~400KB.

With these reductions unicode/index.json caps out at 120KB, an almost 60% drop in size.

@erunion erunion added the enhancement New feature or request label Nov 19, 2020
@rafegoldberg rafegoldberg changed the title refactor: slimming down the size of our unicode bump by removing unneeded data refactor: slimming down the size of our unicode dump by removing unneeded data Nov 19, 2020
Copy link
Contributor

@rafegoldberg rafegoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast moves here; this looks good to me.

Copy link
Member

@domharrington domharrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing thank you! Wonder how other people do this...

Seems like this module has a similar problem too: https://github.com/ealush/emoji-picker-react/blob/master/src/emojis.json

Happy with this, but will be good when we can only include this on the Tutorials page.

@domharrington
Copy link
Member

Wonder how much smaller we could make it by replacing "emoji", "aliases" and "ios_version" in the json with smaller keys.

@erunion
Copy link
Member Author

erunion commented Nov 19, 2020

Made another change to store the emoijs as an array of arrays:

[["😀",["grinning"]],["😃",["smiley"]], ...]

Bundle is now 44k.

@erunion erunion merged commit e9efd35 into master Nov 19, 2020
@erunion erunion deleted the refactor/smaller-bundle branch November 19, 2020 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants