diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/apps.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/apps.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/apps.js b/packages/meshbay-hub/src/meshbay_hub/static/apps.js index eec2158..8ae4db4 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/apps.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/apps.js @@ -1,14 +1,19 @@ import { ChatPanel } from './chat-app.js'; import { FilesPanel } from './files-app.js'; -import { VideoApp } from './video-app.js'; -import { MusicApp } from './music-app.js'; -import { PhotosApp } from './photos-app.js'; -import { ChatSettings } from './chat-app-settings.js'; -import { VideoSettings } from './video-app-settings.js'; -import { MusicSettings } from './music-app-settings.js'; -import { PhotoSettings } from './photos-app-settings.js'; -import { HelloWorldApp } from './helloworld-app.js'; -import { HelloWorldSettings } from './helloworld-app-settings.js'; +import { lazy } from './lazy.js'; + +// Chat and Files open with the group; every other app, and every settings +// pane, is fetched the first time it is shown (lazy.js) — a member who only +// chats never downloads the Videos app. +const VideoApp = lazy(() => import('./video-app.js'), 'VideoApp'); +const MusicApp = lazy(() => import('./music-app.js'), 'MusicApp'); +const PhotosApp = lazy(() => import('./photos-app.js'), 'PhotosApp'); +const ChatSettings = lazy(() => import('./chat-app-settings.js'), 'ChatSettings'); +const VideoSettings = lazy(() => import('./video-app-settings.js'), 'VideoSettings'); +const MusicSettings = lazy(() => import('./music-app-settings.js'), 'MusicSettings'); +const PhotoSettings = lazy(() => import('./photos-app-settings.js'), 'PhotoSettings'); +const HelloWorldApp = lazy(() => import('./helloworld-app.js'), 'HelloWorldApp'); +const HelloWorldSettings = lazy(() => import('./helloworld-app-settings.js'), 'HelloWorldSettings'); /** * Whether apps marked `dev` are shown. Opt in once with `?dev=1`, off with |