-
Notifications
You must be signed in to change notification settings - Fork 224
Description
Proposal Date
2024-01-31
Target Ticket Acceptance Date
2024-02-09
Earliest Open edX Named Release Without This Functionality
Redwood - 2024-04
Rationale
The implementations of the XBlock and XBlockAside classes are chopped into about a dozen tiny mixins. This was done many years ago, probably for some mix of reasons including code organization and theoretical reusability. Now, in 2024 in the openedx GitHub org, there are uses of the XBlock, XBlockAside, and XBlockMixin classes, but we do not see uses of any of the other classes or mixins (other than one extraneous reference to HandlersMixin in edx-platform, which can be removed).
Unfortunately, these mixins make it harder/impossible to write robust type constraints for XBlock and XBlockAside. They also make it harder to find code in the XBlock package. See discussion.
Removal
In an upcoming XBlock 2.0.0 release...
- Removed: class
xblock.core.SharedBlockBase. - Removed: module
xblock.mixins, including...- these classes, collapsed into
xblock.core.Blocklike:xblock.mixins.RuntimeServicesMixinxblock.mixins.ScopedStorageMixinxblock.mixins.IndexInfoMixinxblock.mixins.XmlSerializationMixinxblock.mixins.HandlersMixin
- these classes, collapsed into
xblock.core.XBlock:xblock.mixins.ChildrenModelMetaclassxblock.mixins.HierarchyMixinxblock.mixins.ViewsMixin
- these classes, collapsed into
- New: class
xblock.core.Blocklike, serving as a shared base forxblock.core.XBlockMixin,xblock.core.XBlock, andxblock.core.XBlockAsidse. - No functional changes to
xblock.plugin.Plugin,xblock.core.XBlockandxblock.core.XBlockAside. - Backwards-compatible enhancements to
xblock.core.XBlockMixininclude the functionality of these former classes:xblock.mixins.IndexInfoMixinxblock.mixins.XmlSerializationMixinxblock.mixins.HandlersMixin
The resulting class hierarchy will look like this:
# xblock/plugin.py:
class Plugin:
... # No changes.
# xblock/core.py:
class Blocklike:
... # Collapse in: RuntimeServicesMixin, ScopedStorageMixin, XmlSerializationMixin, HandlersMixin, IndexInfoMixin
class XBlockMixin(Blocklike):
... # No changes (but XmlSerializationMixin, HandlersMixin, and IndexInfoMixin have been added via Blocklike).
class XBlockAside(Blocklike, Plugin):
... # No changes.
class XBlock(Blocklike, Plugin):
... # Collapse in: HierarchyMixin, ViewMixinReplacement
See "Removal"
Deprecation
No plan.
Migration
See "Removal"
Additional Info
No response
Task List
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status