Back to list
TSRX がなぜ私を PHP への思い出すのか
Why TSRX Gives Me PHP Flashbacks
Translated: 2026/4/24 22:00:48
Japanese Translation
数日、フロントエンドのコミュニティは JSX の潜在継承者である TSRX に興奮している。TSRX は、Inferno と Ripple の創作者である Dom Gannaway(@trueadm) が、元 React と Svelte コアチームメンバーとして作成した。現在、React、SolidJS、Ripple 向けのアルファテストとして利用可能である。
Ryan Carniato はすでに詳細な記事を執筆している。
私は自ら検討することに決めたが、正直に言えば、私の感想は複雑である。
一方、解決しようとしている問題は心地よく古く、複雑なコンポーネントにおいて、JSX は {condition && ...}、.map(...)、埋め込みされたコールバック、そして自我で書けられるくさの棒のように変容する。
TSRX は最初に見てみると新鮮な息を吹きかけるものに見える。通常の if と for ステートメントを使用すると、コンポーネント構造の中に非常にクリーンに見える:条件は条件、ループはループ、ブロックはブロックである。
しかし、Solid を書く人間として、その背後にある前提は本質的に「Solid のモデルが既に提供するものとは非常に近いことを行うが、決して Solid と呼ばないで」というものであると言え、揺るがない。Solid の && と { ステージが恐怖を与えるものは、すでに多くのこの可読性の問題を解決している。確かに、専用テンプレート構文が理論的にわずかにクリーンに見えるかもしれないが、実際には、&& と { はすでに完全に読み取り可能である。
しかし、私の本物の不満は、コンポーネントのロジックとマークアップを自由に行き来させるアイデアにある。それは深刻な PHP のフラッシュバックを引き起こす。
私は実際のアーキテクチャ上の進歩を見たいだけだ、単に「一つのファイルに入れる!」→「清潔のためにテンプレートを分離しよう!」→「ロジックをマークアップにに戻そう!」という秤の揺れによるもう一つの乗り物である。
単一のファイルに HTML、CSS、JS、SQL、およびサーバーのロジックを投げ込むとき、あなたは PHP を得る、または、あなたがそれをどのように見ることにかかわらず、React サーバーコンポーネントを。
しかし、それをすべて見たベテラン開発者の知恵に引用して、「あなたが本当にその道を選んではならない。」
公平を期し、私は TSRX のエンジニアリングに多くの敬意を払っている。構文の実験として、それは生態系を長年の仮定を問い直すように促すものであり、Ryan の記事は、なぜこの方向が探求に値しているかを強力な主張を立てている。私たちは、より良い構文とエルゴノミックスの名の下で我々がするアーキテクチャ上のトレードオフを注意深く扱わないといけない。
取れるものは?TSRX を遊んでみろ - それは感銘的な実験であり、私がどのように進化するかを見ることは本当に心待ちにしている。しかし、あなたの目標が本当にあなたのテンプレートとフロントエンドロジックを単純化することであれば、それは Solid に本当のチャンスを与える時なのかもしれない。
Solid の美しさは、標準的なセマンティクスを活用することにある。カスタムテンプレート言語はない、新しいパーサが存在しない - あなたはそれを何らかの方法でダクトテーティングしてあなたの IDE と TS Language Server に取り付ける必要があるものはない、そして余計なボイラープレートはない。あなたが通常のエディターをすぐに必要とするだけです。そして、TypeScript 7 が約束されたパフォーマンス向上を実行することができれば、そのセットアップはより良くなる。
誰が知っている、 Solid の反応的なモデルに慣れ、あなたがまだそのステートメントレベルの構文を求めていて、TSRX をスパインするかもしれないと、そう思ってしまうかもしれない。そして、正直に言えば、あなたがその組み合わせで楽しい気分であれば、その力を与えよ:)
Original Content
For the past few days, the frontend community has been buzzing about a potential successor to JSX: TSRX. It was created by Dominic Gannaway(@trueadm) the creator of Inferno & Ripple, and former React and Svelte core team member. It is available today as an Alpha for React, SolidJS, and Ripple.
And Ryan Carniato has already written a detailed piece on it.
I decided to take a look at it myself, and honestly, my feelings are mixed.
On one hand, the problem it tries to solve is painfully familiar. In complex components, JSX can quickly devolve into a spaghetti of {condition && ...}, .map(...), nested callbacks, and a sea of brackets rendering themselves.
At first glance, TSRX feels like a breath of fresh air. Using regular-looking if and for statements right inside the component structure looks much cleaner: a condition looks like a condition, a loop is just a loop, and a block is a block.
However, as someone who writes Solid, I can't shake the feeling that the underlying premise is essentially: "Let's do something very close to what Solid’s model already gives us, but whatever you do, don't call it Solid." Truth be told, Solid's and components already solve a lot of this readability issue. They flatten the dreaded && { staircase. Sure, a dedicated templating syntax might look slightly cleaner in theory, but in practice, and are already perfectly readable.
But here’s my real gripe. The idea of freely mixing component logic and markup triggers some severe PHP flashbacks. I'd love to see actual architectural progress, not just another ride on the pendulum: "Put everything in one file!" → "Let's separate templates for cleanliness!" → "Let's put the logic back into the markup!"
What do you get when you dump HTML, CSS, JS, SQL, and server logic into a single file? You get PHP. Or, depending on how you look at it, a React Server Component. But to quote the wisdom of senior devs who have seen it all: "You really don't want to go down that road."
To be fair, I have a lot of respect for the engineering behind TSRX. As a syntax experiment, it pushes the ecosystem to question some long-standing assumptions, and Ryan’s article makes a strong case for why this direction is worth exploring. We just need to be mindful of the architectural trade-offs we make in the name of better syntax and ergonomics.
The takeaway? By all means, play around with TSRX—it's a fascinating experiment, and I’m really looking forward to seeing how it evolves. But if your goal is to genuinely simplify your templates and frontend logic, it might be time to give Solid a real chance. The beauty of Solid is that it leverages standard semantics. No custom templating languages, no new parsers that you have to somehow duct-tape to your IDE and the TS Language Server, and no extra boilerplate. All you need is your regular editor out of the box. And if TypeScript 7 delivers on the promised performance gains, that setup only gets better.
Who knows, maybe after getting comfortable with Solid's reactive model, you'll decide you still crave that statement-level syntax and give TSRX a spin anyway. And honestly, if you have a blast with that combo — more power to you :)