Easier re-ordering of FlowRepresentables within a Workflow #43
Unanswered
Tyler-Keith-Thompson
asked this question in
Ideas
Replies: 1 comment
-
Team will revisit this in Story Refinement - labeling as Low Priority for now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Type safety brought all kinds of amazing things, I have no regrets about how we got to where we are, but we did lose something that was important. In the bad old days you could do this:
And re-ordering anything was just a matter of moving the lines around. Type safety brought with it a desire to only be able to initialize a
Workflow
with someFlowRepresentable
type, and so that empty init isn't a thing you can do anymore.We can do better:
I believe we can get the best of both worlds by using static functions:
This gives us all the things, the type safety continues, we still even have a way to reference what the first type created was, Workflows can only be created with some concrete
FlowRepresentable
, all the goodness still exists.Drawbacks:
This would require a bunch of new Static Functions that looked an awful lot like the other functions we ALREADY have in
Workflow.swift
and inWorkflowUIKitAdditions.swift
.While end-consumers might enjoy this experience developers on the project may hate it, because there'll be a bunch of things and a bunch of easy-to-miss things. Did you remember the extension where Output == Never? When you change any one method of fluently creating a workflow you've gotta take care of the rest, are they all up-to-date? All the same? It's sort of a nightmare...
The team may consider a codegen solution, coupled with decent consumer tests around the different ways to create a workflow. This might give the best balance between a really friendly API and something that is reasonable to maintain.
Priority:
While this is a nice-to-have this certainly would fall behind things like SwiftUI support, which is certainly far more important.
Beta Was this translation helpful? Give feedback.
All reactions