Skip to content

Commit

Permalink
[monaco] hide loading
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
  • Loading branch information
akosyakov committed Jun 29, 2017
1 parent b4e7bd1 commit 675cc8d
Show file tree
Hide file tree
Showing 26 changed files with 330 additions and 391 deletions.
6 changes: 4 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
"type": "node",
"request": "launch",
"name": "Launch Backend",
"program": "${workspaceRoot}/examples/browser/lib/backend/main.js",
"program": "${workspaceRoot}/examples/browser/src-gen/backend/main.js",
"args": [
"--loglevel=debug"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/examples/browser/src-gen/backend/main.js",
"${workspaceRoot}/examples/browser/lib/**/*.js",
"${workspaceRoot}/examples/browser/node_modules/theia-core/lib/**/*.js"
]
Expand All @@ -22,13 +23,14 @@
"type": "node",
"request": "launch",
"name": "Launch Backend (eclipse.jdt.ls)",
"program": "${workspaceRoot}/examples/browser/lib/backend/main.js",
"program": "${workspaceRoot}/examples/browser/src-gen/backend/main.js",
"args": [
"--loglevel=debug",
"--root-dir=${workspaceRoot}/../eclipse.jdt.ls/org.eclipse.jdt.ls.core"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/examples/browser/src-gen/backend/main.js",
"${workspaceRoot}/examples/browser/lib/**/*.js",
"${workspaceRoot}/examples/browser/node_modules/theia-core/lib/**/*.js"
]
Expand Down
4 changes: 2 additions & 2 deletions config/webpack/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const path = require('path');
module.exports = function (dirname) {
return {
PROJECT_ROOT: path.resolve(dirname, '.'),
SRC: path.resolve(dirname, 'src'),
SRC_GEN: path.resolve(dirname, 'src-gen'),
BUILD_ROOT: path.resolve(dirname, 'lib'),
ENTRY: path.resolve(dirname, 'lib/frontend/index.js'),
ENTRY: path.resolve(dirname, 'src-gen/frontend/index.js'),
NODE_MODULES: path.resolve(dirname, 'node_modules')
};
};
3 changes: 1 addition & 2 deletions config/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ const electronConfiguration = require('./webpack.config.electron');
const webConfiguration = require('./webpack.config.web');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const monacoEditorPath = './node_modules/monaco-editor-core/dev/vs';
const monacoEditorPath = './node_modules/monaco-editor-core/min/vs';
const monacoLanguagesPath = './node_modules/monaco-languages/release';
const monacoCssLanguagePath = './node_modules/monaco-css/release/min';
const monacoTsLanguagePath = './node_modules/monaco-typescript/release';
const monacoJsonLanguagePath = './node_modules/monaco-json/release/min';
const monacoHtmlLanguagePath = './node_modules/monaco-html/release/min';


module.exports = function (dirname, config = {}) {
const commonConfiguration = {

Expand Down
17 changes: 6 additions & 11 deletions examples/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,18 @@
"bootstrap": "npm install ../../config/local-dependency-manager && npm run localinstall",
"clean": "rimraf lib",
"prepare": "npm run clean && npm run build",
"build": "npm run build:localdeps && npm run build:app",
"build:app": "npm run build:backend && npm run build:frontend",
"build:backend": "tsc && npm run lint",
"build:frontend": "webpack && cp src-gen/frontend/index.html lib/frontend",
"build": "npm run build:localdeps && npm run build:frontend",
"build:frontend": "webpack && cp src-gen/frontend/index.html lib",
"start": "npm run start:app",
"start:app": "concurrently --names backend,webpack-server --prefix \"[{name}]\" \"npm run start:backend\" \"npm run start:frontend\"",
"start:backend": "node ./lib/backend/main.js | bunyan",
"start:backend:debug": "node ./lib/backend/main.js --loglevel=debug | bunyan",
"start:backend": "node ./src-gen/backend/main.js | bunyan",
"start:backend:debug": "node ./src-gen/backend/main.js --loglevel=debug | bunyan",
"start:frontend": "webpack-dev-server --open",
"cold:start": "npm run clean && npm run build && npm start",
"watch": "concurrently --names watch-deps,watch-app --prefix \"[{name}]\" \"npm run watch:localdeps\" \"npm run watch:app\"",
"watch:app": "concurrently --names watch-backend,watch-frontend --prefix \"[{name}]\" \"npm run watch:backend\" \"npm run watch:frontend\"",
"watch:backend": "tsc --watch",
"watch": "concurrently --names watch-deps,watch-frontend --prefix \"[{name}]\" \"npm run watch:localdeps\" \"npm run watch:frontend\"",
"watch:frontend": "npm run build:frontend && webpack --watch",
"localinstall": "ldm install --dev --original-sources",
"build:localdeps": "ldm run build && ldm sync --original-sources",
"lint": "tslint -c ../../config/tslint/tslint.json --project ./tsconfig.json",
"watch:localdeps": "ldm watch --sync --run=watch --original-sources",
"test:ui": "wdio wdio.conf.js"
},
Expand Down Expand Up @@ -65,4 +60,4 @@
"localDevDependencies": {
"local-dependency-manager": "../../config/local-dependency-manager"
}
}
}
42 changes: 42 additions & 0 deletions examples/browser/src-gen/backend/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2017 TypeFox and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/

// @ts-check
require('reflect-metadata');
const path = require('path');
const express = require('express');
const { Container, injectable } = require('inversify');

