You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal is to adhere as closely to the HTML spec as possible and leave all expressions and logic as undefined as possible so that it can vary depending on the implementing language. To accomplish this, it leans on mostly HTML-inspired markup language and pokes holes in various places for foreign logic to exist using Mustache-inspired curly braces {}.
Note
Xero doesn't need any suspense or fallback concepts since Xero handles those naturally.
This experiments with lowercase to feel more like a keyword than a class.
Syntax is made to feel closer to C#/JavaScript for familiarity.
HTML is often seen with valueless attributes (like checked). If what's contained inside the {} evaluates to false, the contents are not included in the output.
<if {{count > 0}}>
<div>My Content</div>
</if>
Avoid verbosity with a Swift-inspired if-let. Inner content is only included if the attribute value is non-null (or truthy). The attribute name can then be used in-scope to save on verbosity. If there are multiple attributes doing this, then each must be non-null (or truthy) to include its contents. The syntax used inside the intital {{}} (e.g. the elvis operator in this example) is outside the scope of this spec and depends on the syntax of the implementing language.
Maybe we can make use of the latest pattern matching features of C#? Basically only the first one to evaluate to true would be rendered. Initially this made use of the keyword switch but was replaced with if to avoid frequent naming collisions with a switch component commonly seen in mobile UI.
HTML-based control flow.
The goal is to adhere as closely to the HTML spec as possible and leave all expressions and logic as undefined as possible so that it can vary depending on the implementing language. To accomplish this, it leans on mostly HTML-inspired markup language and pokes holes in various places for foreign logic to exist using Mustache-inspired curly braces
{}.Note
suspenseorfallbackconcepts since Xero handles those naturally.keywordthan aclass.SolidJS seems to be leading the pack in this department these days. Here's a quick reference: https://www.solidjs.com/docs/latest/api#control-flow
Loops
Giving the iterator's value a name is optional and will default to using
itemas the variable name.Deeply nested loops will require you to supply a name for the iterator's value.
Conditionals
HTML is often seen with valueless attributes (like
checked). If what's contained inside the{}evaluates to false, the contents are not included in the output.Avoid verbosity with a Swift-inspired
if-let. Inner content is only included if the attribute value isnon-null(or truthy). The attribute name can then be used in-scope to save on verbosity. If there are multiple attributes doing this, then each must benon-null(or truthy) to include its contents. The syntax used inside the intital{{}}(e.g. the elvis operator in this example) is outside the scope of this spec and depends on the syntax of the implementing language.Maybe we can make use of the latest pattern matching features of C#? Basically only the first one to evaluate to true would be rendered. Initially this made use of the keyword
switchbut was replaced withifto avoid frequent naming collisions with aswitchcomponent commonly seen in mobile UI.