lemmy
lemmy copied to clipboard
Plugin improvements
Performance:
- to improve performance dont call
function_existsevery time, but store a vec with all available plugin hooks - load plugins immediately on startup, so they can be initialized in the background while lemmy initializes the db, runs migrations etc
- Load plugin metadata in parallel https://github.com/LemmyNet/lemmy/blob/9d98c82ec30e8f261fd9459a4e75dc0f979de0eb/crates/api/api_utils/src/plugins.rs#L113
New features (there are a lot of possibilities):
- move plugin configuration to a database table and support live reloading
- add plugin ui for admins to lemmy-ui with:
- list of installed plugins
- config for each plugin
- list of available plugins to install (hosted on join-lemmy.ml or federated)
- plugin stats (which hooks active, how often called, how long execution time)
- add more plugin hooks
- http endpoints like
GET /api/v4/plugin/*name*/are forwarded to plugin hookhttp_call(req: HttpRequest): HttpResponse - plugins can make db queries via host function, eg for vote analysis (https://github.com/LemmyNet/lemmy/pull/5669)