Title: feat(hub): let buildHub bake statics/frames outside the hub base (sibling deploy layout) · Issue #353 · devframes/devframe · GitHub
Open Graph Title: feat(hub): let buildHub bake statics/frames outside the hub base (sibling deploy layout) · Issue #353 · devframes/devframe
X Title: feat(hub): let buildHub bake statics/frames outside the hub base (sibling deploy layout) · Issue #353 · devframes/devframe
Description: Follow-up to #347 / #349. buildHub({ context }) (#349) lets a host that assembled + mounted its own hub context hand it to the baker. Vite DevTools tried to adopt it to delete its hand-rolled build-static.ts, but hit a layout assumption:...
Open Graph Description: Follow-up to #347 / #349. buildHub({ context }) (#349) lets a host that assembled + mounted its own hub context hand it to the baker. Vite DevTools tried to adopt it to delete its hand-rolled build...
X Description: Follow-up to #347 / #349. buildHub({ context }) (#349) lets a host that assembled + mounted its own hub context hand it to the baker. Vite DevTools tried to adopt it to delete its hand-rolled build...
Opengraph URL: https://github.com/devframes/devframe/issues/353
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(hub): let buildHub bake statics/frames outside the hub base (sibling deploy layout)","articleBody":"Follow-up to #347 / #349.\n\n`buildHub({ context })` (#349) lets a host that assembled + mounted its own hub context hand it to the baker. Vite DevTools tried to adopt it to delete its hand-rolled `build-static.ts`, but hit a layout assumption: `buildHub` bakes the whole hub as **one subtree under a single `base`**, and Vite DevTools serves its devframes and assets as **root-level siblings** of the hub base.\n\n## The blocker\n\n`buildHub`'s `resolveOutPath` throws `DF8006` for any URL base that doesn't start with the hub `base`:\n\n```ts\nconst resolveOutPath = (urlBase) => {\n if (!urlBase.startsWith(base)) throw diagnostics.DF8006({ urlBase, base })\n return resolve(outDir, urlBase.slice(base.length))\n}\n```\n\nIt's applied to every `ctx.views.buildStaticDirs` entry (`copyBuildStatics`) and every served frame base (`writeConnectionMetas`). That's fine when every devframe mounts under the hub base (`/__devframes/\u003cid>/`), as the built-in examples do.\n\nVite DevTools' layout is different. The hub UI + endpoints live at `/__devtools/`, but:\n\n| Surface | Base at serve time |\n|---|---|\n| Hub UI + endpoints (`__connection.json`, `__rpc-dump/`, `__index.json`, `__renderers/`) | `/__devtools/` |\n| Inspect devframe SPA | `/__devframes_plugin_inspect/` |\n| Messages devframe SPA | `/__devframes_plugin_messages/` |\n| Vendored launcher assets | `/__devtools-assets/` |\n\nThe devframes mount at devframe's own default hosted base (`/__\u003cid>/`, via `resolveBasePath`), and the assets at a dedicated root path — all **siblings** of `/__devtools/`, not children. So `buildHub({ context, base: '/__devtools/' })` throws `DF8006` on the first sibling static dir, and `base: '/'` would misplace the hub's own endpoints (the kit client fetches them from `/__devtools/`, baked into the app's injected bootstrap).\n\nEither `base` choice fails, so `buildHub` can't currently bake this context — Vite DevTools keeps shadowing the baker (now only the RPC-dump + `resolveFrom` bits are shared).\n\n## Why the layout is like this\n\nThe hub base is a **protocol namespace** (its connection meta, WS, dump, renderer modules, index), deliberately distinct from where each integration's SPA and assets are served. A host may want the hub at `/__devtools/` while devframes keep their own top-level bases (so a devframe SPA URL is stable and independent of which hub mounts it). This is a legitimate deploy shape, not a Vite-DevTools quirk.\n\n## Request\n\nLet `buildHub` bake a context whose statics/frames live **outside** the hub `base` — a deploy-root layout where the hub base and the devframe/asset bases are siblings under a common deploy root. Concretely, one of:\n\n1. **A `root`/`deployBase` option** distinct from the hub `base`: `outDir` maps to the deploy root, absolute URL bases resolve against it (`resolve(outDir, stripLeadingSlash(urlBase))`), and the hub's own artifacts still write under `base` within it. Then `resolveOutPath` only needs each `urlBase` to be within the deploy root (i.e. absolute), not within the hub base — no `DF8006` for siblings.\n2. **Or** relax `resolveOutPath` so a `urlBase` outside `base` maps to `outDir`'s parent by its absolute path (with the hub subtree still at `\u003coutDir>`), covering the sibling case without a new option.\n\n`writeConnectionMetas`/`writeHubIndex` already read `ctx.frames` + `ctx.views.buildStaticDirs`, so per-frame metas and the index would follow automatically once the out-path resolution allows sibling bases.\n\nThis is the last gap before Vite DevTools can delete `build-static.ts` and bake purely through `buildHub`.\n\n## Context\n\n- `buildHub`: `packages/hub/src/node/build.ts` — `resolveOutPath` / `copyBuildStatics` / `writeConnectionMetas`\n- Downstream builder we want to retire: `vitejs/devtools` `packages/core/src/node/build-static.ts`\n- Downstream mount bases: hub `/__devtools/`; devframes at `resolveBasePath` = `/__\u003cid>/`; assets at `/__devtools-assets/`\n\n---\n\nCreated with the help of an agent.\n","author":{"url":"https://github.com/antfubot","@type":"Person","name":"antfubot"},"datePublished":"2026-09-04T02:49:08Z","url":"https://github.com/devframes/devframe/issues/353"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:497d94d1-9ad1-611c-2934-beed86dcfe78 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2E6:B85F4:149450A:1C17B27:6AFB7370 |
| html-safe-nonce | 7d928b39c380eb750c3af6825ceb93ba694b258d463a3ccf2ea4b7d52b39b3a7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkU2OkI4NUY0OjE0OTQ1MEE6MUMxN0IyNzo2QUZCNzM3MCIsInZpc2l0b3JfaWQiOiIzMDY5MjQ4ODM3NzA5OTUxODU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4e0cc57aa2590f35b7b7dcb2a31c2953ff1f2ecf7b248519b0063b28527e2239 |
| hovercard-subject-tag | issue:5343619750 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/devframes/devframe/353/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3fbd78a8830dc1289c7a917b4e4f67902dc81dbadf1fb98d36a3c854fde5b3c/devframes/devframe/issues/353 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3fbd78a8830dc1289c7a917b4e4f67902dc81dbadf1fb98d36a3c854fde5b3c/devframes/devframe/issues/353 |
| og:image:alt | Follow-up to #347 / #349. buildHub({ context }) (#349) lets a host that assembled + mounted its own hub context hand it to the baker. Vite DevTools tried to adopt it to delete its hand-rolled build... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | antfubot |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48 |
| turbo-cache-control | no-preview |
| go-import | github.com/devframes/devframe git https://github.com/devframes/devframe.git |
| octolytics-dimension-user_id | 279879373 |
| octolytics-dimension-user_login | devframes |
| octolytics-dimension-repository_id | 1231722386 |
| octolytics-dimension-repository_nwo | devframes/devframe |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1231722386 |
| octolytics-dimension-repository_network_root_nwo | devframes/devframe |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2e8872b770cc4d5d0cc1f2026afab747a268e2ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width