[FOLIO-943] Add --sourcemap setting to stripes build in blackbox builds Created: 20/Nov/17 Updated: 12/Nov/18 Resolved: 22/Nov/17 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | Continuous Integration |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | P2 |
| Reporter: | Wayne Schneider | Assignee: | Wayne Schneider |
| Resolution: | Done | Votes: | 0 |
| Labels: | ci, sprint27 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 1 hour, 30 minutes | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||
| Sprint: | |||||||||
| Comments |
| Comment by Matthew Jones [ 21/Nov/17 ] |
|
While updating the build command to include --sourcemap, we may also want to set the environment variable NODE_ENV=production if we're not doing so already. NODE_ENV=production stripes build stripes.config.js output --sourcemap This will keep React from running in development mode. |
| Comment by Mike Taylor [ 21/Nov/17 ] |
|
What is the effect of that, Matt? |
| Comment by Matthew Jones [ 21/Nov/17 ] |
|
React will do things a bit differently when running in "production" mode, supposedly making the UI render faster. Since re-enabling minification (
Redux has similar behavior and warning:
I updated stripes-core in the same PR to include Webpack's EnvironmentPlugin. This enables us to tell React and Redux to operate in production mode. This is done by setting the NODE_ENV environment variable to "production". Webpack will also trim out unused code as a result, making the build slightly smaller. As a trade-off, we also lose some of React's development logging while in production mode. Therefore, I suppose it really comes down to the target audience for a given build if we want to maintain the React dev logging or better performance. |
| Comment by Mike Taylor [ 21/Nov/17 ] |
|
My take is that, at present at least, folio-testing is essentially part of the development process – at least, lots of bugs first manifest there (sometimes in ways that can't be reproduced on development boxes) and need to be tracked down. So I think minification and suchlike would not be appropriate. (For folio-demo they would be, of course.) |
| Comment by Matthew Jones [ 21/Nov/17 ] |
|
With source maps available, minification should be okay. There could be issues resulting from minification and it would be good to catch them early. I agree the added logging in folio-testing would be helpful to keep. Then we only need to add --sourcemap as originally requested. |
| Comment by Wayne Schneider [ 21/Nov/17 ] |
|
OK, this has been added to the Ansible role for building Stripes. It should appear in folio-testing tomorrow. Thanks, Matthew Jones! |
| Comment by Wayne Schneider [ 22/Nov/17 ] |
|
Source maps are now available on the Vagrant boxes folio/testing and folio/snapshot, but for some reason not on folio-testing.aws.indexdata.com. |
| Comment by Matthew Jones [ 22/Nov/17 ] |
|
Wayne Schneider I am seeing the sourcemaps on folio-testing.aws.indexdata.com. Any chance you have a cached copy in your browser? |
| Comment by Mike Taylor [ 22/Nov/17 ] |
|
Working perfectly for me! Many thanks, Wayne. (I'm just sorry you don't seem to be getting the benefit of your own work!) |
| Comment by Wayne Schneider [ 22/Nov/17 ] |
|
Turns out it was a yarn version issue on folio-testing, now resolved. |