Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

FreeAgent Engineering 8 min read How-to mediumAdept

A refreshing take: using serverside rendering to reduce fragile DOM state

Turbo's `refresh` stream action, unlike the original DOM-manipulating actions, exists to let servers broadcast "re-fetch this page" over Action Cable, with idiomorph morphing applying only the changed elements. The result is a mostly server-rendered Rails frontend that still updates in realtime without much custom JS. The catch is client-side DOM state such as open dropdowns, confirmation modals and in-progress uploads, which a refresh would wipe out. FreeAgent protects these with `data-turbo-permanent` or by cancelling morph events, and on state-heavy pages falls back to targeted `update`/`replace` streams or Turbo Frame reloads.

Assumes: Ruby on Rails basicsHotwire TurboWebSockets

Related posts

  • Persisting nested form attribute indexes through Turbo updates

    FreeAgent Engineering mediumAdept

    When a Turbo Stream replaces part of a Rails nested form, the replacement fields must keep the same attribute index as their siblings, which can be passed via the form builder's `index` property as a URL parameter and hidden field. This breaks for rows added client-side with JavaScript templates and timestamp indexes, because the form builder never learns the index and links carry a blank value. FreeAgent fixed it by moving the "Add Another" behaviour to a server-rendered Turbo Stream that sets a timestamp index on `fields_for`, removing the client-side templating duplication entirely.

  • Alternatives to htmx

    htmx essays easyNovice

    Hypermedia-oriented web development has many implementations besides htmx, including Unpoly, the Triptych HTML spec proposals with a polyfill, fixi.js, Datastar, Nomini, µJS, Alpine AJAX, Hotwire Turbo, htmz, TwinSpark and jQuery's load(). Each takes a different angle. Datastar is SSE-oriented and folds in Alpine-style reactivity, while fixi.js and Nomini aim for minimal size at roughly 1.3–1.4k compressed. htmz implements generalized transclusion in a single iframe element using the target attribute and the location hash. If htmx doesn't fit an application, one of these may still let it use the hypermedia model.

  • How I shipped 39 PRs to prod as a non-developer

    8th Light mediumAdept

    A non-developer product manager shipped 39 production pull requests to a Rails/Hotwire client codebase using Claude Code and the team's Research-Plan-Implement agentic process. 62% merged with nothing beyond lint fixes, while developer changes clustered around ignored codebase conventions (custom CSS instead of Tailwind/DaisyUI, hacky Pagy workarounds), edge-case bugs and the Turbo lifecycle. Small PRs under 100 lines were the best fit, with 73% merging cleanly, whereas larger features needed enough developer involvement to erode the benefit. What made it work: collaborative solutioning before RPI, opinionated chunking of the work, active scrutiny of research and plans, moving product QA into the implementation loop, and mandatory human code review.

  • Accelerating Mobile App development at Zalando with Rendering Engine and React Native

    Zalando Engineering mediumAdept

    Zalando is incrementally migrating its separate iOS and Android apps to React Native by reusing Rendering Engine, its React-based web framework whose "renderers" bundle data fetching, caching, observability and tracking into components. React Native ships as a package: an npm "Entry Point" is consumed both by a standalone developer app and by a native SDK exposing a simple view-factory interface. Native interop goes through turbo modules plus injected protocols, which developers can mock. UI is shared with web through react-strict-dom and StyleX, with Metro platform-specific files and compat APIs covering cases one shared implementation can't handle.

  • The fetch()ening

    htmx essays mediumAdept

    htmx 4.0 rebuilds the library's internals on fetch() instead of XMLHttpRequest, drawing on lessons from fixi.js, and makes three simplifying breaking changes: attribute inheritance becomes explicit via an :inherited modifier, history no longer snapshots the DOM locally but re-fetches content, and the event model is linearized with a new htmx:<phase>:<system> naming scheme. The async runtime makes room for streaming responses and SSE in core, idiomorph-based morph swaps, a new <htmx-partial> template element for elaborate out-of-band swaps, queued view transitions, a unified hx-on:<event> syntax, and deeper extension hooks including replaceable fetch(). htmx 2.0 will be supported indefinitely; 4.0 is in alpha now, targeting release in 2026 and becoming latest around early 2027.

The quest for software engineering knowledge.

Look:
Layout: