Skip to content

Conversation

NullVoxPopuli
Copy link
Contributor

No description provided.

Copy link

netlify bot commented Jul 11, 2025

Deploy Preview for ember-guides ready!

Name Link
🔨 Latest commit b34e60a
🔍 Latest deploy log https://app.netlify.com/projects/ember-guides/deploys/687a94a3b9566f00085a7f62
😎 Deploy Preview https://deploy-preview-2123--ember-guides.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Sep 6, 2025

Deploy Preview for ember-guides ready!

Name Link
🔨 Latest commit 31942ad
🔍 Latest deploy log https://app.netlify.com/projects/ember-guides/deploys/68bc58157f04a40008cab7c1
😎 Deploy Preview https://deploy-preview-2123--ember-guides.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Without specifying `/runtime`, there are additional restrictions required for the argument passed to `template()`:
- it must be a string literal

With the `/runtime`, the argument passed to `template()` can be an expression, for example:
Copy link
Contributor

@sukima sukima Oct 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say expression does that also include support for interpolation?

export default template`<div>${someValue}</div>`;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nay -- interpolation is a hazard because it can't be reactive as far as I know -- ideally we'd even add a lint that prevents that.

if reactivity is not needed, then I don't see a reason why this wouldn't work (I expect it to work -- just not be reactive on changes to someValue)

export default template(`<div>${someValue}</div>`);

/* someValue could be from anywhere */
export default default template(someValue);
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would help (me) to see example use cases for the different possibilities. Maybe when to precompile during a <script> tag in the HTML <head> versus dynamically from a <textarea>. The difference between scope: and ${stringInterpolation}. Use of this in a build tool versus use of this in an HTML file. And how this might look used in a QUnit test or Vitest.

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.

3 participants