From 97daec593ce8257ee1e69dcb2cf5837e4d0d3ba2 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Sun, 18 Oct 2026 19:16:35 +0200 Subject: [PATCH] docs(plugins): note optional dependencies still sit in go.mod An optional dependency is optional at activation, not at compile time: importing the package that declares a looked-up type keeps the other plugin in go.mod; only party.Plugin.Requires leaves it out. --- docs/plugins/extending.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/plugins/extending.md b/docs/plugins/extending.md index 1807277c..a4a83673 100644 --- a/docs/plugins/extending.md +++ b/docs/plugins/extending.md @@ -57,6 +57,8 @@ A required dependency goes in `party.Plugin.Requires`, and activation fails when This replaces `PluginManager::exists` checks in WinterCMS. +Optional here means optional at activation, not at compile time. A plugin that looks up a type declared in another plugin's package imports that package, so the other plugin still appears in its `go.mod`. Only `party.Plugin.Requires` leaves it out. `pact.OptionalMessage` is the way to integrate without that import. + ## Model hooks and GORM callbacks A model reacts to its own lifecycle with GORM hook methods such as `BeforeSave`; [lagoon](../../modules/lagoon/README.md) names them as interfaces (`lagoon.HasBeforeSave`, `lagoon.HasBeforeDelete` and the rest) so you can assert them at compile time.