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

WIP: Add GLSP DiagramEditor extension #111

Closed
wants to merge 1 commit into from
Closed

WIP: Add GLSP DiagramEditor extension #111

wants to merge 1 commit into from

Conversation

max-elia
Copy link
Contributor

@max-elia max-elia commented Jun 7, 2021

Signed-off-by: Max Elia Schweigkofler max_elia@hotmail.de

Copy link
Contributor

@JonasHelming JonasHelming left a comment

Choose a reason for hiding this comment

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

There are lots of unrelated formatting changes, e.g. semicolon and changes of ' to "
Could you remove them from the PR please?

@JonasHelming
Copy link
Contributor

Could you also rebase and resolve the conflicts, please?

@JonasHelming
Copy link
Contributor

Also I guess your state of master is old, so the automatic build is not yet in...

@max-elia
Copy link
Contributor Author

max-elia commented Jun 7, 2021

There are lots of unrelated formatting changes, e.g. semicolon and changes of ' to "
Could you remove them from the PR please?

Removed formatting changes, except made all strings consistent with single quote ' and \' if inside string.

Could you also rebase and resolve the conflicts, please?

Done.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I'm not really sure about the example, I'll have to think more about it:

  • it relies heavily on an external repo and project, it might be better not to include it as we now have a dependency on a downstream project which will be harder to maintain.
  • the project structure is not really consistent with other theia applications.
  • it is a very heavy example that needs to install java and maven.

It might be better to have an eclipse-glsp generator rather than trying to fit it into the theia generator.

cc @marcdumais-work

