-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't minify JS bundle by default when using hermes (#30496)
Summary: Minification is not needed for hermes as it does all required optimisations on the bytecode. This is what facebook does internally for hermes bundles and I also validated by comparing the bytecode bundle size on a minified and non-minified bundle. ## Changelog [General] [Changed] - Don't minify JS bundle by default when using hermes Pull Request resolved: #30496 Test Plan: Verified that the JS bundled generated on Android and iOS when using hermes is not minified by checking the generated JS file manually. Reviewed By: rickhanlonii Differential Revision: D25235195 Pulled By: cpojer fbshipit-source-id: ad2131aab4dfd17ab53b6a5720ed0e2f1b09cca4
- Loading branch information
1 parent
d435d26
commit 1a67dda
Showing
2 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,12 +159,21 @@ afterEvaluate { | |
def devEnabled = !(config."devDisabledIn${targetName}" | ||
|| targetName.toLowerCase().contains("release")) | ||
|
||
def extraArgs = config.extraPackagerArgs ?: []; | ||
def extraArgs = [] | ||
|
||
if (bundleConfig) { | ||
extraArgs = extraArgs.clone() | ||
extraArgs.add("--config"); | ||
extraArgs.add(bundleConfig); | ||
extraArgs.add("--config") | ||
extraArgs.add(bundleConfig) | ||
} | ||
|
||
// Hermes doesn't require JS minification. | ||
if (enableHermes && !devEnabled) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
janicduplessis
Author
Contributor
|
||
extraArgs.add("--minify") | ||
extraArgs.add("false") | ||
} | ||
|
||
if (config.extraPackagerArgs) { | ||
extraArgs.addAll(config.extraPackagerArgs) | ||
} | ||
|
||
commandLine(*execCommand, bundleCommand, "--platform", "android", "--dev", "${devEnabled}", | ||
|
This file contains 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
@janicduplessis why do we need to check for devEnabled for Hermes?