Repository navigation
refactor(renderer): remove the web-runtime-session barrel - #27967
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This is a refactor that changes import paths only. No user-visible behavior change is expected, and no concrete merge-blocking risk was identified. Pre-merge checks |
|
…t into main (stablyai#27967) removed the runtime/web-runtime-session barrel, so these mocks stubbed a module nothing imports. Mock web-runtime-terminal-actions, web-runtime-session-environment and web-runtime-session-tab-move instead, as main's own tests now do.
…t into main (stablyai#27967) removed the runtime/web-runtime-session barrel, so these mocks stubbed a module nothing imports. Mock web-runtime-terminal-actions, web-runtime-session-environment and web-runtime-session-tab-move instead, as main's own tests now do.
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
…n-tabs-sync modules Why: upstream removed both barrels (stablyai#27967, stablyai#27969).
ELI5
src/renderer/src/runtime/web-runtime-session.tscontained no code of its own. It re-exported about 25 functions and types from a dozen other files. This PR points every importer at the file that defines what it uses, and deletes the forwarding file.What Changed
Users see no difference.
web-runtime-terminal-creation,web-runtime-session-tab-lifecycle,web-runtime-terminal-actions,web-runtime-session-environmentandweb-terminal-surface-id. That includes the five lazyimport()calls in the store, which now load only the module they need.vi.mock('@/runtime/web-runtime-session', …)is split into one mock per defining module, with the same mocked values. The fiveimportOriginalmocks that replacedcreateWebRuntimeSessionTerminalnow mockweb-runtime-terminal-creation. The floating-panel test helper has one factory per module.web-runtime-terminal-creation,web-runtime-session-tab-lifecycle), and its contract test was updated to match.Net: production −57 (+73/−130), tests +192 (+370/−178; the split mocks).
Why
AGENTS.md and the Phase 3.99 design rule out barrels. They hide which module a file really depends on, and they make a mock of "the session" silently cover a dozen modules. With direct imports, each test mocks exactly the module the code under test calls. This is one of the six barrel PRs (3.5a–f), done one barrel per PR.
Linked Issue
N/A, internal Phase 3.99 cleanup (PR 3.5a).
Visual Proof
N/A, no UI or behaviour change.
Testing
No import, mock,
import()or re-export ofruntime/web-runtime-sessionremains insrc tests mobile config .github(@ts-nocheckfiles included). The unrelatedweb/preload-api/web-runtime-session.tsis untouched.pnpm test src/renderer tests/e2e: 4836 files, 41635 tests pass. The 6 local failures need things this machine lacks (the cloud relay'spgpackage, and builds of old refs for the cross-version wire tests) and are unrelated to this change.pnpm tc,pnpm lint,pnpm run check:code-quality:changed(0 findings),build:electron-vite,build:web-from-renderer, and the PR e2e routing contract tests pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
P0/P1 review: my own review plus an independent reviewer.
Agent skill upstream boundary
Notes
Renderer-only import changes, with no runtime behaviour change. The lazy imports keep their lazy loading. SSH, wire, mobile and platforms are not affected.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)