...
Proposal | Proposer | Notes |
---|---|---|
Create an Open edX specific UI Plugin Framework in React | Designing and implementing the plugin framework was surprisingly easy, and it’s been working well ever since. I put the design details and code on my blog: Creating a UI Plugin Framework in React 3. If anyone has questions about what I learned from that experience, I’m happy to answer them. But the main point I’d like to make is that it doesn’t have to be complicated, and in my experience it can be done quickly and easily, even for relatively complex applications (I had to support white labelling, runtime config, plugin-defined URLs, theming via plugins, etc.). In fact, if you end up with an approach like I took for that project, rolling it out at first is [almost] as simple as putting | |
Design an approach similar to Docosaurus’s Swizzling mechanism | Another well-known approach to UI plugins is Swizzling 1, used by Docusaurus themes to customize their React UI. It has some overlap with my approach, but some major differences. The ways in which you can modify components are more limited, but you can modify virtually any component without having to declare it as a “slot”. | |
Extend a POC developed by David Joy (Deactivated) at 2U that provides iframe based “slots” for frontend customization | I’ll add that another existing PR that was started by @djoy and that I’m working to finish is for enabling a React-based iFrame plugin that lives in openedx/frontend-platform. In terms of its abilities, it allows for:
As for the PR, what’s left is:
| |
Build-time module replacement using Webpacks’s NormalModuleReplacementPlugin | We are currently exploring the use of NPM overrides and additional Webpack scripting. These could be integrated into the Last month, we initiated an internal discovery with the following objectives:
We’ve developed a Proof of Concept (POC) using Webpack’s | |
Consider an approach similar to backstage’s | I’m including for completeness. There are a number of things that I don’t like about how Backstage does plugins. For example, you need to directly alter source of platform pages to include plugins in base pages. However, they have optimized dev tooling to support a vibrant ecosystem of plugins. https://john-tucker.medium.com/backstage-plugins-by-example-part-1-a4737e21d256 https://john-tucker.medium.com/backstage-plugins-by-example-part-2-6ead20cb4c8d | |
Leverage the Piral framework | Slides: https://docs.google.com/presentation/d/14ZkIqYnc5EOSPujxylSfi7W5eJWXaguD-3ECLlURoKA/edit You may (or may not) have heard of Piral, and how we’re trying to leverage it for the Open edX frontend. And while Piral need not concern itself with in-page customization - this can be achieved completely independently of it - it does provide mechanisms that can be used to achieve pluggability as well. Mechanism 1: Extensions
Pros
Cons
Mechanism 2: EventsPiral provides a simple but flexible event system. It would be a simple matter for custom MFEs/pilets/extensions to listen to and react to known events emitted by any other MFE/pilet/extension. Pros
Cons
| |
...