Skip to content

Commit

Permalink
add: comments to add clarity on how PLuginSlot knows what plugin URLs…
Browse files Browse the repository at this point in the history
… to use
  • Loading branch information
jsnwesson committed Sep 8, 2023
1 parent f69ff39 commit 8c7d786
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/src/PluginsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function PluginsPage() {
</p>
<div className="d-flex flex-column">
<PluginSlot
id="example"
id="example" // this is how PluginSlot knows which set of plugin URLs to grab from JS config
className="d-flex flex-column"
pluginProps={{
className: 'flex-grow-1',
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/PluginSlot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import PluginContainer from './PluginContainer';
const PluginSlot = forwardRef(({

Check warning on line 11 in src/plugins/PluginSlot.jsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/PluginSlot.jsx#L11

Added line #L11 was not covered by tests
as, id, intl, pluginProps, children, ...props
}, ref) => {

Check warning on line 13 in src/plugins/PluginSlot.jsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/PluginSlot.jsx#L13

Added line #L13 was not covered by tests
/* the plugins below are obtained by the id passed into PluginSlot by the Host MFE. See example/src/PluginsPage.jsx
for an example of how PluginSlot is populated, and example/src/index.jsx for a dummy JS config that holds all plugins
*/
const { plugins, keepDefault } = usePluginSlot(id);

Check warning on line 17 in src/plugins/PluginSlot.jsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/PluginSlot.jsx#L17

Added line #L17 was not covered by tests

const { fallback } = pluginProps;

Check warning on line 19 in src/plugins/PluginSlot.jsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/PluginSlot.jsx#L19

Added line #L19 was not covered by tests
Expand Down

0 comments on commit 8c7d786

Please sign in to comment.