Skip to content

Ensure release mode redux#7328

Merged
islemaster merged 2 commits into
stagingfrom
ensure-release-mode-redux
Mar 16, 2016
Merged

Ensure release mode redux#7328
islemaster merged 2 commits into
stagingfrom
ensure-release-mode-redux

Conversation

@islemaster

Copy link
Copy Markdown
Contributor

@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.

Comment thread apps/package.json
"browserify": {
"transform": [
"require-globify",
"envify",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

lgtm

islemaster added a commit that referenced this pull request Mar 16, 2016
@islemaster islemaster merged commit 63af17e into staging Mar 16, 2016
@islemaster islemaster deleted the ensure-release-mode-redux branch March 16, 2016 19:19
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

Successfully merging this pull request may close these issues.

2 participants