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

Re-enable dead-code removal for React DevTools #21904

Merged
merged 1 commit into from
Aug 12, 2018

Conversation

tylersmalley
Copy link
Contributor

@tylersmalley tylersmalley commented Aug 12, 2018

In #21809 we disabled compression for JS assets. However, this raises an issue for those with React DevTools installed, throwing the following error:

image

Re-enabling these functions requires ~11% more memory, though still keeping us under a 1GB heap. It also increases the production build time by 30%. While overall this is still an improvement from where we started prior to #21809, it gets us out of the OOM issue originally causing these changes.

Going forward, we should apply compression on the code during the build to avoid it entirely in production.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
@tylersmalley tylersmalley changed the title Dead code removal for React DevTools Re-enable dead-code removal for React DevTools Aug 12, 2018
Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, able to run the build locally again

warnings: false,
negate_iife: false,
keep_fnames: true,
keep_infinity: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda wish all the trues were together at the top or something, but I don't care

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are to disable functionality enabled by default in the compressor. The UglifyJS options aren't really consistent in that respect. https://github.com/mishoo/UglifyJS2/tree/v2.x

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@tylersmalley tylersmalley merged commit 7c2fd3b into elastic:master Aug 12, 2018
tylersmalley added a commit to tylersmalley/kibana that referenced this pull request Aug 12, 2018
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
tylersmalley added a commit that referenced this pull request Aug 12, 2018
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
tylersmalley added a commit to tylersmalley/kibana that referenced this pull request Aug 12, 2018
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
tylersmalley added a commit that referenced this pull request Aug 12, 2018
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants