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.
- Host: GitHub
- URL: https://github.com/lukevdbroek-nl/hybrid-javascript-php
- Owner: lukevdbroek-nl
- License: mit
- Created: 2025-10-23T23:13:19.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-10-25T13:30:31.000Z (5 months ago)
- Last Synced: 2025-10-25T14:18:20.827Z (5 months ago)
- Topics: framework, fullstack, javascript, php, reactive, vdom
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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