Skip to content

Commit 95646dd

Browse files
sarinaormsbeepdpinch
committed
temp: Apply suggestions from code review
Co-authored-by: David Ormsbee <dave@axim.org> Co-authored-by: Peter Pinch <pdpinch+github@hawklake.com>
1 parent 8e16795 commit 95646dd

3 files changed

Lines changed: 12 additions & 50 deletions

File tree

source/developers/concepts/about_xblock_asides.rst

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ same way.
5252

5353
Asides solve this by externalizing the enhancement. The host XBlock is not
5454
modified. The same aside can apply to a Video block, a Problem block, or any
55-
other block type, by overriding a single classmethod. Course authors keep
56-
control over whether the enhancement is active for a given block, because
57-
asides expose their own scoped fields. The enhancement travels with the
58-
course in OLX export and import.
55+
other block type, by overriding a single classmethod. Asides can serialize
56+
their own scoped fields during course import and export.
5957

6058
Reach for an aside when all of the following are true:
6159

@@ -70,9 +68,6 @@ Reach for an aside when all of the following are true:
7068
Reach for something else when:
7169

7270
* You are creating a brand new piece of course content. Write an XBlock.
73-
* You need to change a behavior that is internal to a single block type and
74-
not visible in any view. Consider a runtime service or a filter from the
75-
Hooks Extension Framework.
7671
* You only need to react to platform events. Consider an Open edX event
7772
receiver.
7873

@@ -83,15 +78,6 @@ The runtime maintains a many-to-many relationship between asides and host
8378
blocks at runtime, but each aside instance is bound to exactly one host block
8479
during a single render. The relationship is established in three stages.
8580

86-
Discovery
87-
=========
88-
89-
When the runtime renders an XBlock view, it asks the runtime for the set of
90-
applicable aside types. The default runtime returns every aside class
91-
registered through the ``xblock_asides.v1`` entry point. A runtime may
92-
override this to filter the set further, for example based on the current
93-
user or the course.
94-
9581
Per-Block Filtering
9682
===================
9783

@@ -152,7 +138,7 @@ means an aside-enhanced course is portable, with limitations described below.
152138
Real-World Examples
153139
*******************
154140

155-
Three implementations in the wild illustrate the range of what asides can
141+
Two implementations in the wild illustrate the range of what asides can
156142
do.
157143

158144
Rapid Response XBlock
@@ -176,16 +162,6 @@ or a problem's siblings. A single aside class, registered as one entry
176162
point, handles both block types and uses ``should_apply_to_block`` to gate
177163
on a course-level waffle flag and per-course settings.
178164

179-
Thumbs Sample Aside
180-
===================
181-
182-
The `xblock-sdk`_ repository contains a ``ThumbsAside`` class in
183-
``sample_xblocks/thumbs/thumbs.py``. It is **not functional** and is not
184-
registered through any entry point. The class comment in the source notes:
185-
"Asides aren't ready yet, so this is currently not being installed in
186-
setup.py." It exists as a syntactic example of the decorator pattern, not
187-
as a working aside. Treat it as illustrative only.
188-
189165
Limitations
190166
***********
191167

@@ -199,7 +175,7 @@ No Authoring Story in the Course Authoring MFE
199175
==============================================
200176

201177
The Studio author view for an aside is rendered by the legacy course
202-
authoring frontend. The current Course Authoring micro-frontend has no
178+
authoring frontend. The current Authoring micro-frontend has no
203179
defined location to display aside author UI. If your project depends on the
204180
new MFE for authoring, plan to render the aside's author UI through a
205181
different mechanism, or accept that authors will use the legacy Studio for
@@ -237,12 +213,12 @@ Documentation Has Historically Been Sparse
237213
==========================================
238214

239215
XBlock Asides have been part of the platform for years but have had no
240-
user-facing documentation until this set of articles. The original work was
241-
done by Dave Ormsbee. Most of the institutional knowledge has lived in
242-
docstrings, test code, and the implementations of a handful of asides
243-
maintained outside the core platform. If you find this documentation lacks
244-
detail your project needs, the test file at ``xblock/test/test_asides.py``
245-
in the XBlock repository is the most reliable source of behavioral truth.
216+
user-facing documentation until this set of articles. Most of the institutional
217+
knowledge has lived in docstrings, test code, and the implementations of a
218+
handful of asides maintained outside the core platform. If you find this
219+
documentation lacks detail your project needs, the test file at
220+
``xblock/test/test_asides.py`` in the XBlock repository is the most reliable
221+
source of behavioral truth.
246222

247223
Where to Go Next
248224
****************
@@ -253,7 +229,7 @@ and want a step-by-step recipe, read :ref:`Add an XBlock Aside`. For the
253229
complete list of classes, decorators, methods, and entry points, consult
254230
:ref:`XBlock Asides Reference`.
255231

256-
.. _rapid-response-xblock: https://github.com/mitodl/rapid-response-xblock
232+
.. _rapid-response-xblock: https://github.com/mitodl/open-edx-plugins/tree/main/src/rapid_response_xblock
257233
.. _ol-openedx-chat: https://github.com/mitodl/open-edx-plugins/tree/main/src/ol_openedx_chat
258234
.. _xblock-sdk: https://github.com/openedx/xblock-sdk
259235

source/developers/how-tos/add-an-xblock-aside.rst

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Add an XBlock Aside
66

77
.. tags:: developer, how-to
88

9-
Add an XBlock aside to attach behavior, UI, or stored data to one or more
9+
Add an XBlock Aside to attach behavior, UI, or stored data to one or more
1010
existing XBlock types without modifying those XBlocks. Use this recipe
1111
when you want a single, installable Python package that decorates the
1212
views of XBlocks in your platform.
@@ -227,16 +227,6 @@ Tutor:
227227
tutor mounts add /path/to/feedback_badge_aside
228228
tutor dev launch
229229
230-
Or, if you are managing the environment manually:
231-
232-
.. code-block:: bash
233-
234-
pip install -e /path/to/feedback_badge_aside
235-
236-
After installing, restart both the LMS and Studio. Asides are discovered
237-
at process start, so newly installed asides do not appear until the
238-
services restart.
239-
240230
Step 8: Enable asides in the LMS
241231
********************************
242232

@@ -293,7 +283,6 @@ If the aside does not appear:
293283

294284
#. Check that ``should_apply_to_block`` returns ``True`` for the block
295285
you are testing.
296-
#. Check that the aside is allowlisted for the course.
297286
#. Check the LMS and Studio logs for any exceptions raised inside your
298287
aside view.
299288

source/developers/quickstarts/quickstart_xblock_aside.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ If the banner does not appear, work through these checks in order:
186186
The list should include ``hello_aside``. If it does not, the entry
187187
point is not installed; recheck Step 3 and Step 4.
188188

189-
#. **The aside is allowlisted.** Confirm Step 5 was applied to the
190-
course you are viewing.
191-
192189
#. **The block type matches.** Your test block must have
193190
``category == "problem"``. A Video block, an HTML block, or a
194191
Discussion block will not trigger the aside.

0 commit comments

Comments
 (0)