Skip to content

Commit

Permalink
Change protocol-host package to match its name (#1911)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton authored Mar 30, 2024
1 parent 45c5b9c commit cc3eaae
Show file tree
Hide file tree
Showing 34 changed files with 64 additions and 63 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ New:
Changed:
- Disable klib signature clash checks for JS compilations. These occasionally occur as a result of Compose compiler behavior, and are safe to disable (the first-party JetBrains Compose Gradle plugin also disables them).
- `onModifierChanged` callback in `Widget.Children` now receives the index and the `Widget` instance affected by the change.
- The package of 'redwood-protocol-host' changed to `app.cash.redwood.protocol.host`. This should not affect end-users as its types are mostly for internal use.
- The entire `redwood-yoga` artifact's public API has been annotated with an opt-in annotation indicating that it's only for Redwood internal use and is not stable.
- Revert: Don't block touch events to non-subviews below a `Row`, `Column`, or `Box` in the iOS `UIView` implementation. This matches the behavior of the Android View and Compose UI implementations.
- The generated "widget factories" type (e.g., `MySchemaWidgetFactories`) is now called a "widget system" (e.g., `MySchemaWidgetSystem`). Sometimes it was also referred to as a "provider" in parameter names. A `@Deprecated typealias` is generated for now, but will be removed in the future.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import app.cash.redwood.Modifier
import app.cash.redwood.RedwoodCodegenApi
import app.cash.redwood.layout.widget.RedwoodLayoutTestingWidgetFactory
import app.cash.redwood.lazylayout.widget.RedwoodLazyLayoutTestingWidgetFactory
import app.cash.redwood.protocol.widget.ProtocolBridge
import app.cash.redwood.protocol.host.ProtocolBridge
import app.cash.redwood.testing.TestRedwoodComposition
import app.cash.redwood.testing.WidgetValue
import app.cash.redwood.widget.MutableListChildren
Expand Down
24 changes: 12 additions & 12 deletions redwood-protocol-host/api/android/redwood-protocol-host.api
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
public abstract interface class app/cash/redwood/protocol/widget/GeneratedProtocolFactory : app/cash/redwood/protocol/widget/ProtocolFactory {
public abstract interface class app/cash/redwood/protocol/host/GeneratedProtocolFactory : app/cash/redwood/protocol/host/ProtocolFactory {
public abstract fun createModifier (Lapp/cash/redwood/protocol/ModifierElement;)Lapp/cash/redwood/Modifier;
public abstract fun createNode-WCEpcRY (I)Lapp/cash/redwood/protocol/widget/ProtocolNode;
public abstract fun createNode-WCEpcRY (I)Lapp/cash/redwood/protocol/host/ProtocolNode;
public abstract fun getChildrenTags ()Ljava/util/Map;
}

public final class app/cash/redwood/protocol/widget/ProtocolBridge : app/cash/redwood/protocol/ChangesSink {
public fun <init> (Lapp/cash/redwood/widget/Widget$Children;Lapp/cash/redwood/protocol/widget/ProtocolFactory;Lapp/cash/redwood/protocol/EventSink;)V
public final class app/cash/redwood/protocol/host/ProtocolBridge : app/cash/redwood/protocol/ChangesSink {
public fun <init> (Lapp/cash/redwood/widget/Widget$Children;Lapp/cash/redwood/protocol/host/ProtocolFactory;Lapp/cash/redwood/protocol/EventSink;)V
public fun sendChanges (Ljava/util/List;)V
}

public final class app/cash/redwood/protocol/widget/ProtocolChildren {
public final class app/cash/redwood/protocol/host/ProtocolChildren {
public fun <init> (Lapp/cash/redwood/widget/Widget$Children;)V
public final fun getChildren ()Lapp/cash/redwood/widget/Widget$Children;
}

public abstract interface class app/cash/redwood/protocol/widget/ProtocolFactory {
public abstract interface class app/cash/redwood/protocol/host/ProtocolFactory {
public abstract fun getWidgetSystem ()Lapp/cash/redwood/widget/WidgetSystem;
}

public abstract interface class app/cash/redwood/protocol/widget/ProtocolMismatchHandler {
public static final field Companion Lapp/cash/redwood/protocol/widget/ProtocolMismatchHandler$Companion;
public static final field Throwing Lapp/cash/redwood/protocol/widget/ProtocolMismatchHandler;
public abstract interface class app/cash/redwood/protocol/host/ProtocolMismatchHandler {
public static final field Companion Lapp/cash/redwood/protocol/host/ProtocolMismatchHandler$Companion;
public static final field Throwing Lapp/cash/redwood/protocol/host/ProtocolMismatchHandler;
public abstract fun onUnknownChildren-iETOA3M (II)V
public abstract fun onUnknownModifier-nx0wl1g (I)V
public abstract fun onUnknownProperty-LKUuuww (II)V
public abstract fun onUnknownWidget-WCEpcRY (I)V
}

public final class app/cash/redwood/protocol/widget/ProtocolMismatchHandler$Companion {
public final class app/cash/redwood/protocol/host/ProtocolMismatchHandler$Companion {
}

public abstract class app/cash/redwood/protocol/widget/ProtocolNode {
public abstract class app/cash/redwood/protocol/host/ProtocolNode {
public fun <init> ()V
public abstract fun apply (Lapp/cash/redwood/protocol/PropertyChange;Lapp/cash/redwood/protocol/EventSink;)V
public abstract fun children-dBpC-2Y (I)Lapp/cash/redwood/protocol/widget/ProtocolChildren;
public abstract fun children-dBpC-2Y (I)Lapp/cash/redwood/protocol/host/ProtocolChildren;
public abstract fun getWidget ()Lapp/cash/redwood/widget/Widget;
public final fun updateModifier (Lapp/cash/redwood/Modifier;)V
}
Expand Down
24 changes: 12 additions & 12 deletions redwood-protocol-host/api/jvm/redwood-protocol-host.api
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
public abstract interface class app/cash/redwood/protocol/widget/GeneratedProtocolFactory : app/cash/redwood/protocol/widget/ProtocolFactory {
public abstract interface class app/cash/redwood/protocol/host/GeneratedProtocolFactory : app/cash/redwood/protocol/host/ProtocolFactory {
public abstract fun createModifier (Lapp/cash/redwood/protocol/ModifierElement;)Lapp/cash/redwood/Modifier;
public abstract fun createNode-WCEpcRY (I)Lapp/cash/redwood/protocol/widget/ProtocolNode;
public abstract fun createNode-WCEpcRY (I)Lapp/cash/redwood/protocol/host/ProtocolNode;
public abstract fun getChildrenTags ()Ljava/util/Map;
}

public final class app/cash/redwood/protocol/widget/ProtocolBridge : app/cash/redwood/protocol/ChangesSink {
public fun <init> (Lapp/cash/redwood/widget/Widget$Children;Lapp/cash/redwood/protocol/widget/ProtocolFactory;Lapp/cash/redwood/protocol/EventSink;)V
public final class app/cash/redwood/protocol/host/ProtocolBridge : app/cash/redwood/protocol/ChangesSink {
public fun <init> (Lapp/cash/redwood/widget/Widget$Children;Lapp/cash/redwood/protocol/host/ProtocolFactory;Lapp/cash/redwood/protocol/EventSink;)V
public fun sendChanges (Ljava/util/List;)V
}

public final class app/cash/redwood/protocol/widget/ProtocolChildren {
public final class app/cash/redwood/protocol/host/ProtocolChildren {
public fun <init> (Lapp/cash/redwood/widget/Widget$Children;)V
public final fun getChildren ()Lapp/cash/redwood/widget/Widget$Children;
}

public abstract interface class app/cash/redwood/protocol/widget/ProtocolFactory {
public abstract interface class app/cash/redwood/protocol/host/ProtocolFactory {
public abstract fun getWidgetSystem ()Lapp/cash/redwood/widget/WidgetSystem;
}

public abstract interface class app/cash/redwood/protocol/widget/ProtocolMismatchHandler {
public static final field Companion Lapp/cash/redwood/protocol/widget/ProtocolMismatchHandler$Companion;
public static final field Throwing Lapp/cash/redwood/protocol/widget/ProtocolMismatchHandler;
public abstract interface class app/cash/redwood/protocol/host/ProtocolMismatchHandler {
public static final field Companion Lapp/cash/redwood/protocol/host/ProtocolMismatchHandler$Companion;
public static final field Throwing Lapp/cash/redwood/protocol/host/ProtocolMismatchHandler;
public abstract fun onUnknownChildren-iETOA3M (II)V
public abstract fun onUnknownModifier-nx0wl1g (I)V
public abstract fun onUnknownProperty-LKUuuww (II)V
public abstract fun onUnknownWidget-WCEpcRY (I)V
}

public final class app/cash/redwood/protocol/widget/ProtocolMismatchHandler$Companion {
public final class app/cash/redwood/protocol/host/ProtocolMismatchHandler$Companion {
}

public abstract class app/cash/redwood/protocol/widget/ProtocolNode {
public abstract class app/cash/redwood/protocol/host/ProtocolNode {
public fun <init> ()V
public abstract fun apply (Lapp/cash/redwood/protocol/PropertyChange;Lapp/cash/redwood/protocol/EventSink;)V
public abstract fun children-dBpC-2Y (I)Lapp/cash/redwood/protocol/widget/ProtocolChildren;
public abstract fun children-dBpC-2Y (I)Lapp/cash/redwood/protocol/host/ProtocolChildren;
public abstract fun getWidget ()Lapp/cash/redwood/widget/Widget;
public final fun updateModifier (Lapp/cash/redwood/Modifier;)V
}
Expand Down
2 changes: 1 addition & 1 deletion redwood-protocol-host/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kotlin {

sourceSets {
commonMain {
kotlin.srcDir(ComposeHelpers.get(tasks, 'app.cash.redwood.protocol.widget'))
kotlin.srcDir(ComposeHelpers.get(tasks, 'app.cash.redwood.protocol.host'))
dependencies {
api projects.redwoodProtocol
api projects.redwoodWidget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.Modifier
import app.cash.redwood.RedwoodCodegenApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.Modifier
import app.cash.redwood.RedwoodCodegenApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.protocol.ChildrenTag
import app.cash.redwood.protocol.ModifierTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.Modifier
import app.cash.redwood.RedwoodCodegenApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.Modifier
import app.cash.redwood.RedwoodCodegenApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import kotlin.time.Duration
import kotlinx.serialization.KSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.Modifier
import com.example.redwood.testing.modifier.BackgroundColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.layout.widget.RedwoodLayoutWidgetFactory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.lazylayout.widget.RedwoodLazyLayoutWidgetFactory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.protocol.ChildrenChange.Add
import app.cash.redwood.protocol.ChildrenChange.Remove
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.Modifier
import app.cash.redwood.RedwoodCodegenApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.protocol.ChildrenTag
import app.cash.redwood.protocol.ModifierTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.protocol.Event
import app.cash.redwood.protocol.EventSink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.cash.redwood.protocol.widget
package app.cash.redwood.protocol.host

import app.cash.redwood.protocol.ChildrenTag
import app.cash.redwood.protocol.ModifierTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import app.cash.redwood.layout.widget.MutableBox
import app.cash.redwood.layout.widget.MutableColumn
import app.cash.redwood.layout.widget.RedwoodLayoutTestingWidgetFactory
import app.cash.redwood.lazylayout.widget.RedwoodLazyLayoutTestingWidgetFactory
import app.cash.redwood.protocol.widget.ProtocolBridge
import app.cash.redwood.protocol.host.ProtocolBridge
import app.cash.redwood.widget.MutableListChildren
import app.cash.redwood.widget.Widget
import assertk.assertThat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import app.cash.redwood.protocol.PropertyChange
import app.cash.redwood.protocol.PropertyTag
import app.cash.redwood.protocol.WidgetTag
import app.cash.redwood.protocol.guest.ProtocolRedwoodComposition
import app.cash.redwood.protocol.widget.ProtocolBridge
import app.cash.redwood.protocol.host.ProtocolBridge
import app.cash.redwood.ui.Cancellable
import app.cash.redwood.ui.OnBackPressedCallback
import app.cash.redwood.ui.OnBackPressedDispatcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ internal object ProtocolGuest {

internal object WidgetProtocol {
val ProtocolMismatchHandler =
ClassName("app.cash.redwood.protocol.widget", "ProtocolMismatchHandler")
val ProtocolNode = ClassName("app.cash.redwood.protocol.widget", "ProtocolNode")
val ProtocolChildren = ClassName("app.cash.redwood.protocol.widget", "ProtocolChildren")
val GeneratedProtocolFactory = ClassName("app.cash.redwood.protocol.widget", "GeneratedProtocolFactory")
ClassName("app.cash.redwood.protocol.host", "ProtocolMismatchHandler")
val ProtocolNode = ClassName("app.cash.redwood.protocol.host", "ProtocolNode")
val ProtocolChildren = ClassName("app.cash.redwood.protocol.host", "ProtocolChildren")
val GeneratedProtocolFactory = ClassName("app.cash.redwood.protocol.host", "GeneratedProtocolFactory")
}

internal object Redwood {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ public abstract interface class app/cash/redwood/treehouse/TreehouseView$SaveCal
}

public abstract interface class app/cash/redwood/treehouse/TreehouseView$WidgetSystem {
public abstract fun widgetFactory (Lkotlinx/serialization/json/Json;Lapp/cash/redwood/protocol/widget/ProtocolMismatchHandler;)Lapp/cash/redwood/protocol/widget/ProtocolFactory;
public abstract fun widgetFactory (Lkotlinx/serialization/json/Json;Lapp/cash/redwood/protocol/host/ProtocolMismatchHandler;)Lapp/cash/redwood/protocol/host/ProtocolFactory;
}

2 changes: 1 addition & 1 deletion redwood-treehouse-host/api/jvm/redwood-treehouse-host.api
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ public abstract interface class app/cash/redwood/treehouse/TreehouseView$SaveCal
}

public abstract interface class app/cash/redwood/treehouse/TreehouseView$WidgetSystem {
public abstract fun widgetFactory (Lkotlinx/serialization/json/Json;Lapp/cash/redwood/protocol/widget/ProtocolMismatchHandler;)Lapp/cash/redwood/protocol/widget/ProtocolFactory;
public abstract fun widgetFactory (Lkotlinx/serialization/json/Json;Lapp/cash/redwood/protocol/host/ProtocolMismatchHandler;)Lapp/cash/redwood/protocol/host/ProtocolFactory;
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package app.cash.redwood.treehouse

import app.cash.redwood.protocol.EventSink
import app.cash.redwood.protocol.SnapshotChangeList
import app.cash.redwood.protocol.widget.ProtocolBridge
import app.cash.redwood.protocol.widget.ProtocolMismatchHandler
import app.cash.redwood.protocol.host.ProtocolBridge
import app.cash.redwood.protocol.host.ProtocolMismatchHandler
import kotlinx.serialization.json.Json

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package app.cash.redwood.treehouse
import app.cash.redwood.protocol.EventTag
import app.cash.redwood.protocol.Id
import app.cash.redwood.protocol.WidgetTag
import app.cash.redwood.protocol.widget.ProtocolMismatchHandler
import app.cash.redwood.protocol.host.ProtocolMismatchHandler
import app.cash.zipline.EventListener as ZiplineEventListener

internal interface EventPublisher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import app.cash.redwood.protocol.Id
import app.cash.redwood.protocol.ModifierTag
import app.cash.redwood.protocol.PropertyTag
import app.cash.redwood.protocol.WidgetTag
import app.cash.redwood.protocol.widget.ProtocolMismatchHandler
import app.cash.redwood.protocol.host.ProtocolMismatchHandler
import app.cash.zipline.Call
import app.cash.zipline.CallResult
import app.cash.zipline.Zipline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package app.cash.redwood.treehouse
import app.cash.redwood.protocol.Change
import app.cash.redwood.protocol.Event
import app.cash.redwood.protocol.EventSink
import app.cash.redwood.protocol.widget.ProtocolBridge
import app.cash.redwood.protocol.widget.ProtocolFactory
import app.cash.redwood.protocol.host.ProtocolBridge
import app.cash.redwood.protocol.host.ProtocolFactory
import app.cash.redwood.ui.OnBackPressedCallback
import app.cash.redwood.ui.OnBackPressedDispatcher
import app.cash.redwood.ui.UiConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package app.cash.redwood.treehouse

import app.cash.redwood.protocol.widget.ProtocolFactory
import app.cash.redwood.protocol.widget.ProtocolMismatchHandler
import app.cash.redwood.protocol.host.ProtocolFactory
import app.cash.redwood.protocol.host.ProtocolMismatchHandler
import app.cash.redwood.widget.RedwoodView
import kotlin.native.ObjCName
import kotlinx.serialization.json.Json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package app.cash.redwood.treehouse
import app.cash.redwood.protocol.EventTag
import app.cash.redwood.protocol.Id
import app.cash.redwood.protocol.WidgetTag
import app.cash.redwood.protocol.widget.ProtocolMismatchHandler
import app.cash.redwood.protocol.host.ProtocolMismatchHandler
import app.cash.zipline.EventListener

class FakeEventPublisher : EventPublisher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import app.cash.redwood.protocol.EventSink
import app.cash.redwood.protocol.EventTag
import app.cash.redwood.protocol.Id
import app.cash.redwood.protocol.PropertyChange
import app.cash.redwood.protocol.widget.ProtocolChildren
import app.cash.redwood.protocol.widget.ProtocolNode
import app.cash.redwood.protocol.host.ProtocolChildren
import app.cash.redwood.protocol.host.ProtocolNode
import kotlinx.serialization.json.JsonPrimitive

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import app.cash.redwood.RedwoodCodegenApi
import app.cash.redwood.protocol.ChildrenTag
import app.cash.redwood.protocol.ModifierElement
import app.cash.redwood.protocol.WidgetTag
import app.cash.redwood.protocol.widget.GeneratedProtocolFactory
import app.cash.redwood.protocol.widget.ProtocolNode
import app.cash.redwood.protocol.host.GeneratedProtocolFactory
import app.cash.redwood.protocol.host.ProtocolNode
import app.cash.redwood.widget.WidgetSystem

@OptIn(RedwoodCodegenApi::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package app.cash.redwood.treehouse

import app.cash.redwood.protocol.widget.ProtocolMismatchHandler
import app.cash.redwood.protocol.host.ProtocolMismatchHandler
import kotlinx.serialization.json.Json

internal class FakeTreehouseWidgetSystem : TreehouseView.WidgetSystem<FakeWidget> {
Expand Down
Loading

0 comments on commit cc3eaae

Please sign in to comment.