Skip to content

Make PluginGroup.add and PluginGroup.remove chainable#315

Merged
waynemwashuma merged 1 commit into
wimaengine:devfrom
waynemwashuma:default-plugins-method-chainable
May 12, 2026
Merged

Make PluginGroup.add and PluginGroup.remove chainable#315
waynemwashuma merged 1 commit into
wimaengine:devfrom
waynemwashuma:default-plugins-method-chainable

Conversation

@waynemwashuma
Copy link
Copy Markdown
Collaborator

@waynemwashuma waynemwashuma commented May 12, 2026

Objective

Improve the PluginGroup API by enabling method chaining.

Solution

Previously, PluginGroup#add() and PluginGroup#remove() mutated internal state but returned void.

This prevented fluent configuration patterns such as:

group.add(pluginA).add(pluginB)

Why this approach

Improves ergonomics for plugin composition

Showcase

Before

const group = new PluginGroup()

group.add(pluginA)
group.add(pluginB)
group.remove(typeid(MyPlugin))

After

const group = new PluginGroup()
  .add(pluginA)
  .add(pluginB)
  .remove(typeid(MyPlugin))

Migration guide

No migration required.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma merged commit d1916aa into wimaengine:dev May 12, 2026
7 checks passed
@waynemwashuma waynemwashuma deleted the default-plugins-method-chainable branch May 12, 2026 17:58
@waynemwashuma waynemwashuma self-assigned this May 12, 2026
@waynemwashuma waynemwashuma added the type:enhancement New feature or request label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:app type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant