Browse Source

Update links to docs on the new portal (#3897)

* Updated links to new onboarding articles
* Updated links documentation articles moved to the new doc portal 
* Added placeholders for moved pages

---------

Co-authored-by: Ekaterina.Volodko <ekaterina.volodko@jetbrains.com>
pull/3921/head
katia-energizer 1 year ago committed by GitHub
parent
commit
a32f56bebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      README.md
  2. 124
      VERSIONING.md
  3. 115
      docs/FAQ.md
  4. 7
      tutorials/README.md

33
README.md

@ -6,14 +6,14 @@
# Compose Multiplatform # Compose Multiplatform
**Compose Multiplatform** is a declarative framework for sharing UIs across multiple platforms with Kotlin. [**Compose Multiplatform**](https://jb.gg/cmp) is a declarative framework for sharing UIs across multiple platforms with Kotlin.
It is based on [Jetpack Compose](https://developer.android.com/jetpack/compose) and developed by [JetBrains](https://www.jetbrains.com/) and open-source contributors. It is based on [Jetpack Compose](https://developer.android.com/jetpack/compose) and developed by [JetBrains](https://www.jetbrains.com/) and open-source contributors.
You can choose the platforms across which to share your UIs using Compose Multiplatform: You can choose the platforms across which to share your UIs using Compose Multiplatform:
* [iOS](https://github.com/JetBrains/compose-multiplatform-ios-android-template/#readme) (Alpha) * [iOS](https://jb.gg/start-cmp) (Alpha)
* [Android](https://developer.android.com/jetpack/compose) (via Jetpack Compose) * [Android](https://jb.gg/start-cmp)
* [Desktop](https://github.com/JetBrains/compose-multiplatform-desktop-template/#readme) (Windows, MacOS, Linux) * [Desktop](https://jb.gg/start-cmp) (Windows, MacOS, Linux)
* [Web](https://kotl.in/wasm-compose-example) (Experimental) * [Web](https://kotl.in/wasm-compose-example) (Experimental)
For example, you can share UIs between iOS and Android or Windows and MacOS. For example, you can share UIs between iOS and Android or Windows and MacOS.
@ -29,17 +29,19 @@ For example, you can share UIs between iOS and Android or Windows and MacOS.
Compose Multiplatform shares most of its API with Jetpack Compose, the Android UI framework developed by Google. Compose Multiplatform shares most of its API with Jetpack Compose, the Android UI framework developed by Google.
You can use the same APIs to build user interfaces for both Android and iOS. You can use the same APIs to build user interfaces for both Android and iOS.
Since Compose is built on top of [Kotlin Multiplatform](https://kotlinlang.org/lp/multiplatform/), Since Compose is built on top of [Kotlin Multiplatform](https://jb.gg/kmp),
you can easily access native APIs, such as the [Camera API](https://developer.apple.com/documentation/avfoundation/capture_setup/avcam_building_a_camera_app), you can easily access native APIs, such as the [Camera API](https://developer.apple.com/documentation/avfoundation/capture_setup/avcam_building_a_camera_app),
and embed complex native UI views, such as [MKMapView](https://developer.apple.com/documentation/mapkit/mkmapview). and embed complex native UI views, such as [MKMapView](https://developer.apple.com/documentation/mapkit/mkmapview).
**[Get started with Compose for iOS](https://github.com/JetBrains/compose-multiplatform-ios-android-template#readme)** **[Get started with Compose Multiplatform](https://jb.gg/start-cmp)**
## Android ## Android
When Android is one of your targets, you can get the same experience for Android as if you were developing an Android app When Android is one of your targets, you can get the same experience for Android as if you were developing an Android app
using [Jetpack Compose](https://developer.android.com/jetpack/compose). using [Jetpack Compose](https://developer.android.com/jetpack/compose).
**[Get started with Compose Multiplatform](https://jb.gg/start-cmp)**
## Desktop ## Desktop
Compose Multiplatform targets the JVM and supports high-performance hardware-accelerated UI rendering on all major desktop Compose Multiplatform targets the JVM and supports high-performance hardware-accelerated UI rendering on all major desktop
@ -47,7 +49,9 @@ platforms – macOS, Windows, and Linux.
It has desktop extensions for menus, keyboard shortcuts, window manipulation, and notification management. It has desktop extensions for menus, keyboard shortcuts, window manipulation, and notification management.
**[Get started with Compose for Desktop](https://github.com/JetBrains/compose-multiplatform-desktop-template#readme)** **[Get started with Compose Multiplatform](https://jb.gg/start-cmp)**
> We would appreciate your feedback on Compose Multiplatform in the public Slack channel [#compose](https://kotlinlang.slack.com/archives/CJLTWPH7S/p1678882768039969).
## Web ## Web
@ -61,14 +65,6 @@ all the benefits that WebAssembly has to offer, such as good and predictable per
**[Get started with Compose for Web](https://kotl.in/wasm-compose-example)** **[Get started with Compose for Web](https://kotl.in/wasm-compose-example)**
## All platforms at once
If you want to share UIs across all supported platforms at once, you can start with [this template](https://github.com/JetBrains/compose-multiplatform-template#readme).
> Note that this template currently doesn’t support the web. It will be added later.
>
> We would appreciate your feedback on Compose Multiplatform in the public Slack channel [#compose](https://kotlinlang.slack.com/archives/CJLTWPH7S/p1678882768039969).
## Libraries ## Libraries
### Compose HTML ### Compose HTML
@ -80,11 +76,12 @@ for creating web user interfaces with HTML and CSS.
## Learn more ## Learn more
* [FAQ](docs/FAQ.md) * [FAQ](https://jb.gg/cmp-faq)
* [Samples](examples/README.md) * [Samples](https://jb.gg/cmp-samples)
* [Tutorials](tutorials/README.md) * [Tutorials](tutorials/README.md)
* [Compatibility and versioning](https://jb.gg/cmp-versioning)
* [Changelog](CHANGELOG.md) * [Changelog](CHANGELOG.md)
* [Compatibility and versioning](VERSIONING.md)

124
VERSIONING.md

@ -1,123 +1,3 @@
## Compatibility and versioning overview This document has been moved to [https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html).
### Supported platforms To edit the document, open [https://github.com/JetBrains/kotlin-multiplatform-dev-docs/blob/master/topics/compose/compose-compatibility-and-versioning.md](https://github.com/JetBrains/kotlin-multiplatform-dev-docs/blob/master/topics/compose/compose-compatibility-and-versioning.md).
* Android
* iOS
* macOS (x86-64, arm64)
* Windows (x86-64)
* Linux (x86-64, arm64)
* Web browsers
### Limitations
Following limitations apply to 1.0 release.
* Only 64-bit x86 Windows is supported
* Only JDK 11 or later is supported due to the memory management scheme used in Skia bindings
* Only JDK 17 or later is supported for packaging native distributions due to jpackage limitations
Knowing issues on older versions:
- OpenJDK 11.0.12 has [an issue](https://github.com/JetBrains/compose-jb/issues/940), when we switch keyboard layout on MacOs (isn't reproducible in OpenJDK 11.0.15)
[comment]: <> (__SUPPORTED_GRADLE_VERSIONS__)
### Kotlin compatibility
A new version of Kotlin may be not supported immediately after its release. But after some time we will release a version of Compose Multiplatform
that supports it.
Starting from 1.2.0, Compose Multiplatform supports multiple versions of Kotlin.
Kotlin version | Minimal Compose version | Notes
--- | --- | ---
1.5.31 | 1.0.0
1.6.20 | 1.1.1
1.7.10 | 1.2.0
1.7.20 | 1.2.0 | JS is not supported (fixed in the 1.2.1)
1.7.20 | 1.2.1
1.8.0 | 1.3.0 | 1.3.0 is not supported by earlier k/native versions
1.8.10 | 1.3.1
1.8.20 | 1.4.0
1.8.21 | 1.4.3
1.8.22 | 1.4.3
1.9.0 | 1.4.3
1.9.10 | 1.5.1
1.9.20 | 1.5.10
### Using the latest Kotlin version
When a new version of Kotlin is released, the corresponding Compose Multiplatform release may not yet have been published. There are still ways to use it, although stability is not guarantied. Even if it compiles fine, there can be hidden runtime errors, so it is not recommended to use them for production builds.
#### Using Jetpack Compose Compiler
> **Note**
> The Jetpack Compose Compiler Plugin `androidx.compose.compiler:compiler` is guaranteed to function properly for **Kotlin/JVM** targets, including both the desktop and Android platforms. However, its reliability may not extend to **Kotlin/JS** and **Kotlin/Native** targets. For these scenarios, we recommend using the Compose Multiplatform Compiler Plugin `org.jetbrains.compose.compiler:compiler` to ensure compatibility. See [Using the Compose Multiplatform compiler](#using-the-compose-multiplatform-compiler).
The compilation process of composable functions is handled by the Compose compiler plugin. Each release of the compiler plugin is strictly bound to a single version of the Kotlin compiler. Normally, the Gradle plugin chooses an appropriate version of the compiler plugin automatically. But there is a way to choose another version of Compose Compiler. For example, you can use Jetpack Compose Compiler published by Google.
First, check [this page](https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility) to find a compatible version. If there is one, use it this way:
```
compose {
kotlinCompilerPlugin.set("androidx.compose.compiler:compiler:1.4.2")
}
```
(`1.4.2` corresponds Kotlin 1.8.10)
#### Disabling Kotlin compatibility check
If there is no compatible version of Jetpack Compose Compiler (or you encountered errors), you can try to use Compose Compiler for another version of Kotlin, but disable the Kotlin version check. It can work, if you upgrade to a hotfix version of Kotlin, and most probably won't work if you upgrade to a major version of Kotlin.
```
compose {
kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.7.20"))
kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.7.21")
}
```
Here we set a fixed version of Compose Compiler and configure it by specifying additional arguments. The argument `suppressKotlinVersionCompatibilityCheck` disables the internal Kotlin check that happens inside the compiler. In this argument you should specify the version of Kotlin that is applied to your project. It is required to avoid situations when you upgraded Kotlin and forgot to update Compose Compiler.
#### Using the Compose Multiplatform Compiler
Typically, `-dev` versions of Compose Multiplatform (such as 1.5.0-dev1084) contain actual version mappings from Kotlin to the Compose Compiler. This includes Beta and RC (Release Candidate) builds of Kotlin.
If you're looking to test a Beta or RC version of Kotlin that isn't directly supported by the stable release of Compose Multiplatform, there are two potential solutions:
1) Consider using the most recent `-dev` build of Compose Multiplatform. See the [releases page](https://github.com/JetBrains/compose-multiplatform/releases).
2) Manually specify the `kotlinCompilerPlugin` version. You can find the suitable version by consulting the following file: [ComposeCompilerCompatibility](https://github.com/JetBrains/compose-multiplatform/blob/master/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerCompatibility.kt#L7).
For instance, if you wish to use Kotlin 1.9.0-RC, you can do so in the following way:
```kotlin
compose {
kotlinCompilerPlugin.set("1.4.8-beta")
}
```
**Note:** Unstable versions of Compose Multiplatform compiler plugin (like `1.4.8-beta)` are not available in mavenCentral. Please add `maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")` to the list of repositories in order to use such versions.
### Relationship between the Jetpack Compose and Compose Multiplatform release cycles
Compose Multiplatform shares a lot of code with [Jetpack Compose](https://developer.android.com/jetpack/compose) for Android, a framework developed by Google.
We keep our release cycles aligned, making sure that the common part is properly tested and stabilized.
When a new version of Jetpack Compose is released, we pick the release commit, use it as a base for the next [Compose Multiplatform](https://github.com/JetBrains/androidx) version, finish new platform features, stabilize all platforms, and release Compose Multiplatform.
The gap between a Compose Multiplatform release and a Jetpack Compose release is usually 1 to 3 months.
When you build your application for Android, the artifacts published by Google are used. For example, if you apply the Compose Multiplatform 1.5.0 Gradle plugin and add `implementation(compose.material3)` to your `dependencies`, then your project will use the `androidx.compose.material3:material3:1.1.1` artifact in the Android target (but `org.jetbrains.compose.material3:material3:1.5.0` in the other targets). See the table below to know exactly which version of the Jetpack Compose artifact is used.
Compose Multiplatform version | Jetpack Compose version | Jetpack Compose Material3 version
--- | --- | ---
[1.5.10](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.5.10)|1.5.4|1.1.2
[1.5.1](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.5.1)|1.5.0|1.1.1
[1.5.0](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.5.0)|1.5.0|1.1.1
[1.4.3](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.4.3)|1.4.3|1.0.1
[1.4.1](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.4.1)|1.4.3|1.0.1
[1.4.0](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.4.0)|1.4.0|1.0.1
[1.3.1](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.3.1)|1.3.3|1.0.1
[1.3.0](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.3.0)|1.3.3|1.0.1
[1.2.1](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.2.1)|1.2.1|1.0.0-alpha14
[1.2.0](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.2.0)|1.2.1|1.0.0-alpha14
[1.1.1](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.1.1)|1.1.0|1.0.0-alpha05
[1.1.0](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.1.0)|1.1.0|1.0.0-alpha05
[1.0.1](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.0.1)|1.1.0-beta02|1.0.0-alpha03
[1.0.0](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.0.0)|1.1.0-beta02|1.0.0-alpha03

115
docs/FAQ.md

@ -1,114 +1,3 @@
# Compose Multiplatform FAQ This document has been moved to [https://www.jetbrains.com/help/kotlin-multiplatform-dev/faq.html](https://www.jetbrains.com/help/kotlin-multiplatform-dev/faq.html).
## What is Compose Multiplatform? To edit the document, open [https://github.com/JetBrains/kotlin-multiplatform-dev-docs/blob/master/topics/overview/faq.md](https://github.com/JetBrains/kotlin-multiplatform-dev-docs/blob/master/topics/overview/faq.md).
Compose Multiplatform is a modern declarative and reactive UI framework that provides a simple way to build user
interfaces with a small amount of Kotlin code. It also allows you to write your UI once and run it on any of the supported
platforms – iOS, Android, desktop (Windows, macOS, Linux), and web.
## How does it relate to Jetpack Compose for Android?
Compose Multiplatform shares most of its API with [Jetpack Compose](https://developer.android.com/jetpack/compose), the Android UI framework developed by Google.
In fact, when you are using Compose Multiplatform to target Android, your app simply runs on Jetpack Compose.
Other platforms targeted by Compose Multiplatform may have implementations under the hood that differ from those of
Jetpack Compose on Android, but they still provide you with the same APIs.
## Between which platforms can I share my UI?
We want you to have the option to share your UI between any combination of popular platforms – Android, iOS, desktop
(Linux, macOS, Windows), and web. Note, however, that only Compose for Android and Desktop are Stable at the moment.
## Can I use Compose Multiplatform in production?
The Android and Desktop targets of Compose Multiplatform are Stable. You can use them in production.
The iOS target is in Alpha, and we don’t recommend using it in production. Nevertheless, you are welcome to experiment
with it at your own risk to see what benefits you get and how your application will look in the future.
The version of Compose for Web that is based on WebAssembly, and that has the same UI as Compose for iOS, Android, and
Desktop, is Experimental. You can try it in your pet projects.
## When will Compose Multiplatform become Stable? What are the current stability guarantees?
Compose Multiplatform is Stable for Android and Desktop, while the iOS and Web targets are not Stable yet. The iOS target
is in Alpha, and Web is Experimental.
Stable means that the framework provides a comprehensive API surface that allows you to write beautiful, production-ready
applications, without encountering performance or correctness issues in the framework itself. API-breaking changes can
only be made 2 versions after an official deprecation announcement.
Alpha means that we have decided to productize the idea but it hasn't reached the final shape yet. You can use it at your
own risk and expect migration issues.
Experimental means the framework is under development. It lacks some features and might have performance issues and bugs.
Some aspects might change in the future, and breaking changes can occur often.
The framework is built using [Kotlin Multiplatform](https://kotlinlang.org/lp/multiplatform/), which is not itself Stable yet.
Because of that, you may encounter issues during builds.
## What IDE should I use for building apps with Compose Multiplatform?
We recommend using [IntelliJ IDEA](https://www.jetbrains.com/idea/) for desktop-only, web-only, and combined desktop-web
Multiplatform applications. If you target Android or Android and iOS, we recommend using [Android Studio](https://developer.android.com/studio).
## Where can I find documentation and tutorials?
You can find the Getting Started tutorials on the [main project page](https://github.com/JetBrains/compose-multiplatform#readme)
and more tutorials on [this page](../tutorials/README.md).
## Can I play with a demo application? Where can I find it?
Sure, we have [multiple examples for all platforms](../examples/README.md).
## Does Compose Multiplatform come with widgets?
Yes, Compose Multiplatform provides the full support for [Material 3](https://m3.material.io/) widgets.
## To what extent can I customize the appearance of Material widgets?
You can use Material’s theming capabilities to customize colors, fonts, and paddings. If you want to create a unique
design, you can create completely custom widgets and layouts.
## How does Compose Multiplatform work with Kotlin Multiplatform?
[Kotlin Multiplatform technology](https://kotlinlang.org/lp/multiplatform/) simplifies the development of cross-platform projects.
It reduces time spent writing and maintaining the same code for different platforms while retaining the flexibility and
benefits of native programming.
For business logic, Kotlin Multiplatform is already a well-established and effective approach. Compose Multiplatform
completes the puzzle when you don’t want to build and maintain separate native UIs for your target platforms. Maybe you
don’t have enough people, or perhaps you don’t have enough time. Maybe you just really want to get your app out the door
and into the hands of as many people as quickly as possible.
Compose Multiplatform gives you the option to push the sharing capabilities of Kotlin Multiplatform beyond business logic. It allows you to implement your user interface once and then use it for all the platforms you target.
## Can I share the UI in my existing Kotlin Multiplatform app?
If your application uses a native API for its UI (which is the most popular case), you can indeed gradually rewrite some
parts to Compose Multiplatform, as it provides interoperability for that. You can remove some parts from native UIs and
replace them with a special interop view that wraps a common UI written with Compose.
## I have an existing Android application that uses Jetpack Compose. What should I do to run it on other platforms?
First, you must separate common code from platform-specific logic, such as interactions with Android APIs or uses of
Android-only dependencies. Next, you need to implement this logic on the new platform, either by using a multiplatform
library or writing platform-specific code.
## Can I integrate Compose screens into an existing iOS app?
Yes. Compose Multiplatform supports different integration scenarios.
## Can I integrate UIKit or SwiftUI components into a Compose screen?
Yes, you can.
## What happens when my mobile OS updates and introduces new platform capabilities?
You can use them in platform-specific parts of your codebase as soon as they’re introduced. All new Android capabilities
provide Kotlin or Java APIs, and wrappers over iOS APIs are generated automatically.
## What happens when my mobile OS updates and changes the visual style of the system components or their behavior?
Your UI will stay the same after OS updates because all the components are drawn on a canvas. If you embed native iOS
components into your screen, updates may affect their appearance.

7
tutorials/README.md

@ -1,10 +1,9 @@
# Tutorials # Tutorials
## iOS + Android ## iOS + Android + Desktop
* [Getting started](https://github.com/JetBrains/compose-multiplatform-ios-android-template) * [Getting started](https://jb.gg/start-cmp)
## Desktop ## Desktop
* [Getting started](https://github.com/JetBrains/compose-multiplatform-desktop-template)
* [Image and icon manipulations](Image_And_Icons_Manipulations) * [Image and icon manipulations](Image_And_Icons_Manipulations)
* [Mouse events and hover](Mouse_Events) * [Mouse events and hover](Mouse_Events)
* [Scrolling and scrollbars](Desktop_Components#scrollbars) * [Scrolling and scrollbars](Desktop_Components#scrollbars)
@ -20,7 +19,7 @@
* [Building a native distribution](Native_distributions_and_local_execution) * [Building a native distribution](Native_distributions_and_local_execution)
* [UI testing](UI_Testing) * [UI testing](UI_Testing)
## Web ## Web (based on Wasm)
* [Getting started](https://kotl.in/wasm-compose-example) * [Getting started](https://kotl.in/wasm-compose-example)
## General ## General

Loading…
Cancel
Save