Remove Vue event bus from plugin mediator
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Complexity: Low Target branch: develop
Context
The plugin mediator (packages/kolibri/internal/pluginMediator.js) uses new Vue() as an event dispatcher. This was built in anticipation of the mediator enabling async inter-plugin communication, but that pattern never materialized. The event system is only used internally for two things:
$once('ready', ...)— to deferkolibriModule.ready()until the mediator is ready$emit('kolibri_register', ...)/on('kolibri_register', ...)— to resolve lazily-loaded content viewers inretrieveContentViewer
No plugin defines events or once getters, and no plugin calls emit(), on(), once(), off(), or stopListening() via the facade. The entire event registration system (_registerMultipleEvents, _registerOneTimeEvents, _callbackRegistry) is dead code.
This blocks Vue 3 migration because $on, $off, and $once are removed from Vue instances in Vue 3.
The Change
Replace new Vue() event dispatcher with simple callbacks/promises for the two internal uses. Remove the dead event registration infrastructure and the unused public event API.
- Replace the
'ready'event with a simple callback or promise pattern - Replace the
'kolibri_register'event inretrieveContentViewerwith a direct callback - Remove
_eventDispatcher,_callbackRegistry,_registerEvents,_registerMultipleEvents,_registerOneTimeEvents,_registerEventListener,_registerRepeatedEventListener,_registerOneTimeEventListener,stopListening - Remove
emit,on,once,offfrom the public facade (publicMethodsarray) - Remove corresponding
emit,stopListeningconvenience methods fromKolibriModule(packages/kolibri-module/src/index.js)
Acceptance Criteria
- [ ]
new Vue()event dispatcher removed from pluginMediator - [ ]
'ready'and'kolibri_register'internal uses replaced with simple callbacks/promises - [ ] Dead event registration infrastructure removed (
_callbackRegistry,_registerEvents,_registerMultipleEvents,_registerOneTimeEvents,_registerEventListener,_registerRepeatedEventListener,_registerOneTimeEventListener,stopListening) - [ ]
emit,on,once,offremoved from public facade - [ ]
emit,stopListeningconvenience methods removed fromKolibriModule - [ ] Mediator tests covering removed event functionality deleted
- [ ] All existing tests pass
- [ ] Manual verification (with screenshots) that application boots and content viewers load correctly
AI usage
This issue was drafted with Claude Code (Opus) based on codebase analysis of Vue 3 migration blockers, identifying the pluginMediator event bus as dead code blocking the migration.
Plan: Replace the new Vue() event dispatcher in pluginMediator.js with simple callbacks/promises, removing all dead event infrastructure and unblocking the Vue 3 migration.
- [ ] Update the test file — remove dead tests, add behavior tests
- [ ] Rewrite
pluginMediator.js - [ ] Remove
emitandstopListeningfromKolibriModule - [ ] /simplify pass
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
- Ran the project's full test suite and linter before committing
- For UI changes: captured live screenshots to verify rendering
- For backend changes: verified with example API/CLI output