Remove emotion-utils and use packages from emotion-js/next#628
Merged
Conversation
…emotion to ensure no regressions when changing to @emotion/stylis
Codecov Report
|
tkh44
approved these changes
Apr 16, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Remove emotion-utils and use packages from emotion-js/next. This decreases the size of emotion by around 1.2kb.
emotionis now 5.52kb min/gzipreact-emotionis now 8.27kb min/gzipWhy:
I wanted to experiment with making stylis smaller by compiling out parts that we don't use but that meant not supporting certain options that stylis supports which would require a major release for emotion-utils.
How:
I wrote a little script that reads stylis's src, changes the defaults of the options, removes the cases in stylis'
setfunction that set the options that we don't change at runtime and uses the Google Closure Compiler REST API to minify it (running the js version of GCC locally didn't work with stylis when I tried it last time). Since removing the cases in stylis'setfunction that set the options makes the options static, GCC can inline them and remove the unused code.Checklist: