Lots of friction to add dependencies #1236
-
Hey folks, We've got a pretty complex application at the moment and it's starting to get pretty annoying to add new dependencies to a child feature environment. For example, say we have App -> Home -> Settings -> Support -> Bookmarks -> Bookmark. If we have a use case where a bookmark can be shared, we would create a ShareSheetClient. Then add that to the BookmarkEnvironment. Now we have to propagate that client from App through all the layers, updating preview environments, updating test environments etc. Are there any strategies you all are using to reduce the friction here? Has anyone experimented with using a register/resolve based dependency injection system so you don't have to pass everything through all the layers? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@mfclarke-ts This is definitely a pain point to TCA today, and is something we aim to solve after we wrap up the Swift concurrency release. @mackoj brought up this feedback (and others) recently here: #1104 And you can check out @mbrandonw's reply for a preview into how we aim to solve the problem. We'll likely kick off another beta for the next release in the coming weeks! If you'd like a plug-and-play solution today, @tgrapperon has a nice library that solves the problem: |
Beta Was this translation helpful? Give feedback.
@mfclarke-ts This is definitely a pain point to TCA today, and is something we aim to solve after we wrap up the Swift concurrency release.
@mackoj brought up this feedback (and others) recently here: #1104
And you can check out @mbrandonw's reply for a preview into how we aim to solve the problem. We'll likely kick off another beta for the next release in the coming weeks!
If you'd like a plug-and-play solution today, @tgrapperon has a nice library that solves the problem:
https://github.com/tgrapperon/swift-composable-environment