Skip to content

Commit

Permalink
#418#420 Consume server DI rework (#45)
Browse files Browse the repository at this point in the history
* #418#420 Consume server DI rework

Server
- Update  dependencies to consume latest DI rework
- Update .tpd file and rename it to `r2021-03`
- Adapt existing server code to conform to latest API changes
- Align prefix for eclipse-integration specific classes. (Use `Ide` over `Eclipse`)
- Update  .settings/org.eclipse.jdt.ui.prefs for glsp.ide.editor to ensure that the copyright header for new files has the correct year.
- Introduce a wrapper `GLSPClient` implementation (`IdeGLSPClient`) that handles dedicated GLSPClient proxies for each client session and can be  connected to the `GLSPServer` (#420)
- GLSPDiagramEditor:
-- Refactor Browser-URL generation
-- Generate applicationID and send to client via url query
- Add command to DiagramMenu to open the current DiagramWidget in an external browser for debugging purposes.

Client:
- Update dependencies to latest glsp nightlies
- Adapt code to conform to latest protocol changes
- [WF-Example] Retrieve application id from url params
- [WF-Example] Update webpack config to  webpack 4 and ensure proper source-map generation for debugging
- [WF-Example] Fix webpack build to support codicons (#406)

Fixes eclipse-glsp/glsp/issues/418
Fixes eclipse-glsp/glsp/issues/420
Part of eclipse-glsp/glsp/issues/406
  • Loading branch information
tortmayr committed Nov 5, 2021
1 parent fe162f8 commit d43f740
Show file tree
Hide file tree
Showing 49 changed files with 1,222 additions and 786 deletions.
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ lib
**/app/bundle.js.map

*.log
*.ttf
19 changes: 10 additions & 9 deletions client/examples/workflow-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
"@eclipse-glsp/protocol": "next"
},
"devDependencies": {
"circular-dependency-plugin": "^2.0.0",
"core-js": "^2.5.1",
"css-loader": "^2.1.0",
"reflect-metadata": "^0.1.10",
"rimraf": "^2.6.1",
"style-loader": "^0.23.1",
"ts-loader": "^4.4.2",
"circular-dependency-plugin": "^5.2.2",
"css-loader": "^4.3.0",
"reflect-metadata": "^0.1.13",
"file-loader": "^6.2.0",
"rimraf": "^3.0.2",
"style-loader": "^2.0.0",
"ts-loader": "^9.2.6",
"typescript": "^3.9.2",
"webpack": "^4.15.1",
"webpack-cli": "^3.0.8"
"webpack": "^4.46.0",
"source-map-loader": "^1.0.2",
"webpack-cli": "^4.9.1"
},
"scripts": {
"prepare": "yarn clean && yarn build && yarn lint",
Expand Down
3 changes: 2 additions & 1 deletion client/examples/workflow-webapp/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const filePath = urlParameters.path;
// In the Eclipse Integration, port is dynamic, as multiple editors
// and/or Eclipse Servers may be running in parallel (e.g. 1/Eclipse IDE)
const port = parseInt(urlParameters.port, 10);
const applicationId = urlParameters.application;
const id = 'workflow';
const diagramType = 'workflow-diagram';
const websocket = new WebSocket(`ws://localhost:${port}/${id}`);
Expand All @@ -52,7 +53,7 @@ websocket.onopen = () => {
async function initialize(client: GLSPClient): Promise<void> {
await diagramServer.connect(client);
const result = await client.initializeServer({
applicationId: ApplicationIdProvider.get(),
applicationId,
protocolVersion: GLSPClient.protocolVersion
});
await configureServerActions(result, diagramType, container);
Expand Down
26 changes: 21 additions & 5 deletions client/examples/workflow-webapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const path = require('path');

const buildRoot = path.resolve(__dirname, 'lib');
const appRoot = path.resolve(__dirname, 'app');
var CircularDependencyPlugin = require('circular-dependency-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');

module.exports = {
entry: ['core-js/es6/map', 'core-js/es6/promise', 'core-js/es6/string', 'core-js/es6/symbol', path.resolve(buildRoot, 'index')],
entry: [path.resolve(buildRoot, 'index')],
output: {
filename: 'bundle.js',
path: appRoot
Expand All @@ -30,7 +30,7 @@ module.exports = {
devtool: 'source-map',
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
Expand All @@ -46,10 +46,23 @@ module.exports = {
}
]
},
{
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre'
},
{
test: /\.css$/,
exclude: /\.useable\.css$/,
loader: 'style-loader!css-loader'
use: ['style-loader', 'css-loader']
},
{
test: /\.(ttf)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]',
esModule: false
}
}
]
},
Expand All @@ -60,5 +73,8 @@ module.exports = {
failOnError: false
}),
new webpack.WatchIgnorePlugin([/\.js$/, /\.d\.ts$/])
]
],
stats: {
warningsFilter: [/Failed to parse source map/]
}
};
7 changes: 1 addition & 6 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
"lint": "lerna run lint --",
"copyClient": "copyfiles -f ./examples/workflow-webapp/app/* ../server/example/org.eclipse.glsp.ide.workflow.editor/diagram",
"publish:next": "lerna publish --exact --canary=next --npm-tag=next --yes",
"upgrade:next": "yarn upgrade -p \"@eclipse-glsp.*\" --next "
},
"resolutions": {
"**/@eclipse-glsp/client": "0.9.0-next.3f2a7f35",
"**/@eclipse-glsp/protocol": "0.9.0-next.3f2a7f35",
"**/sprotty": "0.10.0-next.69a773d"
"upgrade:next": "yarn upgrade -p \"@eclipse-glsp.*|sprotty\" --next "
},
"workspaces": [
"packages/*",
Expand Down
4 changes: 3 additions & 1 deletion client/packages/ide/src/features/copy-paste/copy-paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
********************************************************************************/
import {
Action,
CutOperation,
EditorContextService,
GLSP_TYPES,
IActionDispatcher,
IActionHandler,
IAsyncClipboardService,
PasteOperation,
RequestClipboardDataAction,
TYPES,
ViewerOptions
} from '@eclipse-glsp/client';
import { CutOperation, PasteOperation, RequestClipboardDataAction } from '@eclipse-glsp/client/lib/features/copy-paste/copy-paste-actions';
import { inject, injectable } from 'inversify';

// Eclipse-specific integration: in Eclipse, we trigger the Copy/Paste actions from
Expand Down
Loading

0 comments on commit d43f740

Please sign in to comment.