Skip to content

Plugin system → Service Provider model (Wheels 4.0) #1917

@bpamiri

Description

@bpamiri

Phase 4 — Modernization Target #14 (Wheels 4.0)

Replace the zip-based, mixin-injection plugin system with a Service Provider model.

Current Problems

  • Plugins are zip files extracted at boot
  • Methods injected via StructAppend into variable scopes — collision risk
  • No namespacing — two plugins with same method name silently overwrite
  • No lifecycle hooks for plugins
  • Dead code referencing Railo-era workarounds

Proposed Design

component implements="wheels.ServiceProviderInterface" {
    function register(container) {
        container.map("auth").to("MyAuth.AuthService").asSingleton();
    }
    function boot(app) {
        app.addMiddleware("MyAuth.AuthMiddleware");
        app.modelTrait("authenticatable", "MyAuth.Authenticatable");
    }
}

Migration Path

  1. In 3.x, introduce ServiceProvider interface alongside existing plugin system
  2. Plugins can optionally include ServiceProvider.cfc for new-style registration
  3. In 4.0, deprecate mixin injection; require Service Providers
  4. Ship wheels-legacy-plugin-adapter for running old plugins in 4.0

Dependencies

Benefits from expanded DI container (#1912) and middleware pipeline (#1906).

See design_docs/MODERNIZE-WHEELS-RIM.md §4.10 for full implementation plan.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions