[PR #6757] [MERGED] Retrofit useTransactions to use react-query under the hood #13774

Closed
opened 2026-04-10 22:02:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6757
Author: @joel-jeremy
Created: 1/23/2026
Status: Merged
Merged: 2/11/2026
Merged by: @joel-jeremy

Base: masterHead: react-query-useTransactions


📝 Commits (10+)

  • 4e94085 Retrofit useTransactions to use react-query under the hood
  • ad52bca Add release notes for PR #6757
  • ecb5953 Update packages/desktop-client/src/transactions/queries.ts
  • 2a69288 Disable when there is no query parameter
  • 2f4a0ea Fix typecheck errors
  • 5c94541 Remove space
  • 57d51cc Update tests
  • 878631c Coderabbit: Add pageSize to query key
  • a223d5f Use isPending instead of isFetching
  • 3f2b64c Unexport mockStore

📊 Changes

28 files changed (+241 additions, -319 deletions)

View changed files

📝 packages/desktop-client/package.json (+1 -1)
📝 packages/desktop-client/src/components/accounts/Reconcile.test.tsx (+17 -17)
📝 packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx (+3 -3)
📝 packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx (+6 -6)
📝 packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx (+6 -6)
📝 packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx (+6 -6)
📝 packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx (+6 -6)
📝 packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (+3 -3)
📝 packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx (+6 -6)
📝 packages/desktop-client/src/components/mobile/budget/UncategorizedTransactions.tsx (+7 -7)
📝 packages/desktop-client/src/components/mobile/payees/MobilePayeesPage.test.tsx (+3 -3)
📝 packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.test.tsx (+9 -9)
📝 packages/desktop-client/src/components/reports/Change.test.tsx (+3 -1)
📝 packages/desktop-client/src/components/reports/reports/Calendar.tsx (+4 -2)
📝 packages/desktop-client/src/components/settings/AuthSettings.test.tsx (+7 -7)
📝 packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx (+3 -3)
📝 packages/desktop-client/src/hooks/useDisplayPayee.tsx (+1 -1)
📝 packages/desktop-client/src/hooks/useTransactions.ts (+41 -135)
📝 packages/desktop-client/src/index.tsx (+6 -4)
packages/desktop-client/src/mocks.tsx (+25 -0)

...and 8 more files

📄 Description

Results in easier to maintain code with much faster load times and reuses the cached transactions the next time the transaction list is accessed (does not refetch from database).


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.64 MB → 14.64 MB (+5.67 kB) +0.04%
loot-core 1 5.86 MB 0%
api 1 4.39 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.64 MB → 14.64 MB (+5.67 kB) +0.04%
Changeset
File Δ Size
node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js 🆕 +1.97 kB 0 B → 1.97 kB
src/transactions/queries.ts 🆕 +711 B 0 B → 711 B
node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js 🆕 +115 B 0 B → 115 B
node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js 🆕 +91 B 0 B → 91 B
src/redux/store.ts 📈 +321 B (+32.66%) 983 B → 1.27 kB
node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js 📈 +180 B (+25.75%) 699 B → 879 B
node_modules/@tanstack/query-core/build/modern/mutationObserver.js 📈 +404 B (+11.89%) 3.32 kB → 3.71 kB
node_modules/@tanstack/query-core/build/modern/utils.js 📈 +607 B (+10.36%) 5.72 kB → 6.31 kB
src/components/mobile/budget/UncategorizedTransactions.tsx 📈 +163 B (+5.03%) 3.16 kB → 3.32 kB
node_modules/@tanstack/query-core/build/modern/mutation.js 📈 +246 B (+3.73%) 6.44 kB → 6.68 kB
src/hooks/useTransactions.ts 📈 +145 B (+3.19%) 4.44 kB → 4.58 kB
src/index.tsx 📈 +35 B (+2.05%) 1.67 kB → 1.71 kB
node_modules/@tanstack/query-core/build/modern/query.js 📈 +201 B (+1.73%) 11.35 kB → 11.54 kB
src/components/mobile/budget/CategoryTransactions.tsx 📈 +93 B (+1.59%) 5.72 kB → 5.81 kB
src/components/mobile/accounts/AllAccountTransactions.tsx 📈 +93 B (+1.55%) 5.84 kB → 5.93 kB
src/components/mobile/accounts/OnBudgetAccountTransactions.tsx 📈 +93 B (+1.43%) 6.36 kB → 6.45 kB
src/components/mobile/accounts/OffBudgetAccountTransactions.tsx 📈 +93 B (+1.43%) 6.37 kB → 6.46 kB
src/components/mobile/accounts/AccountTransactions.tsx 📈 +93 B (+0.94%) 9.7 kB → 9.79 kB
node_modules/@tanstack/query-core/build/modern/queryObserver.js 📈 +93 B (+0.59%) 15.52 kB → 15.61 kB
src/components/mobile/budget/BudgetPage.tsx 📈 +34 B (+0.08%) 39.56 kB → 39.59 kB
src/components/reports/reports/Calendar.tsx 📈 +5 B (+0.02%) 28.98 kB → 28.99 kB
src/hooks/useDisplayPayee.tsx 📉 -1 B (-0.02%) 4.97 kB → 4.97 kB
node_modules/@react-spring/shared/dist/react-spring_shared.modern.mjs 📉 -6 B (-0.03%) 20.07 kB → 20.06 kB
node_modules/@tanstack/react-query/build/modern/useBaseQuery.js 📉 -26 B (-0.99%) 2.56 kB → 2.53 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/wide.js 160.07 kB → 163.86 kB (+3.79 kB) +2.37%
static/js/index.js 9.48 MB → 9.48 MB (+1.22 kB) +0.01%
static/js/narrow.js 640.46 kB → 641.1 kB (+662 B) +0.10%
static/js/ReportRouter.js 1.12 MB → 1.12 MB (+5 B) +0.00%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 180.44 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 164.55 kB 0%
static/js/es.js 173.83 kB 0%
static/js/fr.js 179.62 kB 0%
static/js/it.js 171.44 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 154.57 kB 0%
static/js/sv.js 78.2 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/TransactionList.js 105.97 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.05 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.86 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.CD8O_YQc.js 5.86 MB 0%

api

Total

Files count Total bundle size % Changed
1 4.39 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
bundle.api.js 4.39 MB 0%

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6757 **Author:** [@joel-jeremy](https://github.com/joel-jeremy) **Created:** 1/23/2026 **Status:** ✅ Merged **Merged:** 2/11/2026 **Merged by:** [@joel-jeremy](https://github.com/joel-jeremy) **Base:** `master` ← **Head:** `react-query-useTransactions` --- ### 📝 Commits (10+) - [`4e94085`](https://github.com/actualbudget/actual/commit/4e94085092cfa471c374efafe5f055fa58d8865f) Retrofit useTransactions to use react-query under the hood - [`ad52bca`](https://github.com/actualbudget/actual/commit/ad52bcabadc6cfcdce60bbd8cacdf47f17c22810) Add release notes for PR #6757 - [`ecb5953`](https://github.com/actualbudget/actual/commit/ecb5953beef51abd3ac51ec5df8c61134c1c1b3d) Update packages/desktop-client/src/transactions/queries.ts - [`2a69288`](https://github.com/actualbudget/actual/commit/2a69288d6dee80b178279d5a1f5e3ae165ba3484) Disable when there is no query parameter - [`2f4a0ea`](https://github.com/actualbudget/actual/commit/2f4a0ea597ee12d2621a44f98308a99532d48189) Fix typecheck errors - [`5c94541`](https://github.com/actualbudget/actual/commit/5c94541599d17e5a06652d9d6adc1e2ebba03387) Remove space - [`57d51cc`](https://github.com/actualbudget/actual/commit/57d51ccd46b61b362b19c8f719ee42fb959869ca) Update tests - [`878631c`](https://github.com/actualbudget/actual/commit/878631c18cb523a7fdd15340f91f7b039391179b) Coderabbit: Add pageSize to query key - [`a223d5f`](https://github.com/actualbudget/actual/commit/a223d5f8e0615cc2d5b02b02a2e97d802b3d78ef) Use isPending instead of isFetching - [`3f2b64c`](https://github.com/actualbudget/actual/commit/3f2b64ca4d4b4ae6ee2f953c138f921fffee3ca0) Unexport mockStore ### 📊 Changes **28 files changed** (+241 additions, -319 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/package.json` (+1 -1) 📝 `packages/desktop-client/src/components/accounts/Reconcile.test.tsx` (+17 -17) 📝 `packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx` (+6 -6) 📝 `packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx` (+6 -6) 📝 `packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx` (+6 -6) 📝 `packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx` (+6 -6) 📝 `packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx` (+6 -6) 📝 `packages/desktop-client/src/components/mobile/budget/UncategorizedTransactions.tsx` (+7 -7) 📝 `packages/desktop-client/src/components/mobile/payees/MobilePayeesPage.test.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.test.tsx` (+9 -9) 📝 `packages/desktop-client/src/components/reports/Change.test.tsx` (+3 -1) 📝 `packages/desktop-client/src/components/reports/reports/Calendar.tsx` (+4 -2) 📝 `packages/desktop-client/src/components/settings/AuthSettings.test.tsx` (+7 -7) 📝 `packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx` (+3 -3) 📝 `packages/desktop-client/src/hooks/useDisplayPayee.tsx` (+1 -1) 📝 `packages/desktop-client/src/hooks/useTransactions.ts` (+41 -135) 📝 `packages/desktop-client/src/index.tsx` (+6 -4) ➕ `packages/desktop-client/src/mocks.tsx` (+25 -0) _...and 8 more files_ </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> Results in easier to maintain code with much faster load times and reuses the cached transactions the next time the transaction list is accessed (does not refetch from database). <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.64 MB → 14.64 MB (+5.67 kB) | +0.04% loot-core | 1 | 5.86 MB | 0% api | 1 | 4.39 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.64 MB → 14.64 MB (+5.67 kB) | +0.04% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js` | 🆕 +1.97 kB | 0 B → 1.97 kB `src/transactions/queries.ts` | 🆕 +711 B | 0 B → 711 B `node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js` | 🆕 +115 B | 0 B → 115 B `node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js` | 🆕 +91 B | 0 B → 91 B `src/redux/store.ts` | 📈 +321 B (+32.66%) | 983 B → 1.27 kB `node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js` | 📈 +180 B (+25.75%) | 699 B → 879 B `node_modules/@tanstack/query-core/build/modern/mutationObserver.js` | 📈 +404 B (+11.89%) | 3.32 kB → 3.71 kB `node_modules/@tanstack/query-core/build/modern/utils.js` | 📈 +607 B (+10.36%) | 5.72 kB → 6.31 kB `src/components/mobile/budget/UncategorizedTransactions.tsx` | 📈 +163 B (+5.03%) | 3.16 kB → 3.32 kB `node_modules/@tanstack/query-core/build/modern/mutation.js` | 📈 +246 B (+3.73%) | 6.44 kB → 6.68 kB `src/hooks/useTransactions.ts` | 📈 +145 B (+3.19%) | 4.44 kB → 4.58 kB `src/index.tsx` | 📈 +35 B (+2.05%) | 1.67 kB → 1.71 kB `node_modules/@tanstack/query-core/build/modern/query.js` | 📈 +201 B (+1.73%) | 11.35 kB → 11.54 kB `src/components/mobile/budget/CategoryTransactions.tsx` | 📈 +93 B (+1.59%) | 5.72 kB → 5.81 kB `src/components/mobile/accounts/AllAccountTransactions.tsx` | 📈 +93 B (+1.55%) | 5.84 kB → 5.93 kB `src/components/mobile/accounts/OnBudgetAccountTransactions.tsx` | 📈 +93 B (+1.43%) | 6.36 kB → 6.45 kB `src/components/mobile/accounts/OffBudgetAccountTransactions.tsx` | 📈 +93 B (+1.43%) | 6.37 kB → 6.46 kB `src/components/mobile/accounts/AccountTransactions.tsx` | 📈 +93 B (+0.94%) | 9.7 kB → 9.79 kB `node_modules/@tanstack/query-core/build/modern/queryObserver.js` | 📈 +93 B (+0.59%) | 15.52 kB → 15.61 kB `src/components/mobile/budget/BudgetPage.tsx` | 📈 +34 B (+0.08%) | 39.56 kB → 39.59 kB `src/components/reports/reports/Calendar.tsx` | 📈 +5 B (+0.02%) | 28.98 kB → 28.99 kB `src/hooks/useDisplayPayee.tsx` | 📉 -1 B (-0.02%) | 4.97 kB → 4.97 kB `node_modules/@react-spring/shared/dist/react-spring_shared.modern.mjs` | 📉 -6 B (-0.03%) | 20.07 kB → 20.06 kB `node_modules/@tanstack/react-query/build/modern/useBaseQuery.js` | 📉 -26 B (-0.99%) | 2.56 kB → 2.53 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/wide.js | 160.07 kB → 163.86 kB (+3.79 kB) | +2.37% static/js/index.js | 9.48 MB → 9.48 MB (+1.22 kB) | +0.01% static/js/narrow.js | 640.46 kB → 641.1 kB (+662 B) | +0.10% static/js/ReportRouter.js | 1.12 MB → 1.12 MB (+5 B) | +0.00% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 180.44 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 164.55 kB | 0% static/js/es.js | 173.83 kB | 0% static/js/fr.js | 179.62 kB | 0% static/js/it.js | 171.44 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 154.57 kB | 0% static/js/sv.js | 78.2 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/TransactionList.js | 105.97 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.05 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.86 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CD8O_YQc.js | 5.86 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.39 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.39 MB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-10 22:02:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#13774