Skip to content

Commit c21ec51

Browse files
authored
Merge branch 'master' into fix-parent
2 parents 7a2076e + c58a252 commit c21ec51

File tree

3 files changed

+41
-32
lines changed

3 files changed

+41
-32
lines changed

apps/remix-ide/src/app.js

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
'use strict'
22
import { RunTab, makeUdapp } from './app/udapp'
3-
import { RemixEngine } from './remixEngine'
43
import { RemixAppManager } from './remixAppManager'
5-
import { ThemeModule } from './app/tabs/theme-module'
6-
import { NetworkModule } from './app/tabs/network-module'
7-
import { Web3ProviderModule } from './app/tabs/web3-provider'
8-
import { SidePanel } from './app/components/side-panel'
9-
import { HiddenPanel } from './app/components/hidden-panel'
10-
import { VerticalIcons } from './app/components/vertical-icons'
11-
import { LandingPage } from './app/ui/landing-page/landing-page'
12-
import { MainPanel } from './app/components/main-panel'
13-
import { PermissionHandlerPlugin } from './app/plugins/permission-handler-plugin'
144

155
import { WalkthroughService } from './walkthroughService'
166

@@ -95,7 +85,7 @@ class AppComponent {
9585
const pluginLoader = self.appManager.pluginLoader
9686
self.panels = {}
9787
self.workspace = pluginLoader.get()
98-
self.engine = new RemixEngine()
88+
self.engine = new (await import('./remixEngine')).RemixEngine
9989
self.engine.register(appManager)
10090

10191
const matomoDomains = {
@@ -126,7 +116,7 @@ class AppComponent {
126116
// ----------------- gist service ---------------------------------
127117
self.gistHandler = new GistHandler()
128118
// ----------------- theme service ---------------------------------
129-
self.themeModule = new ThemeModule()
119+
self.themeModule = new (await import('./app/tabs/theme-module')).ThemeModule()
130120
Registry.getInstance().put({ api: self.themeModule, name: 'themeModule' })
131121

132122
// ----------------- editor service ----------------------------
@@ -159,9 +149,9 @@ class AppComponent {
159149
// service which fetch contract artifacts from sourve-verify, put artifacts in remix and compile it
160150
const fetchAndCompile = new FetchAndCompile()
161151
// ----------------- network service (resolve network id / name) -----
162-
const networkModule = new NetworkModule(blockchain)
152+
const networkModule = new (await import('./app/tabs/network-module')).NetworkModule(blockchain)
163153
// ----------------- represent the current selected web3 provider ----
164-
const web3Provider = new Web3ProviderModule(blockchain)
154+
const web3Provider = new (await import('./app/tabs/web3-provider')).Web3ProviderModule(blockchain)
165155
const hardhatProvider = new HardhatProvider(blockchain)
166156
// ----------------- convert offset to line/column service -----------
167157
const offsetToLineColumnConverter = new OffsetToLineColumnConverter()
@@ -192,7 +182,7 @@ class AppComponent {
192182
const configPlugin = new ConfigPlugin()
193183
self.layout = new Layout()
194184

195-
const permissionHandler = new PermissionHandlerPlugin()
185+
const permissionHandler = new (await import('./app/plugins/permission-handler-plugin')).PermissionHandlerPlugin()
196186

197187
self.engine.register([
198188
permissionHandler,
@@ -219,22 +209,22 @@ class AppComponent {
219209
])
220210

221211
// LAYOUT & SYSTEM VIEWS
222-
const appPanel = new MainPanel()
212+
const appPanel = new (await import('./app/components/main-panel')).MainPanel()
223213
Registry.getInstance().put({ api: self.mainview, name: 'mainview' })
224214
const tabProxy = new TabProxy(fileManager, editor)
225215
self.engine.register([appPanel, tabProxy])
226216

227217
// those views depend on app_manager
228-
self.menuicons = new VerticalIcons()
229-
self.sidePanel = new SidePanel()
230-
self.hiddenPanel = new HiddenPanel()
218+
self.menuicons = new (await import('./app/components/vertical-icons')).VerticalIcons()
219+
self.sidePanel = new (await import('./app/components/side-panel')).SidePanel()
220+
self.hiddenPanel = new (await import('./app/components/hidden-panel')).HiddenPanel()
231221

232222
const pluginManagerComponent = new PluginManagerComponent(
233223
appManager,
234224
self.engine
235225
)
236226
const filePanel = new FilePanel(appManager)
237-
const landingPage = new LandingPage(
227+
const landingPage = new (await import('./app/ui/landing-page/landing-page')).LandingPage(
238228
appManager,
239229
self.menuicons,
240230
fileManager,

apps/remix-ide/src/index.tsx

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
11
// eslint-disable-next-line no-use-before-define
22
import React from 'react'
3-
import ReactDOM from 'react-dom'
4-
import AppComponent from './app'
3+
import { render } from 'react-dom'
54
// eslint-disable-next-line no-unused-vars
65
import { RemixApp } from '@remix-ui/app'
76

8-
const appComponent = new AppComponent()
9-
appComponent.run()
7+
(function () {
8+
render(
9+
<React.StrictMode>
10+
<div style={{ display: 'block' }} className='centered'>
11+
<svg id="Ebene_2" data-name="Ebene 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 100">
12+
<path d="M91.84,35a.09.09,0,0,1-.1-.07,41,41,0,0,0-79.48,0,.09.09,0,0,1-.1.07C9.45,35,1,35.35,1,42.53c0,8.56,1,16,6,20.32,2.16,1.85,5.81,2.3,9.27,2.22a44.4,44.4,0,0,0,6.45-.68.09.09,0,0,0,.06-.15A34.81,34.81,0,0,1,17,45c0-.1,0-.21,0-.31a35,35,0,0,1,70,0c0,.1,0,.21,0,.31a34.81,34.81,0,0,1-5.78,19.24.09.09,0,0,0,.06.15,44.4,44.4,0,0,0,6.45.68c3.46.08,7.11-.37,9.27-2.22,5-4.27,6-11.76,6-20.32C103,35.35,94.55,35,91.84,35Z"/>
13+
<path d="M52,74,25.4,65.13a.1.1,0,0,0-.1.17L51.93,91.93a.1.1,0,0,0,.14,0L78.7,65.3a.1.1,0,0,0-.1-.17L52,74A.06.06,0,0,1,52,74Z"/>
14+
<path d="M75.68,46.9,82,45a.09.09,0,0,0,.08-.09,29.91,29.91,0,0,0-.87-6.94.11.11,0,0,0-.09-.08l-6.43-.58a.1.1,0,0,1-.06-.18l4.78-4.18a.13.13,0,0,0,0-.12,30.19,30.19,0,0,0-3.65-6.07.09.09,0,0,0-.11,0l-5.91,2a.1.1,0,0,1-.12-.14L72.19,23a.11.11,0,0,0,0-.12,29.86,29.86,0,0,0-5.84-4.13.09.09,0,0,0-.11,0l-4.47,4.13a.1.1,0,0,1-.17-.07l.09-6a.1.1,0,0,0-.07-.1,30.54,30.54,0,0,0-7-1.47.1.1,0,0,0-.1.07l-2.38,5.54a.1.1,0,0,1-.18,0l-2.37-5.54a.11.11,0,0,0-.11-.06,30,30,0,0,0-7,1.48.12.12,0,0,0-.07.1l.08,6.05a.09.09,0,0,1-.16.07L37.8,18.76a.11.11,0,0,0-.12,0,29.75,29.75,0,0,0-5.83,4.13.11.11,0,0,0,0,.12l2.59,5.6a.11.11,0,0,1-.13.14l-5.9-2a.11.11,0,0,0-.12,0,30.23,30.23,0,0,0-3.62,6.08.11.11,0,0,0,0,.12l4.79,4.19a.1.1,0,0,1-.06.17L23,37.91a.1.1,0,0,0-.09.07A29.9,29.9,0,0,0,22,44.92a.1.1,0,0,0,.07.1L28.4,47a.1.1,0,0,1,0,.18l-5.84,3.26a.16.16,0,0,0,0,.11,30.17,30.17,0,0,0,2.1,6.76c.32.71.67,1.4,1,2.08a.1.1,0,0,0,.06,0L52,68.16H52l26.34-8.78a.1.1,0,0,0,.06-.05,30.48,30.48,0,0,0,3.11-8.88.1.1,0,0,0-.05-.11l-5.83-3.26A.1.1,0,0,1,75.68,46.9Z"/>
15+
</svg>
16+
<div className="info-secondary splash">
17+
REMIX IDE
18+
</div>
19+
</div>
20+
</React.StrictMode>,
21+
document.getElementById('root')
22+
)
23+
})()
1024

11-
ReactDOM.render(
12-
<React.StrictMode>
13-
<RemixApp app={appComponent}></RemixApp>
14-
</React.StrictMode>,
15-
document.getElementById('root')
16-
)
25+
import ('./app').then((AppComponent) => {
26+
const appComponent = new AppComponent.default()
27+
appComponent.run().then(() => {
28+
render(
29+
<React.StrictMode>
30+
<RemixApp app={appComponent} />
31+
</React.StrictMode>,
32+
document.getElementById('root')
33+
)
34+
})
35+
}).catch(err => {
36+
console.log('Error on loading Remix:', err)
37+
})

apps/remix-ide/tsconfig.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
"jsx": "react",
55
"allowJs": true,
66
"esModuleInterop": true,
7-
"resolveJsonModule": true,
87
"allowSyntheticDefaultImports": true,
98
"types": ["node", "jest"],
10-
"module": "es6",
119
"resolveJsonModule": true
1210
},
1311
"files": [

0 commit comments

Comments
 (0)