Developer Tool · 2026
Watcher design tools for live react apps
Watcher opens a running React app like a design file: rulers and guides, live style editing, a free canvas, responsive previews, an SVG editor, design-system extraction, and a profiler, all on top of the real page. Edits write back into your JSX as Tailwind classes, and production builds ship none of it.

- React
- TypeScript
- Vite
- Babel
- Tailwind CSS
- Web Extensions
Problem
Polishing UI means bouncing between three places: a design tool that isn't the real app, browser devtools whose edits vanish on reload, and the code where you retype every value by hand. I wanted to tune spacing, type, and colour directly on the running app and have those edits land in the source.
Challenge
Writing edits back to code safely. A Vite plugin stamps every JSX element with its source line and column before React's own transform runs, so a click on the page maps to an exact spot in a file. Write-back then parses that file with Babel and edits it with magic-string (never regex on code), turning each CSS change into the matching Tailwind utility on the scale (padding-top: 44px → pt-11) or an arbitrary value when nothing fits. It replaces only the class for the same property, leaves md: and hover: variants alone, and an edit made in the 820px preview is written as md:. When it can't edit safely (a fully computed className, or an element rendered by .map() that would change every copy), it says so instead of guessing.
Architecture
The overlay is a React app mounted in its own shadow root and React root, so the host app's CSS can't reach it and it never re-renders the host's tree. Before it's opened it costs under 1 kB gzipped; the ~103 kB overlay chunk is fetched while the browser is idle. A production export condition resolves the package to an empty module, so Vite and webpack builds ship zero bytes. The Vite plugin only runs on the dev server, only accepts same-origin requests, and only writes .jsx/.tsx files inside the project. A Chrome and Firefox extension runs the same overlay on any website, minus write-back.
Decisions
- Dev-only by construction: an export condition and a NODE_ENV guard instead of asking people to wrap it in an if.
- Shadow-root isolation in both directions: the app's styles can't break the tool, and the tool can't restyle the app.
- Responsive previews are real viewports, so media queries and vw units respond as they would on a device, and inspecting inside a preview shares one undo history with the main page.
- Your editor's git diff is the review step: write-back makes ordinary source edits rather than keeping a hidden layer of overrides.
- Shipped 0.1 with the unfinished Animate tab hidden behind a flag rather than released half-done.
What went wrong
Write-back only speaks Tailwind for now; other styling approaches get live editing and Copy CSS but no save-to-code. The animation timeline isn't finished, which is why it's flagged off. And the overlay grew fast: most of its UI still lives in one very large component file that needs splitting before the next round of features.
Lessons
Developer tools live or die on trust. People will only let a tool rewrite their source if every write is predictable, reviewable, and refuses loudly when it's unsure, so the guardrails ended up being more work than the edits themselves, and they're the part that matters most.