question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(htmlbars) should inherit from Handlebars

See original GitHub issue

I am currently working on refining the handlebars-language to support literal-segments:

The Handlebars-tests are working fine with my changes, but HTMLBars detection testcase no fails… because highlight.js detects Handlebars instead of HTMLBars.

Now, the file that should be detected as HTMLBars, might was well be a Handlebars file

<div class="entry">
  {{!-- only output this author names if an author exists --}}
  {{#if author}}
    {{#playwright-wrapper playwright=author action=(mut author) as |playwright|}}
    <h1>{{playwright.firstName}} {{playwright.lastName}}</h1>
    {{/playwright-wrapper}}
  {{/if}}
  {{yield}}
</div>

In my oppinion, there is no need for an HTMLBars language, because the syntax is actually the same as Handlebars. It even uses the Handlebars parser to generate an AST. Couldn’t htmlbars just be an alias of Handlebars.

I think the only difference really lies in the list of built-ins. HTMLBars/Glimmer/Ember seems to have many more builtin-helpers. But it should be possible to somehow handle that.

There are parts of the html-bars definition that should be moved into the handlebars-definition anyway (like sub-expressions).

I am willing to put some work into that. I just wanted to ask for your opinions first.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:47 (44 by maintainers)

github_iconTop GitHub Comments

1reaction
joshgoebelcommented, Oct 26, 2019

I can live with that, just means we save up the breaking stuff for 10.0

1reaction
joshgoebelcommented, Oct 12, 2019

We’ll see if Egor has any concerns but this is what I had in mind for CPP/Arduino:

https://github.com/highlightjs/highlight.js/pull/2185

Best of both worlds… and now Arduino is really more of a “subclass” of CPP. If we started doing this a lot we could add a little more tooling to make it easier.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is HTMLBars and how is it better than Handlebars
Atleast 30% faster than handlebars. Fast DOM cloning; so large lists will be rendered faster. Get rid of metamorph (script tags). Unlike ...
Read more >
Handlebars Strict Mode - Ember RFCs
In this RFC, we propose a set of changes to Ember's variant of Handlebars that are aimed at codifying best practices, improving clarity...
Read more >
Templating with HTMLBars - Discover Ember - Ludu
Let's start by generating a controller for our application template. Open a new terminal window (the one using ember server must always run...
Read more >
Logical operator in a handlebars.js {{#if}} conditional
A helper to execute javascript expressions. EXPRESSION is a properly escaped String; Yes you NEED to properly escape the string literals or just...
Read more >
Template inheritance for Handlebars - John Freeman
I will not describe the merits of logic-less templates in this post. (If you are unfamiliar with them, then please visit either of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found