-
-
Notifications
You must be signed in to change notification settings - Fork 39
[WIP]: Use class inheritance for plug-in API #784
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
Draft
paulrobertlloyd
wants to merge
21
commits into
main
Choose a base branch
from
feat/plugin-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
246fb38
to
00c33a7
Compare
aa0535f
to
d4c464e
Compare
d4c464e
to
b3b755c
Compare
b3b755c
to
ac7767a
Compare
0d52664
to
7c5bb34
Compare
cc2e089
to
04ad1f5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By using class inheritance with a base
IndiekitPlugin
class with child classes for the different plug-in types, it becomes possible to orchestrate common functionality and centralise debugging and error handling.This becomes even more important if we want to use an event-based model with hooks, to allow multiple plugins (and of certain types) to perform functions at given points in the publishing lifecycle. The goal is to strike a balance between giving plug-ins flexibility to determine behaviour, but have a plug-in system that works in a reliable and consistent way.
We should try to keep largely to the existing plug-in API, but at least one required changed would be to have a plug-in inherit from a parent plugin class to continue working.
Todo
Later PRs
postTypes
object