Stabilize Websocket Plugin Changes

pull/5370/head
ioedeveloper 5 years ago committed by yann300
parent cb6f4e1a7f
commit 28bcb2b2e1
  1. 10
      src/app.js
  2. 10
      src/app/files/remixDProvider.js
  3. 1
      src/app/files/remixd-handle.js
  4. 3
      src/app/panels/file-panel.js

@ -42,7 +42,7 @@ 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, WebsocketPlugin } from '@remixproject/engine' 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'
@ -143,6 +143,7 @@ class App {
registry.put({api: config, name: 'config'}) registry.put({api: config, name: 'config'})
// load file system // load file system
self.appManager = new RemixAppManager({})
self._components.filesProviders = {} self._components.filesProviders = {}
self._components.filesProviders['browser'] = new FileProvider('browser') self._components.filesProviders['browser'] = new FileProvider('browser')
registry.put({api: self._components.filesProviders['browser'], name: 'fileproviders/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) self._components.filesProviders['localhost'] = new RemixDProvider(self.appManager)
registry.put({api: self._components.filesProviders['localhost'], name: 'fileproviders/localhost'}) 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'}) registry.put({api: self._components.filesProviders, name: 'fileproviders'})
migrateFileSystem(self._components.filesProviders['browser']) 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)) makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl))
const contextualListener = new ContextualListener({editor}) const contextualListener = new ContextualListener({editor})
const { remixd } = self._components
engine.register([ engine.register([
contentImport, contentImport,
@ -320,8 +319,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
contextualListener, contextualListener,
terminal, terminal,
web3Provider, web3Provider,
fetchAndCompile, fetchAndCompile
remixd
]) ])
// LAYOUT & SYSTEM VIEWS // 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 // get the file from gist
const gistHandler = new GistHandler() const gistHandler = new GistHandler()
const queryParams = new QueryParams()
const params = queryParams.get()
const loadedFromGist = gistHandler.loadFromGist(params, fileManager) const loadedFromGist = gistHandler.loadFromGist(params, fileManager)
if (!loadedFromGist) { if (!loadedFromGist) {
// insert example contracts if there are no files to show // insert example contracts if there are no files to show

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

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

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

Loading…
Cancel
Save