Skip to content

fix(pages): hydrate islands added while the dev server runs - #870

Draft
liangmiQwQ wants to merge 1 commit into
voidzero-dev:mainfrom
liangmiQwQ:fix/islands-client-new-island
Draft

liangmiQwQ wants to merge 1 commit into
voidzero-dev:mainfrom
liangmiQwQ:fix/islands-client-new-island

Conversation

@liangmiQwQ

Copy link
Copy Markdown

When an island page gains a new island import while the dev server is running, the new island never hydrates. The page HTML includes its data-island wrapper, but virtual:void-islands-client keeps serving the module it generated before the edit, so the island has no loader. Reloading doesn't help; only a server restart does. Reproduction: https://github.com/liang-demos/void-vue-island-hmr-repro

The page transform records the new island in the manifest, but nothing invalidates the client entry afterwards. This PR lets the island manifest keep a reference to the dev server. When register() records a new island, or an island that now resolves to a different file, it invalidates the client entry in every environment. The next page load then picks it up. The React, Vue, Svelte and Solid adapters pass the server to the manifest from configureServer.

🤖 Generated with Claude Code

@cpojer

cpojer commented Nov 18, 2026

Copy link
Copy Markdown
Member

Two issues, slop explanation:

  • Removing an island can break unrelated islands. Add an island, remove its import and file, then add another island. The manifest keeps the deleted path, so Vite returns HTTP 500 when rebuilding the shared client entry. An existing counter stopped hydrating on the PR and kept working on base. Prune deleted components before emitting loaders and cover this edit sequence.
  • The first island on a static page is still missed. In Vue, adding the first island to a previously static .island.vue page produced its HTML wrapper but no hydration script, even after reload. This also fails on base. Refresh the renderer’s decision about whether the page needs client JavaScript when its imports change.

This branch has not been deployed

No deployments
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.

2 participants