Simon Willison’s Weblog

Subscribe

Sunday, 1st June 2025

Progressive JSON. This post by Dan Abramov is a trap! It proposes a fascinating way of streaming JSON objects to a client in a way that provides the shape of the JSON before the stream has completed, then fills in the gaps as more data arrives... and then turns out to be a sneaky tutorial in how React Server Components work.

Ignoring the sneakiness, the imaginary streaming JSON format it describes is a fascinating thought exercise:

{
  header: "$1",
  post: "$2",
  footer: "$3"
}
/* $1 */
"Welcome to my blog"
/* $3 */
"Hope you like it"
/* $2 */
{
  content: "$4",
  comments: "$5"
}
/* $4 */
"This is my article"
/* $5 */
["$6", "$7", "$8"]
/* $6 */
"This is the first comment"
/* $7 */
"This is the second comment"
/* $8 */
"This is the third comment"

After each block the full JSON document so far can be constructed, and Dan suggests interleaving Promise() objects along the way for placeholders that have not yet been fully resolved - so after receipt of block $3 above (note that the blocks can be served out of order) the document would look like this:

{
  header: "Welcome to my blog",
  post: new Promise(/* ... not yet resolved ... */),
  footer: "Hope you like it"
}

I'm tucking this idea away in case I ever get a chance to try it out in the future.

# 4:45 am / json, react, javascript

OK, May was a busy month for coding on GitHub. I blame tool support!

GitHub contribution graph showing May 2025 activity with repository commit statistics. May 2025 Created 405 commits in 47 repositories simonw/llm 149 commits simonw/llm-gemini 20 commits simonw/sqlite-chronicle 15 commits simonw/building-with-llms-pycon-2025 14 commits simonw/tools 14 commits simonw/llm-echo 13 commits simonw/llm-anthropic 13 commits simonw/llm-fragments-github 11 commits simonw/llm-mistral 10 commits datasette/stashed-readmes 10 commits simonw/llm-tools-quickjs 9 commits taketwo/llm-ollama 8 commits simonw/sqlite-utils 7 commits simonw/til 7 commits simonw/datasette.io 6 commits simonw/llm-video-frames 6 commits simonw/llm-tools-datasette 6 commits simonw/llm-tools-sqlite 6 commits simonw/simonwillisonblog 6 commits mpacollaborative/mpacollaborative.org 5 commits simonw/llm-prices 5 commits datasette/datasette-chronicle 5 commits simonw/sqlite-diffable 5 commits simonw/llm-llama-server 5 commits simonw/llm-plugin-tools 5 commits 22 repositories not shown Created 15 repositories

# 5:34 am / github, llm

2025 » June

MTWTFSS
      1
2345678
9101112131415
16171819202122
23242526272829
30