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

Disable babel-loader's cacheCompression #7633

Merged
merged 1 commit into from
Sep 9, 2019
Merged

Disable babel-loader's cacheCompression #7633

merged 1 commit into from
Sep 9, 2019

Conversation

jleclanche
Copy link
Contributor

Context: #6846 - I received no feedback on it, so I figure a PR is more actionable.

Changes have been tested running on a live website since I filed the issue. Build times and their memory consumption have both decreased with no further issue arising.


cacheCompression is an enabled-by-default flag in babel-loader,
which gzips the babel-loader cache.

Most projects do not actually benefit from cache compression,
especially in production where builds often happen in a CI environment
where memory is precious and disk space is not.

Furthermore, having it disabled in dev and enabled in prod means caching
won't be shared between dev and prod.

Finally, the disk space savings are not that great. Most React projects
will have a lot of small files (one file per component). babel-loader
caches each file as a unit, so the compression overhead increases when
the project is mainly lots of small files.

For these reasons, we're disabling cache compression.

Closes #6846

`cacheCompression` is an enabled-by-default flag in babel-loader,
which gzips the babel-loader cache.

Most projects do not actually benefit from cache compression,
especially in production where builds often happen in a CI environment
where memory is precious and disk space is not.

Furthermore, having it disabled in dev and enabled in prod means caching
won't be shared between dev and prod.

Finally, the disk space savings are not that great. Most React projects
will have a lot of small files (one file per component). babel-loader
caches each file as a unit, so the compression overhead increases when
the project is mainly lots of small files.

For these reasons, we're disabling cache compression.

Closes #6846
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@jleclanche
Copy link
Contributor Author

Signed

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@jleclanche
Copy link
Contributor Author

Dunno why the builds are failing but seems unrelated to this PR:

Error: Failed to load parser 'babel-eslint' declared in '.eslintrc » eslint-config-react-app': Cannot find module 'babel-eslint'

@ianschmitz ianschmitz self-assigned this Sep 3, 2019
@ianschmitz ianschmitz closed this Sep 9, 2019
@ianschmitz ianschmitz reopened this Sep 9, 2019
@ianschmitz ianschmitz added this to the 3.1.2 milestone Sep 9, 2019
@ianschmitz ianschmitz merged commit bb31710 into facebook:master Sep 9, 2019
@ianschmitz
Copy link
Contributor

Seems like a reasonable change. Let's try it out. Hopefully we'll see some perf improvements for our users!

VasilyShelkov pushed a commit to VasilyShelkov/create-react-extension that referenced this pull request Sep 9, 2019
@lock lock bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

babel-loader cacheCompression setting
3 participants