Skip to content

docs(adr): document load and dispose lifecycle hooks#544

Open
tbouffard wants to merge 1 commit into
mainfrom
docs/update_adr_plugin_lifecycle_hooks
Open

docs(adr): document load and dispose lifecycle hooks#544
tbouffard wants to merge 1 commit into
mainfrom
docs/update_adr_plugin_lifecycle_hooks

Conversation

@tbouffard

Copy link
Copy Markdown
Member

Aligns the plugin support ADR (docs/adr/0001-plugin-support.md) with the current implementation.

Problem

Commit 58a2446 (feat: add plugin lifecycle hooks for load and dispose, #540) added four optional hooks to the Plugin interface: onBeforeLoad, onLoadSuccess, onLoadError, onDispose. The ADR still only described the construct and onConfigure steps, so it no longer matched the code.

Changes

  • Plugin interface contract: expanded to list all six hooks, using the descriptions from the Plugin interface JSDoc (source of truth).
  • Lifecycle enumeration: extended from 2 steps to 4, covering the per-load hooks (noting load can run multiple times and that onLoadError fires before the error is rethrown) and disposal.
  • Decision Drivers: added a driver about reacting to the load/dispose lifecycle without client code wiring.
  • Consequences: added a matching "Good, because" point.

status stays draft.

Verification

Each hook described in the ADR was cross-checked against the real signatures in packages/addons/src/plugins-support.ts.

The plugin support ADR only described the construct and onConfigure lifecycle steps. Commit 58a2446 added four
optional hooks to the Plugin interface (onBeforeLoad, onLoadSuccess, onLoadError, onDispose), so the ADR no longer
matched the implementation.

Align the ADR with the Plugin interface JSDoc: list all six hooks in the interface contract, extend the lifecycle
enumeration with the per-load hooks and disposal, add a decision driver and a consequence about reacting to the
load/dispose lifecycle without client code wiring. Status stays draft.
@tbouffard tbouffard added the documentation Improvements or additions to documentation label Jul 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant