-
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
The preference extension should be always installed explicitly #667
Comments
One option will be to provide stub implementations in API packages that an app does not fail. Such stubs can log warnings that the implementation is not provided. |
Could this be considered a peerDependency? Since I tought the reason for the split was to avoid circual deps ? We could depend on the api and have the extension as a peerDep ? |
It looks like
|
Humm could Theia take care of installing them ? |
@akosyakov I think for something like this we should use the stub implementations (and default values) if the |
@vince-fugnitto yes, I think it used to work like that, but got broken with all refactorings for last years ) |
Hm, my take on this is that the current design tried to dance around core actually trying to consume some kind of preference to be configured, but it conflicted with the fact that the implementation for preferences lives in Core already does a lot of things, but required things. Why not having the model for preferences defined in core itself? It would make sense to have some config mechanism builtin inside Extensions wanting to access workspace/folder scoped preferences would use Would this make more sense? |
I thought we already have model there. I'm going to rewrite preference provider to use monaco models to respect dirty editors and fix race conditions with current programmatic update of preference values. It should not go to core. Also currently they depend on filesystem how this dependency could be broken? |
But I like an idea to avoid requiring installation of preference extension. I think you mentioned some default in memory implementation of preference providers once? |
I remember you once said that one shouldn't use
This makes me think that from the browser we could store things in localstorage rather than directly on disk (though localstorage is just the browser storing that for you somehow). It might even make more sense than putting it in the user home. |
I don't fully understand the motivation behind it, but does that require to explicitly depend on monaco packages? Sure would be an issue in core, maybe just bring the interfaces into our source code?
Didn't know about this issue, sounds good to me. |
Yes, I'm thinking to add
It can work only if a user always using the same machine, the same browser and the same origin (schema+port+host). If one of them changes user preferences are lost. |
I'm sorry, but could you explain why preferences need this? In my mind, core would provide basic infrastructure for preferences to work and for extensions to build on top of it (new providers/scopes). Monaco-specific things would be contributed from somewhere else than core.
True, could still be interesting to have a preference scope for storing things at this level, but not a hard requirement. It should still be possible for core to have a backend service managing storage in the user home? This way we don't depend on |
Currently we mutate preferences directly on the disk, if a user has a preference file opened with dirty changes we miss it. It is bogus, we should read from a dirty editor model and update it as well. It’s a first problem. Second that vscode extensions are sending many concurrent preference updates leading to different file stats and conflicts. With monaco models updates will be applied one after another and only then flushed to the disk by monaco. |
It will have the same issues as current implementation as race conditions. It is solvable but it does not worth it if no one really using it in such configuration, i.e. it would need new code which we have to test, maintain, distribute and so on. |
Since the preference extension was split on the API and extension package, there are no extensions depending on the extension package.
How should we handle such cases?
To reproduce try to build and start Theia for the following package:
The text was updated successfully, but these errors were encountered: