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

Add ability to pass static options to transpilation. #75

Merged
merged 1 commit into from
Aug 30, 2019

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 30, 2019

This allows consumers to specify additional options during compilation, for example you might need to ensure that the compiled template has a moduleName set (e.g. if you are testing an AST plugin that needs to know the compiled templates module name).

Note: this functionality is only possible with the CallExpression version of hbs. This is because there is no way to pass additional arguments to a TaggedTemplateExpression.

This allows consumers to specify additional options during compilation,
for example you might need to ensure that the compiled template has a
moduleName set (e.g. if you are testing an AST plugin that needs to know
the compiled templates module name).

Note: this functionality is only possible with the `CallExpression`
version of `hbs`. This is because there is no way to pass additional
arguments to a `TaggedTemplateExpression`.
@rwjblue
Copy link
Member Author

rwjblue commented Aug 30, 2019

I made a slimmed down version of this plugin in ASTExplorer if folks want to play with it:

https://astexplorer.net/#/gist/51cf2e40a39f01ccf4e9cd2d9cdd96af/2c99758e9b185da1203d43b9eef82cf25dcf3f02

@rwjblue rwjblue merged commit c47570a into ember-cli:master Aug 30, 2019
@rwjblue rwjblue deleted the accept-options branch August 30, 2019 13:44
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.

None yet

1 participant