diff --git a/CHANGELOG.md b/CHANGELOG.md index 59f193db..292793d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,24 @@ ## [Unreleased] +## [1.2.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](https://github.com/cashapp/molecule/#custom-compose-compiler) for more information. + +Fixed: +- Ensure frame times sent by `RecompositionMode.Immediate` always increase. Previously, + when targeting JS, the same frame time could be seen since the clock only has millisecond + precision. Since the frame time is in nanoseconds, synthetic nanosecond offsets will be added to + ensure each timestamp is strictly greater than the last. +- Perform teardown of the composition on cancellation within an existing coroutine rather than in + a job completion listener. This ensures it executes on the same dispatcher as the rest of the + system, rather than on the canceling caller's thread. + + ## [1.1.0] - 2023-07-20 New: @@ -161,7 +179,8 @@ Initial release -[Unreleased]: https://github.com/cashapp/molecule/compare/1.1.0...HEAD +[Unreleased]: https://github.com/cashapp/molecule/compare/1.2.0...HEAD +[1.2.0]: https://github.com/cashapp/molecule/releases/tag/1.2.0 [1.1.0]: https://github.com/cashapp/molecule/releases/tag/1.1.0 [1.0.0]: https://github.com/cashapp/molecule/releases/tag/1.0.0 [0.11.0]: https://github.com/cashapp/molecule/releases/tag/0.11.0 diff --git a/README.md b/README.md index 1ad01892..f0688156 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'app.cash.molecule:molecule-gradle-plugin:1.1.0' + classpath 'app.cash.molecule:molecule-gradle-plugin:1.2.0' } } @@ -183,7 +183,7 @@ certain versions of Kotlin. | Kotlin | Molecule | |--------|----------------| -| 1.9.0 | 1.1.0 | +| 1.9.0 | 1.1.0 - 1.2.0 | | 1.8.22 | 0.11.0 - 1.0.0 | | 1.8.21 | 0.10.0 | | 1.8.20 | 0.9.0 | @@ -208,7 +208,7 @@ buildscript { } } dependencies { - classpath 'app.cash.molecule:molecule-gradle-plugin:1.2.0-SNAPSHOT' + classpath 'app.cash.molecule:molecule-gradle-plugin:1.3.0-SNAPSHOT' } } @@ -270,6 +270,27 @@ android { } ``` +### Custom Compose Compiler + +Each version of Molecule ships with a specific JetBrains Compose compiler version which works with +a single version of Kotlin (see [version table](#Usage) 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: +```kotlin +molecule { + kotlinCompilerPlugin.set("1.4.8") +} +``` + +To use an alternate Compose compiler dependency: +```kotlin +molecule { + kotlinCompilerPlugin.set("com.example:custom-compose-compiler:1.0.0") +} +``` + + ## License Copyright 2021 Square, Inc. diff --git a/gradle.properties b/gradle.properties index 79f1afc7..e9525d91 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ GROUP=app.cash.molecule # HEY! If you change the major version here be sure to update release.yaml doc target folder! -VERSION_NAME=1.2.0-SNAPSHOT +VERSION_NAME=1.2.0 SONATYPE_AUTOMATIC_RELEASE=true SONATYPE_HOST=DEFAULT diff --git a/molecule-gradle-plugin/src/main/java/app/cash/molecule/gradle/MoleculeExtension.kt b/molecule-gradle-plugin/src/main/java/app/cash/molecule/gradle/MoleculeExtension.kt index 307a23a0..88687e9d 100644 --- a/molecule-gradle-plugin/src/main/java/app/cash/molecule/gradle/MoleculeExtension.kt +++ b/molecule-gradle-plugin/src/main/java/app/cash/molecule/gradle/MoleculeExtension.kt @@ -24,14 +24,14 @@ interface MoleculeExtension { * * Example: using a custom version of the JetBrains Compose compiler * ```kotlin - * redwood { + * molecule { * kotlinCompilerPlugin.set("1.4.8") * } * ``` * * Example: using a custom Maven coordinate for the Compose compiler * ```kotlin - * redwood { + * molecule { * kotlinCompilerPlugin.set("com.example:custom-compose-compiler:1.0.0") * } * ```