feat: upgrade to devframe v0.9.0-beta.1 and adopt @devframes/hub-ui client - #529
Open
antfubot wants to merge 4 commits into
Open
feat: upgrade to devframe v0.9.0-beta.1 and adopt @devframes/hub-ui client#529antfubot wants to merge 4 commits into
antfubot wants to merge 4 commits into
Conversation
Migrate to devframe 0.9 following the upstream migration guide: drop the removed compatibility shims and adopt the slimmed public API surface across kit and core.
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
…evTools
Replace the hand-rolled web-components client (the injected overlay dock, the
standalone SPA, and the bespoke shadow-DOM UnoCSS pipeline) with the reference
hub viewer from @devframes/hub-ui, re-platforming core's serving onto the
hub's initHub({ ui }) path.
- Re-platform serving onto initHub: the DevTools context is handed to
initHub({ base, context, ui, auth, server/ws }) as a "bring your own
context" hub, which owns the RPC connection meta, the shared WebSocket
transport, and the branded ui slot under /__devtools/. This retires the
bespoke WS server (ws.ts), the passive-mode server flag, and the local
static serving.
- Brand the reference UI as Vite DevTools via createUi({ branding }): product
name, primary color (#6b84fd), and a self-contained "V+" mark shipped as a
data-URI logo/favicon so it renders in the injected dock, the standalone
viewer, and static builds alike.
- Injection is now a single external module script pointing at the
hub-served <base>embedded.js; the static build bakes the hub-ui viewer,
embedded bootstrap, and branding.json into the snapshot.
- Remove the local client sources, the standalone Vite build, the client
tsdown entries + CSS build, and the client subpath exports.
Live in-browser UI parity (dock types, settings view, command palette) should
be validated against the reference viewer as a follow-up.
… for static builds - playgrounds/core: remove the local build-css HMR plugin and its import; the client is now the prebuilt @devframes/hub-ui, so there is no shadow-DOM CSS to rebuild (fixes the dev-server config load error). - build-static: seed an empty `devframe:dock-renderers` shared state before collecting the RPC dump so the hub-ui client's boot-time manifest read has a static dump match instead of erroring. Verified by the e2e static-build suite.
… runtime injection - branding: use the official Vite+ brand assets (icon + wordmark, light/dark) from voidzero-dev/community-design-resources for the hub-ui logo/wordmark/ favicon, replacing the hand-drawn placeholder mark. - injection: load `<base>embedded.js` via an inline module that creates the script element at runtime instead of a static `<script type=module src>`. A static root-relative module src makes Vite pre-transform the hub-served bootstrap through its own pipeline (logging "Failed to load url /__devtools/embedded.js"); depending on the Vite version it can shadow the real module, breaking the client's `import.meta.url`-relative branding.json fetch so the dock falls back to devframe's default accent instead of the Vite DevTools primary color. Runtime injection keeps embedded.js out of Vite's module graph, so branding resolves correctly. The hub-ui branding mechanism itself is correct (primaryColor feeds `--devframe-primary` and the derived ramp), so no upstream change is needed.
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.
Description
Two related changes on the devframe 0.9 line.
1. Upgrade
devframe(+ all@devframes/*) tov0.9.0-beta.1— migrates to the trimmed 0.9 public API per the 0.9 migration guide:mountDevframe(ctx, d, opts)→ctx.install(d, opts); dropped the removedmountDevframere-export; simplifiedKitNodeContext.defineDevframefrom thedevframeroot; core:collectStaticRpcDumpfromdevframe/rpc/dump,normalizeHttpServerUrlfromdevframe/internal, inlined the removedisObject.DevframeRpcConnection(was a crosswsPeer);DockRenderersContext.mountreturns aDockRendererMountResultunion; bumped thebirpccatalog to^4.1.0.2. Replace the hand-rolled web-components client with
@devframes/hub-ui, branded as Vite DevTools — re-platforms core's serving onto the hub'sinitHub({ ui })path:initHubin "bring your own context" mode; the hub owns the RPC connection meta, the shared WebSocket transport, and the brandeduislot under/__devtools/. This retires the bespoke WS server, the passive-mode server flag, and the local static serving.createUi({ branding }): product name Vite DevTools, primary color#6b84fd, and a self-contained "V+" mark inlined as adata:URI logo/favicon so it renders in the injected dock, the standalone viewer, and static builds.<base>embedded.js; the static build bakes the hub-ui viewer + embedded bootstrap +branding.jsoninto the snapshot../client/*subpath exports (~15.6k lines).Public API snapshots (tsnapi) updated for the intentional breaking removals.
Linked Issues
Additional context
pnpm lint && pnpm test && pnpm typecheck && pnpm buildall pass. Live in-browser UI parity against the reference viewer (dock types, the~settingsview, command palette) is worth a follow-up validation pass, since the reference UI renders~builtinreserved-id views itself.This PR was created with the help of an agent.