openedx / openedx/frontend-plugin-framework

Refactor: make pluginProps unique to each plugin

Open
#72 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Currently, we have a way to pass a pluginProps attribute to the PluginSlot component. This will then pass those props to each Plugin.

While there is value in being able to apply the same props to each Plugin, there are times when we would want to pass unique props to each one. For example, being able to pass a specific class or style to a specific plugin is something we would like to support.

This can probably be accomplished by adding these unique props to the config for that plugin. Currently, however, our PluginContainers (such as PluginContainerIframe) do not account for any additional props being in the config.

We’d like to make sure the current behavior is unaffected — we still want to be able to pass “universal” props to every Plugin.

Acceptance Criteria:
  • Provide a way to pass unique props to each plugin
  • Original functionality is unaffected
  • Document how to use these props in README and wiki page

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the PluginSlot component and src/plugins/PluginContainerIframe.jsx to trace how universal pluginProps and per-plugin config are passed to each Plugin. Review the other PluginContainers for the same limitation, then update the README and wiki with the usage. Done means unique props work per plugin while universal props still apply to all plugins.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation, frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.