Skip to content

Commit

Permalink
Prepare version 0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Nov 13, 2023
1 parent 9358bd8 commit 6671da2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 7 deletions.
55 changes: 53 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,57 @@

## [Unreleased]

- Add `AnnotatedString` with `SpanStyle` for string customization.

## [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., our `Text`) or general-purpose (e.g., Compose's `remember`). 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.

```kotlin
val size = LocalTerminal.current.size
Text("Terminal(w=${size.width}, h=${size.height})")
```

- `Row`, `Column`, and `Box` now support horizontal and vertical alignment of their children.

```kotlin
Column {
Text("This is very long")
Text(
"On the right",
modifier = Modifier.align(End),
)
}
```

- Add `AnnotatedString` with `SpanStyle` for string customization. Instead of writing a series of
`Text` functions in a `Row`, emit a single `Text` with formatting changes within the string.

```kotlin
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

Expand Down Expand Up @@ -107,7 +157,8 @@ Breaking:
Initial release!


[Unreleased]: https://github.com/JakeWharton/mosaic/compare/0.9.1...HEAD
[Unreleased]: https://github.com/JakeWharton/mosaic/compare/0.10.0...HEAD
[0.10.0]: https://github.com/JakeWharton/mosaic/releases/tag/0.10.0
[0.9.1]: https://github.com/JakeWharton/mosaic/releases/tag/0.9.1
[0.9.0]: https://github.com/JakeWharton/mosaic/releases/tag/0.9.0
[0.8.0]: https://github.com/JakeWharton/mosaic/releases/tag/0.8.0
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10'
classpath 'com.jakewharton.mosaic:mosaic-gradle-plugin:0.9.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20'
classpath 'com.jakewharton.mosaic:mosaic-gradle-plugin:0.10.0'
}
}
Expand All @@ -111,6 +111,7 @@ certain versions of Kotlin.

| Kotlin | Mosaic |
|--------|---------------|
| 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 |
Expand All @@ -136,8 +137,8 @@ buildscript {
}
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0'
classpath 'com.jakewharton.mosaic:mosaic-gradle-plugin:0.10.0-SNAPSHOT'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20'
classpath 'com.jakewharton.mosaic:mosaic-gradle-plugin:0.11.0-SNAPSHOT'
}
}
Expand All @@ -159,6 +160,10 @@ Run `./gradlew installDist` to build the sample binaries.

`./samples/counter/build/install/counter/bin/counter`

* [Demo](samples/demo): A playground for demonstrating many features of Mosaic.

`./samples/demo/build/install/demo/bin/demo`

* [Jest](samples/jest): Example output of a test framework (such as JS's 'Jest').

`./samples/jest/build/install/jest/bin/jest`
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.jakewharton.mosaic
VERSION_NAME=0.10.0-SNAPSHOT
VERSION_NAME=0.10.0

SONATYPE_HOST=DEFAULT
SONATYPE_AUTOMATIC_RELEASE=true
Expand Down

0 comments on commit 6671da2

Please sign in to comment.