An open API service indexing awesome lists of open source software.

https://github.com/lukevdbroek-nl/hybrid-javascript-php

A lightweight reactive framework that bridges PHP and JavaScript through a shared Virtual DOM for real-time state synchronization.
https://github.com/lukevdbroek-nl/hybrid-javascript-php

framework fullstack javascript php reactive vdom

Last synced: 2 months ago
JSON representation

A lightweight reactive framework that bridges PHP and JavaScript through a shared Virtual DOM for real-time state synchronization.

Awesome Lists containing this project

README

          

# Hybrid JavaScript PHP (HJP)

**HJP** is a lightweight experimental framework that merges **PHP and JavaScript** using a shared **Virtual DOM**.
It lets PHP and JS work together in real time — **no Node.js, no reloads**.

---

## Features

- **Unified vDOM** — Shared Virtual DOM between PHP & JS
- **Reactive Updates** — PHP state changes reflected instantly in the browser
- **Server Logic + Client Interactivity** — Combine PHP logic with live JS updates
- **No Build Step** — Runs with native PHP and vanilla JavaScript
- **Lightweight** — Zero dependencies, pure codebase

---

## How It Works

1. PHP renders the initial HTML and a JSON vDOM.
2. JavaScript hydrates and diff-patches DOM updates.
3. State changes are sent to PHP (`update.php`) and returned as a new vDOM.

---

## Example

```php


Hello


This is a reactive framework


Static content