Skip to content
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

Load plugins by entrypoint urls if defined #613

Merged

Conversation

1000TurquoisePogs
Copy link
Member

This PR makes use of zowe/zlux-app-server#308 and zowe/zlux-platform#105 to load the correct entrypoint JS file for native plugins.
It is merely an example as this branch does not have the latest v3 code so it will cause code conflict.

@@ -85,7 +85,8 @@ class SimpleAngularComponentFactory extends ComponentFactory {
export class Angular2PluginFactory extends PluginFactory {
private readonly logger: ZLUX.ComponentLogger = BaseLogger;
private static getAngularModuleURL(pluginDefinition: MVDHosting.DesktopPluginDefinition): string {
return ZoweZLUX.uriBroker.pluginResourceUri(pluginDefinition.getBasePlugin(), 'main.js');
let entryPoint = pluginDefinition.getBasePlugin().getWebEntryPoint() || 'main.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended behaviour? When webContent is not present, you set entryPoint to undefined (https://github.com/zowe/zlux-platform/pull/105/files#diff-46e106c34def1f9496bcb38ec7bd10d61c9631a6c8ee643a0ce96fbe6b46a8e0R187) , but this line 88 defaults to 'main.js' regardless then

Copy link
Member Author

@1000TurquoisePogs 1000TurquoisePogs Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if webContent is not present, they have an invalid angular plugin and schema validation will fail it upon startup.

if somehow that passes, it becomes no worse than the prior state: main.js is attempted, a 404 is given, and the window in the desktop is blank. no other failure state seems much better given time investment in the unlikely subject

@@ -28,7 +28,8 @@ export class ReactPluginFactory extends PluginFactory {
private readonly logger: ZLUX.ComponentLogger = BaseLogger;
private static getReactModuleURL(pluginDefinition: MVDHosting.DesktopPluginDefinition): string {
// TODO: clean this up with .d.ts file
return ZoweZLUX.uriBroker.pluginResourceUri(pluginDefinition.getBasePlugin(), 'main.js');
let entryPoint = pluginDefinition.getBasePlugin().getWebEntryPoint() || 'main.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@DivergentEuropeans
Copy link
Member

Also, this PR should probably be part of #614 (or both need to go int oV3 branch eventually)

@1000TurquoisePogs 1000TurquoisePogs changed the base branch from v3.x/staging to feature/v3/new-desktop-with-changes August 27, 2024 19:26
@1000TurquoisePogs 1000TurquoisePogs changed the title Example of how to customize entrypoint urls Load plugins by entrypoint urls if defined Aug 27, 2024
@1000TurquoisePogs 1000TurquoisePogs marked this pull request as ready for review August 27, 2024 19:27
@1000TurquoisePogs 1000TurquoisePogs changed the base branch from feature/v3/new-desktop-with-changes to v3.x/staging August 29, 2024 17:50
@DivergentEuropeans DivergentEuropeans merged commit 04f9425 into v3.x/staging Aug 29, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants