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

Allow for parallel babel builds #159

Merged
merged 1 commit into from
Feb 5, 2020

Conversation

jrjohnson
Copy link
Contributor

This addon causes the app to opt out of Babel parallel builds.

Reproduction

To reproduce:

  1. Create a new app
npx ember-cli new test-app && cd test-app
// Remove ember-cli-template-lint as this also does not support parallel builds
npm uninstall ember-cli-template-lint
ember install ember-page-title
  1. Add the following to your ember-cli-build.js to throw a hard error on your Ember build if parallel builds aren't possible
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    'ember-cli-babel': {
      throwUnlessParallelizable: true
    }
  });
  return app.toTree();
};
  1. Run npm run build

It will generate the following error:

[broccoli-persistent-filter:Babel > [Babel: test-app]: Babel: test-app] was configured to `throwUnlessParallelizable` and was unable to parallelize a plugin. 
plugins:
1: name: unknown, location: unknown

Please see: https://github.com/babel/broccoli-babel-transpiler#parallel-transpilation for more details

Explanation

I stole this code and most of the text for this PR from @patocallaghan and the same change at ember-simple-set-helper which duplicates similar working patterns like ember-cp-validations

Alternative

The purpose of this babel transform seems to be converting from an old {{page-title}} helper syntax to the current {{title}} since several major version and almost 5 years have passed since this change was made this transform could be removed and a new breaking major version released.

Modified the pre-processor setup to use the babel parallel build syntax.
@knownasilya
Copy link
Contributor

@jrjohnson I'm all for changing the helper and releasing as a new major version. I will merge this since it's here now, but we can remove once we rename the helper.

@knownasilya knownasilya merged commit 78853db into ember-cli:master Feb 5, 2020
@jrjohnson jrjohnson deleted the parallel-build branch February 6, 2020 05:04
@jrjohnson
Copy link
Contributor Author

Upon further review the mod goes from {{title}} to {{page-title}} and page-title is the current helper name. So this seems like it should remain unless the right path is to update docs and recommend that {{page-title}} be used instead?

@knownasilya
Copy link
Contributor

@jrjohnson I need to add a deprecation to {{title}}, then we can do a major release.

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