Skip to content

chore(dockview-core): module boundary hardening (removability test + contract extraction)#1324

Merged
mathuo merged 5 commits into
masterfrom
chore/module-boundary-hardening
Jun 12, 2026
Merged

chore(dockview-core): module boundary hardening (removability test + contract extraction)#1324
mathuo merged 5 commits into
masterfrom
chore/module-boundary-hardening

Conversation

@mathuo

@mathuo mathuo commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Two pieces of module-boundary hardening that keep the registered-module system honest and the seams explicit.

1. Removability contract test

With any single module filtered out of the registered set, the core component must still construct, run the base layout ops (add / split / maximize / serialize / remove) and dispose without throwing. Runs once per module + an all-present baseline.

It immediately caught a leak: RootDropTargetModule was hard-wired (non-?.) in the constructor and updateOptions, so removing it crashed. Made the access optional like every other module's and guarded the edge-drop wiring behind the module's presence. Adds a small internal seam to register a module subset (defaults to the full set; not part of the public options surface).

2. Contract extraction

Moved the service + host interfaces for ContextMenu, TabGroupChips and Accessibility out of their implementation files into a single core moduleContracts.ts. Core (the ServiceCollection slots + the host implementation) now references contracts from core, never from the implementation files. Pure type relocation, no behaviour change.

Together these make the module boundary explicit and provably clean: contracts are core, implementations are details that can be relocated without core depending on them.

Tests

1117 total (+12 removability). All green.

mathuo and others added 2 commits June 11, 2026 22:50
Add a removability test: with any single module filtered out of the registered
set, the core component must still construct, run the base layout operations
(add / split / maximize / serialize / remove) and dispose without throwing.
This is the contract that keeps module boundaries honest — if removing a module
breaks core, the boundary is leaking.

It immediately caught one: RootDropTargetModule was hard-wired in the
constructor (this._rootDropTargetService.onWillShowOverlay/onDrop) and in
updateOptions, so removing it crashed. Make the service access optional like
every other module's — guard the edge-drop wiring behind its presence. Adds a
small internal seam to register a module subset (defaults to the full set; not
part of the public options surface).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…om impl)

Relocate the service + host interfaces for ContextMenu, TabGroupChips and
Accessibility out of their implementation files into a single core
`moduleContracts.ts`. Core (the ServiceCollection slots in modules.ts and the
host implementation in dockviewComponent.ts) now references the contracts from
core, never from the implementation files. Each implementation imports its own
contract from core.

Pure type relocation — no behaviour change, all 1117 tests green. This makes
the module boundary explicit: the contract is core, the implementation is a
detail that can be relocated without core depending on it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mathuo mathuo changed the title test(dockview-core): assert every module is independently removable chore(dockview-core): module boundary hardening (removability test + contract extraction) Jun 12, 2026
mathuo and others added 3 commits June 12, 2026 08:18
Relocate IAdvancedDnDHost / IAdvancedDnDService into the core moduleContracts
file, like the other three modules. Core now imports zero types from any of the
four module implementation files — it references only the contracts — so each
module is fully decoupled from core. The service already encapsulates its whole
surface (preview overlay, group drag ghost, overlay-model resolution, onWill*
dispatch), so only the contract moved. No behaviour change; 1117 tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove an unnecessary qualifier from the accessibility / live-region module
doc comments; wording only, no code change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ry-hardening

# Conflicts:
#	packages/dockview-core/src/dockview/accessibilityService.ts
@sonarqubecloud

Copy link
Copy Markdown

@mathuo mathuo merged commit 944e199 into master Jun 12, 2026
9 checks passed
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.

1 participant