Skip to content

feat(desktop): enable --hmr for Vite and Nuxt - #35851

Merged
crowlKats merged 1 commit into
denoland:mainfrom
crowlKats:feat/desktop-hmr-vite-nuxt
Jul 8, 2026
Merged

crowlKats merged 1 commit into
denoland:mainfrom
crowlKats:feat/desktop-hmr-vite-nuxt

Conversation

@crowlKats

@crowlKats crowlKats commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

deno desktop --hmr (added in #35722) already spawns the detected framework's dev server, parses its Local: URL, and hands it to the desktop runtime. But that PR only wired hmr_command for Fresh, SvelteKit, and React Router β€” Vite and the Nitro-based frameworks (Nuxt, SolidStart, TanStack Start) were left as hmr_command: None // TODO.

As a result a Vue app (a plain Vite SPA, or Nuxt) could not use --hmr and still required a vite build + deno desktop on every change β€” the workflow gap reported in #35745.

Change

Wire hmr_command to deno task dev for:

  • detect_vite β€” both the SSR (server.{js,ts,mjs}) and SPA/MPA branches. Covers a Vue+Vite SPA (npm create vue@latest).
  • detect_nitro_framework β€” shared by Nuxt, SolidStart, and TanStack Start.

These all run a Vite/vinxi-based dev server that prints the Local: http://… line parse_dev_server_url already scans for, so no changes to the HMR launcher (desktop.rs) are needed.

Tests

  • Added vue_vite_spa_supports_hmr (mimics a npm create vue project).
  • Extended the existing Nuxt / Vite-SSR / Vite-SPA detection tests to assert hmr_command resolves to deno task dev.

Fixes #35745.

`deno desktop --hmr` already spawns the detected framework's dev server,
parses its `Local:` URL and hands it to the desktop runtime, but Vite and
the Nitro-based frameworks (Nuxt, SolidStart, TanStack Start) left
`hmr_command` unset, so a Vue app (plain Vite SPA or Nuxt) couldn't use it
and still required a `vite build` + `deno desktop` on every change.

Wire `hmr_command` to `deno task dev` for `detect_vite` (both SSR and
SPA/MPA branches) and `detect_nitro_framework`. All of these run a
Vite/vinxi dev server that prints the `Local:   http://…` line
`parse_dev_server_url` scans for, so no changes to the HMR launcher are
needed.

Towards denoland#35745.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@crowlKats
crowlKats merged commit 115114f into denoland:main Jul 8, 2026
269 of 272 checks passed
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.

Develop Vue applications using Deno Desktop

2 participants