johno
Projects

Blocks

A visual editor that works directly with JSX source code.

A staircase made of lavender isometric blocks with a peach block on top.

Why should moving a button in a design tool give somebody else a button to move in code? With Blocks I wanted the thing on the canvas to be the React component I was shipping. Change a prop in the editor and there’s a change to a JSX file that you can read in a diff.

JSX gave me a tree to work with. A component has children and props, and for a useful subset of edits that’s plenty. The browser already knows how to lay those children out. That let me spend my time on the relationship between selecting something on screen and finding the bit of source that produced it.

The desktop prototype was a nice test of that decision. Most of the editing logic already lived in @blocks/editor. I could put it in an Electron window and spend the rest of the prototype on opening directories, selecting files, and writing changes back to disk.

Blocks explores visual tools that operate directly on source code instead of hiding it behind a separate document format.