Skip to content
HN On Hacker News ↗

Show HN: Domphy – plain-object UI for tool apps, AI-correctable output

▲ 11 points 3 comments by khanhhuunguyen 3w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

1 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 311
PEAK AI % 1% · §1
Analyzed
Jun 20
backend: pangram/v3.3
Segments scanned
1 windows
avg 311 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 311 words · 1 segments analyzed

Human AI-generated
§1 Human · 1%

I built a UI framework named Domphy because I could not learn React although I tried many times. I mean I could not understand React code which is hidden behind multiple layers, especially when some of them use React ecosystem libs. Maybe I am an architect turned developer, so I had no foundation of programming, or I expected something clear and clean.I just think that UI should be simple — HTML and JS are enough and just need some way to make it stateful instead of making it more complicated. My idea: just using JS objects to reflect HTML, and using functions for state. When I need to reuse a component I had one more concept — just make a partial (I call it a Patch) to add props to the main object (but native props still win). With a component-based approach you get deep nesting and exploding props, but with patches you don't. The example below: import { ElementNode, toState } from "@domphy/core"; import { tooltip } from "@domphy/ui";

const count = toState(0);

const App = { div: [ { h3: (listener) => `Count: ${count.get(listener)}` }, { button: "Increment", onClick: () => count.set(count.get() + 1), $: [tooltip({ content: "Add one to the count" })], }, ], style: { display: "flex", gap: "8px", alignItems: "center" }, };

const root = new ElementNode(App); root.render(document.getElementById("app")!);

Right now I am the only one using Domphy, for around a year, for creating SketchUp and Revit plugins in the AEC (Architecture, Engineering, Construction) industry. I created Domphy before AI code generation took off, to make code humans can read and understand clearly, but now AI can build UIs with React well, so sometimes I feel my work is meaningless. But I still use Domphy for my apps, because I feel more confident when I need to read and edit UI code when the AI gets stuck.