11# OpenShift Console Static Plugins
22
33> [ !CAUTION]
4- > The static plugin system is deprecated and is actively being removed. New and existing plugins should
5- > use the [ dynamic plugin system ] ( ../console-dynamic-plugin-sdk/README.md ) instead .
4+ > New console plugins should use the dynamic plugin system as described in
5+ > the [ Console Dynamic Plugins README ] . New static plugins will not be accepted .
66
7- Static plugins become part of the Console application during its webpack build. Their code is maintained
8- as part of the frontend monorepo, built and released as an integral part of Console.
7+ Static plugins become part of the Console application during its webpack build.
8+ Their code is maintained as part of the frontend monorepo, built and released as
9+ an integral part of Console.
910
10- The ` @console/app ` package represents the core application. Static plugins to be automatically included
11- in the build are declared as ` dependencies ` of this package. This can be overridden via ` CONSOLE_PLUGINS `
12- env. variable whose value is a comma separated list of plugin package names.
11+ The ` @console/app ` package represents the core application. Static plugins to be
12+ automatically included in the build are declared as ` dependencies ` of this package.
13+ This can be overridden via ` CONSOLE_PLUGINS ` env. variable whose value is a comma
14+ separated list of plugin package names.
1315
1416For example:
1517
1618``` sh
17- CONSOLE_PLUGINS=dev-console,operator-lifecycle-manager yarn dev
19+ # start a dev server with only `dev-console` and `topology` plugins enabled
20+ CONSOLE_PLUGINS=dev-console,topology yarn dev
1821```
1922
20- starts webpack dev-server with only DevConsole and OLM plugins included in the build.
21-
2223Example project structure:
2324
2425```
@@ -32,8 +33,8 @@ packages/foo-plugin/
3233
3334## ` package.json `
3435
35- ` name ` must include the ` @console ` scope. ` version ` should be ` 0.0.0-fixed ` . Additional plugin metadata
36- is declared via the ` consolePlugin ` object.
36+ ` name ` must include the ` @console ` scope. ` version ` should be ` 0.0.0-fixed ` .
37+ Additional plugin metadata is declared via the [ ` consolePlugin ` object] .
3738
3839``` jsonc
3940{
@@ -42,43 +43,31 @@ is declared via the `consolePlugin` object.
4243 " private" : true ,
4344 // scripts, dependencies, devDependencies, ...
4445 " consolePlugin" : {
45- " entry" : " src/plugin.ts" ,
4646 " exposedModules" : {
4747 " barUtils" : " src/utils/bar.ts"
4848 }
4949 }
5050}
5151```
5252
53- Static plugins can provide both static and dynamic extensions. All paths in the ` consolePlugin ` object
54- are relative to plugin package root directory and expected to reference actual files (including proper
55- file extension).
56-
57- ## Static extensions
58-
59- The ` consolePlugin.entry ` path in ` package.json ` file points to the plugin entry module which exports
60- all of the plugin's static extensions.
53+ Static plugins can provide extensions. All paths in the ` consolePlugin ` object
54+ are relative to plugin package root directory and expected to reference actual
55+ files (including proper file extension). Barrel files (index files which
56+ re-export other modules) are discouraged and not supported.
6157
62- The standard way to reference additional code in static extensions is via ES6 module ` import ` function,
63- which generates a separate [ webpack chunk] ( https://webpack.js.org/guides/code-splitting/ ) to be loaded
64- on demand at runtime.
58+ ## Extensions
6559
66- ## Dynamic extensions
67-
68- Plugin's dynamic extensions are declared via ` console-extensions.json ` file; see the relevant section in
69- [ Console Dynamic Plugins README] ( /frontend/packages/console-dynamic-plugin-sdk/README.md ) for details.
70-
71- When loading static plugins during Console startup, the overall list of plugin's extensions is computed
72- as ` [...staticExtensions, ...dynamicExtensions] ` .
60+ Plugin's extensions are declared via ` console-extensions.json ` file; see the
61+ relevant section in [ Console Dynamic Plugins README] for details.
7362
7463## ` OWNERS `
7564
76- The main purpose of ` OWNERS ` file is to list people responsible for reviewing and approving pull requests
77- related to the given package or project. It also gives us the ability to add labels to pull requests for
78- easier categorization.
65+ The main purpose of ` OWNERS ` file is to list people responsible for reviewing
66+ and approving pull requests related to the given package or project. It also
67+ gives us the ability to add labels to pull requests for easier categorization.
7968
80- Packages maintained by core Console group ( ` packages/console-xxx ` ) usually inherit their reviewer/approver
81- list from root frontend ` OWNERS ` file. Packages maintained by other groups ( ` packages/xxx-plugin ` ) should
69+ Packages maintained by core Console team usually inherit their reviewer/approver
70+ list from root frontend ` OWNERS ` file. Packages maintained by other teams should
8271provide their own list.
8372
8473``` yaml
@@ -92,15 +81,15 @@ labels:
9281 - component/sdk
9382` ` `
9483
95- To add new component label in [Prow CI/CD system](https://github.com/kubernetes/test-infra), open a pull
96- request that modifies
97- [` core-services/prow/02_config/_labels.yaml`](https://github.com/openshift/release/blob/master/core-services/prow/02_config/_labels.yaml)
98- in `openshift/release` repository.
84+ To add new component label in [Prow CI/CD system], open a pull request that modifies
85+ [` core-services/prow/02_config/_labels.yaml`] in `openshift/release` repository.
9986
10087# # Build time constraints and specifics
10188
10289- From webpack perspective, the list of plugins to be included in the build is immutable.
103- - The core application package (`@console/app`) is a static plugin, loaded before any other plugins.
104- - Plugin entry modules are loaded during Console startup. To avoid breaking the overall Console UX :
105- - Additional code should be loaded via the `import` function.
106- - Side effects, such as CSS imports, should be avoided if possible.
90+ - The core application package (`@console/app`) is a static plugin is always loaded first.
91+
92+ [Console Dynamic Plugins README] : /frontend/packages/console-dynamic-plugin-sdk/README.md
93+ [Prow CI/CD system] : https://github.com/kubernetes/test-infra
94+ [`consolePlugin` object] : /frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
95+ [`core-services/prow/02_config/_labels.yaml`] : https://github.com/openshift/release/blob/master/core-services/prow/02_config/_labels.yaml
0 commit comments