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

Upgrade to Zipline 1.7.0 #1718

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ androidx-activity = "1.8.1"
androidx-compose-ui = "1.5.4"
jbCompose = "1.5.11"
lint = "31.2.0"
zipline = "1.6.0"
zipline = "1.7.0"
coil = "2.5.0"
okio = "3.6.0"

Expand Down
1 change: 1 addition & 0 deletions redwood-treehouse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ kotlin {
dependencies {
api projects.redwoodCompose
api projects.redwoodProtocol
api libs.kotlinx.serialization.core
api libs.okio
api libs.zipline
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import app.cash.redwood.protocol.Id
import app.cash.redwood.protocol.WidgetTag
import app.cash.zipline.ZiplineService
import kotlin.native.ObjCName
import kotlinx.serialization.Contextual

@ObjCName("AppLifecycle", exact = true)
public interface AppLifecycle : ZiplineService {
public fun start(host: Host)

public fun sendFrame(timeNanos: Long)
public fun sendFrame(timeNanos: @Contextual Long)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a side point, but I feel like we've been overusing @Contextual. We very explicitly know what serializer we want to use here, and should probably opt for something as outlined at https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#specifying-serializer-globally-using-typealias. Doing @Contextual just pushes all unregistered types to throw a runtime exception, which doesn't make sense if we know what serializer we always want for a specific case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/** Platform features to the guest application. */
public interface Host : ZiplineService {
Expand Down