Migrate content renderer mixin to composable, and require it to be explicitly consumed #12744
Labels
DEV: frontend
DEV: renderers
HTML5 apps, videos, exercises, etc.
TAG: dev experience
Build performance, linting, debugging...
Milestone
Observed behavior
Currently all Kolibri content renderers use the contentRendererMixin - although this is implicitly added after the component is loaded by the pluginMediator code.
While this works it has all the disadvantages of lack of explicitness that mixins have, combined with the fact that the mixin isn't even explicitly imported into the component code.
Expected behavior
The existing contentRendererMixin should be converted into a composable function as the default export of the module, and a named props export which can be reused to define common props across different renderer components. This module should be exposed as part of the kolibri package.
To provide backwards compatibility, the current pluginMediator mixin functionality should be updated to check whether a renderer component has a setup function, and if it does not, to inject a setup function and props into the component that replicates the previous mixin functionality.
User-facing consequences
None - this is a developer experience only change.
The text was updated successfully, but these errors were encountered: