Skip to content

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

Etsy Code as Craft 7 min read Case study mediumAdept

Macramé: Untangling the Knot on the Etsy Android Listing Screen

Etsy rewrote its 4000-line Android listing Fragment into Macramé, a Mobius-inspired unidirectional architecture: a single immutable State exposed via StateFlow, flattened into small UI models rendered by a RecyclerView with ListAdapter diffing, and a sealed-class Event dispatcher routing actions to single-purpose Handlers that update State, launch async work, or emit SideEffects to the Fragment. The five-month rewrite cut Time to First Content by 18% (1585 ms to 1298 ms), lifted listing views, add-to-carts and searches in an A/B test, and raised business-logic unit test coverage from single digits to 76%. Remaining tradeoffs include Event/Handler wiring boilerplate, harder debugging of Handler-dispatched event chains, and overkill on simple screens.

Related posts

  • Adopting Jetpack Compose for Etsy’s Android App

    Etsy Code as Craft mediumAdept

    Etsy adopted Jetpack Compose as its preferred Android UI toolkit through a staged rollout. It started with an internal curriculum and Compose versions of design system components, then moved to an internal-only screen, then user-facing bottom sheets, and finally a three-month rewrite of the Shop screen paired with the Macramé unidirectional-data-flow architecture. An A/B test showed 5% faster initial render and improvements in conversion, add-to-cart and other engagement metrics, and engineers reported less code, better test coverage and value from Compose Previews. Pain points included an alpha-stage third-party library and the different key and item-reuse semantics of LazyRow/LazyColumn compared with RecyclerView.

  • Instant Performance Upgrade: From FlatList to FlashList

    Shopify Engineering easyNovice

    FlashList is Shopify's open-source drop-in replacement for React Native's FlatList. It builds on RecyclerListView, recycling already-allocated cell views instead of creating new ones, and it moves some layout work to native code. The goal is a consistent 60+ FPS and no blank cells, even on low-end Android devices. It uses a small default render buffer (250 px) to cut memory use. Migration is mostly a component rename plus an estimatedItemSize prop, and extras include getItemType for per-type recycling pools, flexible column spans via overrideItemLayout, and built-in blank-cell and FPS metrics.

  • Management of Native Code and React Native at Shopify

    Shopify Engineering mediumAdept

    Shopify's Point of Sale team kept complex UI such as a draggable, reorderable grid of hundreds of buttons in React Native, fixing performance with fewer re-renders, lazy rendering, memoization and Reanimated 2. Background offline sync jobs were a different story: they froze the app because work in single-threaded JavaScript plus bridge traffic blocked interaction. The team moved that sync engine to a Kotlin Multiplatform library using SQLDelight, Apollo and coroutines, reaching about 95% shared code and cutting initial sync for a medium store from 30+ seconds to 2-3 seconds. The post recommends packaging KMM as a separate library with sandbox apps, sketches the Gradle and Xcode build setup, and notes the steeper learning curve for Swift developers.

  • Transitioning to Appcraft: Evolution of Zalando’s server-driven UI framework

    Zalando Engineering mediumAdept

    Zalando replaced its Truly Native Apps (TNA) framework, whose fixed, versioned composite tiles forced client releases for small UI changes, with Appcraft, a server-driven UI framework built on an Elm-style unidirectional architecture and Flexbox layout. Texture on iOS and Litho on Android map Flex definitions onto native views such as UICollectionView and RecyclerView. Screens are composed on the server from primitives (Label, Button, Image, Video, Layout) plus event-to-action bindings, and schema versioning stays server-side. That lets the team gate components by app version, platform or A/B test, remove faulty components without hotfixes, and ship new screens via deep-link configuration the same day. Client releases are needed only for new primitives. Remaining challenges include monitoring launched screens, balancing generality against restrictiveness, interoperability with non-Appcraft components, and cross-platform differences between the layout libraries.

  • Zed Weekly: #25

    Zed mediumAdept

    Zed is rewriting its UI framework as GPUI 2 and porting the whole editor onto it before open-sourcing, trading feature work for better ergonomics while keeping GPUI 1's performance. All state lives in an AppContext that acts like an application-specific heap: Model<T> handles are dereferenced through a context, and models emit and subscribe to events. View<T> wraps models whose types implement a Render trait that returns element trees. Components, Tailwind-style styling helpers, a color-scale-based theme system and a new layout engine and executor round out the design. Bottleneck crates (project, workspace, editor) made the port largely serial, so the team leaned on Rust's type system and Zed's collaborative editing to pair on it, with roughly a third to half of the app ported after two weeks.

The quest for software engineering knowledge.

Look:
Layout: