Skip to content

refactor!: rename Plugin.configure to Plugin.onConfigure#538

Merged
tbouffard merged 2 commits into
mainfrom
refactor/plugin_onConfigure
Jun 25, 2026
Merged

refactor!: rename Plugin.configure to Plugin.onConfigure#538
tbouffard merged 2 commits into
mainfrom
refactor/plugin_onConfigure

Conversation

@tbouffard

@tbouffard tbouffard commented Jun 24, 2026

Copy link
Copy Markdown
Member

Why

The Plugin interface exposed an optional configure(options) method. The name did not convey that it is a lifecycle step invoked by BpmnVisualization after all plugins have been constructed: it could be mistaken for an API that client code is meant to call directly.

This PR also documents the plugin support itself through an Architecture Decision Record, so the rationale behind the design (optional features provided by the Process Analytics community project) is captured alongside the code.

What

Rename Plugin.configure to Plugin.onConfigure

The on prefix follows the common naming convention for framework-invoked lifecycle callbacks and makes the intent explicit. The signature is unchanged.

Updated accordingly:

  • Plugin interface and the internal invocation in packages/addons/src/plugins-support.ts (JSDoc now states it is a framework-called hook, not for client code)
  • the test plugin in packages/addons/test/spec/plugins-support.test.ts
  • documentation: packages/addons/README.md and CLAUDE.md

Document the plugin support with an ADR

  • Add docs/adr/0001-plugin-support.md (MADR format) explaining why the optional features provided by the Process Analytics project are implemented as opt-in plugins rather than forked into or pushed to the core bpmn-visualization library.
  • Add docs/README.md indexing the ADRs and describing the chosen format and the status conventions.
  • Reference the docs folder from the main README.md.

The ADR is currently in draft status.

Breaking change

Plugins implementing the optional configure(options) method must rename it to onConfigure(options). Only the method name changes; the signature is identical.

Validation

  • npm run build -w packages/addons: OK
  • npm test -w packages/addons: 100 tests passing
  • npm run lint-check: OK

Rename the optional `configure` method of the `Plugin` interface to `onConfigure` to signal it is a lifecycle hook
called by `BpmnVisualization` after all plugins are constructed, not an API meant to be called by client code. The
`on` prefix follows the common naming convention for framework-invoked lifecycle callbacks.

BREAKING CHANGE:
- Plugins implementing the optional `configure(options)` method must rename it to `onConfigure(options)`. The
  signature is unchanged; only the method name differs.
@tbouffard tbouffard added the refactoring Code refactoring label Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

♻️ Preview destroyed

PR preview ♻️ Destroyed ♻️ Destroyed
🔗 Preview https://process-analytics-bpmn-visualization-addons-demo-pr-538.surge.sh (already destroyed)
📝 Commit97a6aab
🪵 LogsView logs

🤖 Powered by surge-preview

Introduce Architecture Decision Records under docs/adr, using the MADR format. The first record (0001) documents the
plugin support of BpmnVisualization: why the optional features provided by the Process Analytics project are implemented
as opt-in plugins rather than forked into or pushed to the core library.

Add docs/README.md to index the ADRs and describe the format and status conventions, and reference it from the main
README.
@tbouffard tbouffard merged commit 54d251a into main Jun 25, 2026
10 checks passed
@tbouffard tbouffard deleted the refactor/plugin_onConfigure branch June 25, 2026 08:08
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

refactoring Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add Plugin cleanup support when BpmnVisualization is disposed

1 participant