Menu

xph — Write JSX, ship PHP

#php#redditr#server#greeting#javascript
Reading 0:00
15s threshold

Hey!

I've been working on xph, an compiler that lets you write single-file JSX components that compile into native PHP files and static assets.

```javascript

export interface Props { name: string; }

export interface Server { greeting: string;

}

<script is:server> return [ 'greeting' => 'Hello, ' . $props['name'], ]; </script>

<h1>{server.greeting}</h1>

<style> h1 { color: olive; } </style> ```

It supports scoped CSS, slots, and client-side JavaScript. No Node.js needed at runtime, just PHP.

It already has LSP support with VS Code & Neovim.

Website: https://xph.js.org/

GitHub: https://github.com/sijad/xph

Would love to hear your thoughts and feedback!

submitted by /u/ooldd
[link] [comments]