Skip to content

Commit 1d4fc88

Browse files
committed
Initial commit: React runtime for Dear ImGui with Static Hermes
A React runtime that renders to Dear ImGui using Static Hermes, demonstrating seamless JavaScript and C++ ecosystem integration with zero-cost FFI. Features: - React 19.2.0 with custom reconciler and full hooks support - Native Dear ImGui components (window, button, table, drawing primitives, etc.) - Three-unit architecture separating event loop, React logic, and ImGui rendering - Event loop with setTimeout, setImmediate, and Promise support - Controlled/uncontrolled window positioning patterns - Dynamic window creation and destruction - Custom drawing with shapes (rectangles, circles) - Live-updating tables Implementation: - JavaScript-first: ~2,400 lines of hand-written JS, ~700 lines of C++ glue - ~12,000 lines of auto-generated typed JavaScript FFI bindings - Typed mode for ImGui FFI (zero-cost calls to C functions) - Untyped mode for React runtime and application code - Three compilation modes: native code, bytecode, or source - Automatic Static Hermes build integration via CMake - Simple 5-line CMake function for creating new apps Examples: - hello: Minimal Hello World demo - showcase: Full feature demo with multiple windows, state, animations - dynamic-windows: Dynamic window lifecycle management Platform support: macOS (tested), Linux (expected), Windows (coming soon) Built by the architect of Hermes with extensive assistance from Claude Code for JavaScript implementation, React reconciler architecture, and modern tooling (esbuild, npm, CMake integration). This is an experimental project demonstrating Static Hermes capabilities. Contributions welcome!
0 parents  commit 1d4fc88

File tree

272 files changed

+274898
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+274898
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-react"]
3+
}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules/
2+
dist/
3+
bundle/
4+
*.log
5+
.DS_Store
6+
.npmrc
7+
cmake-build-*/
8+
.claude/
9+
.idea/

.npmrc.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copy this file to .npmrc and update the path to your Hermes binary
2+
hermes_bin=/path/to/hermes

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5"
6+
}

0 commit comments

Comments
 (0)