-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
AST plugins not applied to tagged template strings #307
Comments
Still a few TODO items left, but #309 aims to fix this. I confirmed locally, with those changes the plugin in the reproduction is called for the inlined template. |
Fix is landed and released as https://github.com/ember-cli/ember-cli-htmlbars/releases/tag/v4.0.2. |
FYI - I just confirmed in the demo repo with 4.0.2 that the plugin added there does get called. Sent a PR here (only change is bumping ember-cli-htmlbars though): dfreeman/colocated-components-no-template-transforms#1. |
Opening this here so there's a place to track the issue. This originally came up in Discord in the context of colocated templates (since they're implemented via tagged template strings), but it also applies to templates embedded in JS files directly by users.
AST plugins don't seem to be getting applied to embedded templates. I set up a simple reproduction where the plugin just emits a message to the console when it processes a template. The message is logged for templates that are preprocessed the usual way, but not for those using the
hbs
tag fromember-cli-htmlbars
.Poking around a little, this seems to be related to the template compiler using global state for configured plugins and the way we have to muck with this state to support different plugins in different contexts, but I wasn't able to come up with a fix in the time I spent playing with it.
The text was updated successfully, but these errors were encountered: