You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/developers/applications.adoc
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ everything is ready for bootstrapping Hawtio and rendering `<Hawtio>` component.
94
94
There are 3 methods of registering Hawtio plugins:
95
95
96
96
* using `hawtio.addPlugin()`: adds `Plugin` object directly for Hawtio to register
97
-
* using `hawtio.addDeferredPlugin()`: adds a function which returns a Promise resolving to a `Plugin` object asynchronously
97
+
* using `hawtio.addDeferredPlugin()`: adds a function which returns a Promise resolving to a `Plugin` object or an array of `Plugin` objects asynchronously
98
98
* using `hawtio.addUrl()`: adds a URL (relative or absolute - subject to https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS[CORS] restrictions) from which a JSON array of `HawtioRemote` objects is loaded. These objects represent remote modules which Hawtio can load and evaluate using https://www.npmjs.com/package/@module-federation/utilities[Module Federation utilities].
99
99
100
100
=== Registration of custom plugins
@@ -209,6 +209,7 @@ Hawtio plugins (including built-in plugins) may require some internal Hawtio ser
209
209
210
210
All these assumptions impact the way Hawtio code should be structured. Let's review various ways of _registering_ Hawtio plugins.
This code passes an asynchronous function that returns a `Plugin`. We could also return an array of `Plugin` objects
376
+
and Hawtio will register all of them. This is a good way for a plugin (represented by the `registerExample1Deferred` function) to register multiple Hawtio `Plugin` objects.
377
+
374
378
This code is correct with respect to following `hawtio.bootstrap()`:
375
379
376
380
* while the plugin is _evaluated_ asynchronously after `import()` finishes, Hawtio immediately know that there's `example1` plugin registered
377
-
* `hawtio.bootstrap()` may be called immediately after `registerExample1Deferred()` and `bootstrap()` will internally wait for evaluating the deferred plugin
381
+
* `hawtio.bootstrap()` may be called immediately after `registerExample1Deferred()` and `bootstrap()` will internally wait for evaluation of the deferred plugins
378
382
379
383
==== Using plugins with Module Federation
380
384
@@ -413,7 +417,7 @@ _Static_ usage of Module Federation modules involves configuration of `webpack.c
413
417
414
418
https://github.com/hawtio/hawtio-next/tree/main/app[Hawtio React application] provides fully working example, but let's present the required configuration here. All JSON configuration is part of this object in Webpack configuration file:
This is the _consuming_ part. This declaration should have a related counterpart in actual remote location, which is another `webpack.config.js` for a _remote container of remotely exposed modules_. The configuration of the _remote_ part looks like this:
442
446
443
-
[source,json]
447
+
[source,javascript]
444
448
----
445
449
name: 'app',
446
450
filename: 'remoteEntry.js',
@@ -488,7 +492,7 @@ These two module identifiers (`static-remotes/remote1` and `static-remotes/remot
488
492
489
493
To make life easier, we can tell IDE that these _special_ module locations are actually some real code locations. We can use this `tsconfig.json` configuration:
0 commit comments