Parallelize feature spec build, leverage Make up-to-date for browsers.json#9959
Parallelize feature spec build, leverage Make up-to-date for browsers.json#9959
Conversation
package.json
Outdated
There was a problem hiding this comment.
just for my own edification, in other project's I've seen you use run-p so we 'd have like:
| "build:js": "concurrently 'yarn:webpack' 'make browsers.json'", | |
| "build:js": "run-p build:js:*", | |
| "build:js:webpack": "yarn:webpack", | |
| "build:js:browsers-json": "make browsers.json", |
is there a reason we didn't do that here? to me seems like adding a new dependency either way so idk if one is better/preferred/more common than the other
There was a problem hiding this comment.
I think I recall being faced with this choice with some recent transitive dependency having a vulnerability, and discovering that npm-run-all (run-p) hasn't received a new release in 5 years, which was a motivator to find a maintained alternative. concurrently also makes it a little easier to work with non-NPM commands like what's used here.
But ultimately, yes, they're largely used to the same end, and I think your proposed alternative could work just as well.
changelog: Internal, Build Tooling, Improve performance of JavaScript build
c3d1c37 to
e907ae6
Compare
🛠 Summary of changes
Optimizes a few tasks surrounding JavaScript build:
package.jsonbuild(nowbuild:js) subtasks in parallelbrowsers.jsonbuildyarn generate-browsers-jsonis already pretty fast (0.22s on average) so the room for optimization is minimal, but an up-to-datemake browsers.jsonis faster (0.065s), and the approach allows for some tolerance if ever the work involved ingenerate-browsers-jsonbecame more involved / time-consuming.Performance Results
Diff:
Average of 5 runs:
rspec spec/features/accessibility/user_pages_spec.rb:9Before: 6.66s
After: 4.34s
Diff: -2.32s (-34.8%)
Average of 10 runs:
yarn build(yarn build:js)Before: 3.00s
After: 2.90s
Diff: -0.1s (-3.33%)
📜 Testing Plan
Verify feature specs generate JavaScript and stylesheets:
rm -rf public/packs app/assets/builds/*.cssrspec spec/features/accessibility/user_pages_spec.rb:9Verify build command completes successfully:
yarn build:jsObserve in repeated calls to
yarn build:jsthatmakeskips unnecessary workyarn build:jsyarn build:js