2. A custom JS DSL in the form of custom directives. Currently there are 12 of them.
They may look like regular functions, but they will throw an error if you use them outside of their scope.
Example:
// is fine
html`<p class="${classMap({someClass: true})}">Hello, world</p>`
// Unhandled Promise Rejection: Error: `classMap()`
// can only be used in the `class` attribute
// and must be the only part in the attribute.
html`<p style="${classMap({someClass: true})}">Hello, world</p>`
(Note: that error is incorrect because you can write `class="other parts of the attribute ${classMap(...)}"`)
More stuff is coming to lit, of course, such as contexts, server rendering etc.
I may run into "you're posting too fast, so not all part may appear at the same time" ))
Part 3.
> Huh? Lit-html is simpler than handlebars. Are you confusing it with LitElement?
Of course not.
At the time of writing lit has:
1. A custom DSL for writing HTML
2. A custom JS DSL in the form of custom directives. Currently there are 12 of them.They may look like regular functions, but they will throw an error if you use them outside of their scope.
Example:
(Note: that error is incorrect because you can write `class="other parts of the attribute ${classMap(...)}"`)More stuff is coming to lit, of course, such as contexts, server rendering etc.