StanfordSpezi / Spezi

Open-source framework for rapid development of modern, interoperable digital health applications.
https://swiftpackageindex.com/StanfordSpezi/Spezi/documentation
MIT License
145 stars 11 forks source link

New @Model and @Modifier property wrappers for Modules #88

Closed Supereg closed 11 months ago

Supereg commented 11 months ago

New @Model and @Modifier property wrappers for Modules

:recycle: Current situation & Problem

As motivated in #87, we have a desire to give Modules greater access to the SwiftUI view hierarchy an it's environment. Particularly, we want to provide a way to provide arbitrary ViewModifier implementations, modifying the global SwiftUI view hierarchy.

We introduce several new property wrappers you can use within your Module:

Further, this PR preforms the following breaking changes:

:gear: Release Notes

Breaking Changes

:books: Documentation

Documentation was added and updated to reflect all the above changes.

:white_check_mark: Testing

Testing was updated and added to cover newly added code.

:pencil: Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

codecov[bot] commented 11 months ago

Codecov Report

Merging #88 (6bbe89c) into main (e75ea4d) will decrease coverage by 2.13%. The diff coverage is 90.97%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88/graphs/tree.svg?width=650&height=150&src=pr&token=KHU2K1HTAM&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi)](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #88 +/- ## ========================================== - Coverage 97.63% 95.49% -2.13% ========================================== Files 34 36 +2 Lines 631 665 +34 ========================================== + Hits 616 635 +19 - Misses 15 30 +15 ``` | [Files](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | Coverage Δ | | |---|---|---| | [...ilities/Communication/CollectPropertyWrapper.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9DYXBhYmlsaXRpZXMvQ29tbXVuaWNhdGlvbi9Db2xsZWN0UHJvcGVydHlXcmFwcGVyLnN3aWZ0) | `100.00% <100.00%> (ø)` | | | [...ilities/Communication/ProvidePropertyWrapper.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9DYXBhYmlsaXRpZXMvQ29tbXVuaWNhdGlvbi9Qcm92aWRlUHJvcGVydHlXcmFwcGVyLnN3aWZ0) | `100.00% <100.00%> (ø)` | | | [...bilities/Communication/StorageValueCollector.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9DYXBhYmlsaXRpZXMvQ29tbXVuaWNhdGlvbi9TdG9yYWdlVmFsdWVDb2xsZWN0b3Iuc3dpZnQ=) | `100.00% <100.00%> (ø)` | | | [...abilities/Communication/StorageValueProvider.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9DYXBhYmlsaXRpZXMvQ29tbXVuaWNhdGlvbi9TdG9yYWdlVmFsdWVQcm92aWRlci5zd2lmdA==) | `100.00% <100.00%> (ø)` | | | [...pezi/Capabilities/Lifecycle/LifecycleHandler.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9DYXBhYmlsaXRpZXMvTGlmZWN5Y2xlL0xpZmVjeWNsZUhhbmRsZXIuc3dpZnQ=) | `88.89% <ø> (-11.11%)` | :arrow_down: | | [.../Spezi/Capabilities/Observable/ModelModifier.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9DYXBhYmlsaXRpZXMvT2JzZXJ2YWJsZS9Nb2RlbE1vZGlmaWVyLnN3aWZ0) | `100.00% <100.00%> (ø)` | | | [...pabilities/ViewModifier/ViewModifierProvider.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9DYXBhYmlsaXRpZXMvVmlld01vZGlmaWVyL1ZpZXdNb2RpZmllclByb3ZpZGVyLnN3aWZ0) | `100.00% <100.00%> (ø)` | | | [Sources/Spezi/Configuration/Configuration.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9Db25maWd1cmF0aW9uL0NvbmZpZ3VyYXRpb24uc3dpZnQ=) | `100.00% <100.00%> (ø)` | | | [...rces/Spezi/Dependencies/DependencyDescriptor.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9EZXBlbmRlbmNpZXMvRGVwZW5kZW5jeURlc2NyaXB0b3Iuc3dpZnQ=) | `100.00% <ø> (ø)` | | | [.../Spezi/Dependencies/DependenyPropertyWrapper.swift](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aS9EZXBlbmRlbmNpZXMvRGVwZW5kZW55UHJvcGVydHlXcmFwcGVyLnN3aWZ0) | `100.00% <100.00%> (ø)` | | | ... and [14 more](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [e75ea4d...6bbe89c](https://app.codecov.io/gh/StanfordSpezi/Spezi/pull/88?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi).
Supereg commented 11 months ago

CC: @PSchmiedmayer as codeql is now disabled, we need to remove CodeQL from the list of required actions.

Supereg commented 11 months ago

Addressed the feedback, feel free to merge 😇