From 7973dbeeae2e4ce11e15b3c19ab1d7d2de6a9019 Mon Sep 17 00:00:00 2001 From: Ray Ryan Date: Thu, 7 Nov 2024 10:29:45 -0800 Subject: [PATCH 1/3] Deprecates the name-optional flavor of `StatelessWorkflow.action` Missed a spot in #1226. --- .../com/squareup/workflow1/StatelessWorkflow.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt index 46c44f07d..91e68782d 100644 --- a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt +++ b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt @@ -113,6 +113,16 @@ public fun Workflow.Companion.rendering( rendering: RenderingT ): Workflow = stateless { rendering } + +@Deprecated( + "Always provide a debugging name", + ReplaceWith("action(\"TODO: debugging name\", update)") +) +public fun + StatelessWorkflow.action( + update: WorkflowAction.Updater.() -> Unit +): WorkflowAction = action("", update) + /** * Convenience to create a [WorkflowAction] with parameter types matching those * of the receiving [StatefulWorkflow]. The action will invoke the given [lambda][update] @@ -123,7 +133,7 @@ public fun Workflow.Companion.rendering( */ public fun StatelessWorkflow.action( - name: String = "", + name: String, update: WorkflowAction.Updater.() -> Unit ): WorkflowAction = action({ name }, update) From 7fb5f55a647f2ae2ca5306d11a7c2cd0780b5a3f Mon Sep 17 00:00:00 2001 From: rjrjr Date: Thu, 7 Nov 2024 18:34:30 +0000 Subject: [PATCH 2/3] Apply changes from apiDump Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- workflow-core/api/workflow-core.api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow-core/api/workflow-core.api b/workflow-core/api/workflow-core.api index 0d183c12f..475fa33f8 100644 --- a/workflow-core/api/workflow-core.api +++ b/workflow-core/api/workflow-core.api @@ -411,10 +411,10 @@ public final class com/squareup/workflow1/Workflows { public static final fun action (Lcom/squareup/workflow1/StatefulWorkflow;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction; public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction; public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction; + public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction; public static final fun action (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction; public static final fun action (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction; public static final fun action (Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction; - public static synthetic fun action$default (Lcom/squareup/workflow1/StatelessWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/squareup/workflow1/WorkflowAction; public static final fun applyTo (Lcom/squareup/workflow1/WorkflowAction;Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair; public static final fun contraMap (Lcom/squareup/workflow1/Sink;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/Sink; public static final fun getComputedIdentifier (Lcom/squareup/workflow1/Workflow;)Lcom/squareup/workflow1/WorkflowIdentifier; From b08380c12ac8bcc618be7e248e5bbdd4a08da1fd Mon Sep 17 00:00:00 2001 From: RBusarow Date: Thu, 7 Nov 2024 18:38:35 +0000 Subject: [PATCH 3/3] Apply changes from ktLintFormat Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../kotlin/com/squareup/workflow1/StatelessWorkflow.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt index 91e68782d..cb3d7ca34 100644 --- a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt +++ b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt @@ -113,15 +113,14 @@ public fun Workflow.Companion.rendering( rendering: RenderingT ): Workflow = stateless { rendering } - @Deprecated( "Always provide a debugging name", ReplaceWith("action(\"TODO: debugging name\", update)") ) public fun StatelessWorkflow.action( - update: WorkflowAction.Updater.() -> Unit -): WorkflowAction = action("", update) + update: WorkflowAction.Updater.() -> Unit + ): WorkflowAction = action("", update) /** * Convenience to create a [WorkflowAction] with parameter types matching those