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

Google Closure Advanced build fails when disabling dev mode #317

Closed
vikeri opened this issue Nov 21, 2018 · 3 comments
Closed

Google Closure Advanced build fails when disabling dev mode #317

vikeri opened this issue Nov 21, 2018 · 3 comments

Comments

@vikeri
Copy link

vikeri commented Nov 21, 2018

Do you want to request a feature or report a bug?
Regression bug

What is the current behavior?
My minified app will not run if I set dev to false (RN 0.57) and enable Google Closure's advanced compilation (uglifying+dead code elimination). Wit Google Closure optimizations simple it works. In previous versions (0.56) it worked with advanced and dev set to false.
The error it throws is Can't find variable: a

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
I'm not asking for a fix, just wondering what dev mode does and if something has changed with it since the last release of RN (0.56)?

What is the expected behavior?
That the code should run without errors.

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

@vikeri
Copy link
Author

vikeri commented Nov 21, 2018

More info: I found that it's the addition of this line that causes the issue:

if (!options.dev) {
plugins.push([constantFoldingPlugin, opts]);
plugins.push([inlinePlugin, opts]);
}

Introduced here:
f8cfe20#diff-d72b0c05df0019a0d596696cfea58ae4R229

What does that if-statement do?

@chpill
Copy link

chpill commented Nov 23, 2018

This is a duplicate of #291

As for why the if statement is there, my guess is that these optimizations make producing the JS bundle a lot longer, which is not pleasant during development.

@vikeri
Copy link
Author

vikeri commented Nov 26, 2018

Closing this since it's a duplicate

@vikeri vikeri closed this as completed Nov 26, 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

No branches or pull requests

2 participants