-
-
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 currently have no lifecycle hooks beyond init(). They can't run logic on load, register routes, add event listeners, or perform cross-plugin setup. This issue adds two optional lifecycle methods.
Proposed Hooks
onPluginLoad(app)
- Called after plugin instantiation, before mixin processing
- Receives an app context struct with access to: route mapper, event system, config
- Use cases: register routes, add event listeners, declare config requirements
onPluginActivate()
- Called after all plugins are loaded and all mixins injected
- Use cases: cross-plugin setup, verify peer dependencies are active, warm caches
Contract
Both methods are optional. Existing plugins without them continue to work unchanged. This is the incremental stepping stone toward the register(container) / boot(app) Service Provider pattern in 4.0 (#1917).
Implementation
- After
CreateObject+init()in$pluginsProcess(), check for and callonPluginLoad(app) - After
$initializeMixins()completes for all plugins, loop and callonPluginActivate()
Files
vendor/wheels/Plugins.cfc:146-178— extend$pluginsProcess()vendor/wheels/events/onapplicationstart.cfc:235-246— add post-load activation loop
Phase
Phase 2 — DI Integration & Lifecycle (3.x, backward compatible)
Related
- Plugin system → Service Provider model (Wheels 4.0) #1917 — Plugin → Service Provider model (4.0 epic)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementphase:3-pluginsPlugin lifecycle, DI, middleware, migration bridgePlugin lifecycle, DI, middleware, migration bridge