0.3.0
New:
- Support for testing Composables with new test-specific code generation. Use the
'app.cash.redwood.generator.testing' plugin to generate a lambda-accepting entrypoint function
(such asExampleTester()
). Inside the lambda you can await snapshots of the values which
would be bound to the UI widgets at that time. - Redwood Layout now contains a
Spacer
which can be used to create negative space separately
from padding (which otherwise disappears when the item disappears). - The host's safe area insets are now included in
HostConfiguration
. Note that these are global
values which should only be applied when a view is known to be occupying the full window size. - Use the host's native frame rate to trigger recomposition inside of Treehouse. Pending snapshot
changes are also required for recomposition to occur.
Changes:
- Widgets are now created, populated, and attached to the native view hierarchy in a different order
than before. Previously widget was created, attached to its parent, and then its properties were
all set followed by any language modifiers. Now, the widget is created, all of its properties and
layout modifiers are set, and then it is added to its parent. Additionally, widgets are added to
their parents in a bottom-up manner. Code likeRow { Column { Text } }
will seeText
be added
toColumn
beforeColumn
is added to `Row. - 'redwood-treehouse' module has been split into '-shared', '-guest', and '-host' modules to
more cleanly delineate where each is used. "Host" is the native application and "guess" is code
running inside the Zipline JS VM. - Schema dependencies are not longer parsed when loading a schema. Instead, a JSON representation
is loaded from the classpath which contains the parsed structure of the dependency. As a result,
the module which contains the schema files must apply the 'app.cash.redwood.schema' plugin in
order to create this JSON. - Redwood Layout's
Padding
type is now calledMargin
. - Both Redwood's own API as well as code generated from your schema is now annotated with
@ObjCName
to create better-looking APIs in Objective-C (and Swift). - The
@Deprecated
annotation on a widget or its properties will now propagate into the generated
Composable and widget interface. - Event types are no longer always nullable. They will now respect the nullability in the schema.
- Layout modifiers are now generated into a 'modifier' subpackage.
Fixed:
- Redwood Layout
Constraint
s are now correctly propagated into HTML.
This version only works with Kotlin 1.8.20.