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

Run uglify in parallel, using a workerpool #63

Merged
merged 2 commits into from
Mar 26, 2018
Merged

Run uglify in parallel, using a workerpool #63

merged 2 commits into from
Mar 26, 2018

Conversation

mikrostew
Copy link
Collaborator

@mikrostew mikrostew commented Feb 24, 2018

This converts uglify to run in parallel, using some of the same conventions as babel/broccoli-babel-transpiler#114 and babel/broccoli-babel-transpiler#127.

I had to change the test environment to use node, since otherwise jest uses the browser environment which fails for workerpool.

TODO:

  • docs,
  • debug logging
  • unit test for processFile()

return queue(worker, pendingWork, writer.concurrency)
.then((/* results */) => {
// files are finished processing, shut down the workers
writer.pool.terminate();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we may want to do this even if the promise fails. So in the finally clause (if this is a new promise, or a rsvp promise) otherwise we can use the catch clause.

Copy link
Collaborator Author

@mikrostew mikrostew Mar 23, 2018

Choose a reason for hiding this comment

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

I'm testing this now and it looks like it doesn't support finally, so I'll use catch



// each of these is a string, so that's good
module.exports = function processFile(inFile, outFile, relativePath, outDir, silent, _options) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add a unit test for this function?

@stefanpenner stefanpenner merged commit 644b7b6 into ember-cli:master Mar 26, 2018
@stefanpenner
Copy link
Collaborator

released as 2.1.0

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