Replies: 4 comments 6 replies
-
Hi @jberstler, modularity of TCA features is definitely still a thing, and a huge selling point of TCA. We discuss modularity in general, without being specific to TCA, in these two episodes:
In particular, we use SPM for modularizing an app because it's simplest, but you can also do the same in Xcode with frameworks. And those principles apply to TCA too. We even open sourced a very large TCA app that is built in this modularized fashion. If you have specific questions about modularizing then please do ask. |
Beta Was this translation helpful? Give feedback.
-
@jberstler My project has shared Reducers between an iOS and watchOS target. Before modularising my project it were just files added to both targets, now they are part of a core framework. I haven't used a guide to arrive there but rather just 'did it'. But let me know if you other questions about it. |
Beta Was this translation helpful? Give feedback.
-
@mbrandonw While I still don't know what I was doing wrong with Framework targets, I was easily able to convert these all to local swift packages and everything builds and runs just as expected. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I watched an enormous amount of the TCA video series going waaaay back to the very beginning. One of the ideas that really got me interested was that each feature or screen of my app could be its own module that compiles on its own, and can be tested in complete isolation. However, I have struggled to get this working in practice. I also notice that it isn't really discussed much any more in newer Pointfree content, and from what I've seen, isn't really demonstrated in the example apps.
So I think it is worth asking... is this still a thing?
It's entirely possible that what I'm running up against is a lack of understanding in how Xcode builds projects. In my head, external libraries (like TCA) should be added to a target's "Frameworks, Libraries, and Embedded Content" while dependencies on other targets defined in my project should go in Build Phases > Target Dependencies. Invariably this results in either undefined symbol compiler warnings when I try to integrate multiple targets, or having TCA types defined in multiple places and getting a runtime error about trying to resolve which one will get used.
While I'm sure I could provide an example project to demonstrate this, I'd rather start with a general discussion about it. Is this something people do in practice? Is there a guide on the proper way to integrate targets? Are there examples of TCA apps that are built this way?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions