frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

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

5•khanhhuunguyen•2d ago
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.

Comments

Natfan•2h ago
so preact sans jsx?
khanhhuunguyen•55m ago
Preact changes the syntax, Domphy changes the model: no virtual DOM, listener reactivity, native patch instead of component. It also comes with a constraint-based design system — every size and color value is derived from a formula, not magic numbers.

Renting a sewing machine from the library

https://www.bbc.com/future/article/20260618-the-weird-and-wonderful-libraries-of-finland
107•sohkamyung•3h ago•51 comments

Epoll vs. io_uring in Linux

https://sibexi.co/posts/epoll-vs-io_uring/
61•Sibexico•3h ago•19 comments

When I reject AI code even if it works

https://vinibrasil.com/when-i-reject-ai-code-even-if-it-works/
26•vnbrs•1h ago•7 comments

Show HN: TownSquare, a tiny presence layer for websites

https://townsquare.cauenapier.com/
72•cauenapier•14h ago•23 comments

15-minute at-home Lyme disease tick test

https://www.bostonglobe.com/2026/06/17/business/lyme-disease-tick-test/
39•bookofjoe•2d ago•13 comments

Slow breathing modulates brain function and risk behavior

https://www.cell.com/neuron/fulltext/S0896-6273(26)00339-9
63•croes•4h ago•6 comments

Loupe – A iOS app that raises awareness about what native apps can see

https://github.com/mysk-research/loupe
67•Cider9986•14h ago•17 comments

'We had to get out of the way': The backlash over delivery robots

https://www.bbc.com/news/articles/c0rygp005wjo
26•higginsniggins•2h ago•17 comments

SMPTE Makes Its Standards Freely Accessible

https://www.smpte.org/blog/smpte-makes-its-standards-freely-accessible-openingstandards-library-t...
235•zdw•9h ago•65 comments

Alice is impatient

https://brooker.co.za/blog/2026/06/19/waiting.html
60•birdculture•5h ago•17 comments

White House delays US voting-machine vulnerability report

https://www.reuters.com/world/white-house-delays-release-us-voting-machine-study-midterms-near-20...
32•logickkk1•54m ago•17 comments

Unauthorized alert sent to cell phones across Brazil

https://www.cnn.com/2026/06/20/americas/brazil-hackers-unauthorized-alert-latam
88•zdw•6h ago•63 comments

Project Fetch: Phase Two

https://www.anthropic.com/research/project-fetch-phase-two
31•stopachka•2h ago•9 comments

UHF X11: X11 Built for VisionOS and Apple Vision Pro

https://www.lispm.net/apps/uhf-x11/
169•zdw•9h ago•30 comments

DOS Game "F-15 Strike Eagle II" reversing project needs DOS test pilots

https://neuviemeporte.github.io/f15-se2/2026/06/20/needyou.html
207•LowLevelMahn•11h ago•57 comments

CSSQuake

https://cssquake.com/
465•msalsas•15h ago•101 comments

Moving Beyond Fork() + Exec()

https://lwn.net/Articles/1076018/
6•signa11•1d ago•1 comments

Semiconductor Lifeline Keeps Fighter Jets in the Air

https://spectrum.ieee.org/phoenix-semiconductors-legacychips-oems
38•rbanffy•4d ago•11 comments

Whole cross-sectional human ultrasound tomography

https://www.nature.com/articles/s41551-026-01660-4
25•lnyan•2d ago•3 comments

Developers don't understand CORS (2019)

https://fosterelli.co/developers-dont-understand-cors
3•toilet•48m ago•0 comments

PostgresBench: A Reproducible Benchmark for Postgres Services

https://clickhouse.com/blog/postgresbench
80•saisrirampur•7h ago•22 comments

Show HN: StartupWiki – A Free Alternative to Crunchbase

https://startupwiki.tech/
157•shpran•10h ago•54 comments

Inference cost at scale with napkin math

https://injuly.in/blog/napkin-inference-cost/index.html
61•gmays•4d ago•14 comments

Linux eliminates the strncpy API after six years of work, 360 patches

https://www.phoronix.com/news/Linux-7.2-Drops-strncpy
96•simonpure•5h ago•73 comments

Show HN: Make PDFs look scanned (CLI or in the browser via WASM)

https://github.com/overflowy/make-look-scanned
91•overflowy•8h ago•47 comments

The Wholesale Plagiarism of Obscure Sorrows

https://waxy.org/2026/06/the-wholesale-plagiarism-of-obscure-sorrows/
323•ridesisapis•8h ago•136 comments

Temporary Cloudflare accounts for AI agents

https://blog.cloudflare.com/temporary-accounts/
175•farhadhf•15h ago•96 comments

The rise of South Korea’s weapons business

https://www.politico.com/news/magazine/2026/06/20/south-korea-weapons-dealer-trump-00959559
116•JumpCrisscross•14h ago•42 comments

Supermarket giant Tesco sues VMware for breach of contract

https://www.theregister.com/software/2025/09/03/supermarket-giant-tesco-sues-vmware-for-breach-of...
95•wglb•5h ago•25 comments

Bun has an open PR adding shared-memory threads to JavaScriptCore

https://github.com/oven-sh/WebKit/pull/249
116•gr4vityWall•9h ago•217 comments