TSRX, a new TypeScript language extension created by Dominic Gannaway, the former React and Svelte core team engineer behind Inferno, Lexical and Ripple, has been released in alpha, billing itself as a framework agnostic successor to JSX for building declarative user interfaces.
Announced on X, where Gannaway described it as the "spiritual successor to JSX" that was "extracted from Ripple, and made framework agnostic", TSRX compiles a single .tsrx component file to multiple runtime targets. Plugins such as @tsrx/react, @tsrx/preact, @tsrx/solid, @tsrx/vue and @tsrx/ripple walk a shared AST and emit idiomatic output for each runtime, including scoped CSS, so new targets can be added as standalone compiler plugins without changing the language itself.
The headline idea is moving common UI ergonomics from convention into syntax. TSRX introduces statement level control flow inside templates using @if, @for, @switch and @try, alongside prop shorthands, lazy destructuring and component scoped styles. A component body uses an @{ ... } statement container that ends in a single rendered output.
As documented in the features guide, scoped styles live in a <style> block whose selectors the compiler rewrites with a unique hash, while error and async boundaries are expressed declaratively through @try, @catch and @pending rather than wrapper components.
On Hacker News one reader wrote:
I'm in love with everything about this.
An oxfmt plugin would be appreciated!
While another argued:
I think this is a step in wrong direction. We really need to move away from this XML inside/alongside JS ugliness prevalent in the webdev ecosystem. What I really want are kotlin style builders or F# style computation expressions.
The announcement post on X drew 130 replies and 1.6k likes, and it prompted an article from Ryan Carniato, the creator of SolidJS, titled ‘Why TSRX isn’t just your Favourite Templating Language’. In it, he summarises the implications for Vue, Svelte, React, Solid, and Mitosis developers separately, for example, React developers might escape some of the tedious hook rules, while SolidJS users may find it at odds with the framework’s transparency.
For teams considering it, the getting started guide covers Vite, Rspack, Turbopack and Bun setups, plus Prettier, ESLint and a tsrx-tsc command line type checker for CI. Adoption is per file, as a Medium write up notes: a .tsrx file compiles to a .tsx equivalent component, so it can be introduced in one place while the rest of a codebase stays untouched. That same piece cautions that the project is alpha, advising readers to "experiment, do not migrate".
Compared to its closest peers, TSRX is not a runtime like Solid or Vue, nor a templating dialect tied to a single compiler like Svelte. It sits closer to JSX itself, an authoring syntax that several frameworks can consume.
TSRX is a framework-agnostic TypeScript language extension created by Dominic Gannaway, the former React and Svelte core team engineer behind Inferno, Lexical and Ripple. TSRX is open source under the MIT licence and remains in alpha, with further compiler targets promised.