refactor: ablate redundant abstractions across packages - #352
Conversation
◈ PR Lens
Architecture 18 components touched across 7 lanes. Inside the changed components — 3 viewsComponent view — Devframe Settings Store Consolidation Consolidates client and node settings persistence on top of a shared createSettingsStore abstraction over reactive shared state. Component view — Git Plugin UI Cleanup Retires unreferenced branch and diff panel views and the unused shiki syntax highlighter dependency from the Git devframe. Component view — JSON Render UI Entry Point Cleanup Removes the root source barrel export to enforce subpath imports and cleans up the unused createRenderer factory helper. Data flow
Drill down
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Remove duplicated and vestigial internal design surfaced by a full ablation study, with no change to runtime behaviour and no change to any shipped public entry point (only internal machinery and unpublished source removed). - plugins: drop 12 per-plugin re-creations of `defineRpcFunction` (each was `createDefineWrapperWithContext<DevframeNodeContext>()`, identical to the pre-bound export from `devframe`); import the core wrapper directly instead - plugins: collapse single-consumer `connectAssets`/`connectOg`/ `connectCodeServer`/`connectInspect` SPA pass-throughs to `connectDevframe` (connect modules stay as type barrels) - plugins/git: delete unrendered `BranchesPanelView`/`DiffPanelView` (+ stories) and the now-unused `shiki` dev dep and `RpcContext` export - plugins/terminals: drop dead `snapshot: true` (the plugin sets `capabilities.build: false`, so the snapshot dump never runs) - devframe: drop the always-`false` `unwrapped` field from the internal `argsToJsonSchema`; inline `promiseWithResolver` to native `Promise.withResolvers`; move the test-only `AssertEqual` into its test; extract the byte-identical node/client settings-store body into a shared `createSettingsStore` - hub: delete the dead `logs` script-context prop and two stale docblocks - kits: remove a discarded `createResolver()` call, a self-merging `Object.assign`, and an unreachable `undefined` branch in nuxt; reuse devframe's `normalizeBasePath`/`resolveBasePath` in the next handler; delete json-render-ui's unbuilt (non-exported) barrel + `createRenderer` and prune the dead workspace aliases Created with the help of an agent.
1ba6f5a to
e48cb6a
Compare
What
A full ablation study across every package and built-in devframe, removing duplicated and vestigial internal design. No runtime behaviour changes and no breaking changes — every shipped public entry point is preserved. All removals are dead code, internal single-consumer indirection, byte-identical duplicates collapsed into one implementation, or unpublished source (not in any package's
exports).Verified green end to end:
pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm build.Ablations
Plugins
defineRpcFunction— each wascreateDefineWrapperWithContext<DevframeNodeContext>(), identical to the pre-bound export already shipped fromdevframe. Import the core wrapper directly (matches how terminals/code-server/a11y already do it). Deletesinspect/_define.ts;messages/data-inspector_define.tskeep their real helpers (getMessagesHost,NS). RPC wire names are unchanged.connectAssets/connectOg/connectCodeServer/connectInspectSPA pass-throughs (each justreturn connectDevframe(options)) into directconnectDevframe()calls; theconnectmodules stay as type barrels. (These live in each plugin'sapp/SPA source, not in any published entry.)BranchesPanelView/DiffPanelView(+ their stories — the only consumers), plus the now-orphanedshikidev dependency andRpcContextexport they alone used.snapshot: trueflags — the plugin declarescapabilities.build: false, so the static-build RPC dump that readssnapshotnever runs for it.devframe core (all internal, none exported from an entry point)
argsToJsonSchemareturned{ schema, unwrapped }whereunwrappedwas hard-codedfalseand read by nothing but its own test — return the schema directly.promiseWithResolverto the nativePromise.withResolvers()(already the recommended migration).AssertEqualtype out ofsrc/rpc/utils.tsinto the test that uses it.createSettingsStore(store); the exportedcreateNodeSettings/createClientSettingssignatures are unchanged.hub / hub-ui
logsdock-script-context property (rode in via anas anycast; nothing reads it).serveDevframeAssets.Framework kits
createResolver()call, a self-mergingObject.assign, and an unreachable=== undefinedbranch.normalizeBasePath/resolveBasePathinstead of a localnormalizeBasecopy.src/index.tsbarrel — it was not inpackage.jsonexports(only./hub/./spaship) and was not a tsdown entry, so it was never a published surface — and thecreateRendererhelper only it reached; prune the dead@devframes/json-render-uiand/componentsworkspace aliases and the knip entry that masked them.The one API snapshot delta (
plugin-assets/rpc) is a type-rendering change only:DevframeNodeContextnow prints asimport("devframe").DevframeNodeContextbecause the RPC functions use the rootdefineRpcFunction— the same type, same wire surface.Created with the help of an agent.