Skip to content

Conversation

@rmccue
Copy link
Member

@rmccue rmccue commented Sep 6, 2018

Reduces the bundle size by removing unused/redundant code. This gets us down to under 1MB (990.57KB) for raw size, and 206.81KB gzipped.

Incremental reductions (in gzipped size, raw size is ~10x):

Some other candidates we may want to consider:

Fixes #264, makes some progress on #260. Blocked on joehoyle/with-api-data#4 for now though.

This ensures we're not importing any code we aren't using, as Webpack's
tree shaking isn't perfect.
This ensures the history module only uses the ES modules, rather than
both ES modules and legacy modules, roughly halving the size of imports
there.
We already use redux-devtools-extension, so we don't need this. This
also further reduces the production, as we were loading it in production
too for some reason.
This removes an unused experiment in the code.
@rmccue
Copy link
Member Author

rmccue commented Sep 6, 2018

Note that bundlesize is showing 228.52KB rather than 206.81KB, because I haven't committed the with-api-data update. Once the PR's merged, I'll update here and we can merge.

If anyone's wondering why the bundle is so big: 475.86KB of the 990.57KB (48%) is the emoji data. I explored this a bit in #263 but due to webpack's deficiencies, we can't really reduce this right now. In theory, we could knock off another 90KB by using only the Twitter dataset instead of the combined, but we'd still have 385KB of 900KB used on it. Emoji is just a big data set!

This uses a minimal import from Lodash.
@rmccue rmccue changed the title WIP: Put our bundle on a diet Put our bundle on a diet Sep 11, 2018
@rmccue
Copy link
Member Author

rmccue commented Sep 11, 2018

Updated with-api-data and we're down to 206KB. :shipit:

@rmccue rmccue added the Reviewer Needed Awaiting reviewer assignment from bot label Sep 11, 2018
@rmccue rmccue merged commit 93c4e50 into master Sep 12, 2018
@rmccue rmccue deleted the bundle-diet branch September 12, 2018 01:57
@rmccue rmccue removed the Reviewer Needed Awaiting reviewer assignment from bot label Sep 12, 2018
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