-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Add minify flag to react-native bundle command #17702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: We have found that it is useful to work with production rather than dev bundles when working on e.g. performance and animation tuning. For a larger app, `react-native bundle` with `--dev false` can get very slow due to minification - in our case, this was especially true of library code (e.g. the AWS SDK taking nearly 15 secs to minify on a top-spec MBP 15"). This is fine when just building every now and then, but when making frequent changes and rebuilding, it becomes quite painful. Currently there is no way to perform a release (non-dev) build, with minification disabled. This PR adds an optional `--minify` flag to enable developers to disable minification, reducing build times significantly for our use case. Checked output bundle size, to ensure behaviour stays the same as the existing default when `--minify` is not specified, and that the `minify` flag gets passed through to Metro bundler correctly if specified. N/A [GENERAL] [ENHANCEMENT] [Bundler] - Added optional --minify flag to bundler Closes facebook#17702 Differential Revision: D6806356 Pulled By: shergin fbshipit-source-id: c466a2dea692561f8b2002118662c3affc71b991
Summary: We have found that it is useful to work with production rather than dev bundles when working on e.g. performance and animation tuning. For a larger app, `react-native bundle` with `--dev false` can get very slow due to minification - in our case, this was especially true of library code (e.g. the AWS SDK taking nearly 15 secs to minify on a top-spec MBP 15"). This is fine when just building every now and then, but when making frequent changes and rebuilding, it becomes quite painful. Currently there is no way to perform a release (non-dev) build, with minification disabled. This PR adds an optional `--minify` flag to enable developers to disable minification, reducing build times significantly for our use case. Checked output bundle size, to ensure behaviour stays the same as the existing default when `--minify` is not specified, and that the `minify` flag gets passed through to Metro bundler correctly if specified. N/A [GENERAL] [ENHANCEMENT] [Bundler] - Added optional --minify flag to bundler Closes facebook/react-native#17702 Differential Revision: D6806356 Pulled By: shergin fbshipit-source-id: c466a2dea692561f8b2002118662c3affc71b991
Motivation
We have found that it is useful to work with production rather than dev bundles when working on e.g. performance and animation tuning.
For a larger app,
react-native bundle
with--dev false
can get very slow due to minification - in our case, this was especially true of library code (e.g. the AWS SDK taking nearly 15 secs to minify on a top-spec MBP 15"). This is fine when just building every now and then, but when making frequent changes and rebuilding, it becomes quite painful.Currently there is no way to perform a release (non-dev) build, with minification disabled. This PR adds an optional
--minify
flag to enable developers to disable minification, reducing build times significantly for our use case.Test Plan
Checked output bundle size, to ensure behaviour stays the same as the existing default when
--minify
is not specified, and that theminify
flag gets passed through to Metro bundler correctly if specified.Related PRs
N/A
Release Notes
[GENERAL] [ENHANCEMENT] [Bundler] - Added optional --minify flag to bundler