Stabilize Websocket Plugin Changes

pull/11/head
ioedeveloper 4 years ago
parent 14de905548
commit d8a7e9686d
  1. 10
      apps/remix-ide/src/app.js
  2. 16
      apps/remix-ide/src/app/files/remixDProvider.js
  3. 1
      apps/remix-ide/src/app/files/remixd-handle.js
  4. 3
      apps/remix-ide/src/app/panels/file-panel.js

@ -42,7 +42,7 @@ import { basicLogo } from './app/ui/svgLogo'
import { RunTab, makeUdapp } from './app/udapp'
import PanelsResize from './lib/panels-resize'
import { Engine, WebsocketPlugin } from '@remixproject/engine'
import { Engine } from '@remixproject/engine'
import { RemixAppManager } from './remixAppManager'
import { FramingService } from './framingService'
import { MainView } from './app/panels/main-view'
@ -143,6 +143,7 @@ class App {
registry.put({api: config, name: 'config'})
// load file system
self.appManager = new RemixAppManager({})
self._components.filesProviders = {}
self._components.filesProviders['browser'] = new FileProvider('browser')
registry.put({api: self._components.filesProviders['browser'], name: 'fileproviders/browser'})
@ -155,7 +156,6 @@ class App {
self._components.filesProviders['localhost'] = new RemixDProvider(self.appManager)
registry.put({api: self._components.filesProviders['localhost'], name: 'fileproviders/localhost'})
console.log('self._components.filesProviders: ', self._components.filesProviders)
registry.put({api: self._components.filesProviders, name: 'fileproviders'})
migrateFileSystem(self._components.filesProviders['browser'])
@ -306,7 +306,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl))
const contextualListener = new ContextualListener({editor})
const { remixd } = self._components
engine.register([
contentImport,
@ -320,8 +319,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
contextualListener,
terminal,
web3Provider,
fetchAndCompile,
remixd
fetchAndCompile
])
// LAYOUT & SYSTEM VIEWS
@ -433,6 +431,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// get the file from gist
const gistHandler = new GistHandler()
const queryParams = new QueryParams()
const params = queryParams.get()
const loadedFromGist = gistHandler.loadFromGist(params, fileManager)
if (!loadedFromGist) {
// insert example contracts if there are no files to show

@ -15,12 +15,12 @@ module.exports = class RemixDProvider {
this.filesContent = {}
this.files = {}
// var remixdEvents = ['connecting', 'connected', 'errored', 'closed']
// remixdEvents.forEach((value) => {
// remixd.event.register(value, (event) => {
// this.event.trigger(value, [event])
// })
// })
var remixdEvents = ['connecting', 'connected', 'errored', 'closed']
remixdEvents.forEach((value) => {
// remixd.event.register(value, (event) => {
// this.event.trigger(value, [event])
// })
})
// remixd.event.register('notified', (data) => {
// if (data.scope === 'sharedfolder') {
@ -69,7 +69,7 @@ module.exports = class RemixDProvider {
})
}
// @TODO: refactor all `this._remixd.call(....)` uses into `this.remixd[api](...)`
// @TODO: refactor all `this._appManager.call(....)` uses into `this.remixd[api](...)`
// where `api = ...`:
// this.remixd.read(path, (error, content) => {})
// this.remixd.write(path, content, (error, result) => {})
@ -182,7 +182,7 @@ module.exports = class RemixDProvider {
const unprefixedpath = this.removePrefix(path)
const callId = await this._appManager.call('remixd', 'isDirectory', {path: unprefixedpath})
return await this._remixd.receiveResponse(callId)
return await this._appManager.receiveResponse(callId)
}
async isFile (path) {

@ -34,6 +34,7 @@ export class RemixdHandle extends WebsocketPlugin {
this.fileSystemExplorer = fileSystemExplorer
this.locahostProvider = locahostProvider
this.appManager = appManager
this.methods = ['get']
}
deactivate () {

@ -60,6 +60,9 @@ module.exports = class Filepanel extends ViewPlugin {
var fileExplorer = createProvider('browser', ['createNewFile', 'publishToGist', canUpload ? 'uploadFile' : ''])
var fileSystemExplorer = createProvider('localhost')
console.log('fileSystemExplorer: ', fileSystemExplorer)
console.log('self._deps.fileProviders: ', self._deps.fileProviders['localhost'])
console.log('appManager: ', appManager)
self.remixdHandle = new RemixdHandle(fileSystemExplorer, self._deps.fileProviders['localhost'], appManager)
const explorers = yo`

Loading…
Cancel
Save