modularity_core 0.2.1
modularity_core: ^0.2.1 copied to clipboard
Core implementation of Modularity framework providing dependency injection container and module lifecycle management.
0.2.1 #
GraphResolverandModuleRegistryKeynow includeModule.identityKeyin imported controller identity, preventing accidental reuse between same-type modules with different runtime constructor state.- Circular dependency detection now uses module type plus
Module.identityKey, allowing valid same-type import chains with different runtime identity while still rejecting true cycles. ModuleController.disposenow awaits async module cleanup and remains idempotent across repeated dispose calls.ModuleController.disposeno longer callsModule.onDisposefor controllers whose initialization lifecycle never started.- Imported module controllers are retained by dependent count and disposed only after the last dependent releases them.
GraphResolverrecreates disposed imported controllers instead of returning a stale disposed controller from the registry.ModuleController.initializenow coalesces concurrent calls and rejects reinitialization aftererrorordisposedstates.ModuleController.disposenow waits for in-flight initialization before running cleanup, preventingloading -> loadedraces after disposal.- Binding/export mode is reset with
try/finallyso failed exports and hot reloads cannot leave the binder in export mode. - Interceptor and cleanup failures during initialization are now contained so
controllers reach
errorstate and preserve the original initialization failure. - Configuration failures now move the controller to
errorand configuration is rejected after initialization starts.
0.2.0 #
SimpleBinder,ModuleController, andGraphResolvernow throw typed exceptions (DependencyNotFoundException,CircularDependencyException,ModuleConfigurationException,ModuleLifecycleException) instead of generic errors.- Added comprehensive dartdoc coverage on all public APIs.
- Added strict
analysis_options.yaml(strict-casts, strict-inference, strict-raw-types).
0.1.0 #
- Added
ModuleOverrideScopefor hierarchical overrides and exported it viamodularity_core. - Added
ModuleRegistryKeyfor override-aware controller caching. Controllers with different override scopes are now stored separately in the global registry. ModuleController.hotReloadnow preserves singleton instances while refreshing factories and re-applies overrides automatically (uses the newRegistrationStrategy.preserveExisting).SimpleBinderimplementsRegistrationAwareBinderand respects preserve mode for both private and public scopes.GraphResolverandModuleControllernow pass override scopes down to child modules.
0.0.2 #
- Implemented
sealPublicScope()andresetPublicScope()inSimpleBinder - Added
isExportModeEnabledandisPublicScopeSealedgetters - Improved README with detailed documentation and examples
- Improved package metadata for pub.dev (topics, issue_tracker)
0.0.1 #
- Initial release.