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

Support for hbs('template-here')? #2

Open
rwjblue opened this issue Nov 3, 2019 · 3 comments
Open

Support for hbs('template-here')? #2

rwjblue opened this issue Nov 3, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@rwjblue
Copy link

rwjblue commented Nov 3, 2019

Does this library currently support usage without tagged template literals? Given the name, I'd assume it doesn't but wanted to check in...

In general, the underlying babel plugin that is used by Ember apps supports all of the following:

import { hbs } from 'ember-cli-htmlbars'

hbs`some template here`

hbs('some template here');

hbs('some template here', { moduleName: 'zomg.hbs' });
@flashios09
Copy link
Owner

Does this library currently support usage without tagged template literals?

No it doesn't, only the tagged template literals (back-tick format) is supported

the underlying babel plugin that is used by Ember apps supports all of the following

Why/when we use those formats for inline templates ?

hbs('some template here');
hbs('some template here', { moduleName: 'zomg.hbs' });

@rwjblue
Copy link
Author

rwjblue commented Nov 4, 2019

The most common reason to use the CallExpression form is when you'd need to pass additional metadata. In the example snippet above I pass the moduleName for the template, which is quite important in some cases (e.g. if your translation system uses the template name itself as a key).

@flashios09
Copy link
Owner

which is quite important in some cases

So i think we need to create a new package ember-extract-inline-templates that supports those formats
What do you think ?

@flashios09 flashios09 added the enhancement New feature or request label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants