---
title: "Why the big rewrite?"
description: "Zed rewrote its Rust UI framework from GPUI 1 to GPUI 2 because the original design blocked fast UI work: a Flutter-style constraints-down/sizes-up layout model, styles split between Rust element code and TypeScript-generated JSON \"themes\" loaded at runtime, model code entangled with presentation (a legacy of an early Electron/JSON architecture), and weakly typed geometry (raw f32s and usizes)."
url: "https://swe.quest/articles/why-the-big-rewrite-ec307a4c7f73f459"
canonical: "https://zed.dev/blog/why-the-big-rewrite"
source: "Zed"
published: "2024-01-23"
difficulty: "easy"
kind: "Case study"
reading_minutes: 21
tags: ["rust","frontend","refactoring","developer-tools"]
---

# Why the big rewrite?

A post on [Zed](https://swe.quest/sources/zed.md), published 2024-01-23, 21 min read, Case study. Original: [https://zed.dev/blog/why-the-big-rewrite](https://zed.dev/blog/why-the-big-rewrite)

## Summary

Zed rewrote its Rust UI framework from GPUI 1 to GPUI 2 because the original design blocked fast UI work: a Flutter-style constraints-down/sizes-up layout model, styles split between Rust element code and TypeScript-generated JSON "themes" loaded at runtime, model code entangled with presentation (a legacy of an early Electron/JSON architecture), and weakly typed geometry (raw f32s and usizes). GPUI 2 adopts a Tailwind/Flexbox-inspired Rust DSL with stronger types and one-directional ownership. The migration ran incrementally: GPUI 2 first ran as a prototype on top of GPUI 1, then crates were duplicated (e.g. project\_panel2) with the old copies frozen except for bug fixes, which kept the option of sharing code until the final switch.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- UI layout models
- Rust crates ([easy posts on Rust](https://swe.quest/tags/rust.md?difficulty=easy))

## Keywords

Zed, GPUI, Flutter, Tailwind CSS, Flexbox, Electron

## Related posts

- [Zed Weekly: #25](https://swe.quest/articles/zed-weekly-25-cd3a5f41d4f0b187.md): Zed · 2023-11-03 · Medium · 6 min read · Rust, Frontend, Refactoring & migrations, Developer tools
  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.
- [Zed Weekly: #27](https://swe.quest/articles/zed-weekly-27-be3a7010da4c60e0.md): Zed · 2023-11-24 · Medium · 4 min read · Rust, Frontend, Developer tools
  GPUI, Zed's UI framework, settled on its core view traits: \`Render\` builds a view from a mutable reference each frame, \`RenderOnce\` builds composable elements by consuming them, and \`#\[derive(IntoElement)\]\` lets custom components be passed straight to \`div().child(...)\`. gpui2 now sizes UI in \`rem\` units tied to a new \`ui\_font\_size\` setting (default 16px, on a 4px grid), so the interface scales independently of buffer font size, though sub-pixel sizes remain unresolved.
- [This Week at Zed Industries: #16](https://swe.quest/articles/this-week-at-zed-industries-16-c2caea343c027dbd.md): Zed · 2023-08-18 · Medium · 13 min read · Rust, Frontend, Type systems, Developer tools
  Zed has started using its new channels feature internally, where members can message, talk, share screens and co-edit projects, and plans to use it to stream development and host office hours once the editor is open-sourced.
- [Zed Weekly: #22](https://swe.quest/articles/zed-weekly-22-1c922abde503e316.md): Zed · 2023-10-06 · Easy · 7 min read · Developer tools, Rust, Real-time systems, Product engineering
  Zed team members report weekly progress: GPUI is being rewritten with a ported Metal renderer that uses plane-split for primitive draw ordering, multi-threaded entity access, and a MainThread\<T: Context\> wrapper so native UI APIs are only called from the main thread.
- [Zed Weekly: #29](https://swe.quest/articles/zed-weekly-29-41f27bba860d0170.md): Zed · 2023-12-15 · Medium · 6 min read · Rust, Memory management, Performance engineering, Frontend, Developer tools
  Zed's port to GPUI 2 is nearing daily usability, and the team is focused on frame-rendering performance measured by holding tab-switch at 60Hz key repeat.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
