-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove explicit dependency on terminal #6645
Comments
I was thinking along these lines:
Other extensions can depend only on I think it is the standard way how such issues are resolved for OSGI bundles, for example. |
We discussed that approach in the meeting (similar to a header file and concrete implementation split), but @svenefftinge wasn't keen. |
I am not so sure about no-ops, thinking about why debug depends on the terminals. In a perfect world it would be nice to be able to not include the terminals, at all, and have the debug adapter client in Theia report that If we want to keep the package count minimal, maybe we can make each Theia package contribute multiple Inversify modules? (the Then all we lack is a way to precisely pick which modules we want to checkout. The use case I had in mind concerned the I think it is a matter of splitting functionality more than what we currently do, either by having more packages or setting up something to control what theia module extensions to precisely load. I am not fond of having stub implementations that need to be overriden. Another example: My opinion is that each package does too much at the moment to allow for granular composition of an application. We either need to split in more packages, or split in more modules and being able to pick what to use within each package. |
I don't think we want to go into picking modules. I would prefer to keep package.json as definition of what extension package is exposing and what application packages are consuming.
The point is not in stabbing, but separating definition from the implementation. Also It is not something that I'm inventing. We have bundle, feature (bundle composition) and product (bundle+feature composition) definitions in Eclipse for long time. You can see in plain java world, i.e you can pick junit api as dev dependency and another module as its implementation at runtime.
In my proposal
It still won't help, since you need then dependency to We could improve though process of picking extensions, like stub implementations can warn that real implementation is missing and such can be used. It should be suppressible then. |
While reviewing PRs, I'm generally frustrated with how hard it to add new functionality and how cross package functionality actually couple everything together. 😢 For example, let's say we notice that
It would be nice to make it simple. If each package is split to API (i don't mean that we should use typescript interfaces here, I hate boilerplate) and implementation sides, then:
It allows us to go a way of coupling everything and designing new abstractions each time when we want to break coupling. There are challenges with that, but they are not new:
|
To keep with the
Again, never said anything about hoisting
If the API package doesn't provide interfaces, or at the very least symbols to bind, then what does it provide? Could the runtime check be done at binding time, in the container modules? I think currently, we check out theia extensions as transitive dependencies, so if we define our app like: "dependencies": [
"@theia/core": "...",
"@theia/terminal": "..."
] It will mount |
Looking at how I think it would be more constructive if we look at real usages of |
I was only taking the In this case, it would map to what you said, if I make an application as "dependencies": [
"@theia/core": "...",
"@theia/debug": "..."
] Then we may assume that someone doesn't want the terminals in his application. In this case, the generators shouldn't try to mount the |
Why would i want to download |
For
@inject('TerminalService') @optional()
protected readonly terminalService: TerminalService | undefined;
supportsRunInTerminalRequest: !!this.terminalServer No need for any drastic changes in how extensions are installed. |
I don't think we can remove |
If having something as dev-dependency makes it so generators won't mount containers, then it is exactly what I was trying to get to, thanks for the trick. For |
Correct, we have custom extension points and don't want to expose the terminal in our browser version |
Generators is designed to follow how npm/yarn works. It collects modules transitively from production dependencies. Dev dependencies are not production. We want to stick with this: if someone knows how yarn install dependencies, he should be sure that transitive are installed and loaded. Plus it removes maintenance work to keep package.json up to date whenever some extensions adds another extension dependency.
The plugin system is already complex enough because of custom namespaces and so on and we have a big maintenance effort to catch up with VS Code. We actually would like to find ways to make it simpler, see #6353 and #6353 for example. Technically it is feasible to do what you want by extracting parts agnostic to namespaces in another extension, so you can reuse engine running plugins without features. Conceptually i don't know whether it goes in the direction of simplification or introduce another variant. You are better to discuss with @svenefftinge Regards for other extensions i would be fine to remove dependencies for |
So what's the consensus around moving this forward? @svenefftinge do you have anything to add? |
I would be fine extracting something like @svenefftinge I don't think it collides with an intention to reuse the extension host process, or maybe even help by enabling alternative implementations. It will be breaking change though. cc @eclipse-theia/plugin-system |
@akosyakov I'm more keen to implement the terminal plugin as an interface so it's implementation can be explicitly excluded from a build no matter what other packages rely on it. |
Description
There are many cases when the terminal functionality isn't required. It gives full access to the system being run in a web context and should be easily turned off. e.g. #5663
The problem is, many extensions have a direct or indirect dependency on terminal (e.g. plugin-ext, debug, cpp), so taking any of these means the terminal functionality appears.
As discussed in the dev meeting, there are a few ways this could be resolved:
theia/core
which will satisfy all the plugins, but not register any commands or menus. Including the terminal extension would override this dummy.I think the last option here makes most sense, but as both may require large changes, I want to get some input from others first.
@marcdumais-work @marechal-p @akosyakov @svenefftinge Thoughts?
The text was updated successfully, but these errors were encountered: