Extensibility of Features & Breaking Changes #1637
Replies: 2 comments 3 replies
-
@JacksonUtsch Can you flesh out your post a bit more to more fully explain what you're trying to solve and what specifically is preventing you? A code sample demonstrating the limitation would help. Also, what in particular about enums is limiting you, why/how, and what is preventing you from using something other than an enum to work around the problem? |
Beta Was this translation helpful? Give feedback.
-
Hi @JacksonUtsch, my first impression of your code is that this seems more like a dependency than a reducer. I think this becomes clear once you see that the actions aren't driven off of things the user is doing. Instead they should probably be endpoints on a dependency. We have a bunch of examples of this kind of dependency in the repo too, such as the audio recorder, speech recognizer, web socket, and more. Have you tried that approach? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've utilized TCA features inside isolated packages. A number of executables will depend on these. If wanting to add any functionality (actions) to features it will cause a breaking change. This being the nature of Swift
enums
, have others experienced this too?If Swift had non-exhaustive enums this could help quite a bit. Especially with typed
Failure
cases. There are C enums that arenon-frozen
but don't offer associated values so not a perfect substitution.Is there a good way to circumvent breaking changes if wanting to make changes to features that multiple apps use?
An example of a shared bluetooth package:
Where in the 1.0.0 release of a BLE package the action is defined:
Then if a small addition is added to the action it causes a break to the package for users needing a major version change and a migration guide.
An idea would be to use an alternative to
enum
but you cannot pattern match a function to gain associated values.Perhaps the loss of an associated value is what alternatives to
enum
would lack?Beta Was this translation helpful? Give feedback.
All reactions