Skip to content

Retire browser dev mode: remove dev:browser, the dev-proxy, HttpAdapter and BrowserSyncService #3785

Closed

Description

@malibio

Overview

Retire browser dev mode (bun run dev:browser) and delete everything that exists only to serve it: the HTTP dev-proxy, HttpAdapter, BrowserSyncService, and the tests that pin those two paths to each other. After this, there is one backend path (the Tauri command layer) and agents inspect the real app through the debug bridge.

Problem Statement

Browser mode runs the frontend in Chrome against a second backend path that imitates the Tauri commands, hand-kept in step with the command layer:

  • packages/dev-tools/ (the HTTP dev-proxy, ~2,000 lines of TypeScript across dev-proxy.ts, grpc-client.ts, grpc-error-mapping.ts, model-load-progress.ts, watch-event-mapping.ts)
  • HttpAdapter in packages/desktop-app/src/lib/services/backend-adapter.ts, and adapter-core.ts / http-response.ts / node-normalize.ts that exist for it
  • BrowserSyncService in packages/desktop-app/src/lib/services/browser-sync-service.ts (the SSE path)

No shipped user is ever on this path, and it inspects Chrome rather than the WKWebView the app ships with. The debug-bridge trial (merged; outcome recorded on the trial issue) showed the real app can be queried and driven from a CLI: DOM, console, JS eval, click and typing with persistence, screenshots, IPC invoke.

What the trial said about replacing it

Do not retire on the strength of "the bridge works". It is not a like-for-like replacement:

  • It cannot watch the app's own IPC traffic passively: the monitor only sees calls through window.__TAURI__.core.invoke, while the app uses __TAURI_INTERNALS__. Direct invokes work.
  • hover and right-click are synthetic events (isTrusted: false); CSS :hover does not apply.
  • Launching the app takes over the per-user launchd job for the debug daemon label and cannot be isolated by HOME. Browser mode launches against an isolated daemon cheaply; the Tauri path does not.
  • It needs a running desktop app, so it cannot be a CI tier by itself.

So the work here is deciding what replaces the tests that ride the HTTP path, not only deleting the dev script.

What depends on the browser path today

  • Dev scripts: dev, dev:browser, dev:browser:proxy, dev:browser:frontend, dev:browser:prod, demo:browser (root and packages/desktop-app/package.json). bun run dev points at dev:browser.
  • The e2e tier (test:e2e, vitest.e2e.config.ts, src/tests/e2e/*.e2e.ts, daemon-harness.ts): spawns a real nodespaced plus the dev-proxy and drives HttpAdapter against it. This is the largest dependency.
  • Contract/parity tests: app-lib/tests/it/adapter_contract_test.rs, schema_parity_test.rs, node_crud_tauri_seam_test.rs and the TS adapter-contract.e2e.ts exist to prove the two adapters agree. With one adapter their purpose goes away or must be restated against the Tauri seam alone (ADR-048).
  • Unit tests: dev-proxy-*.test.ts, browser-sync-service.test.ts, backend-adapter.test.ts, adapter-core.test.ts, node-normalize.test.ts, and uses in test-node-helpers.ts, collection-service.test.ts and others.
  • Frontend code that branches on the environment: test-environment.ts, app-initialization.ts, tauri-commands.ts, app-shell.svelte, database.svelte.ts and the services that import HttpAdapter / BrowserSyncService.
  • Tooling: scripts/gate-scope.ts (+ test), scripts/check-code-references.ts, the gate's e2e stage, .claude/skills/run-app/SKILL.md, AGENTS.md.
  • Docs (nodespace-docs): development/browser-dev-mode.md (replace or remove), ADR-048 (describes both adapter paths), and anything linking to them.

Proposed Solution

  1. Take the decision on what covers the frontend-to-daemon path from the test strategy ([Epic] Rebuild the test suite: decide what each tier is for, then keep, rewrite or delete every test against that #3733, Phase 2, which lists the options and their limits: a Vite + Playwright UI tier on mocked IPC, the Tauri-seam tier, a daemon-level gRPC e2e, or a full-stack shim). This issue implements that decision; it does not make it. Amend ADR-048 if its two-adapter description changes.
  2. Make dev point at dev:tauri.
  3. Delete the proxy package, HttpAdapter and its helpers, BrowserSyncService, the environment branching that selected them, and their tests, in one change set with the final architecture (no dual mode, no deprecation period).
  4. Update the run-app skill, AGENTS.md, gate scope and the docs to describe the single path and the bridge recipe.

Acceptance Criteria

  • The test strategy ([Epic] Rebuild the test suite: decide what each tier is for, then keep, rewrite or delete every test against that #3733, Phase 2) has decided what replaces the e2e tier's coverage, and that tier exists before the old one is deleted (with the ADR-048 change if one is needed)
  • packages/dev-tools/ is removed and nothing in the workspace references it
  • HttpAdapter, BrowserSyncService, http-response.ts, and the code that exists only for them are deleted; backendAdapter resolves to the Tauri adapter (or the test mock) only
  • The dev scripts are removed; bun run dev runs dev:tauri
  • The e2e tier, contract tests and unit tests that only served the HTTP path are deleted or restated against the surviving path; no test is left skipped
  • scripts/gate-scope.ts, check-code-references.ts, the gate, AGENTS.md and .claude/skills/run-app/SKILL.md match; browser-dev-mode.md is replaced or removed
  • bun run test:changed passes, including the sync-boundary check; bun run quality:fix is clean

Dependencies

Non-Goals

  • Adopting the Tauri 3 CEF runtime (a separate decision).
  • Making the debug bridge a CI tier.
  • Changing the Tauri command layer or the daemon's gRPC API.

Notes

  • Pre-release rules apply: delete, do not deprecate or keep a flag.
  • Fixing the bridge's gaps (a real-pointer path, passive IPC capture) is not required for this issue but would reduce what is lost; if either is wanted, file it separately.

Activity

  1. malibio commented on Oct 13, 2026

    @malibio
    CollaboratorAuthor

    Linked to #3733: its Phase 2 owns the decision on what replaces the e2e tier, and the options (including a Vite + Playwright UI tier on mocked IPC) are now written there. This issue is blocked on that decision for the test deletions; the dev-script and docs parts are not.

  2. self-assigned this
    on Nov 3, 2026
  3. mstomar125 commented on Nov 3, 2026

    @mstomar125
    Contributor

    Picking this up (sweep drain).

  4. malibio commented on Nov 3, 2026

    @malibio
    CollaboratorAuthor

    The design is now recorded: ADR-103 (Accepted) and Debug Bridge. ADR-048 §5 is amended and the docs inventory updated. The docs describe the end state, so they read ahead of the code until this lands.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions