Menu

I Built xph: Write JSX Components, Ship Native PHP
📰

I Built xph: Write JSX Components, Ship Native PHP

DEV Community: astro·Sajjad Hashemian·1 day ago
#nkachaeD
#devtoastro#devto#dev#server#modern
Reading 0:00
15s threshold

TL;DR: I built xph , an open-source compiler that lets you write Astro-like components with typed props, scoped CSS, and PHP server-side logic, then compiles them into native PHP, CSS, and JavaScript.

Build with Node.js. Run with PHP. No Node.js runtime required in production.

Why I built xph

I've been working with PHP for a long time, and I still appreciate its simplicity, especially when it comes to server-side rendering.

But when building modern user interfaces, I kept running into things that felt unnecessarily difficult.

I wanted to keep PHP as my server-side runtime while enjoying the developer experience that modern frontend frameworks provide.

There were five main reasons I started working on xph.

1. Server-side rendering with modern tooling

PHP already does server-side rendering really well.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.