ember-cli / ember-cli/ember-cli-htmlbars

dedent version of `hbs`?

Offen
#622 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
77
Forks
65
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Is there appetite for a version of `hbs` that dedents the template string?

I find myself often doing things like

```js
layout: hbs(dedent`
greeting: {{greeting}}
`)
```

with an npm package, but it always feels like extra work & is most of the time (always?) what I want.

You can see [in Ember Animated's codebase](https://github.com/ember-animation/ember-animated/blob/d36310bad09d2888a1213b4d0aa9fa7edc3066c2/tests/integration/components/animated-orphans-test.js#L29-L50) Ed's forced to manually dedent the strings because he never got around to installing `dedent`, which kinda sucks.

Wondering if we could export an `hbsd` or `hbsDedent` tag that does this automatically.

```js
layout: hbsDedent`
greeting: {{greeting}}
`)
```

Watcha think?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.