2.0.0
What's Changed
1) Macro architecture was split by responsibility
DIContainerMacrowas decomposed into parser/validator/codegen/model units:Sources/InnoDIMacros/DIContainerParser.swiftSources/InnoDIMacros/DIContainerValidator.swiftSources/InnoDIMacros/DIContainerCodeGenerator.swiftSources/InnoDIMacros/DIContainerModel.swift
- Dependency extraction moved to SwiftSyntax AST traversal (
ExpressionDependencyExtractor) instead of regex heuristics. - Result: easier maintenance, lower parser/validator drift, and more predictable diagnostics.
2) DAG validation became a first-class build-time contract
- Added core cycle detection in
Sources/InnoDICore/DependencyCycleDetector.swift. - Added CLI DAG validation mode (
--validate-dag) and dedicated exit code:ExitCode.dagValidationFailure = 3
- Added build tool plugin:
Plugins/InnoDIDAGValidationPlugin/plugin.swift
@DIContainer(validateDAG: Bool = true)is now supported and defaults to validation-on.- In DAG validation mode,
validateDAG: falsecontainers are excluded from cycle/ambiguity judgments. - Ambiguous container references are promoted to explicit validation failures in DAG mode.
3) Concurrency support expanded in container APIs
@DIContainersignature now includesmainActor:@DIContainer(validate:root:validateDAG:mainActor:)
@Providesignature now includesasyncFactory:@Provide(..., factory: Any? = nil, asyncFactory: Any? = nil, concrete: Bool = false)
- Async factory behavior was added for both transient/shared paths, including async task-backed shared storage (
_storage_task_*). - Throwing behavior for async factories is inferred from closure effects.
4) Validation and parsing correctness hardened
- Centralized parsing contract in
Sources/InnoDICore/Parsing.swiftand aligned macro usage. - Removed fragile string-based checks (e.g. async/throws detection via description matching) in favor of structured syntax checks.
- Eliminated false-positive dependency cycles caused by string literals in factory expressions.
- Strengthened invariant handling in cycle detection to surface impossible states instead of silently skipping.
5) Dependency graph CLI was refactored into modules
InnoDI-DependencyGraphmoved from monolithic main into focused modules:- CLI args/exit codes
- file discovery
- container/dependency collectors
- renderers/output writer
- Rendering and path handling were stabilized across Mermaid/DOT/ASCII outputs.
- Graph identity and declaration-path tracking were made deterministic for reproducible output.
6) Test coverage was significantly expanded
- Added/expanded suites across core, macros, and CLI:
Tests/InnoDICoreTests/*Tests/InnoDIDependencyGraphCLITests/DependencyGraphCLITests.swiftTests/InnoDIMacrosTests/ProvideMacroTests.swiftTests/InnoDIMacrosTests/DependencyExtractionPropertyTests.swiftTests/InnoDIMacrosTests/DiagnosticsTests.swift
- Added seed-based property tests (200 seeds) for parser/dependency/cycle invariants.
- Added regressions for:
validateDAG: falseambiguity exclusion behavior- string-literal dependency false positives
- async factory validation edge-cases
7) Documentation and examples were upgraded
- Added DocC catalog:
Sources/InnoDI/InnoDI.docc/Overview.mdSources/InnoDI/InnoDI.docc/DIContainer.mdSources/InnoDI/InnoDI.docc/Provide.mdSources/InnoDI/InnoDI.docc/Validation.md
- Added doc generation tooling:
Tools/generate-docc.sh - Added runnable examples:
Examples/SwiftUIExampleExamples/TCAIntegrationExampleExamples/PreviewInjectionExample
- Updated
README.md, added/expandedREADME.ko.md, and refreshedExamples/README.md.
8) Benchmarks and CI workflows were modernized
- Added benchmark harness and scripts:
Benchmarks/run-compile-bench.shBenchmarks/run-runtime-bench.shBenchmarks/compare.sh
- Added benchmark result JSON outputs under
Benchmarks/results/. - CI updates:
- PR-focused macro test workflow tuning
- separate docs workflow and benchmark workflow
- Apple Silicon
macos-26runner alignment and Xcode 26.2 stabilization for consistency
- TCA example dependency pinned to
swift-composable-architecture1.23.2.
Migration Notes
- If a dependency is
.input, removefactory/asyncFactoryusage for that member. - If you currently use async construction through
factory, migrate toasyncFactory. - If strict global DAG validation is not desired for a specific container, set
validateDAG: falseexplicitly. - For CI/local parity, use an Xcode 26.2 toolchain where possible.
PRs included in this release
Full Changelog: 1.1.1...2.0.0