Commit 105e2b15 authored by LianaHus's avatar LianaHus

using new engine

parent d1dabcb8
This diff is collapsed.
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
"yo-yoify": "^3.7.3" "yo-yoify": "^3.7.3"
}, },
"dependencies": { "dependencies": {
"@remixproject/engine": "^0.2.0", "@remixproject/engine": "^0.2.0-alpha.1",
"http-server": "^0.11.1", "http-server": "^0.11.1",
"remixd": "0.1.8-alpha.10", "remixd": "0.1.8-alpha.10",
"standard": "^8.5.0" "standard": "^8.5.0"
......
...@@ -35,12 +35,14 @@ const DebuggerTab = require('./app/tabs/debugger-tab') ...@@ -35,12 +35,14 @@ const DebuggerTab = require('./app/tabs/debugger-tab')
const TestTab = require('./app/tabs/test-tab') const TestTab = require('./app/tabs/test-tab')
const FilePanel = require('./app/panels/file-panel') const FilePanel = require('./app/panels/file-panel')
const Editor = require('./app/editor/editor') const Editor = require('./app/editor/editor')
const Terminal = require('./app/panels/terminal')
const ContextualListener = require('./app/editor/contextualListener')
import { basicLogo } from './app/ui/svgLogo' import { basicLogo } from './app/ui/svgLogo'
import { RunTab, makeUdapp } from './app/udapp' import { RunTab, makeUdapp } from './app/udapp'
import PanelsResize from './lib/panels-resize' import PanelsResize from './lib/panels-resize'
import { Engine } from '@remixproject/engine'
import { RemixAppManager } from './remixAppManager' import { RemixAppManager } from './remixAppManager'
import { FramingService } from './framingService' import { FramingService } from './framingService'
import { MainView } from './app/panels/main-view' import { MainView } from './app/panels/main-view'
...@@ -229,12 +231,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -229,12 +231,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// APP_MANAGER // APP_MANAGER
const appManager = new RemixAppManager({}) const appManager = new RemixAppManager({})
const engine = new Engine(appManager)
await engine.onload()
const workspace = appManager.pluginLoader.get() const workspace = appManager.pluginLoader.get()
// SERVICES // SERVICES
// ----------------- import content servive ---------------------------- // ----------------- import content servive ------------------------
const contentImport = new CompilerImport() const contentImport = new CompilerImport()
// ----------------- theme servive ---------------------------- // ----------------- theme servive ---------------------------------
const themeModule = new ThemeModule(registry) const themeModule = new ThemeModule(registry)
registry.put({api: themeModule, name: 'themeModule'}) registry.put({api: themeModule, name: 'themeModule'})
themeModule.initTheme(() => { themeModule.initTheme(() => {
...@@ -247,6 +251,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -247,6 +251,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const editor = new Editor({}, themeModule) // wrapper around ace editor const editor = new Editor({}, themeModule) // wrapper around ace editor
registry.put({api: editor, name: 'editor'}) registry.put({api: editor, name: 'editor'})
editor.event.register('requiringToSaveCurrentfile', () => fileManager.saveCurrentFile()) editor.event.register('requiringToSaveCurrentfile', () => fileManager.saveCurrentFile())
// ----------------- fileManager servive ---------------------------- // ----------------- fileManager servive ----------------------------
const fileManager = new FileManager(editor) const fileManager = new FileManager(editor)
registry.put({api: fileManager, name: 'filemanager'}) registry.put({api: fileManager, name: 'filemanager'})
...@@ -254,20 +259,38 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -254,20 +259,38 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const blockchain = new Blockchain(registry.get('config').api) const blockchain = new Blockchain(registry.get('config').api)
const pluginUdapp = new PluginUDapp(blockchain) const pluginUdapp = new PluginUDapp(blockchain)
// ----------------- compilation metadata generation servive ---------------------------- // ----------------- compilation metadata generation servive ---------
const compilerMetadataGenerator = new CompilerMetadata(blockchain, fileManager, registry.get('config').api) const compilerMetadataGenerator = new CompilerMetadata(blockchain, fileManager, registry.get('config').api)
// ----------------- compilation result service (can keep track of compilation results) ---------------------------- // ----------------- compilation result service (can keep track of compilation results) ----------------------------
const compilersArtefacts = new CompilersArtefacts() // store all the compilation results (key represent a compiler name) const compilersArtefacts = new CompilersArtefacts() // store all the compilation results (key represent a compiler name)
registry.put({api: compilersArtefacts, name: 'compilersartefacts'}) registry.put({api: compilersArtefacts, name: 'compilersartefacts'})
const {eventsDecoder, txlistener} = makeUdapp(blockchain, compilersArtefacts, (domEl) => mainview.getTerminal().logHtml(domEl)) // ----------------- network service (resolve network id / name) -----
// ----------------- network service (resolve network id / name) ----------------------------
const networkModule = new NetworkModule(blockchain) const networkModule = new NetworkModule(blockchain)
// ----------------- convert offset to line/column service ---------------------------- // ----------------- convert offset to line/column service -----------
var offsetToLineColumnConverter = new OffsetToLineColumnConverter() const offsetToLineColumnConverter = new OffsetToLineColumnConverter()
registry.put({api: offsetToLineColumnConverter, name: 'offsettolinecolumnconverter'}) registry.put({api: offsetToLineColumnConverter, name: 'offsettolinecolumnconverter'})
appManager.register([ // -------------------Terminal----------------------------------------
const terminal = new Terminal(
{ appManager, blockchain },
{
getPosition: (event) => {
var limitUp = 36
var limitDown = 20
var height = window.innerHeight
var newpos = (event.pageY < limitUp) ? limitUp : event.pageY
newpos = (newpos < height - limitDown) ? newpos : height - limitDown
return height - newpos
}
}
)
makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl))
const contextualListener = new ContextualListener({editor})
engine.register([
contentImport, contentImport,
themeModule, themeModule,
editor, editor,
...@@ -275,15 +298,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -275,15 +298,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
compilerMetadataGenerator, compilerMetadataGenerator,
compilersArtefacts, compilersArtefacts,
networkModule, networkModule,
offsetToLineColumnConverter offsetToLineColumnConverter,
contextualListener,
terminal
]) ])
// LAYOUT & SYSTEM VIEWS // LAYOUT & SYSTEM VIEWS
const appPanel = new MainPanel() const appPanel = new MainPanel()
const mainview = new MainView(editor, appPanel, fileManager, appManager, txlistener, eventsDecoder, blockchain) const mainview = new MainView(contextualListener, editor, appPanel, fileManager, appManager, terminal)
registry.put({ api: mainview, name: 'mainview' }) registry.put({ api: mainview, name: 'mainview' })
appManager.register([ engine.register([
appPanel appPanel
]) ])
...@@ -306,7 +331,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -306,7 +331,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
self._view.sidepanel.appendChild(sidePanel.render()) self._view.sidepanel.appendChild(sidePanel.render())
document.body.appendChild(hiddenPanel.render()) // Hidden Panel is display none, it can be directly on body document.body.appendChild(hiddenPanel.render()) // Hidden Panel is display none, it can be directly on body
appManager.register([ engine.register([
menuicons, menuicons,
landingPage, landingPage,
sidePanel, sidePanel,
...@@ -344,7 +369,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -344,7 +369,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
new Renderer() new Renderer()
) )
appManager.register([ engine.register([
compileTab, compileTab,
run, run,
debug, debug,
...@@ -354,14 +379,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -354,14 +379,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
]) ])
try { try {
appManager.register(await appManager.registeredPlugins()) engine.register(await appManager.registeredPlugins())
} catch (e) { } catch (e) {
console.log('couldn\'t register iframe plugins', e.message) console.log('couldn\'t register iframe plugins', e.message)
} }
await appManager.activate(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'offsetToLineColumnConverter']) await appManager.activate(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'offsetToLineColumnConverter'])
await appManager.activate(['mainPanel']) await appManager.activate(['mainPanel'])
await appManager.activate(['menuicons', 'home', 'sidePanel', 'pluginManager', 'fileExplorers', 'settings']) await appManager.activate(['menuicons', 'home', 'sidePanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'terminal'])
// Set workspace after initial activation // Set workspace after initial activation
if (Array.isArray(workspace)) await appManager.activate(workspace) if (Array.isArray(workspace)) await appManager.activate(workspace)
......
...@@ -88,7 +88,7 @@ class PluginManagerComponent extends ViewPlugin { ...@@ -88,7 +88,7 @@ class PluginManagerComponent extends ViewPlugin {
} }
renderItem (name) { renderItem (name) {
const api = this.appManager.getOne(name) const api = this.appManager.getPlugin(name)
if (!api) return if (!api) return
const isActive = this.appManager.isActive(name) const isActive = this.appManager.isActive(name)
const displayName = (api.profile.displayName) ? api.profile.displayName : name const displayName = (api.profile.displayName) ? api.profile.displayName : name
...@@ -106,11 +106,11 @@ class PluginManagerComponent extends ViewPlugin { ...@@ -106,11 +106,11 @@ class PluginManagerComponent extends ViewPlugin {
const activationButton = isActive const activationButton = isActive
? yo` ? yo`
<button onclick="${_ => this.appManager.deactivateOne(name)}" class="btn btn-secondary btn-sm" data-id="pluginManagerComponentDeactivateButton${name}"> <button onclick="${_ => this.appManager.deactivatePlugin(name)}" class="btn btn-secondary btn-sm" data-id="pluginManagerComponentDeactivateButton${name}">
Deactivate Deactivate
</button>` </button>`
: yo` : yo`
<button onclick="${_ => this.appManager.activateOne(name)}" class="btn btn-success btn-sm" data-id="pluginManagerComponentActivateButton${name}"> <button onclick="${_ => this.appManager.activatePlugin(name)}" class="btn btn-success btn-sm" data-id="pluginManagerComponentActivateButton${name}">
Activate Activate
</button>` </button>`
...@@ -144,7 +144,7 @@ class PluginManagerComponent extends ViewPlugin { ...@@ -144,7 +144,7 @@ class PluginManagerComponent extends ViewPlugin {
const plugin = profile.type === 'iframe' ? new IframePlugin(profile) : new WebsocketPlugin(profile) const plugin = profile.type === 'iframe' ? new IframePlugin(profile) : new WebsocketPlugin(profile)
this.appManager.registerOne(plugin) this.appManager.registerOne(plugin)
this.appManager.activateOne(profile.name) this.appManager.activatePlugin(profile.name)
} catch (err) { } catch (err) {
// TODO : Use an alert to handle this error instead of a console.log // TODO : Use an alert to handle this error instead of a console.log
console.log(`Cannot create Plugin : ${err.message}`) console.log(`Cannot create Plugin : ${err.message}`)
......
...@@ -118,7 +118,7 @@ export class SidePanel extends AbstractPanel { ...@@ -118,7 +118,7 @@ export class SidePanel extends AbstractPanel {
let docLink = '' let docLink = ''
let versionWarning let versionWarning
if (this.active) { if (this.active) {
const { profile } = this.appManager.getOne(this.active) const { profile } = this.appManager.getPlugin(this.active)
name = profile.displayName ? profile.displayName : profile.name name = profile.displayName ? profile.displayName : profile.name
docLink = profile.documentation ? yo`<a href="${profile.documentation}" class="${css.titleInfo}" title="link to documentation" target="_blank"><i aria-hidden="true" class="fas fa-book"></i></a>` : '' docLink = profile.documentation ? yo`<a href="${profile.documentation}" class="${css.titleInfo}" title="link to documentation" target="_blank"><i aria-hidden="true" class="fas fa-book"></i></a>` : ''
if (profile.version && profile.version.match(/\b(\w*alpha\w*)\b/g)) { if (profile.version && profile.version.match(/\b(\w*alpha\w*)\b/g)) {
......
...@@ -9,6 +9,7 @@ const toaster = require('../ui/tooltip') ...@@ -9,6 +9,7 @@ const toaster = require('../ui/tooltip')
const modalDialogCustom = require('../ui/modal-dialog-custom') const modalDialogCustom = require('../ui/modal-dialog-custom')
const helper = require('../../lib/helper.js') const helper = require('../../lib/helper.js')
import { Plugin } from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import { isNative } from '../../remixAppManager.js'
import * as packageJson from '../../../package.json' import * as packageJson from '../../../package.json'
/* /*
...@@ -172,7 +173,7 @@ class FileManager extends Plugin { ...@@ -172,7 +173,7 @@ class FileManager extends Plugin {
toaster.hide() toaster.hide()
} }
if (this.currentRequest) { if (this.currentRequest) {
if (this.currentRequest.isFromNative) { if (isNative(this.currentRequest.from)) {
this._setFileInternal(path, content) this._setFileInternal(path, content)
return return
} }
......
var yo = require('yo-yo') var yo = require('yo-yo')
var EventManager = require('../../lib/events') var EventManager = require('../../lib/events')
var Terminal = require('./terminal')
var globalRegistry = require('../../global/registry') var globalRegistry = require('../../global/registry')
var { TabProxy } = require('./tab-proxy.js') var { TabProxy } = require('./tab-proxy.js')
var ContextualListener = require('../editor/contextualListener')
var ContextView = require('../editor/contextView') var ContextView = require('../editor/contextView')
var csjs = require('csjs-inject') var csjs = require('csjs-inject')
...@@ -20,7 +18,7 @@ var css = csjs` ...@@ -20,7 +18,7 @@ var css = csjs`
` `
export class MainView { export class MainView {
constructor (editor, mainPanel, fileManager, appManager, txListener, eventsDecoder, blockchain) { constructor (contextualListener, editor, mainPanel, fileManager, appManager, terminal) {
var self = this var self = this
self.event = new EventManager() self.event = new EventManager()
self._view = {} self._view = {}
...@@ -29,9 +27,9 @@ export class MainView { ...@@ -29,9 +27,9 @@ export class MainView {
self.editor = editor self.editor = editor
self.fileManager = fileManager self.fileManager = fileManager
self.mainPanel = mainPanel self.mainPanel = mainPanel
self.txListener = txListener self.txListener = globalRegistry.get('txlistener').api
self.eventsDecoder = eventsDecoder self._components.terminal = terminal
self.blockchain = blockchain self._components.contextualListener = contextualListener
this.appManager = appManager this.appManager = appManager
this.init() this.init()
} }
...@@ -88,32 +86,10 @@ export class MainView { ...@@ -88,32 +86,10 @@ export class MainView {
} }
} }
var contextualListener = new ContextualListener({editor: self.editor}) const contextView = new ContextView({contextualListener: self._components.contextualListener, editor: self.editor})
this.appManager.registerOne(contextualListener)
this.appManager.activate('contextualListener')
var contextView = new ContextView({contextualListener, editor: self.editor})
self._components.contextualListener = contextualListener
self._components.contextView = contextView self._components.contextView = contextView
self._components.terminal = new Terminal({
appManager: this.appManager,
eventsDecoder: this.eventsDecoder,
txListener: this.txListener,
blockchain: this.blockchain
},
{
getPosition: (event) => {
var limitUp = 36
var limitDown = 20
var height = window.innerHeight
var newpos = (event.pageY < limitUp) ? limitUp : event.pageY
newpos = (newpos < height - limitDown) ? newpos : height - limitDown
return height - newpos
}
})
self._components.terminal.event.register('resize', delta => self._adjustLayout('top', delta)) self._components.terminal.event.register('resize', delta => self._adjustLayout('top', delta))
if (self.txListener) { if (self.txListener) {
self._components.terminal.event.register('listenOnNetWork', (listenOnNetWork) => { self._components.terminal.event.register('listenOnNetWork', (listenOnNetWork) => {
......
...@@ -50,7 +50,7 @@ export class TabProxy { ...@@ -50,7 +50,7 @@ export class TabProxy {
}) })
appManager.event.on('activate', (name) => { appManager.event.on('activate', (name) => {
const { profile } = appManager.getOne(name) const { profile } = appManager.getPlugin(name)
if (profile.location === 'mainPanel') { if (profile.location === 'mainPanel') {
this.addTab( this.addTab(
name, name,
...@@ -58,7 +58,7 @@ export class TabProxy { ...@@ -58,7 +58,7 @@ export class TabProxy {
() => this.event.emit('switchApp', name), () => this.event.emit('switchApp', name),
() => { () => {
this.event.emit('closeApp', name) this.event.emit('closeApp', name)
this.appManager.deactivateOne(name) this.appManager.deactivatePlugin(name)
}, },
profile.icon profile.icon
) )
......
...@@ -45,7 +45,7 @@ class Terminal extends Plugin { ...@@ -45,7 +45,7 @@ class Terminal extends Plugin {
self._api = api self._api = api
self._opts = opts self._opts = opts
self.data = { self.data = {
lineLength: opts.lineLength || 80, lineLength: opts.lineLength || 80, // ???
session: [], session: [],
activeFilters: { commands: {}, input: '' }, activeFilters: { commands: {}, input: '' },
filterFns: {} filterFns: {}
...@@ -95,14 +95,12 @@ class Terminal extends Plugin { ...@@ -95,14 +95,12 @@ class Terminal extends Plugin {
self._jsSandboxContext = {} self._jsSandboxContext = {}
self._jsSandboxRegistered = {} self._jsSandboxRegistered = {}
// TODO move this to the application start. Put it in mainView. if (opts.shell) self._shell = opts.shell // ???
// We should have a HostPlugin which add the terminal.
opts.appManager.register(this)
opts.appManager.activate('terminal')
if (opts.shell) self._shell = opts.shell
register(self) register(self)
} }
setTxListener(txListener) {
this._opts.txListener = txListener
}
logHtml (html) { logHtml (html) {
var command = this.commands['html'] var command = this.commands['html']
if (typeof command === 'function') command(html) if (typeof command === 'function') command(html)
...@@ -441,7 +439,7 @@ class Terminal extends Plugin { ...@@ -441,7 +439,7 @@ class Terminal extends Plugin {
self._components.txLogger = new TxLogger(self._opts.eventsDecoder, self._opts.txListener, this, self.blockchain) self._components.txLogger = new TxLogger(self._opts.eventsDecoder, self._opts.txListener, this, self.blockchain)
self._components.txLogger.event.register('debuggingRequested', (hash) => { self._components.txLogger.event.register('debuggingRequested', (hash) => {
// TODO should probably be in the run module // TODO should probably be in the run module
if (!self._opts.appManager.isActive('debugger')) self._opts.appManager.activateOne('debugger') if (!self._opts.appManager.isActive('debugger')) self._opts.appManager.activatePlugin('debugger')
this.call('debugger', 'debug', hash) this.call('debugger', 'debug', hash)
this.call('menuicons', 'select', 'debugger') this.call('menuicons', 'select', 'debugger')
}) })
......
...@@ -52,6 +52,5 @@ export function makeUdapp (blockchain, compilersArtefacts, logHtmlCallback) { ...@@ -52,6 +52,5 @@ export function makeUdapp (blockchain, compilersArtefacts, logHtmlCallback) {
} }
}) })
txlistener.startListening() txlistener.startListening()
registry.put({api: eventsDecoder, name: 'eventsDecoder'})
return {txlistener, eventsDecoder}
} }
...@@ -190,7 +190,7 @@ class AutoCompletePopup { ...@@ -190,7 +190,7 @@ class AutoCompletePopup {
extendAutocompletion () { extendAutocompletion () {
// TODO: this is not using the appManager interface. Terminal should be put as module // TODO: this is not using the appManager interface. Terminal should be put as module
this.opts.appManager.event.on('activate', (id) => { this.opts.appManager.event.on('activate', (id) => {
const profile = this.opts.appManager.getOne(id).profile const profile = this.opts.appManager.getPlugin(id).profile
if (!profile.methods) return if (!profile.methods) return
profile.methods.forEach((method) => { profile.methods.forEach((method) => {
const key = `remix.call({name: '${id}', key:'${method}', payload: []}).then((result) => { console.log(result) }).catch((error) => { console.log(error) })` const key = `remix.call({name: '${id}', key:'${method}', payload: []}).then((result) => { console.log(result) }).catch((error) => { console.log(error) })`
......
...@@ -116,7 +116,7 @@ var css = csjs` ...@@ -116,7 +116,7 @@ var css = csjs`
* *
*/ */
class TxLogger { class TxLogger {
constructor (eventsDecoder, txListener, terminal, blockchain) { constructor (terminal, blockchain) {
this.event = new EventManager() this.event = new EventManager()
this.seen = {} this.seen = {}
function filterTx (value, query) { function filterTx (value, query) {
...@@ -125,8 +125,8 @@ class TxLogger { ...@@ -125,8 +125,8 @@ class TxLogger {
} }
return false return false
} }
this.eventsDecoder = eventsDecoder this.eventsDecoder = globalRegistry.get('teventsDecoder').api
this.txListener = txListener this.txListener = globalRegistry.get('txListener').api
this.terminal = terminal this.terminal = terminal
// dependencies // dependencies
this._deps = { this._deps = {
......
/* global localStorage, fetch */ /* global localStorage, fetch */
import { PluginEngine, IframePlugin } from '@remixproject/engine' import { PluginManager, IframePlugin } from '@remixproject/engine'
import { EventEmitter } from 'events' import { EventEmitter } from 'events'
import { PermissionHandler } from './app/ui/persmission-handler'
import QueryParams from './lib/query-params' import QueryParams from './lib/query-params'
const requiredModules = [ // services + layout views + system views const requiredModules = [ // services + layout views + system views
...@@ -9,22 +8,34 @@ const requiredModules = [ // services + layout views + system views ...@@ -9,22 +8,34 @@ const requiredModules = [ // services + layout views + system views
'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'fileExplorers', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'fileExplorers',
'terminal', 'settings', 'pluginManager'] 'terminal', 'settings', 'pluginManager']
const settings = { export function isNative(name) {
permissionHandler: new PermissionHandler(), const nativePlugins = ['vyper', 'workshops', 'ethdoc', 'etherscan']
autoActivate: false, return nativePlugins.includes(name)
natives: ['vyper', 'workshops', 'ethdoc', 'etherscan'] // Force iframe plugin to be seen as native
} }
export class RemixAppManager extends PluginEngine { export class RemixAppManager extends PluginManager {
constructor (plugins) { constructor (plugins) {
super(plugins, settings) super()
this.event = new EventEmitter() this.event = new EventEmitter()
this.registered = {} this.registered = {}
this.pluginsDirectory = 'https://raw.githubusercontent.com/ethereum/remix-plugins-directory/master/build/metadata.json' this.pluginsDirectory = 'https://raw.githubusercontent.com/ethereum/remix-plugins-directory/master/build/metadata.json'
this.pluginLoader = new PluginLoader() this.pluginLoader = new PluginLoader()
} }
async canActivate (from, to) {
return true
}
async canDeactivate (from, to) {
return from.name === 'manager'
}
async canCall (From, to, method) {
// todo This is the dafault behaviour, we could save user choises in session scope
return true
}
onActivated (plugin) { onActivated (plugin) {
this.pluginLoader.set(plugin, this.actives) this.pluginLoader.set(plugin, this.actives)
this.event.emit('activate', plugin.name) this.event.emit('activate', plugin.name)
...@@ -36,10 +47,6 @@ export class RemixAppManager extends PluginEngine { ...@@ -36,10 +47,6 @@ export class RemixAppManager extends PluginEngine {
}) })
} }
getOne (name) {
return this.registered[name]
}
getIds () { getIds () {
return Object.keys(this.registered) return Object.keys(this.registered)
} }
...@@ -55,21 +62,9 @@ export class RemixAppManager extends PluginEngine { ...@@ -55,21 +62,9 @@ export class RemixAppManager extends PluginEngine {
this.event.emit('added', plugin.name) this.event.emit('added', plugin.name)
} }
// TODO check whether this can be removed deactivatePlugin (name) {
ensureActivated (apiName) {
if (!this.isActive(apiName)) this.activateOne(apiName)
this.event.emit('ensureActivated', apiName)
}
// TODO check whether this can be removed
ensureDeactivated (apiName) {
if (this.isActive(apiName)) this.deactivateOne(apiName)
this.event.emit('ensureDeactivated', apiName)
}
deactivateOne (name) {
if (requiredModules.includes(name)) return if (requiredModules.includes(name)) return
super.deactivateOne(name) super.deactivatePlugin(name)
} }
isRequired (name) { isRequired (name) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment