11'use strict'
22import { RunTab , makeUdapp } from './app/udapp'
3- import { RemixEngine } from './remixEngine'
43import { 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
155import { 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 ,
0 commit comments