Skip to content

Commit 2f5d208

Browse files
Rename VeryExperimentalWorkflow opt-in annotation to ExperimentalWorkflow.
The new name is more idiomatic, and the "very" prefix was only used to point out that, pre-1.0, the entire library was "experimental" in a sense.
1 parent 5c79e73 commit 2f5d208

File tree

12 files changed

+41
-40
lines changed

12 files changed

+41
-40
lines changed

workflow-core/src/main/java/com/squareup/workflow/VeryExperimentalWorkflow.kt renamed to workflow-core/src/main/java/com/squareup/workflow/ExperimentalWorkflow.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ import kotlin.annotation.AnnotationRetention.BINARY
2020

2121
/**
2222
* Marks Workflow APIs that are extremely likely to change in future versions, rely themselves on
23-
* other unstable, experimental APIs, and SHOULD NOT be used in production code. Proceed with
24-
* caution, and be ready to have the rug pulled out from under you.
23+
* other unstable, experimental APIs, and SHOULD NOT be used in library code or app code that you
24+
* are not prepared to update when changing even minor workflow versions. Proceed with caution, and
25+
* be ready to have the rug pulled out from under you.
2526
*/
2627
@MustBeDocumented
2728
@Retention(value = BINARY)
2829
@RequiresOptIn(level = ERROR)
29-
annotation class VeryExperimentalWorkflow
30+
annotation class ExperimentalWorkflow

