How pathlanddev/pathland works
Pathland is a cross-language declarative UI protocol and runtime. The main workflow is a view DSL rendered and retained on the server, with initial HTML followed by binary deltas to a browser client; the same protocol also supports native renderers. The README documents these product-level flows and proxy composition. Source excerpts show parts of the Kotlin view/reactivity, Rust engine, browser client, routing, and proxy behavior; unsampled internals and some runtime connections are represented only where documentation supports them.
Main entry points: PathlandSession.java Server session · CoreView.kt Kotlin view DSL · engine.rs Rust diff engine · index.ts Client connection
Components 19
View authoring
- Kotlin view DSL
lib/java/pathland-view-core/src/main/kotlin/dev/pathland/view/dsl/CoreView.kt - Rust view API
lib/rust/crates/pathland-view/src/lib.rs - Signals and state
lib/java/pathland-view-core/src/main/kotlin/dev/pathland/view/core/signal/Signals.kt - View routing
lib/java/pathland-view-core/src/main/kotlin/dev/pathland/view/core/router/Router.kt
Protocol runtime
- Server session
lib/java/pathland-server-core/src/main/java/dev/pathland/server/PathlandSession.java - Opcode protocol
lib/java/pathland-core/src/main/java/dev/pathland/core/protocol/Commands.java - Frame transport
lib/java/pathland-core/src/main/java/dev/pathland/core/transport/FrameCodec.java - Rust diff engine
lib/rust/crates/pathland-engine/src/engine.rs
Web surface
- HTML rendering
lib/java/pathland-render-html/src/main/java/dev/pathland/render/html/HtmlRenderer.java - JVM host adapters
lib/java/pathland-quarkus/src/main/java/dev/pathland/quarkus/PathlandSocket.java - DOM delta client
lib/typescript/src/apply.ts - Client connection
lib/typescript/src/index.ts - Stateful navigation
lib/typescript/src/service-worker.ts
Native surfaces
- GTK renderer
lib/rust/crates/pathland-render-gtk/src/lib.rs - Qt renderer
lib/rust/crates/pathland-render-qt/src/renderer.rs
Composition
- Proxy session
lib/java/pathland-server-core/src/main/java/dev/pathland/server/proxy/ProxySession.java
Other components
- Application developer
- Browser user
- Origin Pathland server
Connections 23
- Application developer → Kotlin view DSL: declares views
README.md - Application developer → Rust view API: declares views
README.md - Kotlin view DSL → Signals and state: uses signals
- Kotlin view DSL → View routing: supports navigation
- Kotlin view DSL → Server session: mounts in
README.md - Server session → HTML rendering: renders initial HTML
lib/java/pathland-server-core/src/main/java/dev/pathland/server/PathlandSession.java - Server session → Opcode protocol: emits deltas
README.md - Server session → Frame transport: sends frames
lib/java/pathland-server-core/src/main/java/dev/pathland/server/PathlandSession.java - Rust view API → Rust diff engine: drives view engine
- Rust diff engine → Opcode protocol: emits opcodes
lib/rust/crates/pathland-engine/src/engine.rs - Opcode protocol → Frame transport: encoded as frames
lib/java/pathland-core/src/main/java/dev/pathland/core/transport/FrameCodec.java - JVM host adapters → Server session: hosts sessions
README.md - HTML rendering → Browser user: serves HTML
README.md - Browser user → Client connection: opens live connection
README.md - Client connection → Frame transport: exchanges deltas
README.md - Client connection → DOM delta client: applies incoming frames
lib/typescript/src/index.ts - DOM delta client → Browser user: updates DOM
README.md - Client connection → Stateful navigation: registers worker
lib/typescript/src/index.ts - Rust diff engine → GTK renderer: drives native surface
README.md - Rust diff engine → Qt renderer: drives native surface
README.md - Server session → Proxy session: composes subtree
lib/java/pathland-server-core/src/main/java/dev/pathland/server/PathlandSession.java - Proxy session → Origin Pathland server: connects as client
README.md - Proxy session → Server session: splices opcode stream
README.md