René's URL Explorer Experiment


Title: feat(hub): let buildHub bake an already-assembled context (reuse in Vite DevTools) · Issue #347 · devframes/devframe · GitHub

Open Graph Title: feat(hub): let buildHub bake an already-assembled context (reuse in Vite DevTools) · Issue #347 · devframes/devframe

X Title: feat(hub): let buildHub bake an already-assembled context (reuse in Vite DevTools) · Issue #347 · devframes/devframe

Description: What buildHub (@devframes/hub/build, #339) bakes a whole static hub — but it owns the entire pipeline: it creates its own createHubContext({ mode: 'build' }), mounts devframes from a devframes/configure input, then does the baking (stati...

Open Graph Description: What buildHub (@devframes/hub/build, #339) bakes a whole static hub — but it owns the entire pipeline: it creates its own createHubContext({ mode: 'build' }), mounts devframes from a devframes/conf...

X Description: What buildHub (@devframes/hub/build, #339) bakes a whole static hub — but it owns the entire pipeline: it creates its own createHubContext({ mode: 'build' }), mounts devframes from a devfra...

Opengraph URL: https://github.com/devframes/devframe/issues/347

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(hub): let buildHub bake an already-assembled context (reuse in Vite DevTools)","articleBody":"## What\n\n`buildHub` (`@devframes/hub/build`, #339) bakes a whole static hub — but it **owns the entire pipeline**: it creates its own `createHubContext({ mode: 'build' })`, mounts devframes from a `devframes`/`configure` input, then does the baking (static-dir copy, renderer manifest, UI artifacts, `__client-imports.js`, `__index.json`, hub + per-frame `__connection.json`, and the RPC dump).\n\nVite DevTools (`@vitejs/devtools` + `@vitejs/devtools-kit`) can't feed it that way, so today it **re-implements the whole baker by hand** (`packages/core/src/node/build-static.ts`) and drifts out of sync with upstream — e.g. the 0.9.10 `collectStaticRpcDump` format change (files became `{ serialization, fnName, data }` wrappers with per-file structured-clone/json encoding) silently broke our hand-rolled `JSON.stringify(data)` writer until we switched to the now-shared `writeStaticRpcDump`.\n\nWe'd like to reuse `buildHub`'s baking instead of shadowing it. A few things block that.\n\n## Why `buildHub`'s own-context model doesn't fit\n\nVite DevTools assembles its context differently from a plain hub:\n\n1. **Kit-augmented context.** It builds via `createKitContext` (wraps `createHubContext`) so the context carries Vite-specific slots (`viteConfig`/`viteServer`) that the integrations' `setup(ctx)` hooks read. `buildHub`'s internal `createHubContext(...)` produces a plain hub context without them.\n2. **Devframes arrive as Vite plugins, not a `devframes` array.** Built-ins and user integrations are mounted by scanning `viteConfig.plugins` for a `.devtools.setup` hook and running it against the context — arbitrary Vite plugins, not `DevframeDefinition`s we can enumerate into `buildHub({ devframes })`.\n3. **Capability gating happens Vite-side** (`shouldSkipSetupByCapabilities` on `plugin.devtools.capabilities[mode]`), before mount.\n\nSo we need to create + mount the context ourselves and hand the *already-mounted* context to the baker.\n\n## Requests (roughly in priority order)\n\n1. **Expose the post-mount baker as a public function that takes an existing, already-mounted `DevframeHubContext`.** Something like `bakeHubStatic(ctx, { outDir, base, ui, renderers, name, version, pretty })` that runs exactly the tail of `buildHub` (renderer manifest → UI artifacts → `__client-imports.js` → `__index.json` → hub + per-frame `__connection.json` → `collectStaticRpcDump` + `writeStaticRpcDump`), **without** creating a context or mounting devframes. `buildHub` then becomes `createHubContext` + `mountDevframes` + `bakeHubStatic(ctx, opts)`. This single change unblocks us — we stop shadowing the whole file and inherit format/behaviour fixes for free.\n\n2. **Frame discovery from an externally-mounted context.** The baker needs the installed frames + their bases to write `__index.json` and per-frame `__connection.json`. In `buildHub` these come from `mountDevframes`' return value and `host.mountConnectionMeta`. For a context mounted by the caller, please expose a public way to enumerate mounted frames/bases (e.g. `ctx.frames`, or via `getInternalContext`) so the baker can emit the index + per-frame metas it did not mount itself. (Today our hand-rolled builder writes only a single hub `__connection.json` and no `__index.json`, so a frame SPA loaded standalone can't find the shared dump — the exact gap #339 fixed for `buildHub`.)\n\n3. **Materialize `views.buildStaticDirs` from the provided context.** In build mode the kit host's `mountStatic` is a no-op (\"baked into build output by createBuild\"), so statics registered via `views.hostStatic` are only reachable through `ctx.views.buildStaticDirs` (each `{ baseUrl, source }`, some remote-asset sources needing `resolveStaticAssetsSource(...).materialize(dir)`). `buildHub` copies statics as a side effect of its own H3 host's `mount` during mounting; the extracted baker should instead iterate the provided context's `views.buildStaticDirs` so an externally-mounted context's statics get copied.\n\n4. **Don't unconditionally `rm -rf` `outDir`.** `buildHub` does `if (existsSync(outDir)) await fs.rm(outDir, { recursive: true })`. When baking into an existing app build output (the `@devframes/vite/hub` `build: true` case, and our `build.withApp`), the devtools subtree lives alongside the app's own `dist/`. A `clean?: boolean` opt-out (default keeping today's behaviour) would make it safe to point the baker at a shared directory.\n\n## Alternative (smaller scope)\n\nIf extracting a public baker is too big, publishing the internal helpers `buildHub` composes — `mountDevframes`, `renderClientImportsModule`, `resolveRendererRegistrations`, and the `__index.json` / connection-meta writers (currently private in the `assemble` chunk; only `createHubContext` and `buildHub` are public from `@devframes/hub/node` and `@devframes/hub/build`) — would at least let downstreams compose their own baker without copy-pasting upstream. The extracted `bakeHubStatic(ctx, opts)` is the cleaner outcome, though.\n\n## Context\n\n- `buildHub`: `packages/hub/src/node/build.ts` (from #339)\n- Downstream hand-rolled equivalent we want to delete: `vitejs/devtools` `packages/core/src/node/build-static.ts`\n\n---\n\nCreated with the help of an agent.\n","author":{"url":"https://github.com/antfubot","@type":"Person","name":"antfubot"},"datePublished":"2026-09-03T12:34:27Z","url":"https://github.com/devframes/devframe/issues/347"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ff9f3370-c570-ecf7-0aff-01c1ac9bb456
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC258:35E137:50CDC:6D899:6AFB842C
html-safe-nonce7f60ce505578e42084f529e20a6e00df8f2862a538b7932b7e02433b5c887bf1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjU4OjM1RTEzNzo1MENEQzo2RDg5OTo2QUZCODQyQyIsInZpc2l0b3JfaWQiOiI4NTkxMDE2NDU3NDAyMDI1MDA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8e747d909d440bbb590915287df715aa9e4a6cd4bf4a583368b9600084ad2417
hovercard-subject-tagissue:5336677022
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/devframes/devframe/347/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3cbe2ea08c6ce98f4a3421ec03eb39f5b42314b023b93eb0ceff9db468d21b05/devframes/devframe/issues/347
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3cbe2ea08c6ce98f4a3421ec03eb39f5b42314b023b93eb0ceff9db468d21b05/devframes/devframe/issues/347
og:image:altWhat buildHub (@devframes/hub/build, #339) bakes a whole static hub — but it owns the entire pipeline: it creates its own createHubContext({ mode: 'build' }), mounts devframes from a devframes/conf...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameantfubot
hostnamegithub.com
expected-hostnamegithub.com
Noneef32892d4269fb87b55e81cc4ba8d86e0f16aa28446ffbf46cba8be5179ab188
turbo-cache-controlno-preview
go-importgithub.com/devframes/devframe git https://github.com/devframes/devframe.git
octolytics-dimension-user_id279879373
octolytics-dimension-user_logindevframes
octolytics-dimension-repository_id1231722386
octolytics-dimension-repository_nwodevframes/devframe
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1231722386
octolytics-dimension-repository_network_root_nwodevframes/devframe
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasebc3703b4dcbe820d1284ef63c88b001c850be25e
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/devframes/devframe/issues/347#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdevframes%2Fdevframe%2Fissues%2F347
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdevframes%2Fdevframe%2Fissues%2F347
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=devframes%2Fdevframe
Reloadhttps://github.com/devframes/devframe/issues/347
Reloadhttps://github.com/devframes/devframe/issues/347
Reloadhttps://github.com/devframes/devframe/issues/347
devframeshttps://github.com/devframes
devframehttps://github.com/devframes/devframe
Codehttps://github.com/devframes/devframe
Issues12 (12)https://github.com/devframes/devframe/issues
Pull requests13 (13)https://github.com/devframes/devframe/pulls
Actionshttps://github.com/devframes/devframe/actions
Security and qualityhttps://github.com/devframes/devframe/security
Insightshttps://github.com/devframes/devframe/pulse
https://github.com/devframes/devframe
New issuehttps://github.com/login?return_to=https://github.com/devframes/devframe/issues/347
New issuehttps://github.com/login?return_to=https://github.com/devframes/devframe/issues/347
#349https://github.com/devframes/devframe/pull/349
feat(hub): let buildHub bake an already-assembled context (reuse in Vite DevTools)https://github.com/devframes/devframe/issues/347#top
#349https://github.com/devframes/devframe/pull/349
https://github.com/antfubot
antfubothttps://github.com/antfubot
on Sep 3, 2026https://github.com/devframes/devframe/issues/347#issue-5336677022
#339https://github.com/devframes/devframe/pull/339
feat(hub): static hub builds with buildHub #339https://github.com/devframes/devframe/pull/339
feat(hub): static hub builds with buildHub #339https://github.com/devframes/devframe/pull/339
antfuhttps://github.com/antfu
completedhttps://github.com/devframes/devframe/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#349https://github.com/devframes/devframe/pull/349
on Sep 4, 2026https://github.com/devframes/devframe/issues/347#event-30527681916
Sign up for freehttps://github.com/signup?return_to=https://github.com/devframes/devframe/issues/347
Sign in to commenthttps://github.com/login?return_to=https://github.com/devframes/devframe/issues/347
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.