-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
There was a problem hiding this 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?
Could you also rebase and resolve the conflicts, please? |
Also I guess your state of master is old, so the automatic build is not yet in... |
Removed formatting changes, except made all strings consistent with single quote ' and \' if inside string.
Done. |
There was a problem hiding this 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.
@@ -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) | |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@max-elia please check
There was a problem hiding this comment.
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', { |
There was a problem hiding this 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 fond of depending on external repos this way. I'm not sure this is appropriate for a theia
extension generator.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@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:
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. |
@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.
While true, I don't think we should aim to include all possible downstream examples as part of the generic generator.
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
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.
I believe point 1 applies here.
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:
In essence, having such a tight coupling with the other repository is not ideal. |
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." |
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. |
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? |
The diagram-editor example now fetches from a specific tag. |
@vince-fugnitto : I would like to merge this, any objections? |
@JonasHelming I don't have strong objections but the
|
Thank you very much for your feedback, I created upstream issues! |
- 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>
We've re-worked this generator and opened a new PR: #153 |
Closes Support generator for glsp extension #110
Signed-off-by: Max Elia Schweigkofler max_elia@hotmail.de