Skip to content

Commit 1c09fd5

Browse files
authored
Merge branch 'main' into wenli/workflow-viewer-open-nodes
2 parents d9b1a19 + f0ca5cb commit 1c09fd5

File tree

82 files changed

+245
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+245
-306
lines changed

.github/workflows/publish-release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
with:
3535
task: publish
3636
env:
37-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
38-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
39-
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
37+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
38+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
39+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
40+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

.github/workflows/publish-snapshot.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@ jobs:
3939
with:
4040
task: publish
4141
env:
42-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
43-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
42+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
43+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
44+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
45+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
1. `git merge --no-ff origin/yourname/kotlin-v0.1.0`
9494
1. `git push origin gh-pages`
9595

96-
1. _Don't do this until the tutorial gets updated._ Once Maven artifacts are synced, update the workflow version used by the tutorial in
96+
1. Once Maven artifacts are synced, update the workflow version used by the tutorial in
9797
`samples/tutorial/build.gradle`.
9898

9999
### Validating Markdown

benchmarks/performance-poetry/complex-poetry/src/main/java/com/squareup/benchmarks/performance/complex/poetry/MaybeLoadingGatekeeperWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MaybeLoadingGatekeeperWorkflow<T : Any>(
2727
override fun render(
2828
renderProps: Unit,
2929
renderState: IsLoading,
30-
context: RenderContext
30+
context: RenderContext<Unit, IsLoading, Unit>
3131
): MayBeLoadingScreen {
3232
context.runningWorker(isLoading.asTraceableWorker("GatekeeperLoading")) {
3333
action("GatekeeperLoading") {

benchmarks/performance-poetry/complex-poetry/src/main/java/com/squareup/benchmarks/performance/complex/poetry/PerformancePoemWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class PerformancePoemWorkflow(
9696
override fun render(
9797
renderProps: Poem,
9898
renderState: State,
99-
context: RenderContext
99+
context: RenderContext<Poem, State, ClosePoem>
100100
): OverviewDetailScreen<*> {
101101
if (simulatedPerfConfig.simultaneousActions > 0) {
102102
repeat(simulatedPerfConfig.simultaneousActions) { index ->

benchmarks/performance-poetry/complex-poetry/src/main/java/com/squareup/benchmarks/performance/complex/poetry/PerformancePoemsBrowserWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class PerformancePoemsBrowserWorkflow(
8686
override fun render(
8787
renderProps: ConfigAndPoems,
8888
renderState: State,
89-
context: RenderContext
89+
context: RenderContext<ConfigAndPoems, State, Unit>
9090
): OverviewDetailScreen<*> {
9191
when (renderState) {
9292
is Recurse -> {

benchmarks/performance-poetry/complex-poetry/src/main/java/com/squareup/benchmarks/performance/complex/poetry/PerformancePoetryActivity.kt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.squareup.benchmarks.performance.complex.poetry
22

33
import android.content.pm.ApplicationInfo
4-
import android.os.Build
54
import android.os.Bundle
65
import android.os.Handler
76
import android.os.Looper
@@ -26,9 +25,9 @@ import com.squareup.workflow1.WorkflowInterceptor
2625
import com.squareup.workflow1.ui.Screen
2726
import com.squareup.workflow1.ui.ViewEnvironment.Companion.EMPTY
2827
import com.squareup.workflow1.ui.ViewRegistry
29-
import com.squareup.workflow1.ui.WorkflowLayout
3028
import com.squareup.workflow1.ui.renderWorkflowIn
3129
import com.squareup.workflow1.ui.withEnvironment
30+
import com.squareup.workflow1.ui.workflowContentView
3231
import kotlinx.coroutines.flow.StateFlow
3332
import kotlinx.coroutines.flow.map
3433
import kotlinx.coroutines.flow.onEach
@@ -97,13 +96,9 @@ class PerformancePoetryActivity : AppCompatActivity() {
9796
model.renderings
9897
}
9998

100-
setContentView(
101-
WorkflowLayout(this).apply {
102-
take(
103-
lifecycle,
104-
instrumentedRenderings.map { it.withEnvironment(viewEnvironment) }
105-
)
106-
}
99+
workflowContentView.take(
100+
lifecycle,
101+
instrumentedRenderings.map { it.withEnvironment(viewEnvironment) }
107102
)
108103

109104
// We can report this here as the first rendering from the Workflow is rendered synchronously.
@@ -125,7 +120,7 @@ class PerformancePoetryActivity : AppCompatActivity() {
125120
val traceMain = intent.getBooleanExtra(EXTRA_TRACE_ALL_MAIN_THREAD_MESSAGES, false)
126121
val traceSelectOnTimeout = intent.getBooleanExtra(EXTRA_TRACE_SELECT_TIMEOUTS, false)
127122
val areTracingViaMainLooperCurrently = traceMain || traceSelectOnTimeout
128-
val ableToTrace = Build.VERSION.SDK_INT != 28 && (debuggable || profileable)
123+
val ableToTrace = debuggable || profileable
129124

130125
if (areTracingViaMainLooperCurrently && ableToTrace) {
131126
// Add main message tracing to see everything happening in Perfetto.

build-logic/src/main/java/com/squareup/workflow1/buildsrc/PublishingConventionPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class PublishingConventionPlugin : Plugin<Project> {
4848
}
4949

5050
target.extensions.configure(MavenPublishBaseExtension::class.java) { basePluginExtension ->
51-
basePluginExtension.publishToMavenCentral(SonatypeHost.S01, automaticRelease = true)
51+
basePluginExtension.publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
5252
// Will only apply to non snapshot builds.
5353
basePluginExtension.signAllPublications()
5454
// import all settings from root project and project-specific gradle.properties files

design-docs/compose-based-workflows-design.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ A more interesting, comprehensive example that ties this in with the First Primi
282282
```kotlin
283283
class IdentityWorkflow(
284284
private val child: Workflow<Props, Output, Rendering>
285-
) : StatelessWorkflow<Props, Output, Rendering {
285+
) : StatelessWorkflow<Props, Output, Rendering> {
286286
override fun render(props: Props, context: RenderContext): Rendering {
287287
return context.renderComposable {
288288
renderWorkflow(child, props, onOutput = { output ->
@@ -379,8 +379,7 @@ public abstract class ComposeWorkflow<
379379
To implement the `Workflow` interface, we need to have a function that returns a `StatefulWorkflow` with the actual implementation. That's trivial: we just return a really simple workflow that does nothing but call `renderComposable` from above in its render method:
380380

381381
```kotlin
382-
private inner class ComposeWorkflowWrapper :
383-
StatefulWorkflow<PropsT, Unit, OutputT, RenderingT>() {
382+
inner class ComposeWorkflowWrapper : StatefulWorkflow<PropsT, Unit, OutputT, RenderingT>() {
384383

385384
override fun initialState(
386385
props: PropsT,
@@ -392,7 +391,7 @@ To implement the `Workflow` interface, we need to have a function that returns a
392391
override fun render(
393392
renderProps: PropsT,
394393
renderState: Unit,
395-
context: RenderContext
394+
context: StatefulWorkflow.RenderContext<PropsT,Unit,OutputT>
396395
): RenderingT = context.renderComposable {
397396
// Explicitly remember the output function since we know that actionSink
398397
// is stable even though Compose might not know that.

samples/compose-samples/src/main/java/com/squareup/sample/compose/hellocompose/HelloComposeWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object HelloComposeWorkflow : StatefulWorkflow<Unit, State, Nothing, HelloCompos
3232
override fun render(
3333
renderProps: Unit,
3434
renderState: State,
35-
context: RenderContext
35+
context: RenderContext<Unit, State, Nothing>
3636
): HelloComposeScreen = HelloComposeScreen(
3737
message = renderState.name,
3838
onClick = { context.actionSink.send(helloAction) }

0 commit comments

Comments
 (0)