Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#258 Refactor theia integration code base #84

Merged
merged 2 commits into from
Aug 10, 2021
Merged

Conversation

tortmayr
Copy link
Contributor

@tortmayr tortmayr commented Aug 10, 2021

Reactor the theia integration code base to reduce boilerplate configuration code and make the setup of a new GLSP theia diagram editor easier

Major changes:

  • Rename GLSPTheiaSprottyConnector to TheiaGLSPConnector and refactor the implementation to enable injecton of connectors (instead of the previous constructor-based approach). The connector is injected into the corresponding diagram container in the diagram configuration.
  • Implement a reusable and easy reconfigurable convenience container module ('GLSPTheiaFrontendModule') that setups the necessary module configuration for a GLSP theia diagram implementation and serves as a documented entry point for users. Similar to how the GLSPModule is implemented on server side
  • Introduced GLSPDiagramLanguage interface to capture configuration constants for a diagram integration. The 'GLSPTheiaFrontendModule' uses this for configuration. This replaces the previous best-practice approach of keeping a namespace with configuration constants in the common-package.
  • The 'GLSPDiagramClient' API is no longer needed and for the base use case it's no longer necessary to explicitly bind a diagram managr, glsp client contribution or theia-glsp connector.

Additional changes:

  • Remove redundant name property in GLSPClient and GLSPServer contribution
  • Refactor TheiaJsonrpcClient
  • Remove unused fileExtensions property form glsp-client-contribution.ts
  • Rename files so that the file name is aligned with the name of the central component in the .ts file (Theia Coding Convention)
  • Defined lib/browser as main entry point for @eclipse-glsp/theia-integration.

Requires eclipse-glsp/glsp-client/pull/130
Fixes eclipse-glsp/glsp/issues/258

@tortmayr tortmayr requested a review from planger August 10, 2021 09:51
Reactor the theia integration code base to reduce boilerplate configuration code and make the setup of a new GLSP theia diagram editor easier

Major changes:
- Rename `GLSPTheiaSprottyConnector` to `TheiaGLSPConnector` and refactor the implementation to enable injecton of connectors (instead of the previous constructor-based approach). The connector is injected into the corresponding diagram container in the diagram configuration.
- Implement  a reusable and easy reconfigurable convenience container module ('GLSPTheiaFrontendModule') that setups the necessary module configuration for a GLSP theia diagram implementation and serves as a documented entry point for users. Similar to how the `GLSPModule` is implemented on server side
- Introduced `GLSPDiagramLanguage` interface to capture configuration constants for a diagram integration. The 'GLSPTheiaFrontendModule' uses this for configuration. This replaces the previous best-practice approach of keeping a namespace with configuration constants in the common-package.
- The 'GLSPDiagramClient' API is no longer needed and for the base use case it's no longer necessary to explicitly bind a diagram manager glsp client contribution or theia-glsp connector. 

Additional changes:
- Remove redundant `name` property in GLSPClient and GLSPServer contribution
- Refactor TheiaJsonrpcClient
- Remove unused `fileExtensions` property form glsp-client-contribution.ts
- Rename files so that the file name is aligned with the name of the central component in the .ts file (Theia Coding Convention)
- Defined lib/browser as main entry point  for `@eclipse-glsp/theia-integration`. 

Requires eclipse-glsp/glsp-client/pull/130
Fixes eclipse-glsp/glsp/issues/258
@tortmayr tortmayr force-pushed the tortmayr/issues/258 branch from a39f75f to 02f7c23 Compare August 10, 2021 12:08
Copy link
Member

@planger planger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks a lot!
Much less boilerplate code and much cleaner. Thanks again!

Co-authored-by: Philip Langer <planger@users.noreply.github.com>
@tortmayr tortmayr merged commit 2e2816c into master Aug 10, 2021
@tortmayr tortmayr deleted the tortmayr/issues/258 branch August 10, 2021 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce boilerplate code for creating a new glsp theia diagram editor
2 participants