openedx / XBlock

Framework for building custom learning components that run in the Open edX LMS!
https://docs.openedx.org/projects/xblock/en/latest/xblock-tutorial/index.html
Apache License 2.0
452 stars 217 forks source link

Refactor or deprecate parent-child relationships between XBlocks #729

Open kdmccormick opened 6 months ago

kdmccormick commented 6 months ago

This would be a long-term initiative. It probably belongs on the platform-roadmap.

Context

We have decided that parent-child relationships should only exist at/below the VerticalBlock: https://github.com/openedx/edx-platform/blob/master/docs/decisions/0006-role-of-xblock.rst

We have further discussed that parent-child relationships in their entirety should be removed; I'm not sure if we came to a consensus on that.

TODO -- Add more context ( @ormsbee , @kdmccormick , and @bradenmacdonald ).

Tasks

Off the top of my head...

bradenmacdonald commented 6 months ago

Should parent-child relationships still exist at/below the Vertical block?

Other than the "structural" XBlocks (course, sequential, vertical/unit, etc.), the only blocks I know of with has_children are:

For the other three (conditional, split, LCB), I think they're going to be a blocker for now until we have some kind of Outline concept that can unify and replace them. But what I'd love to do is put in a restriction so that only those three blocks can have children, and attempting to do it for other blocks will raise an error. That way we can prevent people from introducing new dependencies on has_children.