From 5eec11075d70eb61a5782f760519269e79b48855 Mon Sep 17 00:00:00 2001 From: Maxwell Frank Date: Tue, 16 Jan 2024 22:31:03 +0000 Subject: [PATCH] docs: update readme docs: update readme docs: update readme --- README.rst | 9 ++++++--- src/example/example.env.config.js | 31 ------------------------------- 2 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 src/example/example.env.config.js diff --git a/README.rst b/README.rst index 99f44825..9089aa28 100644 --- a/README.rst +++ b/README.rst @@ -35,9 +35,10 @@ Micro-frontend configuration document (JS) ------------------------------------------ Micro-frontends that would like to use the Plugin Framework need to be configured via a JavaScript configuration -document and a ``pluginSlots`` config. Technically, only the Host MFE would require an ``env.config.js`` file with a ``pluginSlots`` config. -Keep in mind that since any Child MFE can theoretically also contain its own ``PluginSlot``, it will eventually need its own -JavaScript configuration. +document and a ``pluginSlots`` config. Technically, only the Host MFE requires an ``env.config.js`` file with a ``pluginSlots`` config. +However, note that any Child MFE can theoretically contain one or more ``PluginSlot`` component, thereby making it both a Child MFE and a Host MFE. +In this instance, it would have its own JavaScript file to configure the ``PluginSlot`` component(s). +For more information on how JS based configuration works, see the `config.js`_ file in frontend-platform. .. code-block:: @@ -56,6 +57,8 @@ JavaScript configuration. } } +.. _config.js: https://github.com/openedx/frontend-platform/blob/556424ee073e0629d7331046bbd7714d0d241f43/src/config.js + Host Micro-frontend (JSX) ------------------------- diff --git a/src/example/example.env.config.js b/src/example/example.env.config.js deleted file mode 100644 index ef38106f..00000000 --- a/src/example/example.env.config.js +++ /dev/null @@ -1,31 +0,0 @@ -/* -The Frontend Plugin Framework uses the env.config.js file to extract the layout configuration for the plugins. - -The PluginSlot will find the configuration by the provided ID which matches a key inside the `pluginSlots` object - -Note: having both .env and env.config.js files will follow a predictable order, in which non-empty values in the -JS-based config will overwrite the .env environment variables. - -frontend-platform's getConfig loads configuration in the following sequence: -- .env file config -- optional handlers (commonly used to merge MFE-specific config in via additional process.env variables) -- env.config.js file config -- runtime config -*/ - -/** TODO: Examples still need to be set up as part of APER-3042 https://2u-internal.atlassian.net/browse/APER-3042 */ - -// module.exports = { -// pluginSlots: { -// example_plugin_slot: { -// keepDefault: false, -// plugins: [ -// { -// id: 'example_plugin', -// type: 'IFRAME_PLUGIN', -// url: 'http://localhost:{PORT}/{ROUTE}', -// }, -// ], -// }, -// }, -// };