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

Opt htmlbars-ast-plugin into parallel Babel builds #3

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

patocallaghan
Copy link
Contributor

@patocallaghan patocallaghan commented Jan 31, 2020

So this addon causes your app to opt out of Babel parallel builds.

Reproduction

To reproduce you can do the following:

  1. Create a new ember-cli and update dependencies
npx ember-cli new test-app && cd test-app
// Remove ember-cli-template-lint as this also does not support parallel builds
yarn remove ember-cli-template-lint
yarn add ember-simple-set-helper
  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 yarn build

It will generate the following error:

➜  test-app  git:(master) ✗ yarn build
yarn run v1.21.1
$ ember build
⠋ Building[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

Change

This PR follows a pattern other ast-plugins use to opt them into parallel builds, e.g. ember-cp-validations.

After this change yarn build works correctly without no babel parallel error.

@patocallaghan patocallaghan requested a review from pzuraq January 31, 2020 08:05
@jrjohnson
Copy link

@pzuraq friendly ping on this one, I think it is the last addon preventing parallel builds of our app.

@pzuraq pzuraq merged commit 2f5d38e into pzuraq:master Feb 20, 2020
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.

4 participants