Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly declare root instantiables #126

Merged
merged 6 commits into from
Dec 29, 2024
Merged

Explicitly declare root instantiables #126

merged 6 commits into from
Dec 29, 2024

Conversation

dfed
Copy link
Owner

@dfed dfed commented Dec 28, 2024

Finding the @Instantiable-decorated types that are roots of a dependency tree automatically is a bit magical, but also comes with a concrete downside: when writing a brand new type that only has @Instantiated dependencies, SafeDI complains during builds until that new type is @Instantiated by another @Instantiable-decorated type.

This case is difficult for newcomers to SafeDI to debug, and also annoys veteran SafeDI consumers.

This PR represents a breaking change from the 0.9.* release, and is intended to land prior to a 1.0.0 release. This PR will land after a 0.9.1 release is created.

@dfed dfed self-assigned this Dec 28, 2024
@dfed dfed requested a review from NickEntin December 28, 2024 05:06
@dfed dfed marked this pull request as ready for review December 28, 2024 05:07
Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.68%. Comparing base (15927f1) to head (1028470).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #126   +/-   ##
=======================================
  Coverage   99.68%   99.68%           
=======================================
  Files          33       33           
  Lines        3453     3496   +43     
=======================================
+ Hits         3442     3485   +43     
  Misses         11       11           
Files with missing lines Coverage Δ
...eDICore/Extensions/AttributeSyntaxExtensions.swift 100.00% <100.00%> (ø)
...afeDICore/Generators/DependencyTreeGenerator.swift 100.00% <100.00%> (ø)
Sources/SafeDICore/Models/Instantiable.swift 100.00% <100.00%> (ø)
Sources/SafeDICore/Models/Property.swift 100.00% <100.00%> (ø)
...rces/SafeDICore/Visitors/InstantiableVisitor.swift 100.00% <100.00%> (ø)
...ources/SafeDIMacros/Macros/InstantiableMacro.swift 100.00% <100.00%> (ø)
Sources/SafeDITool/SafeDITool.swift 98.85% <100.00%> (+<0.01%) ⬆️

Copy link
Collaborator

@NickEntin NickEntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation and tests LGTM

@dfed dfed merged commit f189847 into main Dec 29, 2024
13 checks passed
@dfed dfed deleted the dfed--isRoot branch December 29, 2024 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants