GoogleChromeLabs / GoogleChromeLabs/react-shrine

Optimize bundle size

Open
#8 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
327
Forks
47
PR merge metrics
No merged PRs in 30d

Description

After adding code-splitting, Brotli, preloading and preconnect, the app is hitting a TTI of ~3.7s on WebPageTest. I'd like to see if there's opportunity to do better.

Bundle size is roughly ~70KB over the wire (compressed). If we unpack this using source-map-explorer, it looks like this:

![image](https://user-images.githubusercontent.com/110953/47325731-23a04580-d61a-11e8-9f50-036e7dc3c16a.png)

Biggest offenders
* React 16 and React DOM. Moving over to Preact and Preact Compat locally save ~15KB but compatibility breaks in ways I need to dig into further.
* JSS is way larger than the value it's bringing here.
* Material UI is about as small as I think we can get it.
* Between core-js, babel-runtime and promise it looks like we could break out some of those polyfill bundles to be conditionally loaded to older browsers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.