workflow-runtime/src/main/java/com/squareup/workflow/LaunchWorkflow.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ fun <PropsT, OutputT : Any, RenderingT, RunnerT> launchWorkflowIn(
209209
* A [StateFlow] of [RenderingAndSnapshot]s that will emit any time the root workflow creates a new
210210
* rendering.
211211
*/
212-
@OptIn(ExperimentalCoroutinesApi::class, VeryExperimentalWorkflow::class)
212+
@OptIn(ExperimentalCoroutinesApi::class, ExperimentalWorkflow::class)
213213
fun <PropsT, OutputT : Any, RenderingT> renderWorkflowIn(
214214
workflow: Workflow<PropsT, OutputT, RenderingT>,
215215
scope: CoroutineScope,
@@ -268,7 +268,7 @@ fun <PropsT, OutputT : Any, RenderingT> renderWorkflowIn(
268268
@OptIn(
269269
ExperimentalCoroutinesApi::class,
270270
FlowPreview::class,
271-
VeryExperimentalWorkflow::class
271+
ExperimentalWorkflow::class
272272
)
273273
@Suppress("LongParameterList")
274274
internal fun <PropsT, StateT, OutputT : Any, RenderingT, RunnerT> launchWorkflowImpl(

workflow-runtime/src/main/java/com/squareup/workflow/diagnostic/ChainedDiagnosticListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package com.squareup.workflow.diagnostic
1717

18-
import com.squareup.workflow.VeryExperimentalWorkflow
18+
import com.squareup.workflow.ExperimentalWorkflow
1919
import com.squareup.workflow.WorkflowAction
2020
import kotlinx.coroutines.CoroutineScope
2121

@@ -31,7 +31,7 @@ fun WorkflowDiagnosticListener.andThen(
3131
.apply { addVisitor(next) }
3232
}
3333

34-
@OptIn(VeryExperimentalWorkflow::class)
34+
@OptIn(ExperimentalWorkflow::class)
3535
@Suppress("TooManyFunctions")
3636
internal class ChainedDiagnosticListener(
3737
listener: WorkflowDiagnosticListener

workflow-runtime/src/main/java/com/squareup/workflow/diagnostic/DebugSnapshotRecordingListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package com.squareup.workflow.diagnostic
1717

18-
import com.squareup.workflow.VeryExperimentalWorkflow
18+
import com.squareup.workflow.ExperimentalWorkflow
1919
import com.squareup.workflow.WorkflowAction
2020
import com.squareup.workflow.diagnostic.WorkflowHierarchyDebugSnapshot.ChildWorker
2121
import com.squareup.workflow.diagnostic.WorkflowHierarchyDebugSnapshot.ChildWorkflow
@@ -29,7 +29,7 @@ import com.squareup.workflow.diagnostic.WorkflowUpdateDebugInfo.Source.Worker
2929
* A [WorkflowDiagnosticListener] that records [WorkflowHierarchyDebugSnapshot]s and
3030
* [WorkflowUpdateDebugInfo]s and sends them to [debugger] after each render pass.
3131
*/
32-
@VeryExperimentalWorkflow
32+
@ExperimentalWorkflow
3333
@Suppress("TooManyFunctions")
3434
class DebugSnapshotRecordingListener(
3535
private val debugger: (WorkflowHierarchyDebugSnapshot, WorkflowUpdateDebugInfo?) -> Unit

workflow-runtime/src/main/java/com/squareup/workflow/diagnostic/SimpleLoggingDiagnosticListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*/
1616
package com.squareup.workflow.diagnostic
1717

18-
import com.squareup.workflow.VeryExperimentalWorkflow
18+
import com.squareup.workflow.ExperimentalWorkflow
1919
import com.squareup.workflow.WorkflowAction
2020
import kotlinx.coroutines.CoroutineScope
2121

2222
/**
2323
* A [WorkflowDiagnosticListener] that just prints all events using [println].
2424
*/
25-
@OptIn(VeryExperimentalWorkflow::class)
25+
@OptIn(ExperimentalWorkflow::class)
2626
@Suppress("TooManyFunctions")
2727
open class SimpleLoggingDiagnosticListener : WorkflowDiagnosticListener {
2828

workflow-runtime/src/main/java/com/squareup/workflow/diagnostic/WorkflowDiagnosticListener.kt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package com.squareup.workflow.diagnostic
1717

18-
import com.squareup.workflow.VeryExperimentalWorkflow
18+
import com.squareup.workflow.ExperimentalWorkflow
1919
import com.squareup.workflow.WorkflowAction
2020
import kotlinx.coroutines.CoroutineScope
2121

@@ -76,7 +76,7 @@ interface WorkflowDiagnosticListener {
7676
*
7777
* Corresponds to [onAfterRenderPass].
7878
*/
79-
@VeryExperimentalWorkflow
79+
@ExperimentalWorkflow
8080
fun onBeforeRenderPass(props: Any?) = Unit
8181

8282
/**
@@ -85,7 +85,7 @@ interface WorkflowDiagnosticListener {
8585
* @param workflowId The ID of the workflow for this event. If null, the props for the root
8686
* workflow changed. [oldState] and [newState] will always be null in that case.
8787
*/
88-
@VeryExperimentalWorkflow
88+
@ExperimentalWorkflow
8989
fun onPropsChanged(
9090
workflowId: Long?,
9191
oldProps: Any?,
@@ -99,7 +99,7 @@ interface WorkflowDiagnosticListener {
9999
*
100100
* Corresponds to [onAfterWorkflowRendered].
101101
*/
102-
@VeryExperimentalWorkflow
102+
@ExperimentalWorkflow
103103
fun onBeforeWorkflowRendered(
104104
workflowId: Long,
105105
props: Any?,
@@ -111,7 +111,7 @@ interface WorkflowDiagnosticListener {
111111
*
112112
* Corresponds to [onBeforeWorkflowRendered].
113113
*/
114-
@VeryExperimentalWorkflow
114+
@ExperimentalWorkflow
115115
fun onAfterWorkflowRendered(
116116
workflowId: Long,
117117
rendering: Any?
@@ -122,7 +122,7 @@ interface WorkflowDiagnosticListener {
122122
*
123123
* Corresponds to [onBeforeRenderPass].
124124
*/
125-
@VeryExperimentalWorkflow
125+
@ExperimentalWorkflow
126126
fun onAfterRenderPass(rendering: Any?) = Unit
127127

128128
/**
@@ -131,7 +131,7 @@ interface WorkflowDiagnosticListener {
131131
*
132132
* Corresponds to [onAfterSnapshotPass].
133133
*/
134-
@VeryExperimentalWorkflow
134+
@ExperimentalWorkflow
135135
fun onBeforeSnapshotPass() = Unit
136136

137137
/**
@@ -140,7 +140,7 @@ interface WorkflowDiagnosticListener {
140140
*
141141
* Corresponds to [onBeforeSnapshotPass].
142142
*/
143-
@VeryExperimentalWorkflow
143+
@ExperimentalWorkflow
144144
fun onAfterSnapshotPass() = Unit
145145

146146
// endregion
@@ -154,7 +154,7 @@ interface WorkflowDiagnosticListener {
154154
*
155155
* Corresponds to [onRuntimeStopped].
156156
*/
157-
@VeryExperimentalWorkflow
157+
@ExperimentalWorkflow
158158
fun onRuntimeStarted(
159159
workflowScope: CoroutineScope,
160160
rootWorkflowType: String
@@ -166,7 +166,7 @@ interface WorkflowDiagnosticListener {
166166
*
167167
* Corresponds to [onRuntimeStarted].
168168
*/
169-
@VeryExperimentalWorkflow
169+
@ExperimentalWorkflow
170170
fun onRuntimeStopped() = Unit
171171

172172
/**
@@ -185,7 +185,7 @@ interface WorkflowDiagnosticListener {
185185
* [initialState][com.squareup.workflow.StatefulWorkflow.initialState].
186186
* @param restoredFromSnapshot True iff the snapshot parameter to `initialState` was non-null.
187187
*/
188-
@VeryExperimentalWorkflow
188+
@ExperimentalWorkflow
189189
@Suppress("LongParameterList")
190190
fun onWorkflowStarted(
191191
workflowId: Long,
@@ -204,7 +204,7 @@ interface WorkflowDiagnosticListener {
204204
*
205205
* @param workflowId The ID of the workflow that stopped.
206206
*/
207-
@VeryExperimentalWorkflow
207+
@ExperimentalWorkflow
208208
fun onWorkflowStopped(workflowId: Long) = Unit
209209

210210
/**
@@ -218,7 +218,7 @@ interface WorkflowDiagnosticListener {
218218
* @param key The key passed to `runningWorker` by [parentWorkflowId].
219219
* @param description A string description of the worker. Contains the worker's `toString`.
220220
*/
221-
@VeryExperimentalWorkflow
221+
@ExperimentalWorkflow
222222
fun onWorkerStarted(
223223
workerId: Long,
224224
parentWorkflowId: Long,
@@ -235,7 +235,7 @@ interface WorkflowDiagnosticListener {
235235
* @param workerId The ID of the worker that stopped.
236236
* @param parentWorkflowId The ID of the workflow that was running this worker.
237237
*/
238-
@VeryExperimentalWorkflow
238+
@ExperimentalWorkflow
239239
fun onWorkerStopped(
240240
workerId: Long,
241241
parentWorkflowId: Long
@@ -255,7 +255,7 @@ interface WorkflowDiagnosticListener {
255255
* receive the output.
256256
* @param output The value that the worker output.
257257
*/
258-
@VeryExperimentalWorkflow
258+
@ExperimentalWorkflow
259259
fun onWorkerOutput(
260260
workerId: Long,
261261
parentWorkflowId: Long,
@@ -271,7 +271,7 @@ interface WorkflowDiagnosticListener {
271271
* corresponding [WorkflowAction].
272272
* @param action The [WorkflowAction] that will be executed by [workflowId].
273273
*/
274-
@VeryExperimentalWorkflow
274+
@ExperimentalWorkflow
275275
fun onSinkReceived(
276276
workflowId: Long,
277277
action: WorkflowAction<*, *>
@@ -290,7 +290,7 @@ interface WorkflowDiagnosticListener {
290290
* the state, this will be the same value as [oldState].
291291
* @param output The output value returned from [action].
292292
*/
293-
@VeryExperimentalWorkflow
293+
@ExperimentalWorkflow
294294
fun onWorkflowAction(
295295
workflowId: Long,
296296
action: WorkflowAction<*, *>,

workflow-runtime/src/main/java/com/squareup/workflow/internal/Workers.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package com.squareup.workflow.internal
1717

18-
import com.squareup.workflow.VeryExperimentalWorkflow
18+
import com.squareup.workflow.ExperimentalWorkflow
1919
import com.squareup.workflow.Worker
2020
import com.squareup.workflow.diagnostic.WorkflowDiagnosticListener
2121
import kotlinx.coroutines.CoroutineName
@@ -79,7 +79,7 @@ private fun <T> Worker<T>.runWithNullCheck(): Flow<T> =
7979
"If this is a test mock, make sure you mock the run() method!"
8080
)
8181

82-
@OptIn(VeryExperimentalWorkflow::class)
82+
@OptIn(ExperimentalWorkflow::class)
8383
private fun <T> Flow<T>.wireUpDebugger(
8484
workerDiagnosticId: Long,
8585
workflowDiagnosticId: Long,

workflow-runtime/src/main/java/com/squareup/workflow/internal/WorkflowLoop.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package com.squareup.workflow.internal
1818
import com.squareup.workflow.RenderingAndSnapshot
1919
import com.squareup.workflow.Snapshot
2020
import com.squareup.workflow.StatefulWorkflow
21-
import com.squareup.workflow.VeryExperimentalWorkflow
21+
import com.squareup.workflow.ExperimentalWorkflow
2222
import com.squareup.workflow.diagnostic.IdCounter
2323
import com.squareup.workflow.diagnostic.WorkflowDiagnosticListener
2424
import kotlinx.coroutines.channels.consume
@@ -53,7 +53,7 @@ internal interface WorkflowLoop {
5353
): Nothing
5454
}
5555

56-
@OptIn(VeryExperimentalWorkflow::class)
56+
@OptIn(ExperimentalWorkflow::class)
5757
internal open class RealWorkflowLoop : WorkflowLoop {
5858

5959
@Suppress("LongMethod")

workflow-runtime/src/main/java/com/squareup/workflow/internal/WorkflowNode.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package com.squareup.workflow.internal
1717

1818
import com.squareup.workflow.Snapshot
1919
import com.squareup.workflow.StatefulWorkflow
20-
import com.squareup.workflow.VeryExperimentalWorkflow
20+
import com.squareup.workflow.ExperimentalWorkflow
2121
import com.squareup.workflow.Worker
2222
import com.squareup.workflow.Workflow
2323
import com.squareup.workflow.WorkflowAction
@@ -50,7 +50,7 @@ import kotlin.coroutines.EmptyCoroutineContext
5050
* hard-coded values added to worker contexts. It must not contain a [Job] element (it would violate
5151
* structured concurrency).
5252
*/
53-
@OptIn(VeryExperimentalWorkflow::class)
53+
@OptIn(ExperimentalWorkflow::class)
5454
internal class WorkflowNode<PropsT, StateT, OutputT : Any, RenderingT>(
5555
val id: WorkflowId<PropsT, OutputT, RenderingT>,
5656
workflow: StatefulWorkflow<PropsT, StateT, OutputT, RenderingT>,

workflow-runtime/src/main/java/com/squareup/workflow/internal/WorkflowRunner.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package com.squareup.workflow.internal
1818
import com.squareup.workflow.RenderingAndSnapshot
1919
import com.squareup.workflow.Snapshot
2020
import com.squareup.workflow.StatefulWorkflow
21-
import com.squareup.workflow.VeryExperimentalWorkflow
21+
import com.squareup.workflow.ExperimentalWorkflow
2222
import com.squareup.workflow.Workflow
2323
import com.squareup.workflow.diagnostic.IdCounter
2424
import com.squareup.workflow.diagnostic.WorkflowDiagnosticListener
@@ -32,7 +32,7 @@ import kotlinx.coroutines.flow.produceIn
3232
import kotlinx.coroutines.selects.select
3333
import kotlin.coroutines.EmptyCoroutineContext
3434

35-
@OptIn(ExperimentalCoroutinesApi::class, VeryExperimentalWorkflow::class)
35+
@OptIn(ExperimentalCoroutinesApi::class, ExperimentalWorkflow::class)
3636
internal class WorkflowRunner<PropsT, OutputT : Any, RenderingT>(
3737
scope: CoroutineScope,
3838
protoWorkflow: Workflow<PropsT, OutputT, RenderingT>,

0 commit comments

Comments
 (0)