...
A major challenge with the edX platform today is that developers do not have a documented way to add new features to the web or mobile client. Worse still, there is no way to introduce such changes without both modifying the edx-platform code base and then also updating the mobile clients. The only exception is for features that can be purely implemented as XBlocks as they can be installed into the platform with minimal code changes. See See Extending the edX Platform for for the documented ways in which developers can extend the platform today.
This is also a major roadblock to the community providing new features. If they have a contributor has a feature that they want wish to share, then they have to make a pull request against the edX platform. This needs to be carefully reviewed by edX across all of the dimensions that we are concerned with (i18n, accessibility, performance, security, theming, test coverage etc). This is often too high a hurdle for other organizations to want to take on.
...
Adding Features Today
There are four five major ways to introduce a new feature to the edX platform
- Update the platform directlyCohorted CoursewareNew XBlockNew Django app in its own Git repo
- Limitations: PR 6299
- New Django app in edx-platfom repo
- XBlocks can currently only provide courseware components.
- Examples:
- Mentoring XBlock: https://github.com/gsehub/xblock-mentoring
- Update the platform directly
- Limitations:
- The feature now becomes a built-in part of the platform, and must be reviewed as such.
- Examples:
- Cohorted Courseware: PR 6299
- Limitations:
- New Django app in edx-platfom repo
- Limitations:
- The feature must be reviewed to be merged into the platform, and currently most of the static assets cannot live in the app itself
- Note: edX is moving towards having more of the assets live in the app. See: How to add a new feature to LMS or Studio
- Limitations:
- New Django app in its own Git repo
- Limitations:
- The only UX integration available is XBlocks which limits the functionality to courseware components.
- Examples:
- ORA 2: https://github.com/edx/edx-ora2
- edX Notifications: https://github.com/edx/edx-notifications
- Limitations:
- New Independently deployable application (IDA)
- Limitations:
- Most features today need a tighter integration with the edX platform
- Examples:
- edX Analytics Dashboard: https://github.com/edx/edx-analytics-dashboard
- Limitations:
However, for options 1-34, the new capabilities need to be added to hard-coded lists in the platform. For example, there is a list of installed XBlocks, a list of URLs, a list of tab types, a list of reports, a list of instructor dashboard components etc. This seems simple to update, but it means that the platform has to be changed to receive each new feature.
Use Cases
Here is a quick summary of how four recent features were implemented. For more details, see the Appendix: Recent Feature Audit.
...
- Stevedore extension points should be provided for each of the common UX changes that need to be made
- Note: see the Audit below for a comprehensive list
- The first such extension point has been provided by PR implemented:
Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key TNL-2242 - https://github.com/edx/edx-platform/pull/8015
- This allows any Django app to provide new views tabs for a courseThese views are shown as tabs in the current web client
- See Adding a new course tab for details
- Some important first extension points are as follows:
- "Feature flag"
- Note: this will be a ConfigurationModel derivative (which includes a built-in
enabled
column) - We recommend this over using a Django settings feature flag
- It would be useful to allow all associated extensions to obey the feature flag automatically
- Note: this will be a ConfigurationModel derivative (which includes a built-in
- URLs for new UI and REST APIs
- Instructor Dashboard components/tabs
- "Feature flag"
- XBlocks should be extended to provide more capabilities
- Course-scoped fields for configuration settingsfor configuration settings
Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key TNL-1804
- Ability to add an xblock as a course tab
Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key TNL-18042319
- Studio editing tabs for xblocks
Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key TNL-850 Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key TNL-851
- Admin views for both Studio and LMS
- Need built-in support for RequireJS or AMD compliant dependency management
Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key PLAT-481
- Course-scoped fields for configuration settingsfor configuration settings
- The Django asset pipeline needs to be improved
- Have the pipeline pick up assets from all installed Django apps (to support CDNs, minification etc)
A spike was done at the beginning of the quarter: PR 7610: Django extension spike)- A spike was done to prove the approach: PR 7610: Django extension spike
- The work was completed as part of the Teams epic:
Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key TNL-2242
- RequireJS Optimizer support should be added to the LMS
Jira Legacy server JIRA (openedx.atlassian.net) serverId 13fd1930-5608-3aac-a5dd-21b934d3a4b4 key TNL-1322 - See also RequireJS in the LMS
- Have the pipeline pick up assets from all installed Django apps (to support CDNs, minification etc)
- There are some interesting aspects of supporting arbitrary plug-ins
- An order must be established for visual aspects such as tabs. Today the order is implicit in the hard-coded list.
- If in doubt, sort the items alphabetically by name
- How can view page-level plug-ins render the correct page
- For example, how does a new tab render the correct header and footer for itselfthe page that it renders?
- The simplest solution is to document the boilerplate that each plug-in type is required to include
- Miki suggests that maybe we should use inheritance to our benefit here, where the superclass renders the boilerplate
- Eventually we might want to use a mechanism more like XBlock so that a plug-in only owns a block and not the entire page
- Of course, supporting XBlocks themselves should also be supported
- A possible challenge with this is that it is subverting the Django framework
- It needs to be decided how mobile can benefit from these plug-ins
- If they provide new UI as URLs then they won't just drop in to mobile
- XBlocks will just appear, but only by using a web view to render the HTML
- React, a JavaScript library from Facebook, might help with native rendering of HTML
- An order must be established for visual aspects such as tabs. Today the order is implicit in the hard-coded list.
...
The following is an audit of four recent feature features (CCX, Cohorted Courseware, ORA 2 and Student Notes) which enumerates all of the ways in which they extend the platform. The hope is that this gives a fairly representative sample of the types of changes that might need to be pluggable.
...
- PR 7610: Django extension spike
- PR 7937: Add "Teams" tab
- Thoughts on LMS front end architecture
- Adding How to add a feature as a separate Django appnew feature to LMS or Studio
- Adding a new course tab