0.8.0
New:
flex(double)
modifier for layouts which acts as a weight along the main axis.- Allow reserving widget, modifier, property, and children tags in the schema. This can be used to document old items which no longer exist and prevent their values from accidentally being reused.
- Add
dangerZone { }
DSL to theredwood { }
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).- Expose
frameClock
onStandardAppLifecycle
to allow monitoring host frames. CodeListener.onUncaughtException
notifies of any uncaught exceptions which occur in Treehouse guest code.- Preview: Add
Box
widget which stacks children on top of each other. This is currently only implemented for Android views and iOS UIKit. - Support
rememberSaveable
in plain Redwood compositions. - Programmatic scrolls on
LazyListState
can now setanimated=true
for an animated scroll. - Add
ziplineCreated
,manifestReady
, andcodeLoadSkippedNotFresh
event callbacks to TreehouseEventListener
.
Changed:
- The Treehouse Zipline disk cache directory is no longer within the cache directory on Android. This ensures it can't be cleared while the app is running. Zipline automatically constrains the directory to a maximum size so old entires will still be purged automatically.
- Set the Zipline thread's stack size to 8MiB on Android to match iOS.
- Use
margin-inline-start
andmargin-inline-end
for the start and end margin, respectively, for the HTML DOM layout bindings. TestRedwoodComposition
now accepts only the initialUiConfiuration
and exposes aMutableStateFlow
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.- Emoji Search sample applications now bundle the latest guest code at compile-time and do not require the server running to work.
- The built-in
RedwoodView
forHTMLElement
now reports density changes to theUiConfiguration
. - Redwood protocol modules have been renamed to 'guest' and 'host' to match Treehouse conventions.
- Suppress deprecation warnings in generated code. This code often refers to user types which may be deprecated, and should not cause additional warnings.
TreehouseAppContent.preload
is now idempotent.LazyList
on iOS has changed fromUICollectionView
toUITableView
, and changes to the backing data are now reported granularly rather than reloading everything.- Allow arbitrary serializable content within
rememberSaveable
inside Treehouse. - Add a
TreehouseApp
argument toCodeListener
. 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 aTreehouseApp
instead of aTreehouseAppFactory
. This more closely scopes them with the lifetime of theZipline
instance.
Fixed:
- Ensure changes to modifiers notify their parent widget when using Treehouse.
- Explicitly mark the generated scope objects as
@Stable
to prevent needless recomposition. - Dispose the old composition when the
RedwoodContent
composable recomposes or is removed from the composition. - Ensure
UIViewChildren
indexes children usingtypedArrangedSubviews
when removing views from aUIStackView
. - Correctly parse
data object
modifiers in the schema. - Remember the default
CodeListener
forTreehouseContent
to avoid unneccessary recomposition on creation. - When calling
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. - Persist saved values from Treehouse without jumping back to the UI thread which allows proper restoration after a config change.
- Reset the requested widths and heights of a layout in the underlying Yoga engine when the size is invalidated. This ensures that the engine will properly measure changed content the grows and shrinks in either dimension.
This version works with Kotlin 1.9.22 by default.