Refactoring XBlock references

Hello :wave:

This is a follow-up to this thread (fortunately, the changes from the current thread are not breaking anything). As mentioned there:

Currently, various terms refer to XBlocks: “xblocks” (or “blocks”), “descriptors”, “modules”, or “items”. This makes the code a lot less approachable and understandable. Since we are getting rid of a lot of tech debt, we are doing a small refactor of this terminology in the edx-platform to make it consistent.

We have just merged the second PR from this effort. This one converts references using item to refer to XBlocks to use block.

:warning: The most significant change affecting you while writing tests is that we renamed the ItemFactory to BlockFactory.

There are also the following changes in methods that are not widely used (you can find the reasoning behind these changes here):

  1. Replaced iterations over displayable_items with self, as this method was returning [self].
  2. Replaced displayable_items with get_children, as the result is identical.
  3. Removed these two (already deprecated) methods, as they were not used outside of the edx-platform.

We have two remaining refactor tickets we’re planning to merge soon:

  1. Rename module to block (needs the final review).
  2. Rename descriptor to block (needs some changes, as we are close to removing the ModuleSystem).

I will update this thread once we merge them to keep the context in one place.

4 Likes

Update: we have merged the second PR: rename module to block :tada:

:warning: If you are using the LTI Consumer XBlock, you should make sure you’re using version 7.3.0 once you pull new changes from the edx-platform repository.

Except for this dependency update, there are no breaking changes.