Skip to content

Commit

Permalink
wip: 🔥 Only three @deprecated remain, all worker related
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrjr committed Dec 13, 2023
1 parent 3d54f7b commit ffb5279
Show file tree
Hide file tree
Showing 104 changed files with 55 additions and 6,909 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.squareup.workflow1.ui.ViewEnvironment
import com.squareup.workflow1.ui.ViewRegistry
import com.squareup.workflow1.ui.WorkflowLayout
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
import com.squareup.workflow1.ui.compose.composeViewFactory
import com.squareup.workflow1.ui.compose.withCompositionRoot
import com.squareup.workflow1.ui.container.withEnvironment
import com.squareup.workflow1.ui.plus
Expand All @@ -31,7 +30,8 @@ private val viewEnvironment =
}

/**
* Demonstrates how to create and display a view factory with [composeViewFactory].
* Demonstrates how to create and display a view factory with
* [composeScreenViewFactory][com.squareup.workflow1.ui.compose.composeScreenViewFactory].
*/
class HelloBindingActivity : AppCompatActivity() {
@OptIn(WorkflowUiExperimentalApi::class)
Expand Down
1 change: 0 additions & 1 deletion samples/containers/hello-back-button/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies {
implementation(libs.androidx.activity.ktx)

implementation(project(":samples:containers:android"))
implementation(project(":workflow-ui:container-android"))
implementation(project(":workflow-ui:core-android"))
implementation(project(":workflow-ui:core-common"))
}
2 changes: 0 additions & 2 deletions samples/dungeon/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ dependencies {
implementation(project(":samples:dungeon:timemachine"))
implementation(project(":samples:dungeon:timemachine-shakeable"))
implementation(project(":workflow-tracing"))
implementation(project(":workflow-ui:container-android"))
implementation(project(":workflow-ui:container-common"))
implementation(project(":workflow-ui:core-android"))
implementation(project(":workflow-ui:core-common"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineScreen
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow.PropsFactory
import com.squareup.workflow1.StatelessWorkflow
import com.squareup.workflow1.mapRendering
import com.squareup.workflow1.renderChild
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
import com.squareup.workflow1.ui.asScreen
import kotlin.time.ExperimentalTime
import kotlin.time.TimeSource

Expand All @@ -25,10 +23,9 @@ class TimeMachineAppWorkflow(
context: Context
) : StatelessWorkflow<BoardPath, Nothing, ShakeableTimeMachineScreen>() {

@Suppress("DEPRECATION")
private val timeMachineWorkflow =
ShakeableTimeMachineWorkflow(
TimeMachineWorkflow(appWorkflow.mapRendering { asScreen(it) }, clock),
TimeMachineWorkflow(appWorkflow, clock),
context
)

Expand Down
1 change: 0 additions & 1 deletion samples/tictactoe/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies {
implementation(project(":samples:containers:android"))
implementation(project(":samples:tictactoe:common"))
implementation(project(":workflow-tracing"))
implementation(project(":workflow-ui:container-android"))
implementation(project(":workflow-ui:core-android"))
implementation(project(":workflow-ui:core-common"))
}
2 changes: 0 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ include(
":workflow-ui:core-android",
":workflow-ui:internal-testing-android",
":workflow-ui:internal-testing-compose",
":workflow-ui:container-common",
":workflow-ui:container-android",
":workflow-ui:radiography"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ internal class WorkerCompositionIntegrationTest {
state += 1
}

val workflow = Workflow.stateful<Int, Int, () -> Unit>(
val workflow = Workflow.stateful(
initialState = 0,
render = { _ ->
runningWorker(triggerOutput) { action { setOutput(state) } }
Expand Down Expand Up @@ -221,7 +221,7 @@ internal class WorkerCompositionIntegrationTest {

@Test fun `runningWorker throws when output emitted`() {
@Suppress("UNCHECKED_CAST")
val worker = Worker.from { Unit } as Worker<Nothing>
val worker = Worker.from { } as Worker<Nothing>
val workflow = Workflow.stateless<Unit, Unit, Unit> {
// Suppress runningWorker usage because we want to make sure the deprecated
// method still throws an exception as expected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ internal class RealRenderTesterTest {

@Test fun `verifyAction verifies workflow output`() {
val child = Workflow.stateless<Unit, String, Unit> {}
val workflow = Workflow.stateless<Unit, Nothing, Unit> {
val workflow = Workflow.stateless {
renderChild(child) { TestAction(it) }
}
val testResult = workflow.testRender(Unit)
Expand All @@ -998,7 +998,7 @@ internal class RealRenderTesterTest {

@Test fun `verifyAction verifies worker output`() {
val worker = Worker.finished<String>()
val workflow = Workflow.stateless<Unit, Nothing, Unit> {
val workflow = Workflow.stateless {
runningWorker(worker) { TestAction(it) }
}
val testResult = workflow.testRender(Unit)
Expand Down
11 changes: 0 additions & 11 deletions workflow-ui/compose-tooling/api/compose-tooling.api
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
public final class com/squareup/workflow1/ui/compose/tooling/ComposableSingletons$LegacyViewFactoriesKt {
public static final field INSTANCE Lcom/squareup/workflow1/ui/compose/tooling/ComposableSingletons$LegacyViewFactoriesKt;
public static field lambda-1 Lkotlin/jvm/functions/Function4;
public fun <init> ()V
public final fun getLambda-1$wf1_compose_tooling ()Lkotlin/jvm/functions/Function4;
}

public final class com/squareup/workflow1/ui/compose/tooling/ComposableSingletons$ViewFactoriesKt {
public static final field INSTANCE Lcom/squareup/workflow1/ui/compose/tooling/ComposableSingletons$ViewFactoriesKt;
public static field lambda-1 Lkotlin/jvm/functions/Function4;
public fun <init> ()V
public final fun getLambda-1$wf1_compose_tooling ()Lkotlin/jvm/functions/Function4;
}

public final class com/squareup/workflow1/ui/compose/tooling/LegacyViewFactoriesKt {
public static final fun Preview (Lcom/squareup/workflow1/ui/ViewFactory;Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
}

public final class com/squareup/workflow1/ui/compose/tooling/ViewFactoriesKt {
public static final fun Preview (Lcom/squareup/workflow1/ui/ScreenViewFactory;Lcom/squareup/workflow1/ui/Screen;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit ffb5279

Please sign in to comment.