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

@embroider/macros is not parallelizable #671

Closed
rwjblue opened this issue Jan 28, 2021 · 0 comments · Fixed by #865
Closed

@embroider/macros is not parallelizable #671

rwjblue opened this issue Jan 28, 2021 · 0 comments · Fixed by #865

Comments

@rwjblue
Copy link
Collaborator

rwjblue commented Jan 28, 2021

Quick example PR over in ember-engines: ember-engines/ember-engines#751

Haven't had much time to dig into this just yet, but it seems like the plugins registered here:

registry.add('htmlbars-ast-plugin', {
name: `@embroider/macros/${index}`,
plugin,
baseDir() {
return join(__dirname, '..');
},
});

Need to be including the parallelBabel property (which is used by ember-cli-htmlbars here).

Here is an example from ember-cli-htmlbars own test suite:

    registry.add('htmlbars-ast-plugin', {
      name: 'module-name-inliner',
      baseDir() {
        return __dirname;
      },
      parallelBabel: {
        requireFile: __filename,
        buildUsing: 'buildPlugin',
        params: {},
      },
      plugin(env) {
        let { builders } = env.syntax;

        return {
          name: 'module-name-inliner',

          visitor: {
            PathExpression(node) {
              if (node.original === 'module-name-inliner') {
                // replacing the path with a string literal, like this
                // {{"the-module-name-here"}}
                return builders.string(env.moduleName);
              }
            },
          },
        };
      },
    });
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 a pull request may close this issue.

1 participant