[PR #7259] [CLOSED] [AI] Fix browser preload missing from browser builds after .browser extension removal #37239

Closed
opened 2026-04-21 00:05:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7259
Author: @Copilot
Created: 3/22/2026
Status: Closed

Base: matiss/remove-browser-connection-extensionHead: copilot/sub-pr-7254


📝 Commits (3)

  • b22d7bf Initial plan
  • ce79ecb [AI] Fix browser-preload not being resolved in browser builds after .browser extension removal
  • dabe1db [AI] Fix CI failures: restore .browser.* extension resolution for IS_GENERIC_BROWSER only

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 packages/desktop-client/vite.config.ts (+3 -0)

📄 Description

Removing .browser.* extension resolution from vite.config.ts broke browser builds because browser-preload.browser.js relied on that mechanism — ./browser-preload resolved to the blank electron stub instead of the real browser initialization code (worker setup, PWA registration, IndexedDB backend, etc.).

Changes

  • vite.config.ts: restore .browser.js/.browser.jsx/.browser.ts/.browser.tsx extension priority in resolveExtensions only when IS_GENERIC_BROWSER is set, so generic browser builds correctly pick up browser-preload.browser.js
const resolveExtensions = [
  ...(env.IS_GENERIC_BROWSER
    ? ['.browser.js', '.browser.jsx', '.browser.ts', '.browser.tsx']
    : []),
  '.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json',
];

browser-preload.browser.js is the only remaining .browser.* file after the base PR renamed connection/index.browser.ts to connection/index.ts. Adding back .browser.* resolution exclusively for IS_GENERIC_BROWSER is the minimal, targeted fix that resolves the broken browser build without affecting test or Electron build module resolution.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 24 → 27 12.39 MB → 12.07 MB (-331.14 kB) -2.61%
loot-core 1 4.83 MB 0%
api 4 4.06 MB 0%
cli 1 7.88 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
24 → 27 12.39 MB → 12.07 MB (-331.14 kB) -2.61%
Changeset
File Δ Size
locale/sv.json 🆕 +80.58 kB 0 B → 80.58 kB
node_modules/absurd-sql/dist/indexeddb-main-thread-worker-e59fee74.js 🆕 +13.46 kB 0 B → 13.46 kB
src/browser-preload.js 🆕 +8.09 kB 0 B → 8.09 kB
node_modules/workbox-window/build/workbox-window.prod.es5.mjs 🆕 +7.28 kB 0 B → 7.28 kB
package.json 🆕 +3.22 kB 0 B → 3.22 kB
@vite-plugin-pwa/virtual:pwa-register 🆕 +2.21 kB 0 B → 2.21 kB
node_modules/absurd-sql/dist/indexeddb-main-thread.js 🆕 +1.31 kB 0 B → 1.31 kB
src/shared-browser-server.ts?sharedworker 🆕 +187 B 0 B → 187 B
src/languages.ts 📈 +99 B (+6.69%) 1.44 kB → 1.54 kB
node_modules/react-dnd-html5-backend/dist/NativeTypes.js 📈 +4 B (+1.25%) 321 B → 325 B
src/redux/store.ts 📈 +2 B (+0.22%) 927 B → 929 B
node_modules/react-dnd-html5-backend/dist/NativeDragSources/nativeTypesConfig.js 📈 +2 B (+0.19%) 1.05 kB → 1.05 kB
node_modules/ua-parser-js/src/main/ua-parser.mjs 📈 +12 B (+0.03%) 41.47 kB → 41.49 kB
node_modules/react-i18next/dist/es/TransWithoutContext.js 📉 -14 B (-0.10%) 14.05 kB → 14.04 kB
node_modules/react-i18next/dist/es/useTranslation.js 📉 -6 B (-0.11%) 5.3 kB → 5.3 kB
node_modules/react-i18next/dist/es/utils.js 📉 -10 B (-0.49%) 1.98 kB → 1.97 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
static/js/sv.js 0 B → 80.58 kB (+80.58 kB) -
static/js/indexeddb-main-thread-worker-e59fee74.js 0 B → 13.46 kB (+13.46 kB) -
static/js/workbox-window.prod.es5.js 0 B → 7.28 kB (+7.28 kB) -

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.21 MB → 3.23 MB (+15.03 kB) +0.46%

Smaller

Asset File Size % Changed
static/js/theme.js 478.17 kB → 30.68 kB (-447.48 kB) -93.58%

Unchanged

Asset File Size % Changed
static/js/BackgroundImage.js 119.98 kB 0%
static/js/FormulaEditor.js 846.44 kB 0%
static/js/ReportRouter.js 1021.25 kB 0%
static/js/TransactionList.js 81.29 kB 0%
static/js/ca.js 185.57 kB 0%
static/js/da.js 104.66 kB 0%
static/js/de.js 177.58 kB 0%
static/js/en-GB.js 7.16 kB 0%
static/js/en.js 170.68 kB 0%
static/js/es.js 172.13 kB 0%
static/js/fr.js 177.57 kB 0%
static/js/it.js 168.97 kB 0%
static/js/narrow.js 354.12 kB 0%
static/js/nb-NO.js 154.72 kB 0%
static/js/nl.js 111.58 kB 0%
static/js/pl.js 88.34 kB 0%
static/js/pt-BR.js 180.5 kB 0%
static/js/resize-observer.js 18.03 kB 0%
static/js/th.js 179.94 kB 0%
static/js/uk.js 213.14 kB 0%
static/js/useTransactionBatchActions.js 4.29 MB 0%
static/js/wide.js 418 B 0%

loot-core

Total

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

api

Total

Files count Total bundle size % Changed
4 4.06 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
index.js 3.84 MB 0%
from-Bl-Hslp4.js 167.73 kB 0%
multipart-parser-BnDysoMr.js 8.1 kB 0%
src-iMkUmuwR.js 43.64 kB 0%

cli

Total

Files count Total bundle size % Changed
1 7.88 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.88 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/7259 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 3/22/2026 **Status:** ❌ Closed **Base:** `matiss/remove-browser-connection-extension` ← **Head:** `copilot/sub-pr-7254` --- ### 📝 Commits (3) - [`b22d7bf`](https://github.com/actualbudget/actual/commit/b22d7bf8cf6badafa00383b18fc22dfe7a932cfd) Initial plan - [`ce79ecb`](https://github.com/actualbudget/actual/commit/ce79ecb52c9cb0c4001f568ecbba68a41178a755) [AI] Fix browser-preload not being resolved in browser builds after .browser extension removal - [`dabe1db`](https://github.com/actualbudget/actual/commit/dabe1dbd479a121f9ff41d57d3750e41dd867220) [AI] Fix CI failures: restore .browser.* extension resolution for IS_GENERIC_BROWSER only ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/vite.config.ts` (+3 -0) </details> ### 📄 Description Removing `.browser.*` extension resolution from `vite.config.ts` broke browser builds because `browser-preload.browser.js` relied on that mechanism — `./browser-preload` resolved to the blank electron stub instead of the real browser initialization code (worker setup, PWA registration, IndexedDB backend, etc.). ## Changes - **`vite.config.ts`**: restore `.browser.js/.browser.jsx/.browser.ts/.browser.tsx` extension priority in `resolveExtensions` **only** when `IS_GENERIC_BROWSER` is set, so generic browser builds correctly pick up `browser-preload.browser.js` ```ts const resolveExtensions = [ ...(env.IS_GENERIC_BROWSER ? ['.browser.js', '.browser.jsx', '.browser.ts', '.browser.tsx'] : []), '.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json', ]; ``` `browser-preload.browser.js` is the only remaining `.browser.*` file after the base PR renamed `connection/index.browser.ts` to `connection/index.ts`. Adding back `.browser.*` resolution exclusively for `IS_GENERIC_BROWSER` is the minimal, targeted fix that resolves the broken browser build without affecting test or Electron build module resolution. <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 24 → 27 | 12.39 MB → 12.07 MB (-331.14 kB) | -2.61% loot-core | 1 | 4.83 MB | 0% api | 4 | 4.06 MB | 0% cli | 1 | 7.88 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 24 → 27 | 12.39 MB → 12.07 MB (-331.14 kB) | -2.61% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `locale/sv.json` | 🆕 +80.58 kB | 0 B → 80.58 kB `node_modules/absurd-sql/dist/indexeddb-main-thread-worker-e59fee74.js` | 🆕 +13.46 kB | 0 B → 13.46 kB `src/browser-preload.js` | 🆕 +8.09 kB | 0 B → 8.09 kB `node_modules/workbox-window/build/workbox-window.prod.es5.mjs` | 🆕 +7.28 kB | 0 B → 7.28 kB `package.json` | 🆕 +3.22 kB | 0 B → 3.22 kB `@vite-plugin-pwa/virtual:pwa-register` | 🆕 +2.21 kB | 0 B → 2.21 kB `node_modules/absurd-sql/dist/indexeddb-main-thread.js` | 🆕 +1.31 kB | 0 B → 1.31 kB `src/shared-browser-server.ts?sharedworker` | 🆕 +187 B | 0 B → 187 B `src/languages.ts` | 📈 +99 B (+6.69%) | 1.44 kB → 1.54 kB `node_modules/react-dnd-html5-backend/dist/NativeTypes.js` | 📈 +4 B (+1.25%) | 321 B → 325 B `src/redux/store.ts` | 📈 +2 B (+0.22%) | 927 B → 929 B `node_modules/react-dnd-html5-backend/dist/NativeDragSources/nativeTypesConfig.js` | 📈 +2 B (+0.19%) | 1.05 kB → 1.05 kB `node_modules/ua-parser-js/src/main/ua-parser.mjs` | 📈 +12 B (+0.03%) | 41.47 kB → 41.49 kB `node_modules/react-i18next/dist/es/TransWithoutContext.js` | 📉 -14 B (-0.10%) | 14.05 kB → 14.04 kB `node_modules/react-i18next/dist/es/useTranslation.js` | 📉 -6 B (-0.11%) | 5.3 kB → 5.3 kB `node_modules/react-i18next/dist/es/utils.js` | 📉 -10 B (-0.49%) | 1.98 kB → 1.97 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- static/js/sv.js | 0 B → 80.58 kB (+80.58 kB) | - static/js/indexeddb-main-thread-worker-e59fee74.js | 0 B → 13.46 kB (+13.46 kB) | - static/js/workbox-window.prod.es5.js | 0 B → 7.28 kB (+7.28 kB) | - **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 3.21 MB → 3.23 MB (+15.03 kB) | +0.46% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/theme.js | 478.17 kB → 30.68 kB (-447.48 kB) | -93.58% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/BackgroundImage.js | 119.98 kB | 0% static/js/FormulaEditor.js | 846.44 kB | 0% static/js/ReportRouter.js | 1021.25 kB | 0% static/js/TransactionList.js | 81.29 kB | 0% static/js/ca.js | 185.57 kB | 0% static/js/da.js | 104.66 kB | 0% static/js/de.js | 177.58 kB | 0% static/js/en-GB.js | 7.16 kB | 0% static/js/en.js | 170.68 kB | 0% static/js/es.js | 172.13 kB | 0% static/js/fr.js | 177.57 kB | 0% static/js/it.js | 168.97 kB | 0% static/js/narrow.js | 354.12 kB | 0% static/js/nb-NO.js | 154.72 kB | 0% static/js/nl.js | 111.58 kB | 0% static/js/pl.js | 88.34 kB | 0% static/js/pt-BR.js | 180.5 kB | 0% static/js/resize-observer.js | 18.03 kB | 0% static/js/th.js | 179.94 kB | 0% static/js/uk.js | 213.14 kB | 0% static/js/useTransactionBatchActions.js | 4.29 MB | 0% static/js/wide.js | 418 B | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.83 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.Dmj0rSrb.js | 4.83 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 4 | 4.06 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 ----- | --------- | --------- index.js | 3.84 MB | 0% from-Bl-Hslp4.js | 167.73 kB | 0% multipart-parser-BnDysoMr.js | 8.1 kB | 0% src-iMkUmuwR.js | 43.64 kB | 0% </div> </details> --- #### cli **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 7.88 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.88 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-21 00:05:09 -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#37239