This is required for the preview parameters to be correctly picked up by
the preview adapter in IDE, which expects the provider to be a subclass
of AndroidX's interface, and fails with the `ClassCastException`
otherwise.
## Release Notes
### Fixes - Multiple Platforms
- Support Preview parameters for Previews in common source sets in IJ
and AS. Note: IDEs also need to implement support on their end. Please
check the respective IDE release notes to confirm this is supported.
Example usage:
```
import androidx.compose.runtime.Composable
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider
class MyPreviewParameterProvider : PreviewParameterProvider<String> {
override val values = sequenceOf("Hello, Compose!", "Hello, World!")
}
/**
* This function will generate two preview images with different texts.
*/
@Preview@Composable
fun MyPreview(@PreviewParameter(MyPreviewParameterProvider::class) text: String) {
Text(text)
}
```
Fixes
https://youtrack.jetbrains.com/issue/CMP-8192/Changelog-script.-Handle-multi-cherry-pick-PRs-into-a-release
Now there is a special format for Release Notes, not for the PR.
Example: https://github.com/JetBrains/compose-multiplatform/pull/5312
- There was an old non-structured way determined it by "Cherry-picked
from ...", it is removed, as it is less convenient (we still need to
define Release Notes)
- We can determine cherry-picks automatically by git, but not always (in
case of conflicts or additional fixes). Because of this, now it is a
requirement either to describe the release notes the usual way or add
links to the original PRs.
## Testing
```
kotlin changelog.main.kts v1.7.3..v1.8.0
kotlin changelog.main.kts v1.8.0..v1.8.1+dev2468
```
Doesn't change old entries, and include new ones
## Release Notes
N/A
---------
Co-authored-by: Victor Kropp <victor.kropp@jetbrains.com>
After https://github.com/JetBrains/compose-multiplatform-core/pull/2097
is merged, CI fails with:
```
Warning: com.jetbrains.JBR: can't find referenced method 'java.lang.Object invokeExact(java.lang.Class,java.lang.Class,java.lang.Class,java.lang.Class,java.util.Map,java.util.function.Function)' in library class java.lang.invoke.MethodHandle
Warning: com.jetbrains.JBR: can't find referenced method 'java.lang.Object invokeExact(java.lang.invoke.MethodHandles$Lookup)' in library class java.lang.invoke.MethodHandle
<============-> 96% EXECUTING [3s] Warning: there were 2 unresolved references to library class members.aseJars
You probably need to update the library versions.-crash-in-the-field
(https://www.guardsquare.com/proguard/manual/troubleshooting#unresolvedlibraryclassmember)
Unexpected error
java.io.IOException: Please correct the above warnings first.
```
During Gradle tests.
## Testing
Tests for Gradle plugin pass
## Release Notes
### Fixes - Desktop
N/A
When users use `androidx.navigation`, they see `@Serialization`
annotation they can use, without explictly adding
`kotlinx.serialization`. They see, because it is added as an `api`
dependency.
The Compose Gradle plugin on the other hand provide `./gradlew
runRelease` task that uses ProGuard to minify binaries. Because the
plugin should support not only Compose, but also all support libraries
(androidx, components), we should bundle serialization ProGuard rules
into it.
Fixes https://youtrack.jetbrains.com/issue/CMP-8050
## Testing
```
import androidx.compose.ui.window.singleWindowApplication
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
fun main() = singleWindowApplication {
NavHost(
navController = rememberNavController(),
startDestination = LoginRoute()
) {
composable<LoginRoute> {}
}
}
sealed interface Route
@kotlinx.serialization.Serializable
data class LoginRoute(val id: Long? = null) : Route
```
Doesn't crash when run `./gradlew runRelease`
## Release Notes
### Fixes - Desktop
- Fix "Serializer for class is not found" using `androidx.navigation`
and running `./gradlew runRelease`
- `kotlinx.serialization` ProGuard rules are bundled in the Compose
Gradle plugin
This PR only updates Compose and Kotlin versions.
I'm going to follow it up with further updates addressing various
warnings.
## Testing
`./validateExamples.sh`, `./validateExamplesIos.sh`, and
`./validateExamplesWithJs.sh`
## Release Notes
N/A
- identify cherry-picks
- via "git log --cherry-pick" (we have to clone repos for that)
- in case it doesn't work, additionally identified via "cherry-picked
from" in PR descriptions
- fix multiline changes formatting
- exclude prerelease fixes
## Release Notes
N/A
---------
Co-authored-by: Victor Kropp <victor.kropp@jetbrains.com>
Updated the test to use a more relevant project setup and refined checks
for resource handling. Improved validation by verifying resource files
in the generated JAR.
## Release Notes
N/A
Gradle Plugin DSL to change the generated Res class name:
```kotlin
compose.resources {
nameOfResClass = "MyRes"
}
```
Fixes [CMP-7341](https://youtrack.jetbrains.com/issue/CMP-7341) Support
generating custom resource class name
## Testing
Integration tests.
## Release Notes
### Features - Resources
- Gradle Plugin DSL to change the generated Res class name
Co-authored-by: Omico <me@omico.icu>
Refactor resource accessors generator to minify output source files.
- Number of items per file was decreased to 100
- Common part of the path extracted to the private const
- Added imports
- Removed the private object with item's properties
- The file structure was reorganized
Fixes [CMP-7934](https://youtrack.jetbrains.com/issue/CMP-7934) Too
large String0.commonMain.kt will break code insight feature in AS
## Testing
Integration tests.
This should be tested by QA
## Release Notes
### Fixes - Resources
- Fix IDE highlighting/resoulution when a generated file with resource
accessors is too big
- images are not cached in the memory in such a case in all the impls.
- it reflects closer real world where a bunch of images usually loaded
from internet asynchronously
## Fixes
It is a workaround for
[CMP-8038](https://youtrack.jetbrains.com/issue/CMP-8038)
## Release Notes
N/A
- Updated the README.md with the description of benchmarks (might be
useful to external parties)
- customized a runner for D8
- added a `warmupCount` parameter to `runBenchmarks`, because it's
required for Jetstream3 (a set of benchmarks) that there is no warmup
(they skip it)
- Added a smooth scroll variant of LazyGrid + variants with
LaunchedEffect in grid cells for coroutines usage.
- Added a new class `Config`. Object `Args` is simplified, it's purpose
is to simply parse the arguments and produce a instance of `Config`. The
usages of `Args` were replaced by `Config`, except the parsing in fun
main.
- Renamed Example1 to MultipleComponents
- Also added MultipleComponents-NoVectorGraphics for D8 - it's similar
to MultipleComponents but doesn't use vector icons.
Fixes https://youtrack.jetbrains.com/issue/CMP-6942
Note: it's based on this PR
https://github.com/JetBrains/compose-multiplatform/pull/5275
## Testing
Manually run the benchmarks
## Release Notes
N/A
Replaced legacy handling of the Compose compiler plugin with a new mechanism using `checkComposeCompilerPlugin`. This ensures compatibility with Kotlin 2.0.0+ and eliminates outdated compatibility code, simplifying future maintenance.
Continuation of
https://github.com/JetBrains/compose-multiplatform/pull/5279
```
> Task :composeApp:runRelease
Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: Bad return type
Exception Details:
Location:
kotlinx/coroutines/flow/FlowKt__MergeKt.transformLatest$21dee7bd(Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/flow/internal/ChannelFlowTransformLatest; @17: areturn
Reason:
Type 'kotlinx/coroutines/flow/Flow' (current frame, stack[0]) is not assignable to 'kotlinx/coroutines/flow/internal/ChannelFlowTransformLatest' (from method signature)
Current Frame:
bci: @17
flags: { }
locals: { 'kotlinx/coroutines/flow/Flow', 'kotlin/jvm/functions/Function3' }
stack: { 'kotlinx/coroutines/flow/Flow' }
Bytecode:
0000000: bb00 0e59 2b2a 0103 0110 1cb7 0012 c000
0000010: 0ab0
at kotlinx.coroutines.flow.FlowKt.mapLatest(Unknown Source)
at kotlinx.coroutines.flow.FlowKt.collectLatest(Unknown Source)
at androidx.compose.foundation.text.SecureTextFieldController.observeHideEvents(BasicSecureTextField.kt:241)
at androidx.compose.foundation.text.BasicSecureTextFieldKt$BasicSecureTextField$1$1.invokeSuspend(BasicSecureTextField.kt:139)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.flush$lambda$4(FlushCoroutineDispatcher.skiko.kt:96)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.performRun(FlushCoroutineDispatcher.skiko.kt:105)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.flush(FlushCoroutineDispatcher.skiko.kt:83)
at androidx.compose.ui.scene.ComposeSceneRecomposer.performScheduledEffects(ComposeSceneRecomposer.skiko.kt:91)
at androidx.compose.ui.scene.BaseComposeScene.render(BaseComposeScene.skiko.kt:171)
at androidx.compose.ui.scene.ComposeSceneMediator.onRender$lambda$20$lambda$19(ComposeSceneMediator.desktop.kt:600)
at androidx.compose.ui.viewinterop.SwingInteropContainer.postponingExecutingScheduledUpdates(SwingInteropContainer.desktop.kt:251)
at androidx.compose.ui.scene.ComposeSceneMediator.onRender(ComposeSceneMediator.desktop.kt:598)
at org.jetbrains.skiko.SkiaLayer.update$skiko(SkiaLayer.awt.kt:558)
at org.jetbrains.skiko.redrawer.AWTRedrawer.update(AWTRedrawer.kt:54)
at org.jetbrains.skiko.redrawer.Direct3DRedrawer.redrawImmediately(Direct3DRedrawer.kt:74)
at org.jetbrains.skiko.SkiaLayer.tryRedrawImmediately(SkiaLayer.awt.kt:394)
at org.jetbrains.skiko.SkiaLayer.paint(SkiaLayer.awt.kt:367)
at androidx.compose.ui.scene.skia.WindowSkiaLayerComponent$contentComponent$1.paint(WindowSkiaLayerComponent.desktop.kt:64)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137)
at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
at androidx.compose.ui.awt.JLayeredPaneWithTransparencyHack.paint(Utils.desktop.kt:121)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137)
at androidx.compose.ui.window.Window_desktopKt.Window$lambda$40$lambda$39(Window.desktop.kt:629)
at androidx.compose.ui.window.AwtWindow_desktopKt.AwtWindow$lambda$7$lambda$6(AwtWindow.desktop.kt:78)
at androidx.compose.ui.util.UpdateEffect_desktopKt.UpdateEffect$lambda$8$lambda$7$performUpdate$lambda$4(UpdateEffect.desktop.kt:59)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2496)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:460)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:244)
at androidx.compose.ui.util.UpdateEffect_desktopKt.UpdateEffect$lambda$8$lambda$7$performUpdate(UpdateEffect.desktop.kt:55)
at androidx.compose.ui.util.UpdateEffect_desktopKt.UpdateEffect$lambda$8$lambda$7(UpdateEffect.desktop.kt:64)
at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:83)
at androidx.compose.runtime.internal.RememberEventDispatcher.dispatchRememberObservers(RememberEventDispatcher.kt:1182)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:1044)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1067)
at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:1159)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:2677)
at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:221)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.scene.ComposeContainer$DesktopCoroutineExceptionHandler@5bbe2373, androidx.compose.runtime.BroadcastFrameClock@3c45d5c5, StandaloneCoroutine{Cancelling}@7b8a1fc6, FlushCoroutineDispatcher@1850cb73]
```
## Release Notes
N/A
Adds serialization to JSON format to collect and analyze the results of
benchmark runs.
Additionally, improve the Gradle build by using version catalogues and
modern APIs.
## Testing
A regular benchmarks execution was set on the CI.
## Release Notes
### Features - Multiple Platforms
- Improve benchmarks build and serialize results into JSON for the
collection and analysis
Benchmarks crash due to the attempt to use a cached scene that was
closed in the previous benchmark.
Create a Surface for each of the benchmarks instead.
## Testing
Testing was done manually.
## Release Notes
N/A