@@ -51,6 +51,7 @@ yo theia-extension --help
| `tree-editor` | Creates a tree editor extension | [readme](https://github.com/eclipse-theia/generator-theia-extension/blob/master/templates/tree-editor/README.md) |
| `empty` | Creates a simple, minimal extension | [readme](https://github.com/eclipse-theia/generator-theia-extension/blob/master/templates/empty/README.md) |
| `backend` | Creates a backend communication extension | [readme](https://github.com/eclipse-theia/generator-theia-extension/blob/master/templates/backend/README.md) |
| `diagram-editor` | Creates a diagram editor extension | [readme](https://github.com/eclipse-glsp/glsp-examples/blob/master/README.md) |
Copy link
Member

Choose a reason for hiding this comment

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

We should probably not reference links to other repos, especially those not in the same organization.
We can probably reference a readme as part of the repo (maintained by the repo).

package.json Outdated
@@ -16,6 +16,9 @@
"author": "TypeFox",
"license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
"dependencies": {
"download": "^8.0.0",
"fs-extra": "^10.0.0",
"github-download": "^0.5.0",
Copy link
Member

Choose a reason for hiding this comment

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

Is the dependency being used?

Copy link
Contributor

Choose a reason for hiding this comment

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

@max-elia please check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed it.

src/app/index.ts Outdated
/** DiagramEditor */
if (this.params.extensionType === ExtensionType.DiagramEditor) {
var done = this.async();
download('https://github.com/eclipse-glsp/glsp-examples/archive/master.tar.gz', 'tmp', {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not really fond of depending on external repos this way. I'm not sure this is appropriate for a theia extension generator.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree this is not ideal. For example we have the vscode-ripgrep dependency in the main repo that does this, to fetch a platform-appropriate ripgrep binary from GH downloads, and is a rather consistent source of misc problems, like getting the download to work behind some corporate firewalls.

Do we know if the download dependency will respect proxy environment settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exchanged the download dependency and replaced it with the more common request and tar packages.

@JonasHelming
Copy link
Contributor

I'm not really sure about the example, I'll have to think more about it:

  • it relies heavily on an external repo and project, it might be better not to include it as we now have a dependency on a downstream project which will be harder to maintain.
  • the project structure is not really consistent with other theia applications.
  • it is a very heavy example that needs to install java and maven.

It might be better to have an eclipse-glsp generator rather than trying to fit it into the theia generator.

cc @marcdumais-work

@vince-fugnitto : Thank you for your comment. We actually discussed the exact same concerns before we decided to contribute this here. The example is essentially showing how GLSP diagrams can be embedded into Theia. So you can definitily argue it should be located here or in a GLSP specific generator. Our main drivers to contribute here were:

  1. It is visible to Theia beginners, which i believe is positive for Theia and GLSP. It shows what you can do with Theia and that there are other technologies integrating with it.
  2. If you get started with Theia and a diagram, you likely also want a command, a tree or others things in this generator, so for the user it feels more consistent than using to (or maybe more) generators.
  3. Strictly speaking, other generators have technology dependencies, too, e.g. the widget depends on React.
  4. We wanted to avoid maintaining two generators. We actually took over more of the maintainance work of the Theia generator and intend to continue to do so. Therefore, we can put 100% of our maintainance resource on one generator, rather than splitting it. This would not be a good argument on its own, but combined with the others, I believe it is valid.
  5. Finally, and most important, we obeserve that especially new adopters get confused about the project borders. We frenquently get questions and comments that the available technologies are not easy to get and the relations between them are hard to find. I believe having a place with examples that integrate the different projects into Theia can be a part of a solution to this issue.

For the maintenance effort, I can commit to heavily contribute to this.

At the end, both options have their pros and cons, I hope the reasons above make some sense to you.

@vince-fugnitto
Copy link
Member

@JonasHelming I don't mean to hold back the pull-request, just wanted to share my thoughts on it candidly (as is I have issues with the extension directly pulling files from another repository). I'll let @marcdumais-work take a look as well, initially he shared the same sentiments I had.

  1. It is visible to Theia beginners, which i believe is positive for Theia and GLSP. It shows what you can do with Theia and that there are other technologies integrating with it.

While true, I don't think we should aim to include all possible downstream examples as part of the generic generator.

  1. If you get started with Theia and a diagram, you likely also want a command, a tree or others things in this generator, so for the user it feels more consistent than using to (or maybe more) generators.

I believe the generated templates should be simple, as you mentioned it is for beginners (some have issues with just the hello-world example). More complex templates should likely not be part of the repo, and the glsp + theia example can simply be its own repo which has an example on how to do the integration. But this is my opinion.

  1. Strictly speaking, other generators have technology dependencies, too, e.g. the widget depends on React.

I believe the two are not the same, it is different to have a versioned dependency which is heavily tested and maintained like React and instead fetch files from another repository. In addition, the template always pulls master which is not ideal. I would not say this point is valid as is.

  1. We wanted to avoid maintaining two generators. We actually took over more of the maintainance work of the Theia generator and intend to continue to do so. Therefore, we can put 100% of our maintainance resource on one generator, rather than splitting it. This would not be a good argument on its own, but combined with the others, I believe it is valid.

I believe point 1 applies here.

  1. Finally, and most important, we obeserve that especially new adopters get confused about the project borders. We frenquently get questions and comments that the available technologies are not easy to get and the relations between them are hard to find. I believe having a place with examples that integrate the different projects into Theia can be a part of a solution to this issue.

The use of examples also succeed in informing users, I don't necessarily believe it has to be part of a generator.


If we are to move forward with this generator, we should fix the following:

  • not fetch files directly from the other repository.
  • not fetch master (as we have no guarantee of what is added to master and it is the opposite of versioning).

In essence, having such a tight coupling with the other repository is not ideal.

@JonasHelming
Copy link
Contributor

thank you again for sharing your opinion!

Quick note: I definitely share the concern with fetching master, it should be a tag which is actively maintained for this purpose

"While true, I don't think we should aim to include all possible downstream examples as part of the generic generator."
=> I think we are far away from this state :-)

@marcdumais-work
Copy link
Contributor

I'm not really sure about the example, I'll have to think more about it:

FWIW, I think this is a rather niche example at the moment, that most Theia extension developers will not need. However, the few that do will benefit from it being available. So, as long as this new example does not hinder too much, I think it's worthwhile, and could kick-start a nice eco-system of Theia-based graphical/diagram apps.

@marcdumais-work
Copy link
Contributor

marcdumais-work commented Jun 17, 2021

In essence, having such a tight coupling with the other repository is not ideal.

However, if I understand correctly, the dependency seems well-insulated, in the sense that it will be fetched lazily, when the user chooses to create that type of extension. IoW if it breaks, the rest (other examples) should still work? That, and the commitment by Jonas to maintain it, appeases my mild apprehensions about this PR.

In addition, it will be a nice example to have, no? Very different from what we have so far in this repo?

@max-elia
Copy link
Contributor Author

The diagram-editor example now fetches from a specific tag.

cc @JonasHelming

@JonasHelming
Copy link
Contributor

@vince-fugnitto : I would like to merge this, any objections?

@vince-fugnitto
Copy link
Member

@vince-fugnitto : I would like to merge this, any objections?

@JonasHelming I don't have strong objections but the glsp extension should likely be updated upstream, there are a few issues such as:

  • Pinning all of theia to 1.14.0
  • Because of the pin, the extension still targets es5 and not es2017
  • The idea of client and server (top level directories) does not make sense to me, can you clarify why it's done this way? The "client" component (theia) is made up of client + server already so it may be confusing to adopters.
  • Given that the extension is one of the more complex templates we have as part of the repository, we might want to document the code more, the example is likely not documented well enough for adopters to use as is.

@JonasHelming
Copy link
Contributor

Thank you very much for your feedback, I created upstream issues!

@max-elia max-elia changed the title Add GLSP DiagramEditor extension WIP: Add GLSP DiagramEditor extension Mar 30, 2022
- Implement generator for glsp theia extension based on https://github.com/eclipse-glsp/glsp-examples
- Give the possibility to add additional custom nodes with the shape of Rectangle, Circle or Diamond
Closes #110

Signed-off-by: Max Elia Schweigkofler <max_elia@hotmail.de>
@planger
Copy link
Contributor

planger commented Aug 9, 2022

We've re-worked this generator and opened a new PR: #153
I think this one can now be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support generator for glsp extension
5 participants