Closed kdmccormick closed 6 months ago
@ormsbee
Can you manually invoke the decorator on Blocklike after it's defined? I haven't done something like this in ages, but I think it'd be something like this?
Good idea. That bit of backwards incompatibility was making me a little nervous, so I'm glad to smooth it out. The syntax ended up being:
Blocklike.needs('field-data')(Blocklike)
Supporting info
Proposed in this DEPR issue:
excerpt:
The edx-platform upgrade PR is here:
Description
Various extraneous classes have been removed from the XBlock API. We believe that most, if not all, XBlock API users will be unaffected by this change.
Diagram
Generated with
pyreverse
anddot
.Before
After
Change list
xblock.XBlockMixin
(still available asxblock.core.XBlockMixin
)xblock.core.SharedBlockBase
(replaced withxblock.core.Blocklike
)xblock.internal.Nameable
xblock.internal.NamedAttributesMetaclass
xblock.django.request.HeadersDict
xblock.fields.XBlockMixin
(still available asxblock.core.XBlockMixin
)xblock.mixins.RuntimeServicesMixin
xblock.mixins.ScopedStorageMixin
xblock.mixins.IndexInfoMixin
xblock.mixins.XmlSerializationMixin
xblock.mixins.HandlersMixin
xblock.mixins.ChildrenModelMetaclass
xblock.mixins.HierarchyMixin
xblock.mixins.ViewsMixin
xblock.core.Blocklike
, the new common ancestor ofXBlock
andXBlockAside
, andXBlockMixin
, replacingxblock.core.SharedBlockBase
.xblock.core.XBlockAside
, each behaving the same as theirXBlock
counterpart:usage_key
context_key
index_dictionary
xblock.core.XBlockMixin
, encompassing the functionality of these former classes:xblock.mixins.IndexInfoMixin
xblock.mixins.XmlSerializationMixin
xblock.mixins.HandlersMixin
Bumps version from 2.0.0 to 3.0.0.
Testing
Docs
You can preview the doc additions by clicking "Details" on the docs build, hitting "View Docs", and going to the "XBlock API" page).
Homepage: https://docsopenedxorg--718.org.readthedocs.build/projects/xblock/en/718/index.html New XBlockAside generated docs: https://docsopenedxorg--718.org.readthedocs.build/projects/xblock/en/718/xblock.html#xblock.core.XBlockAside
XBlock and XBlockAside attributes
From the root of the repo, you can run this script in order to compare the list of attributes on XBlock/XBlockAside before and after this PR, both for the classes and their instances.
This should yield:
which indicates that:
context_key
,usage_key
andindex_dictionary
attributes