const { BackendApplication, backendApplicationModule, loggerBackendModule } = require('theia-core/lib/application/node');
const { messagingBackendModule } = require("theia-core/lib/messaging/node");

const fileSystemBackendModule = require("theia-core/lib/filesystem/node/filesystem-backend-module").default;
const workspaceBackendModule = require("theia-core/lib/workspace/node/workspace-backend-module").default;
const terminalBackendModule = require('theia-core/lib/terminal/node/terminal-backend-module').default;
const languagesBackendModule = require('theia-core/lib/languages/node/languages-backend-module').default;
const javaBackendModule = require('theia-core/lib/java/node/java-backend-module').default;
const pythonBackendModule = require('theia-core/lib/python/node/python-backend-module').default;
const cppBackendModule = require('theia-core/lib/cpp/node/cpp-backend-module').default;

const container = new Container();
container.load(backendApplicationModule);
container.load(messagingBackendModule);
container.load(loggerBackendModule);

container.load(fileSystemBackendModule);
container.load(workspaceBackendModule);
container.load(languagesBackendModule);
container.load(terminalBackendModule);
container.load(javaBackendModule);
container.load(pythonBackendModule);
container.load(cppBackendModule);

const application = container.get(BackendApplication);
application.use(express.static(path.join(__dirname, '../../lib'), {
index: 'index.html'
}));
application.start();
49 changes: 0 additions & 49 deletions examples/browser/src-gen/backend/main.ts

This file was deleted.

4 changes: 2 additions & 2 deletions examples/browser/src-gen/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta charset="UTF-8">
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript" src="https://www.promisejs.org/polyfills/promise-6.1.0.js" charset="utf-8"></script>
<script type="text/javascript" src="../vs/loader.js" charset="utf-8"></script>
<script type="text/javascript" src="../bundle.js" charset="utf-8"></script>
<script type="text/javascript" src="./vs/loader.js" charset="utf-8"></script>
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
</head>

<body>
Expand Down
42 changes: 42 additions & 0 deletions examples/browser/src-gen/frontend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2017 TypeFox and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/

// @ts-check
import { Container } from 'inversify';
import { FrontendApplication, frontendApplicationModule } from 'theia-core/lib/application/browser';
import { messagingFrontendModule } from 'theia-core/lib/messaging/browser';
import { loggerFrontendModule } from 'theia-core/lib/application/browser';

const container = new Container();
container.load(frontendApplicationModule);
container.load(messagingFrontendModule);
container.load(loggerFrontendModule);

function load(raw) {
return Promise.resolve(raw.default).then(module =>
container.load(module)
)
}

function start() {
const application = container.get(FrontendApplication);
application.start();
}

import('theia-core/lib/application/browser/menu/browser-menu-module').then(load)
.then(function () { return import('theia-core/lib/application/browser/clipboard/browser-clipboard-module').then(load) })
.then(function () { return import('theia-core/lib/filesystem/browser/filesystem-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/workspace/browser/workspace-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/navigator/browser/navigator-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/terminal/browser/terminal-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/editor/browser/editor-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/monaco/browser/monaco-browser-module').then(load) })
.then(function () { return import('theia-core/lib/languages/browser/languages-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/java/browser/java-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/python/browser/python-frontend-module').then(load) })
.then(function () { return import('theia-core/lib/cpp/browser/cpp-frontend-module').then(load) })
.then(start);
34 changes: 0 additions & 34 deletions examples/browser/src-gen/frontend/index.ts

This file was deleted.

45 changes: 0 additions & 45 deletions examples/browser/src-gen/frontend/main.ts

This file was deleted.

24 changes: 0 additions & 24 deletions examples/browser/tsconfig.json

This file was deleted.

14 changes: 5 additions & 9 deletions examples/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@
"clean": "rimraf lib",
"postinstall": "electron-rebuild",
"prepare": "npm run clean && npm run build",
"build": "npm run build:localdeps && npm run build:app",
"build:app": "npm run build:backend && npm run build:frontend",
"build:backend": "tsc && npm run lint",
"build:frontend": "webpack --target electron && cp src/frontend/index.html lib/frontend",
"build": "npm run build:localdeps && npm run build:frontend",
"build:frontend": "webpack --target electron && cp src-gen/frontend/index.html lib",
"build:localdeps": "ldm run build && ldm sync --original-sources",
"lint": "tslint -c ../../config/tslint/tslint.json --project ./tsconfig.json",
"start": "electron ./lib/frontend/electron-main.js | bunyan",
"start:debug": "electron ./lib/frontend/electron-main.js --loglevel=debug | bunyan",
"start": "electron ./src-gen/frontend/electron-main.js | bunyan",
"start:debug": "electron ./src-gen/frontend/electron-main.js --loglevel=debug | bunyan",
"cold:start": "npm run clean && npm run build && npm start",
"watch": "concurrently --names watch-deps,watch-backend,watch-frontend --prefix \"[{name}]\" \"npm run watch:localdeps\" \"npm run watch:backend\" \"npm run watch:frontend\"",
"watch:backend": "tsc --watch",
"watch": "concurrently --names watch-deps,watch-frontend --prefix \"[{name}]\" \"npm run watch:localdeps\" \"npm run watch:frontend\"",
"watch:frontend": "npm run build:frontend && webpack --watch",
"watch:localdeps": "ldm watch --sync --run=watch --original-sources",
"test": "electron-mocha --timeout 60000 --require ts-node/register test/**/*.espec.ts",
Expand Down
Loading

0 comments on commit 675cc8d

Please sign in to comment.