From 25210117c0a8634a39c03cddb412f46b3da2dde0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 29 Sep 2022 11:44:28 +0200 Subject: [PATCH] filter out dependent module (do not activate them on load) --- apps/remix-ide/src/remixAppManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 76fbaae663..0eac9055ff 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -14,7 +14,7 @@ const requiredModules = [ // services + layout views + system views 'compileAndRun', 'search', 'recorder', 'fileDecorator', 'codeParser', 'codeFormatter'] // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) -const dependentModules = ['hardhat', 'truffle', 'slither'] +const dependentModules = ['foundry', 'hardhat', 'truffle', 'slither'] const sensitiveCalls = { 'fileManager': ['writeFile', 'copyFile', 'rename', 'copyDir'], @@ -93,7 +93,7 @@ export class RemixAppManager extends PluginManager { } onPluginActivated(plugin) { - this.pluginLoader.set(plugin, this.actives) + this.pluginLoader.set(plugin, this.actives.filter((plugin) => !this.isDependent(plugin))) this.event.emit('activate', plugin) this.emit('activate', plugin) if (!requiredModules.includes(plugin.name)) _paq.push(['trackEvent', 'pluginManager', 'activate', plugin.name]) @@ -110,7 +110,7 @@ export class RemixAppManager extends PluginManager { } onPluginDeactivated(plugin) { - this.pluginLoader.set(plugin, this.actives) + this.pluginLoader.set(plugin, this.actives.filter((plugin) => !this.isDependent(plugin))) this.event.emit('deactivate', plugin) _paq.push(['trackEvent', 'pluginManager', 'deactivate', plugin.name]) }