Remove Vuex from core framework, make plugins responsible for store creation
Overview
Complexity: High Target branch: develop
Context
Currently, Vuex is deeply embedded in the core framework:
packages/kolibri/store.jscreates a shared store singleton and exports itpackages/kolibri/index.jscallsVue.use(Vuex)globallypackages/kolibri-app/src/index.js(KolibriApp.setupVue()) assembles plugin state into the shared store viahotUpdate(),replaceState(), andregisterModule(), then passes the store tonew Vue()packages/kolibri/internal/apiSpec.jsexposesvuexas part of the public API for third-party pluginspackages/kolibri/store.jsexportscoreStoreFactoryused by plugin tests
This means plugins cannot own their stores independently — the framework assumes a single shared store and handles all assembly.
The Change
Move Vuex out of core framework responsibility. Plugins that still need Vuex create and own their own stores.
- A
createStoreutility inpackages/kolibri-commoncallsVue.use(Vuex), creates a store from the plugin module definition, and returns it. Plugins include the store in theirRootVuegetter, which gets passed through tonew Vue()naturally. KolibriAppcleaned up:get store(),get pluginModule(), andsetupVue()removedget stateSetters()removed — plugins move async initialization into their root component'ssetup()startRootVue()no longer passes a store tonew Vue()— any store comes throughRootVue
packages/kolibri/store.jsdeleted — no more shared singletonVue.use(Vuex)removed frompackages/kolibri/index.jsvuexremoved frompackages/kolibri/package.jsondependencies, andapiSpec.jsregenerated via linting/formattingcoreStoreFactoryremoved — plugin tests usecreateStorefromkolibri-commonor create their own stores directly
Out of Scope
- Migrating individual plugins off Vuex — this is about removing Vuex from the framework, not from plugin internals
Acceptance Criteria
- [ ]
packages/kolibri/store.jsdeleted — no shared store singleton - [ ]
Vue.use(Vuex)removed frompackages/kolibri/index.js - [ ]
vuexremoved frompackages/kolibri/package.jsondependencies, andapiSpec.jsregenerated via linting/formatting - [ ]
coreStoreFactoryremoved - [ ] Core Vuex module (
kolibri/core/frontend/state/modules/core/) deleted andstore.registerModule('core', coreModule)removed fromkolibri/core/frontend/index.js - [ ]
KolibriApp:get store(),get pluginModule(),get stateSetters(), andsetupVue()removed - [ ]
startRootVue()no longer passes a store tonew Vue() - [ ]
createStoreutility added topackages/kolibri-common - [ ] Existing plugins updated to use
createStore+RootVuepattern - [ ] All existing tests pass — test infrastructure updated as needed, but no changes to behavioural assertions
- [ ] PR includes screenshots of every app landing page demonstrating manual testing
References
packages/kolibri-app/src/index.js— primary target forKolibriAppcleanup
AI usage
This issue was drafted with Claude Code (Opus) based on codebase analysis of how Vuex is integrated into the core framework, as part of the broader Vuex removal tracked in #11722.
Plan: Move Vuex out of the Kolibri core framework so that plugins which still use Vuex create and own their own stores.
- [x]
createStoreutility inkolibri-common - [x] Coach plugin owns its store
- [x] Device plugin owns its store
- [x] Facility plugin owns its store
- [x] Learn plugin owns its store
- [x] Setup wizard plugin owns its store
- [x] User profile plugin owns its store
- [x] Delete the dead Vuex modules in policies, user_auth, and my_downloads
- [x] Strip Vuex out of
KolibriApp - [x] Drop the unused store fixtures from shared-package tests
- [x] Delete the core store singleton, the core Vuex module, and the
vuexcore export - [x] Manual verification with screenshots of every app landing page
@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
All acceptance criteria are complete in #15089.
The plan checklist above is ticked. I can't tick the boxes in the issue body — no write permission on the issue — so status is recorded here.
| Criterion | Where |
|---|---|
packages/kolibri/store.js deleted |
808341749f |
Vue.use(Vuex) removed from packages/kolibri/index.js |
808341749f |
vuex dropped from packages/kolibri/package.json, apiSpec.js regenerated |
808341749f |
coreStoreFactory removed |
808341749f |
Core Vuex module deleted, registerModule('core', …) gone from kolibri/core/frontend/index.js |
808341749f |
KolibriApp: get store(), get pluginModule(), get stateSetters(), setupVue() removed |
740e751d63 |
startRootVue() passes no store to new Vue() |
740e751d63 |
createStore added to kolibri-common |
27f801bd4d |
Six plugins on the createStore + RootVue pattern |
8e306f430a…7f09ce83d1 |
| All tests pass, no behavioural assertions changed | pnpm test-jest green |
| Screenshots of every app landing page | PR body, "Manual verification" |
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.