The Kilim Gazette

Notes on the web, type and slow making

Technology

The case for zero JavaScript

Most pages are documents. Shipping them without a script is a feature, not a limitation.

An abstract pattern of woven kilim motifs

Most of the web is still documents: an article, a menu, a price list, a page of docs. They load a framework anyway, and the reader pays for it on a train with one bar of signal.

What you give up

Less than you think. A details element opens and closes, a form posts, a link prefetches the next page with Speculation Rules. The browser has learned a great deal since we last checked.

  • Menus and accordions: <details> and <summary>
  • Dark mode: prefers-color-scheme
  • Instant navigation: prefetching on hover

What you get

Pages that render on the first round trip, that a screen reader understands, and that still work in ten years. When a page truly needs a script, it should say so out loud.

The fastest script is the one you never send.

Start from zero and add what the page asks for. It is a better default than starting from everything and trying to take it away.

More in Technology