-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[app] Imporove federated module core #405
Conversation
89606a3
to
67ba10a
Compare
67ba10a
to
8c287d5
Compare
* @param scope the module scope. In kobs it's usually the plugin name: e.g. 'kiali' | ||
* @param module the name of the module entry point. e.g. './Page' | ||
* @returns the module component or method | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some documentation. In a later PR, I'll try to type this with generics so that we can get rid of any
.
} | ||
|
||
if (failed) { | ||
if (isFailed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've re-ordered the cases so that the error case always apprears first.
* Note: the version can't be changed during runtime. | ||
* @returns the status of the script/module | ||
*/ | ||
export const useDynamicScript = (name: string, version: string): ScriptStatus => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've separated the Kobs business logic and the script loading into two functions. Should make it easier to re-use it later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @marwonline and thanks for your contribution.
I tested your changes locally and everything works as expected 🙂
Small refactoring of the module federation handling which is used to load/handle/initialize plugins