New:
- Nothing yet!
Changed:
- Nothing yet!
Fixed:
- Nothing yet!
0.15.0 - 2025-01-07
New:
- Create
mosaic-animation
library, that provides various possibilities for animating Mosaic. An analog of androidx.compose.animation-core. - Add
IntrinsicSize
and relatedModifier.width
/height
/requiredWidth
/requiredHeight
. - New
mosaic-testing
library for deterministically rendering Mosaic composables under test. - Add
Mosaic.layoutId
which allows identifying the element within its parent during layout. - Add
Modifier.composed
that allows creating custom reusable modifiers with access to Compose functionality inside.
Changed:
- Rendering now occurs as fast as possible, although still only when necessary. Previously the maximum FPS was capped to 20, which could cause minor visual delays when processing events.
Fixed:
- Fix the handling of custom
Modifier
s that have multiple parents fromLayoutModifier
,DrawModifier
,KeyModifier
,ParentDataModifier
.
0.14.0 - 2024-10-07
New:
- Support synchronized terminal update for rendering. This should eliminate tearing when rendering updates for terminals that support this feature.
- The terminal cursor is now automatically hidden during rendering and restored afterward.
- Added
Modifier.onKeyEvent
orModifier.onPreKeyEvent
to listen to keyboard events. - Send real frame times into Compose which can be used for things like animations.
Changed:
- The entrypoints (
runMosaic
andrunMosaicBlocking
) have been changed to directly accept a composable lambda. Asynchronous work should now be performed inside Compose's effect system (e.g.,LaunchedEffect
), and rendering will complete when all effects have completed. Check out our samples for more information about how to do this. - Сhange
DrawScope#drawRect
API with the ability to draw with text characters and specifyDrawStyle
(Fill
orStroke
). - Drop support for JS target. If you were using this, please file an issue so we can discuss support.
0.13.0 - 2024-05-28
New:
- Support Kotlin 2.0.0!
Changed:
- Remove our Gradle plugin in favor of JetBrains' (see below for more).
Note: Version 0.12.0 was also released today, but it still supports Kotlin 1.9.24. Check out its release entry for more on what's new.
This version of Mosaic removes the custom Gradle plugin in favor of the official JetBrains Compose compiler plugin which ships as part of Kotlin itself.
Each module in which you had previously applied the com.jakewharton.mosaic
plugin should be changed to apply org.jetbrains.kotlin.plugin.compose
instead.
The Mosaic runtime will no longer be added as a result of the plugin change, and so any module which references Mosaic APIs should apply the com.jakewharton.mosaic:mosaic-runtime
dependency.
For posterity, the Kotlin version compatibility table and compiler version customization for our old Mosaic Gradle plugin will be archived here:
Mosaic 0.12.0 Gradle plugin Kotlin compatibility table
Since Kotlin compiler plugins are an unstable API, certain versions of Mosaic only work with certain versions of Kotlin.
Kotlin | Mosaic |
---|---|
1.9.24 | 0.12.0 |
1.9.22 | 0.11.0 |
1.9.20 | 0.10.0 |
1.9.10 | 0.9.1 |
1.9.0 | 0.8.0 - 0.9.0 |
1.8.22 | 0.7.1 |
1.8.21 | 0.7.0 |
1.8.20 | 0.6.0 |
1.8.10 | 0.5.0 |
1.8.0 | 0.3.0 - 0.4.0 |
1.7.10 | 0.2.0 |
1.5.10 | 0.1.0 |
Mosaic 0.12.0 Gradle plugin Compose compiler customization instructions
Each version of Mosaic ships with a specific JetBrains Compose compiler version which works with a single version of Kotlin (see version table above). Newer versions of the Compose compiler or alternate Compose compilers can be specified using the Gradle extension.
To use a new version of the JetBrains Compose compiler version:
mosaic {
kotlinCompilerPlugin.set("1.4.8")
}
To use an alternate Compose compiler dependency:
mosaic {
kotlinCompilerPlugin.set("com.example:custom-compose-compiler:1.0.0")
}
0.12.0 - 2024-05-28
New:
- Add
linuxArm64
target. - Add
rrtop
sample. - Support true color palette.
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).
- Remove
Terminal$Size
and useIntSize
instead inTerminal#size
for optimization purposes. - Remove
Color.Bright*
constants. UseColor
function to create the desired color. - Replace nullable
Color
andTextStyle
withColor.Unspecified
andTextStyle.Unspecified
respectively. Also makeTextStyle
an inline class.
Fixed:
- Use CRLF line endings to fix rendering when a terminal is in raw mode.
0.11.0 - 2024-02-27
New:
- Support Kotlin 1.9.22 via JetBrains Compose compiler 1.5.10.
Filler
composable is like aSpacer
but fills its area with a character instead of a space.Box
without content provides the ability to render using drawing modifiers without needing an empty chidlren lambda.Modifier.aspectRatio
attempts to constrain a composable to an aspect ratio in either the vertical or horizontal direction.Modifier.offset
offsets the composable in its parent by the given coordinates.Modifier.fillMaxWidth
,Modifier.fillMaxHeight
,Modifier.fillMaxSize
,Modifier.wrapContentWidth
,Modifier.wrapContentHeight
,Modifier.wrapContentSize
, andModifier.defaultMinSize
help size composable measurement in relation to their parent.Modifier.weight
allows sizing a composable proportionally to others within the same parent.Row
andColumn
each feature an arrangement parameter which controls the placement of children on the main axis of the container.
Changed:
Modifier
parameter is now universally calledmodifier
in the API.- Disable decoy generation for JS target to make compatible with JetBrains Compose 1.6. This is an ABI-breaking change, so all Compose-based libraries targeting JS will also need to have been recompiled.
Fix:
- Ensure ANSI control sequences are written properly to Windows terminals.
- Robot sample now correctly moves on Windows.
This version works with Kotlin 1.9.22 by default.
0.10.0 - 2023-11-13
New:
-
Support Kotlin 1.9.20 via JetBrains Compose compiler 1.5.3.
-
@MosaicComposable
annotation restricts composable function usage to those meant for Mosaic (e.g., ourText
) or general-purpose (e.g., Compose'sremember
). In most cases the Compose compiler can infer this automatically, but it's available for explicit use if needed. -
LocalTerminal
composition local provides the size of the terminal if it can be detected. If the size changes, your function will automatically be recomposed with the new values.val size = LocalTerminal.current.size Text("Terminal(w=${size.width}, h=${size.height})")
-
Row
,Column
, andBox
now support horizontal and vertical alignment of their children.Column { Text("This is very long") Text( "On the right", modifier = Modifier.align(End), ) }
-
Add
AnnotatedString
withSpanStyle
for string customization. Instead of writing a series ofText
functions in aRow
, emit a singleText
with formatting changes within the string.Text(buildAnnotatedString { append("Plain! ") withStyle(SpanStyle(color = BrightGreen)) { append("Green! ") } withStyle(SpanStyle(color = BrightBlue)) { append("Blue!") } })
-
Spacer
node for occupying space within layouts. -
Constraints and intrinsics are now available in the layout system.
This version works with Kotlin 1.9.20 by default.
0.9.1 - 2023-09-14
New:
- Support Kotlin 1.9.10 via JetBrains Compose compiler 1.5.2.
This version works with Kotlin 1.9.10 by default.
0.9.0 - 2023-08-09
New:
-
Support for specifying custom Compose compiler versions. This will allow you to use the latest version of Molecule with newer versions of Kotlin than it explicitly supports.
See the README for more information.
0.8.0 - 2023-07-20
New:
- Support Kotlin 1.9.0 via JetBrains Compose compiler 1.5.0.
0.7.1 - 2023-06-30
New:
- Support Kotlin 1.8.22 via JetBrains Compose compiler 1.4.8.
0.7.0 - 2023-06-26
New:
- Support Kotlin 1.8.21 via JetBrains Compose compiler 1.4.7.
- Add support for modifiers on layouts and built-in components.
There are two types which are built-in:
DrawModifier
andLayoutModifier
. The built-in functions aredrawBehind
,background
,layout
, andpadding
. - Add Box component.
Changed:
- Frames are now emitted slightly differently relying on Compose for signaling when a change has happened. Please report any problems.
0.6.0 - 2023-04-17
New:
- Support Kotlin 1.8.20 via JetBrains Compose compiler 1.4.5.
Changed:
- Upgrade JetBrains Compose runtime to 1.4.0.
- Reduce string copies and string allocation required to perform a single frame render.
- Only split text strings on newline when its value changes by caching layout information across recomposition.
- Canvas is no longer clipped for each node. If you notice any overlapping drawing, please report a bug.
Breaking:
- Composables were moved into
ui
subpackage. Layout
and related interfaces were moved intolayout
subpackage.Static
content is now based onSnapshotStateList
instead ofFlow
.
0.5.0 - 2023-03-09
- Support Kotlin 1.8.10 via JetBrains Compose compiler 1.4.2.
- New:
renderMosaic
function returns a single string of the composition for tools that require only static output. - New: Expose a custom
Layout
composable similar to Compose UI. This is just the beginning of a larger change to expose more powerful primitives. - Implicit root node is no longer a
Row
. Multiple children at the root will now draw on top of each other. Choose aRow
orColumn
as the root composable yourself. - Each
Static
content is no longer wrapped in aRow
. Multiple children in a singleStatic
composable will draw on top of each other. Choose aRow
orColumn
if you have multiple items. MultipleStatic
composables will still render inColumn
-like behavior
0.4.0 - 2023-02-19
-
Mosaic is now multiplatform!
The following targets are now supported in addition to the JVM:
- Linux (X64)
- MacOS (ARM & X64)
- Windows (X64)
- JS (experimental)
Additionally, the JetBrains Compose compiler is now used instead of AndroidX which should offer better support for native and JS targets.
-
runMosaic
is now a suspending function which will return when the composition ends. For the previous behavior, arunMosaicBlocking
function is provided (JVM + native).
0.3.0 - 2023-01-17
- Support Kotlin 1.8.0 via Compose compiler 1.4.0.
- New:
Static
composable for rendering permanent output. - Fix: Correct line calculation to prevent output from drifting downward over time when its height changes.
0.2.0 - 2022-08-12
- Support Kotlin 1.7.10 via Compose compiler 1.3.0.
- Migrate from custom build of Compose compiler and Compose runtime to Google's Compose compiler and JetBrains' multiplatform Compose runtime. Note that this will require you have the Google Maven repositories in your Gradle repositories (
google()
).
0.1.0 - 2021-06-25
Initial release!