-
-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Labels
enhancementphase:3-pluginsPlugin lifecycle, DI, middleware, migration bridgePlugin lifecycle, DI, middleware, migration bridge
Milestone
Description
Summary
Plugins cannot register middleware with the middleware pipeline (#1906). A plugin that needs request-level behavior (auth checks, CORS, rate limiting) must inject into controller scopes via mixins — the wrong abstraction level.
Proposed API
Via onPluginLoad
function onPluginLoad(app) {
app.addMiddleware("plugins.myPlugin.MyMiddleware");
}Via plugin.json
{
"middleware": ["AuthMiddleware", "CorsMiddleware"]
}Behavior
- During plugin loading, middleware declarations are collected
- After all plugins load, declared middleware is appended to the middleware pipeline
- Order follows plugin load order (which follows alphabetical or explicit ordering)
- The middleware pipeline (Middleware pipeline #1906) already supports dynamic registration — this just adds the plugin integration point
Files
vendor/wheels/Plugins.cfc— collect middleware declarations during loadvendor/wheels/events/onapplicationstart.cfc— register collected middleware with pipeline
Phase
Phase 2 — DI Integration & Lifecycle (3.x, backward compatible)
Related
- Middleware pipeline #1906 — Middleware pipeline (implemented)
- Plugin system → Service Provider model (Wheels 4.0) #1917 — Plugin → Service Provider model (4.0 epic)
- Depends on: Add plugin.json manifest support alongside box.json #1976 (plugin.json manifest), benefits from Plugin lifecycle hooks: onPluginLoad, onPluginActivate #1979 (lifecycle hooks)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementphase:3-pluginsPlugin lifecycle, DI, middleware, migration bridgePlugin lifecycle, DI, middleware, migration bridge