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

Ensure release mode redux #7328

Merged
merged 2 commits into from Mar 16, 2016
Merged

Ensure release mode redux #7328

merged 2 commits into from Mar 16, 2016

Conversation

@islemaster
Copy link
Member

islemaster commented Mar 16, 2016

@Bjvanminnen noticed the following warning in App Lab on production, following the release of #7148:

You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.

We tracked the warning down to this clever function in redux which checks an undocumented dependency on a certain build environment. We already do this properly for React in code-studio, but we only load redux in apps and missed that we weren't putting it in production-mode correctly.

To fix, we make sure to set NODE_ENV=production for all of the release build process, not just as a config option to our envify transform. Before we were only replacing instances of process.env.NODE_ENV in our own code - now it happens in included node_modules as well. We also switch to loose-envify as recommended by the redux warning message.

@@ -21,7 +21,6 @@
"browserify": {
"transform": [
"require-globify",
"envify",

This comment has been minimized.

Copy link
@islemaster

islemaster Mar 16, 2016

Author Member

No need to specify this in configuration if we're defining it inline in the build command.

Since we're no longer passing a custom configuration we might want to define it here instead of the build command, but I'm not sure what that does to the ordering of the transforms, and we're currently doing envify after babelify.

@Bjvanminnen

This comment has been minimized.

Copy link
Contributor

Bjvanminnen commented Mar 16, 2016

lgtm

islemaster added a commit that referenced this pull request Mar 16, 2016
Ensure release mode redux
@islemaster islemaster merged commit 63af17e into staging Mar 16, 2016
5 checks passed
5 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.0%) to 85.294%
Details
hound No violations found. Woof!
@islemaster islemaster deleted the ensure-release-mode-redux branch Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.