[idea:26w38-rheo]rheo2026-09-20

Rheo

A good experience of building out rookeries relies heavily on Rheo, the engine that pulls in the rookery package, compiles it to HTML, and incrementally rebuilds the site on changes to source files. I packaged this week’s changes into a 0.6.4 release, as they mostly pertain to better incremental compilation and code quality.

Ideomorph in Rheo’s watch server

Taking a cue from Kento Okura’s development of Forester 6.0 (via Jon Sterling’s weeknote section on it), I added support for Idiomorph to the Rheo watch server. Typst has built-in incremental compilation so that the compiler doesn’t have to recompute everything every time you add content to a source file, and instead only does the necessary work to recreate the PDF or HTML file. But without Idiomorph, that incrementality wasn’t felt in the downstream browser, as the watch server would refresh the entire page once the new HTML file was ready. Now, the browser gets only the little package of content that has changed and inserts it into the DOM at the appropriate place. This may seem subtle, but it matters a great deal when editing files in a rookery, as it means that your state (scroll position, input text, and so on) is maintained while you’re working on the underlying files.

@rheo/rehydrate

Following on from this change, I added a @rheo/rehydrate package to rheo-packages. This is an opt-in optimization that Rheo package authors can use to ensure optimal rehydration in Rheo watch dev servers. The bottom line here is that Rheo doesn’t analyze JavaScript code in packages to understand whether or not they need to be re-run when HTML elements in the page are inserted or changed (as happens when a Typst source file incrementally recompiles). Packages need to alert Rheo how to run package JavaScript when a change occurs. Currently, this alert takes the form of a coarse-grained js_rehydrate boolean, which tells Rheo to re-run package JavaScript on every change when true. @rheo/rehydrate may become more nuanced in the future as Rheo’s incremental compilation and package system evolve.

@rheo/sitemap and other improvements

I consolidated blogfeed and sidebar into a single sitemap package, as they both offer UX elements that are projections of Rheo’s spine. There are a few smaller improvements in the release, such as fixing a package conflict in a local cache when you use both the releases and repo attributes in different Rheo projects on the same machine, so that you can maintain different versions of custom packages across different repos. Thanks also to Luigi Sartor Piucco for the fix to Rheo’s Nix flake.