-
Notifications
You must be signed in to change notification settings - Fork 52
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
Allow user to get plugin config from client #1133
Allow user to get plugin config from client #1133
Conversation
It seems expensive to construct a plugin instance to get the config. What are the pros and cons of changing the
|
@krisbitney The main con that came to mind when looking at this issue was that we would need to trust the developer that their implementation of the PluginFactory for their plugin actually assigns the config being used by the plugin to that field (or assigns it at all). My main issue in general here has to do with the recent work of moving away from plugin configs and placing any configuration into Env. I have actually recently worked on an issue that's related to this: #1060 The question of "how much time we want to spend on this?" kind of comes to mind, and whether we are really moving away from configs into envs, making even my implementation obsolete at one point in the future. And in any case, do we foresee that we'll be using this I'm sure that I'm missing something important when considering all of this and I'd love to chat regarding this so feel free to hit me up on Discord and we'll come up with something smart! |
All of that makes sense. Thanks! |
@Tracer.traceMethod("PolywrapClient: getPluginConfig") | ||
public async getPluginConfig<TUri extends Uri | string>( | ||
uri: TUri, | ||
options: GetPluginConfigOptions = {} |
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.
Since we are using options to interact with the getPlugin
function, I think it would make sense to re-use the already existing type GetPluginOptions
I don't think this feature makes sense, since we are trying to phase out plugins from the client On your point of moving from configs to envs, that's not completely true, configs can do what envs can not (e.g. pass objects by reference) so they will always have their place. |
I agree with Jure, I think we should instead just expose a helper |
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.
comment above
…er-to-get-plugin-config-from-client
900e6e0
to
20381d2
Compare
Closes #839
The implementation fetches the plugin config by calling its factory function within the PluginPackage and extracting the config from the resulting object.