Skip to content

refactor!: remove never-implemented SPA adapter remnants and other dead code - #234

Merged
antfu merged 1 commit into
mainfrom
refactor/prune-dead-spa-and-unused-api
Aug 15, 2026
Merged

refactor!: remove never-implemented SPA adapter remnants and other dead code#234
antfu merged 1 commit into
mainfrom
refactor/prune-dead-spa-and-unused-api

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Why

The spa field, setupBrowser / DevframeBrowserContext, and the spa-loader.json build output described a static SPA adapter that was never implemented — no adapter ever invoked setupBrowser, no client ever read spa-loader.json, and there is no spa runtime/subcommand. This removes that whole dead chain and does a sweep of the adjacent dead code found alongside it.

What changed

Never-implemented SPA remnants

  • Remove DevframeDefinition.spa, DevframeSpaOptions, setupBrowser, DevframeBrowserContext, the spa-loader.json writer in createBuild, and its now-orphaned base build option / --base flag.
  • Strip spa: { loader } from all plugins/examples and the createJsonRenderDevframe preset; delete the invalid spa-devframe.ts skill template and the orphaned adapters/spa snapshot.

Unused exported API (breaking surface reduction)

  • Remove DevframeRuntime, DevframeDiagnosticsDefinition, src/types/utils.ts (Thenable / EntriesToObject / PartialWithoutId, duplicated in rpc/types.ts), and DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID, plus the matching @devframes/hub type re-exports.
  • Drop the dead CreateH3DevframeHostOptions.app field and simplify capabilities to { dev?, build? } (the Record<string, boolean> arm was never consumed).

capabilities.dev is now actually enforced

  • createDevServer refuses a definition declaring capabilities.dev: false (new diagnostic DF0058) unless { force: true } is passed — the exact mirror of capabilities.build / DF0042. Adds the diagnostic, a force option, the docs/errors/DF0058.md page, and tests.

Docs & stale comments

  • Update the devframe skill, guide/adapter/example docs, and stale source comments (the nonexistent packages/kit/.../vite-host.ts, "adapter lands" notes). Regenerate the tsnapi public-API snapshots.

Breaking changes

Removes exported types/fields from devframe and @devframes/hub (DevframeRuntime, DevframeDiagnosticsDefinition, Thenable/EntriesToObject/PartialWithoutId, DevframeDefinition.spa, setupBrowser, DevframeBrowserContext, DevframeSpaOptions, the capabilities Record shape). No in-repo consumer used any of them. capabilities.dev: false now throws where it was previously ignored.

Verification

pnpm typecheck · pnpm build · pnpm lint (0 errors) · pnpm knip (clean) · devframe + hub suites (614 passed). tsnapi snapshots regenerated (intentional breaking public-API reduction).

This PR was created with the help of an agent.

…ad code

The `spa` field, `setupBrowser`/`DevframeBrowserContext`, and the
`spa-loader.json` build output described a static SPA adapter that was
never implemented: no adapter ever read `setupBrowser`, and nothing ever
consumed `spa-loader.json`. Remove that whole chain, plus a sweep of
adjacent dead exports found alongside it:

- Drop `DevframeSpaOptions`, `DevframeBrowserContext`, `setupBrowser`,
  `DevframeDefinition.spa`, and the `spa-loader.json` writer (with its
  now-orphaned `base` build option).
- Remove unused exported API: `DevframeRuntime`,
  `DevframeDiagnosticsDefinition`, `src/types/utils.ts`
  (`Thenable`/`EntriesToObject`/`PartialWithoutId`, duplicated in
  `rpc/types.ts`), and `DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID`, along with the
  matching hub type re-exports.
- Drop the dead `CreateH3DevframeHostOptions.app` field and simplify
  `capabilities` to `{ dev?, build? }` (the `Record<string, boolean>` arm
  was never consumed).

`capabilities.dev` is now actually enforced: `createDevServer` refuses a
definition with `capabilities.dev: false` (new `DF0058`) unless
`{ force: true }` is passed, mirroring `capabilities.build` / `DF0042`.

Update plugins, examples, docs, the devframe skill, and stale comments
(kit/vite-host references, "adapter lands" notes) accordingly, and
regenerate the tsnapi public-API snapshots.

Created with the help of an agent.
@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 20c97e3
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a800f8b58fa18000888f91d
😎 Deploy Preview https://deploy-preview-234--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
antfu merged commit c0dfc1f into main Aug 15, 2026
12 checks passed
@antfu
antfu deleted the refactor/prune-dead-spa-and-unused-api branch August 15, 2026 07:27
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