-
Notifications
You must be signed in to change notification settings - Fork 102
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
action {}
, eventHandler {}
with no debugging name is deprecated
#1226
Conversation
...dungeon/timemachine/src/test/java/com/squareup/sample/timemachine/TimeMachineWorkflowTest.kt
Show resolved
Hide resolved
workflow-core/src/commonMain/kotlin/com/squareup/workflow1/BaseRenderContext.kt
Outdated
Show resolved
Hide resolved
workflow-core/src/commonMain/kotlin/com/squareup/workflow1/BaseRenderContext.kt
Show resolved
Hide resolved
public fun eventHandler( | ||
// Type variance issue: https://github.com/square/workflow-kotlin/issues/891 | ||
update: | ||
WorkflowAction<@UnsafeVariance PropsT, StateT, @UnsafeVariance OutputT>.Updater.() -> Unit | ||
): () -> Unit = eventHandler("eventHandler", update) |
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.
why do we have to introduce these versions without the name
parameter just to deprecate it? Is this about the way in which the deprecation detection works with the optional parameter?
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.
Yes, exactly.
@@ -76,6 +76,16 @@ public abstract class StatefulWorkflow< | |||
public inner class RenderContext internal constructor( | |||
baseContext: BaseRenderContext<PropsT, StateT, OutputT> | |||
) : BaseRenderContext<@UnsafeVariance PropsT, StateT, @UnsafeVariance OutputT> by baseContext { | |||
public inline fun <reified CurrentStateT : StateT & Any> safeEventHandler( |
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.
not sure I understand why this one isn't deprecated? (Or why its introduced?)
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.
Oops, lost the deprecation annotation. Thanks.
workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/RenderWorkflowInTest.kt
Show resolved
Hide resolved
Logs of actions are nearly useless if they have no name. Let's stop making things so convenient that we go blind.
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.
Got it. Makes sense now!
Logs of actions are nearly useless if they have no name. Let's stop making things so convenient that we go blind.