Skip to content
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

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

rjrjr
Copy link
Contributor

@rjrjr rjrjr commented Nov 2, 2024

Logs of actions are nearly useless if they have no name. Let's stop making things so convenient that we go blind.

@rjrjr rjrjr requested review from a team and zach-klippenstein as code owners November 2, 2024 00:34
Comment on lines +191 to +195
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)
Copy link
Contributor

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?

Copy link
Contributor Author

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(
Copy link
Contributor

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?)

Copy link
Contributor Author

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.

Logs of actions are nearly useless if they have no name. Let's stop making things so convenient that we go blind.
Copy link
Contributor

@steve-the-edwards steve-the-edwards left a 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!

@rjrjr rjrjr merged commit a5a9618 into main Nov 4, 2024
30 checks passed
@rjrjr rjrjr deleted the ray/actionable branch November 4, 2024 20:58
rjrjr added a commit that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants