diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 087c074020..490c646bdf 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -424,6 +424,9 @@ class AppComponent { } catch (e) { console.log("couldn't register iframe plugins", e.message) } + if(isElectron()){ + await this.appManager.activatePlugin(['fs']) + } await this.appManager.activatePlugin(['layout']) await this.appManager.activatePlugin(['notification']) await this.appManager.activatePlugin(['editor']) @@ -460,7 +463,7 @@ class AppComponent { await this.appManager.activatePlugin(['solidity-script', 'remix-templates']) if(isElectron()){ - await this.appManager.activatePlugin(['fs', 'isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep']) + await this.appManager.activatePlugin(['isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep']) } this.appManager.on( diff --git a/apps/remix-ide/src/app/components/preload.tsx b/apps/remix-ide/src/app/components/preload.tsx index ec9be4597a..b521068f7f 100644 --- a/apps/remix-ide/src/app/components/preload.tsx +++ b/apps/remix-ide/src/app/components/preload.tsx @@ -7,6 +7,7 @@ import {indexedDBFileSystem} from '../files/filesystems/indexedDB' import {localStorageFS} from '../files/filesystems/localStorage' import {fileSystemUtility, migrationTestData} from '../files/filesystems/fileSystemUtility' import './styles/preload.css' +import isElectron from 'is-electron' const _paq = (window._paq = window._paq || []) export const Preload = () => { @@ -28,10 +29,14 @@ export const Preload = () => { ) function loadAppComponent() { + console.log('app import', new Date().toLocaleString()) import('../../app') .then((AppComponent) => { + console.log('app loaded', new Date().toLocaleString()) const appComponent = new AppComponent.default() + console.log('app run', new Date().toLocaleString()) appComponent.run().then(() => { + console.log('Remix loaded', new Date().toLocaleString()) render( <> @@ -68,7 +73,6 @@ export const Preload = () => { testBlockStorage.current ? null : localStorageFileSystem.current ]) if (fsLoaded) { - console.log(fsLoaded.name + ' activated') _paq.push(['trackEvent', 'Storage', 'activate', fsLoaded.name]) loadAppComponent() } else { @@ -85,6 +89,10 @@ export const Preload = () => { } useEffect(() => { + if(isElectron()){ + loadAppComponent() + return + } async function loadStorage() { ;(await remixFileSystems.current.addFileSystem(remixIndexedDB.current)) || _paq.push(['trackEvent', 'Storage', 'error', 'indexedDB not supported']) ;(await remixFileSystems.current.addFileSystem(localStorageFileSystem.current)) || _paq.push(['trackEvent', 'Storage', 'error', 'localstorage not supported']) diff --git a/apps/remix-ide/src/app/files/electronProvider.ts b/apps/remix-ide/src/app/files/electronProvider.ts index 3543f756a4..cb24867999 100644 --- a/apps/remix-ide/src/app/files/electronProvider.ts +++ b/apps/remix-ide/src/app/files/electronProvider.ts @@ -44,6 +44,8 @@ export class ElectronProvider extends FileProvider { // isDirectory is already included // this is a more efficient version of the default implementation async resolveDirectory(path, cb) { + console.log('resolveDirectory', path) + console.log('start', new Date(new Date().getTime()).toLocaleTimeString()) path = this.removePrefix(path) if (path.indexOf('/') !== 0) path = '/' + path try { @@ -59,6 +61,7 @@ export class ElectronProvider extends FileProvider { } } //console.log(ret, 'ret resolveDirectory ELECTRON') + console.log('end', new Date(new Date().getTime()).toLocaleTimeString()) if (cb) cb(null, ret) return ret } catch (error) { diff --git a/apps/remixdesktop/src/plugins/ripgrepPlugin.ts b/apps/remixdesktop/src/plugins/ripgrepPlugin.ts index b9b9f415d0..4f479f2dfc 100644 --- a/apps/remixdesktop/src/plugins/ripgrepPlugin.ts +++ b/apps/remixdesktop/src/plugins/ripgrepPlugin.ts @@ -20,7 +20,6 @@ const convertPathToPosix = (pathName: string): string => { export class RipgrepPlugin extends ElectronBasePlugin { clients: RipgrepPluginClient[] = [] constructor() { - console.log('constructor ripgrepPlugin') super(profile, clientProfile, RipgrepPluginClient) this.methods = [...super.methods] } @@ -37,10 +36,8 @@ export class RipgrepPluginClient extends ElectronBasePluginClient { workingDir: string = '' constructor(webContentsId: number, profile: Profile) { super(webContentsId, profile) - console.log('constructor ripgrepPluginClient') this.onload(() => { - console.log('onload ripgrepPluginClient') this.on('fs' as any, 'workingDirChanged', async (path: string) => { this.workingDir = path }) @@ -52,7 +49,6 @@ export class RipgrepPluginClient extends ElectronBasePluginClient { path = convertPathToPosix(this.fixPath(path)) return new Promise((c, e) => { - console.log('PATH rg', path) const rg = spawn(rgPath, ['.', '-l', path]) @@ -60,7 +56,6 @@ export class RipgrepPluginClient extends ElectronBasePluginClient { const stream = byline(rg.stdout.setEncoding('utf8')) stream.on('data', (rgresult: string) => { - console.log(this.workingDir) let pathWithoutWorkingDir = rgresult.replace(this.workingDir, '') if (pathWithoutWorkingDir.endsWith('/')) { pathWithoutWorkingDir = pathWithoutWorkingDir.slice(0, -1) @@ -77,7 +72,6 @@ export class RipgrepPluginClient extends ElectronBasePluginClient { }) }) stream.on('end', () => { - console.log('rg', resultrg) c(resultrg) }) }) diff --git a/apps/remixdesktop/src/preload.ts b/apps/remixdesktop/src/preload.ts index bffaad1400..f7eb174569 100644 --- a/apps/remixdesktop/src/preload.ts +++ b/apps/remixdesktop/src/preload.ts @@ -2,7 +2,7 @@ import { Message } from '@remixproject/plugin-utils' import { contextBridge, ipcRenderer } from 'electron' -console.log('preload.ts') +console.log('preload.ts', new Date().toLocaleTimeString()) /* preload script needs statically defined API for each plugin */ diff --git a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx index 2ad2e8e96e..578ab4a100 100644 --- a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx @@ -37,6 +37,7 @@ const RemixApp = (props: IRemixAppUi) => { setLocale(props.app.localeModule.currentLocale()) } if (props.app) { + console.log('app activate', new Date().toLocaleString()) activateApp() } }, [])