Multiplatform reactive UI for Android, iOS, and web using Kotlin and Jetpack Compose
APACHE-2.0 License
Bot releases are visible (Hide)
New:
toDebugString
method for WidgetValue
and List<WidgetValue>
which returns a formatted string of a widget's children and properties, useful for test debugging.Changed:
typealias
es for package names which changed in 0.10.0.UIViewLazyList
's UITableView
, adding special-case handling for programmatic scroll-to-top calls.FileSystem
and Path
now have the FileSystem
coming before the Path
in the parameter list. Compatibility functions are retained for this version, but will be removed in the next version.Fixed:
UIViewLazyList
, fix UInt
to UIColor
conversion math used for pullRefreshContentColor
.YogaUIView
's setScrollEnabled
method, only call setNeedsLayout
if the scrollEnabled
value is actually changing.YogaUIView
's layoutNodes
method, return early for nested YogaUIView
s to prevent redundant frame calculations.Upgraded:
This version works with Kotlin 1.9.24 by default.
Published by github-actions[bot] 7 months ago
New:
Box
.Widget.Children
interface now exposes widgets: List<Widget<W>>
property. Most subtypes were already exposing this individually.Changed:
onModifierChanged
callback in Widget.Children
now receives the index and the Widget
instance affected by the change.app.cash.redwood.protocol.host
. This should not affect end-users as its types are mostly for internal use.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.Row
, Column
, or Box
in the iOS UIView
implementation. This matches the behavior of the Android View and Compose UI implementations.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.typealias
es are generated in the old locations for public types and functions, but those will be removed in the next release.
your.package.testing
.your.package.protocol.guest
.your.package.protocol.host
.--compose-protocol
and --widget-protocol
to --protocol-guest
and --protocol-host
, respectively.RedwoodVersion
type, and will be automatically wired if using our Treehouse artifacts.Fixed:
CoroutineScope
is being cancelledView
implementation of Box
to wrap its width and height by default. This matches the behavior of the UIView
implementation and all other layout widgets.UIView
implementation of Box
not updating when some of its parameters are changed.Modifier.size
not being applied to children inside a Box
.Margin
not being applied to the UIView
implementation of Box
.View
implementation of Box
now applies start/end margins correctly in RTL, and does not crash if set before the native view was attached.UIViewLazyList
to be transparent. This matches the behavior of the other LazyList
platform implementations.TreehouseUIView
to size itself according to the size of its subview.UIViewLazyList
, adding beginUpdates
/endUpdates
calls to insertRows
/deleteRows
, and wrapping changes in UIView.performWithoutAnimation
blocks.UIViewLazyList
, don't remove subviews from hierarchy during prepareForReuse
callPublished by github-actions[bot] 8 months ago
Changed:
Modifier
parameter to RedwoodContent
which is applied to the root Box
into which content is rendered (https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md#elements-accept-and-respect-a-modifier-parameter).LazyRow
and LazyColumn
have changed to reflect Compose best practices (https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md#elements-accept-and-respect-a-modifier-parameter).TreehouseContent
has changed to reflect Compose best practices (https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md#elements-accept-and-respect-a-modifier-parameter).ComposeWidgetChildren
has been renamed to Render
to reflect Compose best practices (https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md#naming-unit-composable-functions-as-entities).Fixed:
Row
, Column
, or Box
in the iOS UIView
implementation. This matches the behavior of the Android View and Compose UI implementations.This version works with Kotlin 1.9.22 by default.
Published by github-actions[bot] 8 months ago
New:
flex(double)
modifier for layouts which acts as a weight along the main axis.dangerZone { }
DSL to the redwood { }
Gradle extension which allows enabling Compose reports and metrics. Currently these features break build caching as Compose forces the use of absolute paths in the Kotlin compiler arguments when in use (hence why they're marked as dangerous).BackHandler
composable provides a callback for handling hardware back affordances (currently only on Android).frameClock
on StandardAppLifecycle
to allow monitoring host frames.CodeListener.onUncaughtException
notifies of any uncaught exceptions which occur in Treehouse guest code.Box
widget which stacks children on top of each other. This is currently only implemented for Android views and iOS UIKit.rememberSaveable
in plain Redwood compositions.LazyListState
can now set animated=true
for an animated scroll.ziplineCreated
, manifestReady
, and codeLoadSkippedNotFresh
event callbacks to Treehouse EventListener
.Changed:
margin-inline-start
and margin-inline-end
for the start and end margin, respectively, for the HTML DOM layout bindings.TestRedwoodComposition
now accepts only the initial UiConfiuration
and exposes a MutableStateFlow
for changing its value over time.TreehouseLayout
now defines a default ID to allow state saving and restoration to work. Note that this will only work when a single instance is present in the hierarchy. If you have multiple, supply your own unique IDs.RedwoodView
for HTMLElement
now reports density changes to the UiConfiguration
.TreehouseAppContent.preload
is now idempotent.LazyList
on iOS has changed from UICollectionView
to UITableView
, and changes to the backing data are now reported granularly rather than reloading everything.rememberSaveable
inside Treehouse.TreehouseApp
argument to CodeListener
. Combined with the new uncaught exception callback, this provides an easy way to restart a Treehouse application on a crash.EventListener.Factory
instances are now supplied as part of a TreehouseApp
instead of a TreehouseAppFactory
. This more closely scopes them with the lifetime of the Zipline
instance.Fixed:
@Stable
to prevent needless recomposition.RedwoodContent
composable recomposes or is removed from the composition.UIViewChildren
indexes children using typedArrangedSubviews
when removing views from a UIStackView
.data object
modifiers in the schema.CodeListener
for TreehouseContent
to avoid unneccessary recomposition on creation.TreehouseUi.start
, fall back to older API signature when newer one does not match. This is needed because an addiitonal parameter was added in newer versions, but older guest code may have the old signature.This version works with Kotlin 1.9.22 by default.
Published by github-actions[bot] about 1 year ago
New:
UiConfiguration
.RedwoodView
and platform-specific subtypes provide a turnkey view into which aRedwoodComposition
can be rendered. TreehouseView
now extends RedwoodView
.Changed:
org.jetbrains.kotlin.js
). This plugin is deprecatedorg.jetbrains.kotlin.multiplatform
).TreehouseView
subtypes were renamed to better match platform conventions:
TreehouseWidgetView
is now TreehouseLayout
for Android.TreehouseUIKitView
is now TreehouseUIView
for iOS.UIViewChildren
now supports UIStackView
automatically.lazylayout
instead of just layout
.This version works with Kotlin 1.9.10 by default.
Published by github-actions[bot] about 1 year ago
New:
Support for specifying custom Compose compiler versions. This will allow you to use the latest
version of Redwood with newer versions of Kotlin than it explicitly supports.
See the README for more information.
LazyList
can now be programmatically scrolled through its ScrollItemIndex
parameter.
Pull-to-refresh indicator color on LazyList
is now customizable through
pullRefreshContentColor
parameter.
Changes:
data class
to regular classes withequals
/hashCode
/toString()
. If you were relying on destructuring or copy()
for theseFix:
LazyList
UICollectionViewFlowLayout
.This version works with Kotlin 1.9.0 by default.
Published by github-actions[bot] over 1 year ago
This release marks Redwood's "beta" period which provides slightly more stability guarantees than
before. All future releases up to (but NOT including) 1.0 will have protocol and service
compatibility with older versions. In practice, what this means is that you can use Redwood 0.6
(and beyond) to compile and deploy Treehouse guest code which will run inside a Treehouse host
from Redwood 0.5.
Redwood still reserves the right to make binary- and source-incompatible changes within the host
code or within the guest code.
New:
redwoodApiGenerate
Gradle task willredwoodApiCheck
task will validate the current schema ascheck
lifecycle task.width
, height
, and size
modifiers allow precise control over widget size withinrememberSaveable
within Treehouse guest code with persistence onlyChanges:
LazyList
now has arguments for margin
and cross-axis alignmentverticalAlignment
for LazyRow
, horizontalAlignment
for LazyColumn
)LazyList
. Any missing functionality fromFixed:
This version only works with Kotlin 1.8.22.
Published by github-actions[bot] over 1 year ago
New:
LazyRow
and LazyColumn
via refreshing
booleanonRefresh
lambda. These are experimental because we expect refresh support to migrate toDisplayLinkClock
is available for iOS and MacOS users of Redwood.WidgetValue
(or List<WidgetValue>
) produced from the generated testing function'sawaitSnapshot()
can now be converted to a SnapshotChangeList
which can be serialized to JSON.TreehouseView
to recreate a full viewChangeListener
interface to receive an onEndChanges()
LazyRow
and LazyColumn
now support a placeholder
composable slot which will be used withwidth
and height
constraints.Changes:
LayoutModifier
has been renamed to Modifier
.
UI primitives like Dp
, Density
, and Margin
have moved from Treehouse into the Redwood
runtime (in the app.cash.redwood.ui
package).
HostConfiguration
has moved from Treehouse into the Redwood runtime (in the
app.cash.redwood.ui
package) and is now called UiConfiguration
.
Composables running in Treehouse now run on a background thread on iOS. Previously they were
running on the main thread. Interactions with UIKit still occur on the main thread.
RedwoodContent
function for hosting a Redwood composable within Compose UI has moved into a new
redwood-composeui
artifact as it will soon require a Compose UI dependency.
The generated testing function now returns the value which was returned from the testing lambda.
Before:
suspend fun ExampleTester(body: suspend TestRedwoodComposition.() -> Unit)
Now:
suspend fun <R> ExampleTester(body: suspend TestRedwoodComposition.() -> R): R
The Redwood and Treehouse frame clocks now send actual values for the frame time instead of 0.
Fixed:
null
value when nonull
would only be seen after a non-null
lambda.Row
, Column
, Spacer
, and UIViewChildren
now react to size andThis version only works with Kotlin 1.8.20.
Published by github-actions[bot] over 1 year ago
New:
ExampleTester()
). Inside the lambda you can await snapshots of the values whichSpacer
which can be used to create negative space separatelyHostConfiguration
. Note that these are globalChanges:
Row { Column { Text } }
will see Text
be addedColumn
before Column
is added to `Row.Padding
type is now called Margin
.@ObjCName
to create better-looking APIs in Objective-C (and Swift).@Deprecated
annotation on a widget or its properties will now propagate into the generatedFixed:
Constraint
s are now correctly propagated into HTML.This version only works with Kotlin 1.8.20.
Published by github-actions[bot] over 1 year ago
Changed:
ScrollView
/HorizontalScrollView
as the parent container for View-based Row
andColumn
display when the container is not scrollable (the default). Use a FrameLayout
instead.Fixed:
redwood-treehouse-composeui
artifact.This version only works with Kotlin 1.7.20.
Published by github-actions[bot] over 1 year ago
New:
redwood-layout-dom
module provides HTML implementations of Row
and Column
.concurrentDownloads
parameter for TreehouseApp.Factory
. The default is 8.moduleLoadStart
and moduleLoadEnd
events to Treehouse's EventListener
.Changed:
Row
and Column
layouts rather than its own unspecified one.CoroutineScope
for each TreehouseView
. When a view leaves, its coroutinesTreehouseLauncher
is now called TreehouseApp.Factory
. Additionally, when you create()
aTreehouseApp
from a factory you must also call start()
for it to actually start.Fixed:
Configuration
s created by our plugin. This ensures they are not candidatesFrameClock
is closed to avoid crashing on updates.This version only works with Kotlin 1.7.20.
Published by github-actions[bot] almost 2 years ago
Initial release