About Pickle-Reactor
A Next.js-style Python framework using Pyodide and VDOM diffing.
β¨ Features
- π Write UI components in Python (server & client)
- β‘ Server-Side Rendering (SSR) for fast initial load
- π Virtual DOM with efficient diffing algorithm
- π― React-style hooks (use_state) for state management
- πΊοΈ File-based routing (Next.js-style)
- π HTML escaping for XSS protection
- π Runs Python in browser via Pyodide WebAssembly
- π¨ Component-based architecture
ποΈ Architecture
Pickle-Reactor uses a hybrid rendering approach:
- Server (FastAPI): Renders components to HTML for initial page load
- Client (Pyodide): Hydrates HTML with interactivity using Python in WebAssembly
- VDOM: Efficient DOM updates using Preact-style O(n) diffing
- State: React-style hooks for component state management
- Routing: File-based routing with server and client-side navigation
π οΈ Technology Stack
- Pyodide 0.24+: Python 3.11 in WebAssembly
- FastAPI: Modern async Python web framework
- PyScript pydom: Pythonic DOM manipulation
- VDOM: Custom Python implementation with Preact-style diffing
- pytest: Comprehensive testing (unit, integration, E2E)
π Implementation Phases
- β
Phase 1: VNode, SSR, Pyodide Bootstrap
- β
Phase 2: ComponentInstance, use_state, mount/rerender
- β
Phase 3: patch(), events, keyed children
- β
Phase 4: Routing, multiple pages
- β
Phase 5: Data loading, server actions
- β
Phase 6: CLI, development server, production build