Skip to content

Revert "perf(desktop): serve over in-process memory channel instead of TCP loopback (#35272)" - #35670

Merged
bartlomieju merged 1 commit into
denoland:mainfrom
littledivy:revert-35272-memory-channel
Jul 1, 2026
Merged

bartlomieju merged 1 commit into
denoland:mainfrom
littledivy:revert-35272-memory-channel

Conversation

@littledivy

Copy link
Copy Markdown
Member

Reverts #35272 (perf(desktop): serve over in-process memory channel instead of TCP loopback).

That PR replaced the deno desktop TCP loopback serve path with an in-process memory: transport (ext/net MemoryListener, ext/http DENO_SERVE_ADDRESS=memory: override, and an app:// scheme bridge in cli/rt_desktop). It caused regressions, so this restores the prior TCP-loopback behavior.

What this restores

  • deno desktop serves on a random TCP loopback port and navigates the webview to http://127.0.0.1:PORT (waits for a real HTTP response before navigating).
  • Removes the ext/net memory transport (memory.rs, op_net_listen_memory, listen({ transport: "memory" }), MemoryStreamResource).
  • Removes the ext/http memory:<name> DENO_SERVE_ADDRESS override.
  • Removes cli/rt_desktop/scheme_bridge.rs and the app:// navigation.

Conflict resolution

Only cli/rt_desktop/lib.rs needed manual resolution — the window-reveal fix from #35620 (hidden bootstrap window revealed on first paint + show() fallback) landed on top of the memory-channel navigate loop. This revert keeps that fix: the navigate loop is restored to TCP wait + navigate(&url) while preserving the on_page_load reveal and the idempotent show() fallback.

Verification

cargo check passes for deno_net, deno_http, and denort_desktop.

@divybot

divybot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This also fixes #35590 (Vite template desktop app renders a blank window). Root cause there is the app:// scheme: the webview navigates to app://desktop/ and doesn't render the non-standard scheme as a document, so the DOM is empty even though serveDir returns the correct bytes. Restoring TCP-loopback + http:// navigation here resolves it. Might be worth adding Fixes #35590 to the description.

@bartlomieju
bartlomieju merged commit 25289de into denoland:main Jul 1, 2026
136 checks passed
littledivy added a commit that referenced this pull request Jul 1, 2026
…instead of TCP loopback (#35272)\" (#35670)"

This reverses the release-branch revert so the in-memory transport is back
in place. The next commit adds the WebSocket loopback proxy that was the
missing piece: the reason #35670 was needed at all was that user code doing
`new WebSocket("ws://" + window.location.host)` couldn't reach `Deno.serve`
when it was bound only to the memory channel. Reintroducing the transport
in isolation would reproduce that regression — the follow-up commit is
what makes it viable.

Refs #35576

Co-Authored-By: Divy Srivastava <me@littledivy.com>
littledivy added a commit that referenced this pull request Jul 11, 2026
Reconcile the stable-serve-port fix with main after #35272 (in-process
memory channel) was reverted by #35670, which restored TCP loopback and
brought back the ephemeral-port storage-partition problem this PR fixes.

Only conflict was the test-module `use super::` list: keep both the
stable-port helpers (this branch) and `should_show_native_error_dialog`
plus its three tests (main). The port allocation call site now feeds the
stable port into the restored TCP-loopback `DENO_SERVE_ADDRESS` setup.

Co-Authored-By: Divy Srivastava <me@littledivy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants