Skip to content

perf(deps): shrink the install footprint - #392

Merged
antfu merged 6 commits into
mainfrom
deps/trim-install-footprint
Sep 15, 2026
Merged

antfu merged 6 commits into
mainfrom
deps/trim-install-footprint

Conversation

@antfubot

@antfubot antfubot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

What

Trims what a consumer installs when pulling devframe / @devframes/* packages, without bundling anything that should stay a shared or externally-resolved dependency. Bundle intent is expressed purely through dependencies (external) vs devDependencies (bundled) — no tsdown onlyBundle whitelists.

ufo is gone

New in-house devframe/utils/url module (browser-safe, zero-dep) covers the handful of helpers we actually used — joinURL, withBase, withProtocol, withLeadingSlash/withoutLeadingSlash, withTrailingSlash/withoutTrailingSlash, cleanDoubleSlashes — with unit tests and a Utilities Reference entry. ufo is removed from every package and the pnpm catalog.

Shared types & utils via the devframe peer

Integrations reuse these through the devframe peer instead of taking their own dependency:

  • devframe/utils/debounce — devframe bundles perfect-debounce and re-exports it (browser-safe). @devframes/hub and @devframes/plugin-assets import it here instead of declaring their own perfect-debounce.
  • devframe/utils/simple-schema re-exports the StandardSchemaV1 contract type. @standard-schema/spec stays a types-only devDependency inside devframe (declarations inlined into its .d.mts); consumers name the type through the peer.
  • devframe/utils/nostics re-exports nostics plus a DevframeDiagnostics helper type. nostics stays a real (external) devframe dependency — not inlined — so integrations reference diagnostics types through the peer.

@devframes/json-render now names both StandardSchemaV1 and DevframeDiagnostics through devframe, so its public .d.mts references devframe/utils/simple-schema / devframe/utils/nostics (no inlined nostics, no @standard-schema/spec), and @standard-schema/spec is dropped from its package.json.

What's bundled vs external

package bundled (devDependencies)
devframe birpc, mrmime, perfect-debounce (also exposed as devframe/utils/debounce), @standard-schema/spec (types only)

nostics, pathe, tinyexec, and h3 are not bundled — they stay real, externally-resolved dependencies — and the plugins (@devframes/plugin-assets, @devframes/plugin-git) keep all of their deps external.

Runtime dependencies after this change:

package dependencies
devframe crossws, h3, nostics, pathe
@devframes/hub destr, h3, pathe, tinyexec, zigpty
@devframes/agentic MCP SDK (client/server), h3, pathe
@devframes/json-render @json-render/core, zod

Incidental

The throwing root entries (@devframes/agentic, @devframes/vite, @devframes/next, @devframes/nuxt) get an explicit export {} so the dts emitter stops warning about script-mode files. mlly is dropped from @devframes/hub (unused after the 0.10 API removal on main).

Verification

  • pnpm lint && pnpm knip && pnpm typecheck && pnpm build all pass (build 28/28); full vitest suite (1547 tests) passes, including the tsnapi API snapshots.
  • pnpm test:runtime smoke passes.
  • Audited every dist: dependencies appear only as external import specifiers, devDependencies are bundled with no specifier left behind; devframe/utils/{debounce,simple-schema,nostics} are bundled once in devframe and referenced externally by hub/json-render/plugin-assets.

Created with the help of an agent.

- add devframe/utils/url, an in-house, browser-safe replacement for the
  handful of ufo helpers (joinURL, withBase, withProtocol, slash helpers,
  cleanDoubleSlashes); ufo is gone from every package and the catalog
- move the types-only @standard-schema/spec to devDependencies everywhere
  and inline its declarations into each package's dts
- bundle the remaining tiny pure deps instead of installing them:
  birpc, mrmime, nostics, pathe (devframe); pathe, perfect-debounce,
  tinyexec (hub); pathe (agentic, vite kit, service-open, plugin-git);
  image-meta, pathe, perfect-debounce, tinyglobby (plugin-assets)
- give the throwing root entries an explicit 'export {}' so dts emit
  stops warning about them

devframe's runtime deps shrink to crossws + h3; hub's to destr + h3 +
zigpty; every dist stays self-contained (verified: no bundled-package
import specifiers survive in dist).
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 15, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +2 new · 🟠 ~12 changed · 🔴 -0 removed · 0 flows · 36 files · commit be4fe8d


Architecture

Architecture diagram for devframes/devframe at be4fe8d

14 components touched across 8 lanes.

Open the interactive canvas


Inside the changed components — 2 views

Component view — Devframe Core Utilities

Internal modules of the devframe package providing zero-dep URL manipulation and debounced storage.

Architecture view of Component view — Devframe Core Utilities in devframes/devframe

Component view — Hub & Consumer Packages

Hub orchestration and consumer plugins consuming the shared URL, debounce, and schema helpers.

Architecture view of Component view — Hub & Consumer Packages in devframes/devframe

Data flow

No data-flow sequence changed in this PR.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail

Tip

Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds.

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists.
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through.
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change.
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time.
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time.
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs on every push.
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works.
  • Push a commit and the comment redraws for the new head. A slow older run never overwrites a newer one.
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion.

Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
devframe Ready Ready Preview Sep 15, 2026 2:33am UTC

…ugin deps

Reverts the bundling of nostics + pathe (devframe), pathe + tinyexec
(hub), and pathe (agentic, vite kit, service-open) back to real
dependencies. Fully reverts the plugin deps inlining: @devframes/plugin-assets
(image-meta, pathe, perfect-debounce, tinyglobby) and @devframes/plugin-git
(pathe) return to dependencies with no tsdown deps whitelist.

Still bundled: birpc + mrmime (devframe), perfect-debounce (hub), and the
types-only @standard-schema/spec declarations. json-render keeps nostics as
a dts-only inlined type (matches main; no install-footprint impact).
…ounce

New browser-safe util re-exports perfect-debounce's debounce (bundled into
devframe's dist). @devframes/hub and @devframes/plugin-assets now import it
through the devframe peer instead of declaring their own perfect-debounce
dependency, so the bytes live once and integrations reuse it with no new
install. perfect-debounce is now declared only by devframe.
… devframe peer

tsdown's default deps/devDeps split already expresses bundle intent
(dependencies external, devDependencies bundled), so the onlyBundle
whitelists in devframe/hub/json-render are removed.

devframe re-exports the Standard Schema contract type from
devframe/utils/simple-schema and adds a DevframeDiagnostics helper type to
devframe/utils/nostics. @devframes/json-render now names both through the
devframe peer instead of inlining nostics or depending on
@standard-schema/spec: its public dts references devframe/utils/simple-schema
and devframe/utils/nostics, and @standard-schema/spec is dropped from its
package.json. Any integration can reuse both the same way.
@antfu antfu changed the title chore(deps): shrink the install footprint perf(deps): shrink the install footprint Sep 15, 2026
@antfu
antfu merged commit 4f0157c into main Sep 15, 2026
14 checks passed
@antfu
antfu deleted the deps/trim-install-footprint branch September 15, 2026 02:41
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