refactor!: rename Plugin.configure to Plugin.onConfigure#538
Merged
Conversation
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.
♻️ Preview destroyed
🤖 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.
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.




Why
The
Plugininterface exposed an optionalconfigure(options)method. The name did not convey that it is a lifecycle step invoked byBpmnVisualizationafter 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.configuretoPlugin.onConfigureThe
onprefix follows the common naming convention for framework-invoked lifecycle callbacks and makes the intent explicit. The signature is unchanged.Updated accordingly:
Plugininterface and the internal invocation inpackages/addons/src/plugins-support.ts(JSDoc now states it is a framework-called hook, not for client code)packages/addons/test/spec/plugins-support.test.tspackages/addons/README.mdandCLAUDE.mdDocument the plugin support with an ADR
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 corebpmn-visualizationlibrary.docs/README.mdindexing the ADRs and describing the chosen format and the status conventions.README.md.The ADR is currently in
draftstatus.Breaking change
Plugins implementing the optional
configure(options)method must rename it toonConfigure(options). Only the method name changes; the signature is identical.Validation
npm run build -w packages/addons: OKnpm test -w packages/addons: 100 tests passingnpm run lint-check: OK