Repository navigation
refactor(pages): share adapter build-plugin code that must stay in sync - #673
Merged
cpojer merged 1 commit intoNov 3, 2026
Merged
Conversation
The React, Vue, Svelte and Solid islands and pages plugins each kept their own copy of logic that is tied to core contracts. Move those parts into `void/pages-islands-plugin` and `void/pages` as plain helpers; each adapter keeps its Vite plugin object and its framework rendering and hydration code. - `createIslandManifest`: island id resolution and the island page/layout pre-scan, which follow the page scan model. - `islandCssFiles`, `generateIslandClientEntry`: the islands client entry's CSS strategy and `initIslands` runtime; adapters pass their style-block imports and `hydrateIsland` source. - `islandsBuildConfig`: the `islands-client` build input. - `mdClientScriptIds`: the `void-md` plugin API lookup. - `PrefetchConfig`, `PagesPluginOptions`, `resolvePrefetchConfig`: the public adapter options and their defaults. Adapters re-export `PrefetchConfig`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yangshun
marked this pull request as draft
November 2, 2026 12:48
yangshun
marked this pull request as ready for review
November 2, 2026 13:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The React, Vue, Svelte and Solid adapters each kept their own copy of build-plugin logic that is tied to core contracts. This moves those parts into core as plain helpers. Each adapter keeps its own Vite plugin object and its framework rendering and hydration codegen.
void/pages-islands-plugincreateIslandManifest(root, extensions): resolves island imports to ids and pre-scans island pages and layouts. It follows the page scan model, so a new layout kind now needs one change instead of four.islandCssFiles(...)andgenerateIslandClientEntry(...): the islands client entry's CSS strategy (dev skip, server-recorded styles, fallback) and theinitIslandsruntime. Adapters pass in what is framework-specific: style-block imports for Vue and Svelte, and thehydrateIslandsource.islandsBuildConfig(root, pagesDir): theislands-clientbuild input.mdClientScriptIds(resolvedConfig): thevoid-mdplugin API lookup.computePagesNeedingClientJSnow uses it too.void/pagesPrefetchConfig(itscacheForis nowCacheForInput) andPagesPluginOptions. Each adapter'splugin-pages.tsre-exportsPrefetchConfig, so the name stays the same.resolvePrefetchConfig(prefetch): the 75 ms /'30s'defaults, which were repeated in four codegen strings.The adapter
plugin-islands.tsfiles shrink by about 130–180 lines each.Left in the adapters on purpose
Some code is repeated but differs by framework, or isn't tied to a core contract, so it stays where it is:
<script setup>injection)cssScopeTohandlinguseFormwarninghasNonIslandPages(React and Solid use the scan).pages-plugin-adapters.test.tspins this difference, so unifying it would be a separate behavior change.Behavior changes
buildStartinstead of accumulating acrossbuildStartcalls. Invite build --watch, a deleted island page's styles stop being imported. A single build is unchanged.hydrateIslandinstead ofmountIsland. This only changes generated code.resolveSpecifiernow accepts aReadonlyArrayof extensions (type widening only).Generated client and renderer output is otherwise unchanged.
Verification
vp run --filter './packages/**' typecheck: all 12 packages pass. A fullvp run checkalso typechecks playgrounds, which needvp run build:allfirst; I didn't run that locally.plugin-islandsandplugin-pages, pluspages-plugin-adapters,pages-islands-rescanandisland-css-rewrite: 11 files, 175 tests pass.@void/md: 18 files, 259 tests pass.vp test run: 732 files pass and 31 fail. None of the failures come from this change:platform/packages/dashboard/.void/tsconfig.json.cf-build-outputtimed out under full-suite load. All 3 files pass on their own (54 tests).🤖 Generated with Claude Code