Engineering case study · GNOME Shell

Engineering SimpleWeather.

A behind-the-scenes look at the architecture, tooling, and maintenance of the production desktop software.

70,000+downloads in production
145+issues and pull requests reviewed
English + 25active community translations
5supported GNOME Shell releases
01 / Context

The engineering brief

Learning from the mistakes of the previous idea.

SimpleWeather was built as the TypeScript successor to OpenWeather Refined. The architecture of SimpleWeather was guided by the mistakes of the previous extension, which mostly had to do with it being a product of 2011 that was still being maintained in 2024.

Async: Both JavaScript and the GNOME platform have heavily evolved since then, which led to outdated programming techniques and recurring performance stability problems. One of the main issues was the extension's handling of asynchronous programming such as network requests since async/await didn't exist at that point. Therefore one of my main goals with SimpleWeather was to elegantly handle any asynchronous programming with promises.

Separation of Concerns: The old extension's UI system was directly connected to the network system. This led to many performance issues. Because the networking, application state, and GUI layers were tightly coupled, the GUI could not be updated independently of a network request. This meant that updating the UI was extremely difficult, changing a setting caused a new network request, and that the weather API's JSON output was directly tied to the UI. SimpleWeather had to separate the network connection and weather state from the UI frontend.

Performance: Because of the aforementioned issues, the old extension was full of performance issues and performance was a common complaint among users (#86, #99, #107, #110). Minor performance hiccups may not be a critical issue in something like a Desktop app, however a GNOME Shell extension runs on the same process as the desktop shell, which means any freezing or slow-downs can affect the whole system, and not just the app itself.

Experience: OpenWeather Refined was the first project that I shipped that gained a real user base. I learned a lot in my year of running this extension, including experiencing failure because of poorly designed behavior (#32), poor testing (#40), and unforeseen issues (#49). The goal of SimpleWeather was to have an extension that could reliably ship stable updates and working features, which lead to me doing more rigorous testing and using the development version myself for a while before shipping a new release.

Interface gallery

Layouts, themes, and locales.

A separation of concerns makes it easy to customize layouts, themes, and translations, without having to worry about what the weather API or networking conditions look like.

Default · System theme
Default · Immersive · Chinese
Classic · After Dark
02 / Internationalization

Global engineering

International by Design

International support is built into SimpleWeather and evident in its data model and display. First-run behavior is optimized to the user's system settings and location so that the initial experience feels right at home.

01

Unit safety

Measurements, Not Numbers

Weather values are stored in measurement classes such as Temp, Speed, Pressure, and RainMeasurement. Instead of doubles being thrown around where they could potentially be mixed up, each measurement is stored in a way that hides the unit from the programmer. Internally it holds an imperial measurement, but in order to receive the display string the program must pass in a specific unit to be used.

This makes it much harder for a unit mismatch to occur and ensures that units are only shown to the user in their configured unit. It also keeps variable names cleaner, since the unit no longer needs to be encoded in the name. That eliminates names like windSpeedKph, which always felt a bit like Hungarian notation to me. It also makes the type system aware of the unit, which lets me take full advantage of a typed language.

Provider Valuenew Temp(fahrenheit)temp.display(config)User-Friendly String
02

location, gettext, env, GNOME settings, and Intl

Localization

26supported languages

English · St. Paul
German · Berlin
Chinese · Chengdu

The GUI is localized based on the user's system settings and environment. Language, units, and clock format are all chosen based on what is most natural for the user.

03

First-run configuration

Regional Behavior

On first run, SimpleWeather determines the country from its location lookup and falls back to the system locale if the location service is unavailable. It then chooses a sensible set of units for that country. China also uses a different search provider because of regional Internet restrictions.

  • United States

    °F · mph · inHg · in · mi

    Nominatim search
  • United Kingdom

    °C · mph · hPa · mm · mi

    Nominatim search
  • Nordics

    °C · m/s · hPa · mm · km

    Nominatim search
  • China

    °C · km/h · hPa · mm · km

    Open-Meteo search
  • Everywhere Else

    °C · km/h · hPa · mm · km

    Nominatim search
03 / Wrap-up

The engineering result

Engineering for Real Life.

SimpleWeather began as a response to the failures of OpenWeather Refined that I encountered while maintaining the old code. The rebuild was designed with a completely new architecture and a focus on stability. SimpleWeather wasn't designed as a personal project to get thrown away when I'm done working on it; it was designed as a real piece of software that people around the world could rely on everyday.

source / developmentGPL-3.0-or-later

Review the implementation

Read the code and docs.

The complete project is developed publicly and guided by what the community wants to see.