Skip to content

Commit

Permalink
use remix plugin 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Nov 3, 2020
1 parent e724491 commit e8c9989
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 516 deletions.
207 changes: 0 additions & 207 deletions apps/remix-ide/package.json

This file was deleted.

8 changes: 4 additions & 4 deletions apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const appManager = self.appManager
const pluginLoader = appManager.pluginLoader
const workspace = pluginLoader.get()
const engine = new Engine(appManager)
const engine = new Engine()
engine.setPluginOption = ({ name, kind }) => {
if (kind === 'provider') return {queueTimeout: 60000 * 2}
if (name === 'LearnEth') return {queueTimeout: 60000}
return {queueTimeout: 10000}
}
await engine.onload()

engine.register(appManager)
// SERVICES
// ----------------- import content servive ------------------------
const contentImport = new CompilerImport()
Expand Down Expand Up @@ -397,7 +397,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
await appManager.activatePlugin(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'web3Provider', 'offsetToLineColumnConverter'])
await appManager.activatePlugin(['mainPanel', 'menuicons'])
await appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await appManager.activatePlugin(['home', 'hiddenPanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'scriptRunner', 'terminal', 'fetchAndCompile'])
await appManager.activatePlugin(['home', 'hiddenPanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'terminal', 'fetchAndCompile'])

const queryParams = new QueryParams()
const params = queryParams.get()
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide/src/app/files/remixd-handle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import isElectron from 'is-electron'
import { WebsocketPlugin } from '@remixproject/engine'
import { WebsocketPlugin } from '@remixproject/engine-web'
import * as packageJson from '../../../../../package.json'
var yo = require('yo-yo')
var modalDialog = require('../ui/modaldialog')
Expand Down
21 changes: 13 additions & 8 deletions apps/remix-ide/src/remixAppManager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* global localStorage, fetch */
import { PluginManager, IframePlugin } from '@remixproject/engine'
import { PluginManager } from '@remixproject/engine'
import { IframePlugin } from '@remixproject/engine-web'
import { EventEmitter } from 'events'
import QueryParams from './lib/query-params'
import { PermissionHandler } from './app/ui/persmission-handler'
Expand Down Expand Up @@ -28,11 +29,11 @@ export class RemixAppManager extends PluginManager {
this.permissionHandler = new PermissionHandler()
}

async canActivate (from, to) {
return canActivate(from.name)
async canActivatePlugin (from, to) {
return true // canActivate(from.name)
}

async canDeactivate (from, to) {
async canDeactivatePlugin (from, to) {
return from.name === 'manager'
}

Expand Down Expand Up @@ -69,8 +70,8 @@ export class RemixAppManager extends PluginManager {
this.event.emit('deactivate', plugin)
}

onRegistration (plugin) {
this.event.emit('added', plugin.name)
onRegistration () {
console.log('manager has been registered')
}

async ensureActivated (apiName) {
Expand Down Expand Up @@ -105,8 +106,12 @@ export class RemixAppManager extends PluginManager {
'description': 'Use an external wallet for transacting',
'icon': 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyYWRpYWxHcmFkaWVudCBpZD0iYSIgY3g9IjAlIiBjeT0iNTAlIiByPSIxMDAlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1ZDlkZjYiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMDZmZmYiLz48L3JhZGlhbEdyYWRpZW50PjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0ibTI1Ni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GU9Im5vbnplcm8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDk4IDE2MCkiLz48L2c+PC9zdmc+',
'location': 'mainPanel'
})
return plugins.map(plugin => new IframePlugin(plugin))
})
return plugins.map(plugin => {
if (plugin.name === 'scriptRunner') {
plugin.url = 'ipfs://QmRWBCgCzKa1ixoVN9mvJACVuqWLRTRYS4sUJ9wzUBRHSf'
}
return new IframePlugin(plugin) })
}
}

Expand Down
Loading

0 comments on commit e8c9989

Please sign in to comment.