-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat]: give AnyWorkflow a Workflow conformance #184
Conversation
cc @bencochran probably something you have opinions on |
…ow-workflow-conformance * origin/main: Expose AnyScreen.wrappedScreen for inspection (#193) Improve introspection for SignalProducerWorkflow actions (#192) [release]: bump version to 2.2.0 & remove separate concurrency version (#191) [feat]: add runtime observation API (#168) [chore]: refactor some internal actions to use existential any (#190) [fix]: use weak reference to internal sinks when vending to clients (#189) [feat]: add primary associated types to more protocols (#188) [chore]: pre major version bump cleanup (#187) [chore]: bump minimum deployment & swift versions (#186) Abstract ViewEnvironment to shared framework (#185)
renderingTransform: { $0 }, | ||
outputTransform: { $0 } | ||
)) | ||
if let workflow = workflow as? AnyWorkflow<Rendering, Output> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to get the compiler to do this without having to perform the runtime check?
/// Wrapper around an AnyWorkflow that allows us to have a concrete | ||
/// WorkflowHost without WorkflowHostingController itself being generic | ||
/// around a Workflow. | ||
fileprivate struct RootWorkflow<Rendering, Output>: Workflow { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Motivation
the fact that
AnyWorkflow
is not itself aWorkflow
creates confusion, and some awkwardness in some of our testing facilities. we'd like to add such a conformance to address these issues, and prevent consumers from having to write such type-erasing wrappers themselves.Changes
Workflow
conformance toAnyWorkflow
RootWorkflow
withAnyWorkflow
inWorkflowHostingController
Checklist
- [ ] UI Testsn/a- [ ] Snapshot Tests (iOS only)n/a- [ ] I have made corresponding changes to the documentationn/a