• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openSUSE / agama / 9839659175
72%

Build:
DEFAULT BRANCH: master
Ran 08 Jul 2024 12:37PM UTC
Jobs 3
Files 794
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jul 2024 12:33PM UTC coverage: 71.408%. Remained the same
9839659175

push

github

web-flow
refactor(web): adopt TanStack Query for state management (#1439)

Trello:
https://trello.com/c/8u1WOJz4/3723-8-agama-ui-adopt-a-state-management-solution

Agama's UI state management could be better. For that reason, and after
evaluating a few alternatives (see the list of considered alternatives),
we decided to adopt [Tanstack Query (former React
Query)](https://tanstack.com/query/v5).

## Why TanStack query

* It offers a mechanism (based on promises) to fetch/update the state.
* It is not limited to the client state: it works great with the server
state, too.
* It takes care of caching, re-fetching, error handling, etc.
* It is a mature, well-documented and widely known project.
* Plays nicely with [React Router](https://reactrouter.com/), although a
[TanStack Router](https://tanstack.com/router/latest) project exits.

## What is included in this PR

There is quite some work to do so let's consider this pull request as
the first step in this path. It introduces the following changes:

- Add TanStack query as a dependency.
- Replace `L10Provider` with a queries-based approach, including data
mutation. Check
[queries/l10n.js](https://github.com/openSUSE/agama/blob/react-query/web/src/queries/l10n.js)
if you are curious.
- Re-enable L10nPage tests (and add other tests).
- Use React Router loaders to make sure data is loaded before the
components are rendered.

## Considered Alternatives

- [Redux](https://react-redux.js.org/)
- [Jotai](https://jotai.org/)
- [Zustand](https://docs.pmnd.rs/zustand/getting-started/introduction)
- [Tanstack Query (former React Query)](https://tanstack.com/query/v5)
- [Recoil](https://recoiljs.org/)

We had a look at others but did not consider them at all.

1987 of 2868 branches covered (69.28%)

Branch coverage included in aggregate %.

12 of 12 new or added lines in 4 files covered. (100.0%)

46 existing lines in 4 files now uncovered.

19586 of 27343 relevant lines covered (71.63%)

34.75 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
54.55
0.0% web/src/client/index.js
1
95.83
0.0% web/src/test-utils.js
10
79.82
0.0% web/src/utils.js
34
17.31
0.0% web/src/client/l10n.js
Subprojects
ID Flag name Job ID Ran Files Coverage
3 service 9839659175.3 08 Jul 2024 12:37PM UTC 366
87.04
GitHub Action Run
3 rust 9794493654.3 04 Jul 2024 12:47PM UTC 85
23.4
GitHub Action Run
3 web 8937163624.3 03 May 2024 09:49AM UTC 343
75.3
GitHub Action Run
Source Files on build 9839659175
  • Tree
  • List 794
  • Changed 5
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #9839659175
  • 05e79638 on github
  • Prev Build on master (#9794493654)
  • Next Build on master (#9853207056)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc