From 6bf5b7d906e2e193e36fcb5f9ad26376bb6726b3 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Oct 2023 19:36:03 +0700 Subject: [PATCH 1/5] #255: Read plugins manifest from CDN --- electron/core/plugin-manager/execution/facade.js | 5 ++++- plugins/data-plugin/package.json | 2 ++ plugins/inference-plugin/package.json | 2 ++ plugins/model-management-plugin/package.json | 2 ++ plugins/monitoring-plugin/package.json | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/electron/core/plugin-manager/execution/facade.js b/electron/core/plugin-manager/execution/facade.js index c4f62f9951..df75ce731f 100644 --- a/electron/core/plugin-manager/execution/facade.js +++ b/electron/core/plugin-manager/execution/facade.js @@ -65,7 +65,10 @@ export async function getActive() { return; } // eslint-disable-next-line no-undef - const plgList = await window.pluggableElectronIpc.getActive(); + const plgList = await window.pluggableElectronIpc?.getActive() ?? + import( + /* webpackIgnore: true */ PLUGIN_CATALOG + `?t=${Date.now()}` + ).then((data) => data.default.filter((e) => e.supportCloudNative)); return plgList.map( (plugin) => new Plugin( diff --git a/plugins/data-plugin/package.json b/plugins/data-plugin/package.json index a685039b14..0845009c85 100644 --- a/plugins/data-plugin/package.json +++ b/plugins/data-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/cjs/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/data-plugin/index.js", "activationPoints": [ "init" ], diff --git a/plugins/inference-plugin/package.json b/plugins/inference-plugin/package.json index 9d2fbd50b1..30b0c073ab 100644 --- a/plugins/inference-plugin/package.json +++ b/plugins/inference-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/inference-plugin/index.js", "activationPoints": [ "init" ], diff --git a/plugins/model-management-plugin/package.json b/plugins/model-management-plugin/package.json index 21ce35f385..c122456c3e 100644 --- a/plugins/model-management-plugin/package.json +++ b/plugins/model-management-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/model-management-plugin/index.js", "activationPoints": [ "init" ], diff --git a/plugins/monitoring-plugin/package.json b/plugins/monitoring-plugin/package.json index 49f9e4b46d..eb7cf91236 100644 --- a/plugins/monitoring-plugin/package.json +++ b/plugins/monitoring-plugin/package.json @@ -7,6 +7,8 @@ "module": "dist/module.js", "author": "Jan ", "license": "MIT", + "supportCloudNative": true, + "url": "/plugins/monitoring-plugin/index.js", "activationPoints": [ "init" ], From 01f230ef8e963fbf6d0c71472f35fc1214980d58 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Oct 2023 19:45:18 +0700 Subject: [PATCH 2/5] Skip no-undef lint --- electron/core/plugin-manager/execution/facade.js | 1 + 1 file changed, 1 insertion(+) diff --git a/electron/core/plugin-manager/execution/facade.js b/electron/core/plugin-manager/execution/facade.js index df75ce731f..f5abea125e 100644 --- a/electron/core/plugin-manager/execution/facade.js +++ b/electron/core/plugin-manager/execution/facade.js @@ -67,6 +67,7 @@ export async function getActive() { // eslint-disable-next-line no-undef const plgList = await window.pluggableElectronIpc?.getActive() ?? import( + // eslint-disable-next-line no-undef /* webpackIgnore: true */ PLUGIN_CATALOG + `?t=${Date.now()}` ).then((data) => data.default.filter((e) => e.supportCloudNative)); return plgList.map( From 8f586b453bc9373ba8b406da0978633e22cd1988 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Oct 2023 19:50:28 +0700 Subject: [PATCH 3/5] Fix async call --- electron/core/plugin-manager/execution/facade.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron/core/plugin-manager/execution/facade.js b/electron/core/plugin-manager/execution/facade.js index f5abea125e..9924455117 100644 --- a/electron/core/plugin-manager/execution/facade.js +++ b/electron/core/plugin-manager/execution/facade.js @@ -66,7 +66,7 @@ export async function getActive() { } // eslint-disable-next-line no-undef const plgList = await window.pluggableElectronIpc?.getActive() ?? - import( + await import( // eslint-disable-next-line no-undef /* webpackIgnore: true */ PLUGIN_CATALOG + `?t=${Date.now()}` ).then((data) => data.default.filter((e) => e.supportCloudNative)); From e667dd405612efde081a5e46b3e66a05ff844754 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Oct 2023 20:21:56 +0700 Subject: [PATCH 4/5] revert change --- electron/core/plugin-manager/execution/facade.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/electron/core/plugin-manager/execution/facade.js b/electron/core/plugin-manager/execution/facade.js index 9924455117..fca7001afe 100644 --- a/electron/core/plugin-manager/execution/facade.js +++ b/electron/core/plugin-manager/execution/facade.js @@ -65,11 +65,7 @@ export async function getActive() { return; } // eslint-disable-next-line no-undef - const plgList = await window.pluggableElectronIpc?.getActive() ?? - await import( - // eslint-disable-next-line no-undef - /* webpackIgnore: true */ PLUGIN_CATALOG + `?t=${Date.now()}` - ).then((data) => data.default.filter((e) => e.supportCloudNative)); + const plgList = await window.pluggableElectronIpc?.getActive(); return plgList.map( (plugin) => new Plugin( From a61f98c17a7c63519851935437cf4f39fd066a10 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Oct 2023 20:22:33 +0700 Subject: [PATCH 5/5] revert change --- electron/core/plugin-manager/execution/facade.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron/core/plugin-manager/execution/facade.js b/electron/core/plugin-manager/execution/facade.js index fca7001afe..c4f62f9951 100644 --- a/electron/core/plugin-manager/execution/facade.js +++ b/electron/core/plugin-manager/execution/facade.js @@ -65,7 +65,7 @@ export async function getActive() { return; } // eslint-disable-next-line no-undef - const plgList = await window.pluggableElectronIpc?.getActive(); + const plgList = await window.pluggableElectronIpc.getActive(); return plgList.map( (plugin) => new Plugin(