Feature #20097
Allow plugins webpack code to be used
Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin integration
Target version:
Pull request:
Fixed in Releases:
Found in Releases:
Description
At the moment, the only entrypoint for webpack seems to be /webpack. webpack.config.js should also support code coming from plugins.
Using bundler, we can fetch this directory trivially - a dumb heuristic could be to add as an entry point the '/webpack' directory of all gem dependencies that look like "foreman*".
Associated revisions
refs #20097 - use relative path in webpack config
History
#1
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
- Assignee set to Daniel Lobato Garcia
- Pull request https://github.com/theforeman/foreman/pull/4619 added
#2
Updated by The Foreman Bot about 5 years ago
- Pull request https://github.com/theforeman/foreman/pull/4625 added
#3
Updated by Ohad Levy about 5 years ago
- Pull request deleted (
https://github.com/theforeman/foreman/pull/4619)
#4
Updated by Daniel Lobato Garcia about 5 years ago
- Legacy Backlogs Release (now unused) set to 240
#5
Updated by Ohad Levy about 5 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset caa81e6f38f54d3a5be37bb294091b22abc79a53.
#6
Updated by The Foreman Bot about 5 years ago
- Pull request https://github.com/theforeman/foreman/pull/4643 added
fixes #20097 - webpack support for foreman plugins
How to use:
in a plugin, create a directory call webpack
then inside a file called index.js put something like:
```
import React from 'react';
import ReactDOM from 'react-dom';
import Icon from 'foremanReact/common/Icon';
const reactNode = document.querySelector('#content');
if (reactNode) {
ReactDOM.render(
<Icon type='ok' />,
reactNode);
};
```
TODOS:
- support JEST / eslint
- extend the react mounter, so plugins can add more mounting points and
use them.
- update storybook to support plugins too
- make equivalnt of rake test