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

PluginCapability #381

Closed
PhantomYopta opened this issue Mar 15, 2024 · 3 comments
Closed

PluginCapability #381

PhantomYopta opened this issue Mar 15, 2024 · 3 comments
Labels
untriaged New issue has not been triaged

Comments

@PhantomYopta
Copy link

PhantomYopta commented Mar 15, 2024

Could you please add an event to PluginCapability that triggers when a Capability is registered, and also ensure that it is triggered immediately if it's already registered? It's very difficult to deal with when you have a chain of dependencies.

@github-actions github-actions bot added the untriaged New issue has not been triaged label Mar 15, 2024
@roflmuffin
Copy link
Owner

Currently capabilities are generally registered in the load method and then used from within all plugins loaded. How do you see this flow working? Will plugins register capabilities in all plugins loaded and then listen to the event?

@Muinez
Copy link
Contributor

Muinez commented Mar 16, 2024

let's say there are 3 plugins

api of plugin 2 depends on the api of plugin 1

plugin 3 depends on api of plugin 2, but since plugin 2 depends on plugin 1, plugin 2 will have to register capability in OnAllPluginsLoaded and then plugin 3 will not be able to get api of plugin 2 in OnAllPluginsLoaded.

I think the problem is solved simply if the plugin simply subscribed in Load to the event when the capability was registered
Thus a plugin that does not depend on other plugins simply registers capability in OnAllPluginsLoad, and other plugins that already depend on it, subscribe to capability registration in Load and register their api when event occurs.

@B3none
Copy link
Collaborator

B3none commented Mar 21, 2024

Could you please add an event to PluginCapability that triggers when a Capability is registered, and also ensure that it is triggered immediately if it's already registered? It's very difficult to deal with when you have a chain of dependencies.

We had a slight issue when we implemented an event firing / listening flow for Retakes.

For us it was solved by ensuring the dependencies were loaded in the correct order (alphabetically) which required slight file name changes.

I suspect the way we're firing / listening to events in our plugin could be slightly modified to fit your use case.

@roflmuffin roflmuffin closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

4 participants