How to Implement a Page Editor
Development

How to Implement a Page Editor

· 1 min read

After building many websites and SaaS products, I’ve often come across web page editors. I never really understood how they worked under the hood. In the past couple of days, since one of my own products needed something like this, I decided to do some research with the help of AI.

I even used Codex to analyze Google Stitch’s page code to infer the tech stack it uses.

The conclusion: while there are various approaches to implementing these editors, two mainstream ones stand out — HTML-First and JSON-First.

HTML-First

The HTML-First approach means that during design, the page you see is rendered from HTML, with IDs embedded into DOM nodes following a set of rules. This allows real-time editing of the page through DOM manipulation.

This approach is relatively old-school. It’s simple, but the functionality it can achieve is also fairly limited.

JSON-First

Simply put, the page you see during design is rendered from a JSON object by a renderer. When the user edits page elements, what actually changes is the JSON. Once the JSON changes, the renderer re-renders the HTML, enabling real-time page editing.

This is the mainstream approach today.

独立产品人日记

Notes on indie products, AI tools, growth, and engineering.

Related Articles