[PR #8166] [AI] api: add browser build #122379

Open
opened 2026-06-11 21:13:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/8166
Author: @MatissJanis
Created: 6/9/2026
Status: 🔄 Open

Base: master ← Head: matiss/api-browser-build


📝 Commits (10+)

  • 533dfc6 [AI] api: add browser build
  • 19cba98 [AI] Rename release note to match PR number 8166
  • 09b4a59 [AI] api: move browser worker plumbing into loot-core
  • 81f1f5e [AI] api: simplify browser build cleanups
  • 20080ee [AI] api: drop the createBackendWorker wrapper, revert browser-preload churn
  • 651b9b8 [AI] api: trim verbose comments in the browser build
  • d7883d6 [AI] api: drop redundant absurd-sql dependency
  • 18a3b1c [AI] api: drop the api-browser condition, inject the worker into the connection
  • f7e99f9 [AI] api: route methods through the client connection, slim the facade
  • 3a2ec48 [AI] api: trim prose comments to the essential ones

📊 Changes

28 files changed (+524 additions, -34 deletions)

View changed files

📝 .github/actions/docs-spelling/allow/keywords.txt (+1 -0)
➕ .github/workflows/api-browser-test.yml (+47 -0)
📝 .gitignore (+2 -0)
➕ packages/api/browser-worker.ts (+21 -0)
➕ packages/api/e2e/browser.test.ts (+94 -0)
➕ packages/api/e2e/harness.html (+12 -0)
➕ packages/api/e2e/serve-dist.mjs (+46 -0)
➕ packages/api/e2e/tsconfig.json (+9 -0)
➕ packages/api/index.browser.ts (+45 -0)
📝 packages/api/methods.ts (+1 -9)
📝 packages/api/package.json (+12 -1)
➕ packages/api/playwright.config.ts (+18 -0)
📝 packages/api/tsconfig.json (+1 -0)
📝 packages/api/utils.ts (+1 -4)
➕ packages/api/vite.browser-worker.config.mts (+54 -0)
➕ packages/api/vite.browser.config.mts (+25 -0)
📝 packages/api/vite.config.mts (+30 -0)
📝 packages/docs/docs/api/index.md (+24 -0)
📝 packages/loot-core/package.json (+2 -0)
➕ packages/loot-core/src/platform/client/backend-worker.ts (+20 -0)

...and 8 more files

📄 Description

Description

Making the @actual-app/api package be usable in browser context + tests covering this functionality.

Highly experimental feature.

Related issue(s)

N/A

Testing

N/A

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I have read every line of this diff and can explain what each change does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 37 14.14 MB → 14.14 MB (+24 B) +0.00%
loot-core 1 5.29 MB → 5.29 MB (+53 B) +0.00%
api 2 3.87 MB → 3.87 MB (+113 B) +0.00%
cli 1 7.97 MB 0%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
37 14.14 MB → 14.14 MB (+24 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/platform/client/connection/index.ts 📈 +24 B (+0.72%) 3.24 kB → 3.27 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/extends.js 508.79 kB → 508.81 kB (+24 B) +0.00%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 1.6 MB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 962.55 kB 0%
static/js/ManageRules.js 46.63 kB 0%
static/js/PayeeRuleCountLabel.js 7.33 kB 0%
static/js/ReportRouter.js 1.27 MB 0%
static/js/ScheduleEditForm.js 146.57 kB 0%
static/js/SchedulesTable.js 206.3 kB 0%
static/js/TransactionEdit.js 90.63 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/Value.js 5.08 MB 0%
static/js/_baseIsEqual.js 98.38 kB 0%
static/js/ca.js 185.63 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 100.19 kB 0%
static/js/de.js 182.38 kB 0%
static/js/en-GB.js 9.25 kB 0%
static/js/en.js 201.71 kB 0%
static/js/es.js 177.58 kB 0%
static/js/fr.js 177.35 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 163.93 kB 0%
static/js/narrow.js 365.05 kB 0%
static/js/nb-NO.js 147.07 kB 0%
static/js/nl.js 119.71 kB 0%
static/js/pt-BR.js 187.34 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 173.33 kB 0%
static/js/theme.js 31.88 kB 0%
static/js/toString.js 705.18 kB 0%
static/js/uk.js 216.7 kB 0%
static/js/useFormatList.js 2.52 kB 0%
static/js/useTransactionBatchActions.js 9.71 kB 0%
static/js/wide.js 298.99 kB 0%
static/js/workbox-window.prod.es5.js 7.33 kB 0%
static/js/zh-Hans.js 116.44 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.29 MB → 5.29 MB (+53 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/mutators.ts 📈 +30 B (+1.41%) 2.08 kB → 2.11 kB
home/runner/work/actual/actual/packages/loot-core/src/platform/server/fs/index.ts 📈 +23 B (+0.28%) 7.93 kB → 7.95 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.Du4ycZR0.js 0 B → 5.29 MB (+5.29 MB) -

Removed

Asset File Size % Changed
kcab.worker.DjCqYlkp.js 5.29 MB → 0 B (-5.29 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
2 3.87 MB → 3.87 MB (+113 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/platform/client/connection/index.api.ts 🆕 +326 B 0 B → 326 B
home/runner/work/actual/actual/packages/loot-core/src/server/mutators.ts 📈 +31 B (+1.55%) 1.95 kB → 1.98 kB
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts 📉 -2 B (-0.01%) 29.3 kB → 29.3 kB
home/runner/work/actual/actual/packages/loot-core/src/server/api.ts 📉 -2 B (-0.01%) 22.89 kB → 22.88 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/schedule-template.ts 📉 -2 B (-0.02%) 8.19 kB → 8.19 kB
home/runner/work/actual/actual/packages/loot-core/src/server/rules/action.ts 📉 -2 B (-0.03%) 7.6 kB → 7.6 kB
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts 📉 -8 B (-0.03%) 24.32 kB → 24.31 kB
home/runner/work/actual/actual/packages/loot-core/src/server/rules/customFunctions.ts 📉 -2 B (-0.03%) 5.81 kB → 5.81 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/util.ts 📉 -4 B (-0.06%) 6.22 kB → 6.22 kB
home/runner/work/actual/actual/packages/loot-core/src/server/importers/ynab4.ts 📉 -6 B (-0.06%) 9.19 kB → 9.18 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/category-template-context.ts 📉 -26 B (-0.13%) 19.95 kB → 19.93 kB
home/runner/work/actual/actual/packages/loot-core/src/server/transactions/export/export-to-csv.ts 📉 -6 B (-0.21%) 2.75 kB → 2.74 kB
methods.ts 📉 -60 B (-1.02%) 5.72 kB → 5.67 kB
home/runner/work/actual/actual/packages/loot-core/src/server/main.ts 📉 -38 B (-1.08%) 3.44 kB → 3.4 kB
utils.ts 📉 -86 B (-33.99%) 253 B → 167 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.87 MB → 3.87 MB (+113 B) +0.00%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 7.97 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
cli.js 7.97 MB 0%

crdt

Total

Files count Total bundle size % Changed
1 11.12 kB 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
index.js 11.12 kB 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/8166 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 6/9/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `matiss/api-browser-build` --- ### 📝 Commits (10+) - [`533dfc6`](https://github.com/actualbudget/actual/commit/533dfc613aba6f4fb71cd46e69bc015fffabb796) [AI] api: add browser build - [`19cba98`](https://github.com/actualbudget/actual/commit/19cba987bd11c65bd85d115a7fdc3de4a00431c0) [AI] Rename release note to match PR number 8166 - [`09b4a59`](https://github.com/actualbudget/actual/commit/09b4a59fd80724e8139f2d59023625fd909b3289) [AI] api: move browser worker plumbing into loot-core - [`81f1f5e`](https://github.com/actualbudget/actual/commit/81f1f5e57337ae9c12baab57215372dd85a12ccf) [AI] api: simplify browser build cleanups - [`20080ee`](https://github.com/actualbudget/actual/commit/20080ee73311e4520d551d3c12a4e134dbeb7c3b) [AI] api: drop the createBackendWorker wrapper, revert browser-preload churn - [`651b9b8`](https://github.com/actualbudget/actual/commit/651b9b8de083e995097548994fea9e4f513795aa) [AI] api: trim verbose comments in the browser build - [`d7883d6`](https://github.com/actualbudget/actual/commit/d7883d64ab8be3604db25c9c02e5b985472f726c) [AI] api: drop redundant absurd-sql dependency - [`18a3b1c`](https://github.com/actualbudget/actual/commit/18a3b1cc22fce7217a0163e4c8d53b4997ad02ae) [AI] api: drop the api-browser condition, inject the worker into the connection - [`f7e99f9`](https://github.com/actualbudget/actual/commit/f7e99f96fbda932b42f77d0d1ff8cbc52d9f65d7) [AI] api: route methods through the client connection, slim the facade - [`3a2ec48`](https://github.com/actualbudget/actual/commit/3a2ec48a7cc394c2643b44326675ea1206b44bda) [AI] api: trim prose comments to the essential ones ### 📊 Changes **28 files changed** (+524 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/docs-spelling/allow/keywords.txt` (+1 -0) ➕ `.github/workflows/api-browser-test.yml` (+47 -0) 📝 `.gitignore` (+2 -0) ➕ `packages/api/browser-worker.ts` (+21 -0) ➕ `packages/api/e2e/browser.test.ts` (+94 -0) ➕ `packages/api/e2e/harness.html` (+12 -0) ➕ `packages/api/e2e/serve-dist.mjs` (+46 -0) ➕ `packages/api/e2e/tsconfig.json` (+9 -0) ➕ `packages/api/index.browser.ts` (+45 -0) 📝 `packages/api/methods.ts` (+1 -9) 📝 `packages/api/package.json` (+12 -1) ➕ `packages/api/playwright.config.ts` (+18 -0) 📝 `packages/api/tsconfig.json` (+1 -0) 📝 `packages/api/utils.ts` (+1 -4) ➕ `packages/api/vite.browser-worker.config.mts` (+54 -0) ➕ `packages/api/vite.browser.config.mts` (+25 -0) 📝 `packages/api/vite.config.mts` (+30 -0) 📝 `packages/docs/docs/api/index.md` (+24 -0) 📝 `packages/loot-core/package.json` (+2 -0) ➕ `packages/loot-core/src/platform/client/backend-worker.ts` (+20 -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://actualbudget.org/docs/contributing/#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> ## Description <!-- What does this PR do? Why is it needed? Please give context on the "why?": why do we need this change? What problem is it solving for you?--> <!-- If AI tools wrote a significant part of this change, please disclose it here and name the tool you used. See https://actualbudget.org/docs/contributing/ai-usage-policy --> Making the `@actual-app/api` package be usable in browser context + tests covering this functionality. Highly experimental feature. ## Related issue(s) <!-- e.g. Fixes #123, Relates to #456 --> N/A ## Testing <!-- What did you test? How can we reproduce the issue you are fixing or how can we test the feature you built? --> N/A ## Checklist - [x] Release notes added (see link above) - [x] No obvious regressions in affected areas - [x] Self-review has been performed - I have read every line of this diff and can explain what each change does and why it is needed <!--- actual-bot-sections ---> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 37 | 14.14 MB → 14.14 MB (+24 B) | +0.00% loot-core | 1 | 5.29 MB → 5.29 MB (+53 B) | +0.00% api | 2 | 3.87 MB → 3.87 MB (+113 B) | +0.00% cli | 1 | 7.97 MB | 0% crdt | 1 | 11.12 kB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 37 | 14.14 MB → 14.14 MB (+24 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/platform/client/connection/index.ts` | 📈 +24 B (+0.72%) | 3.24 kB → 3.27 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/extends.js | 508.79 kB → 508.81 kB (+24 B) | +0.00% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 1.6 MB | 0% static/js/BackgroundImage.js | 121.09 kB | 0% static/js/FormulaEditor.js | 962.55 kB | 0% static/js/ManageRules.js | 46.63 kB | 0% static/js/PayeeRuleCountLabel.js | 7.33 kB | 0% static/js/ReportRouter.js | 1.27 MB | 0% static/js/ScheduleEditForm.js | 146.57 kB | 0% static/js/SchedulesTable.js | 206.3 kB | 0% static/js/TransactionEdit.js | 90.63 kB | 0% static/js/TransactionList.js | 85.81 kB | 0% static/js/Value.js | 5.08 MB | 0% static/js/_baseIsEqual.js | 98.38 kB | 0% static/js/ca.js | 185.63 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 100.19 kB | 0% static/js/de.js | 182.38 kB | 0% static/js/en-GB.js | 9.25 kB | 0% static/js/en.js | 201.71 kB | 0% static/js/es.js | 177.58 kB | 0% static/js/fr.js | 177.35 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 163.93 kB | 0% static/js/narrow.js | 365.05 kB | 0% static/js/nb-NO.js | 147.07 kB | 0% static/js/nl.js | 119.71 kB | 0% static/js/pt-BR.js | 187.34 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 173.33 kB | 0% static/js/theme.js | 31.88 kB | 0% static/js/toString.js | 705.18 kB | 0% static/js/uk.js | 216.7 kB | 0% static/js/useFormatList.js | 2.52 kB | 0% static/js/useTransactionBatchActions.js | 9.71 kB | 0% static/js/wide.js | 298.99 kB | 0% static/js/workbox-window.prod.es5.js | 7.33 kB | 0% static/js/zh-Hans.js | 116.44 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.29 MB → 5.29 MB (+53 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/mutators.ts` | 📈 +30 B (+1.41%) | 2.08 kB → 2.11 kB `home/runner/work/actual/actual/packages/loot-core/src/platform/server/fs/index.ts` | 📈 +23 B (+0.28%) | 7.93 kB → 7.95 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.Du4ycZR0.js | 0 B → 5.29 MB (+5.29 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DjCqYlkp.js | 5.29 MB → 0 B (-5.29 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 2 | 3.87 MB → 3.87 MB (+113 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/platform/client/connection/index.api.ts` | 🆕 +326 B | 0 B → 326 B `home/runner/work/actual/actual/packages/loot-core/src/server/mutators.ts` | 📈 +31 B (+1.55%) | 1.95 kB → 1.98 kB `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts` | 📉 -2 B (-0.01%) | 29.3 kB → 29.3 kB `home/runner/work/actual/actual/packages/loot-core/src/server/api.ts` | 📉 -2 B (-0.01%) | 22.89 kB → 22.88 kB `home/runner/work/actual/actual/packages/loot-core/src/server/budget/schedule-template.ts` | 📉 -2 B (-0.02%) | 8.19 kB → 8.19 kB `home/runner/work/actual/actual/packages/loot-core/src/server/rules/action.ts` | 📉 -2 B (-0.03%) | 7.6 kB → 7.6 kB `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts` | 📉 -8 B (-0.03%) | 24.32 kB → 24.31 kB `home/runner/work/actual/actual/packages/loot-core/src/server/rules/customFunctions.ts` | 📉 -2 B (-0.03%) | 5.81 kB → 5.81 kB `home/runner/work/actual/actual/packages/loot-core/src/shared/util.ts` | 📉 -4 B (-0.06%) | 6.22 kB → 6.22 kB `home/runner/work/actual/actual/packages/loot-core/src/server/importers/ynab4.ts` | 📉 -6 B (-0.06%) | 9.19 kB → 9.18 kB `home/runner/work/actual/actual/packages/loot-core/src/server/budget/category-template-context.ts` | 📉 -26 B (-0.13%) | 19.95 kB → 19.93 kB `home/runner/work/actual/actual/packages/loot-core/src/server/transactions/export/export-to-csv.ts` | 📉 -6 B (-0.21%) | 2.75 kB → 2.74 kB `methods.ts` | 📉 -60 B (-1.02%) | 5.72 kB → 5.67 kB `home/runner/work/actual/actual/packages/loot-core/src/server/main.ts` | 📉 -38 B (-1.08%) | 3.44 kB → 3.4 kB `utils.ts` | 📉 -86 B (-33.99%) | 253 B → 167 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- index.js | 3.87 MB → 3.87 MB (+113 B) | +0.00% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- models.js | 0 B | 0% </div> </details> --- #### cli **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 7.97 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 ----- | --------- | --------- cli.js | 7.97 MB | 0% </div> </details> --- #### crdt **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 11.12 kB | 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 ----- | --------- | --------- index.js | 11.12 kB | 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-06-11 21:13:23 -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#122379