TSRX Playground
The published @tsrx/yuku, running in this tab: parse, analyze, generate.
export function Cart({ items }): unknown @{
const count = items.length;
<ul class="cart">
@for (const item of items; key item.id) {
<li>{item.label}</li>
} @empty {
<li>Your cart is empty</li>
}
@if (count > 0) { <li>{count} in the cart</li> }
<style>.cart { display: grid; gap: 4px; }</style>
</ul>
}
a TSRX component, highlighted with the TSRX grammar
@tsrx/yuku
The program parse returns, as JSON: ESTree, with TSRX nodes such as JSXCodeBlock, JSXForExpression and JSXStyleElement.
Every diagnostic, with the TSRXnnnn code @tsrx/core reports. The parse also reports semantic errors here.
The program printed back to TSRX by generate.
The scopes, bindings, references, imports, and exports analyze finds.
the parser starts when this page loads