Skip to content

Commit

Permalink
Merge pull request JetBrains#3558 from JetBrains/add-compose-ios
Browse files Browse the repository at this point in the history
update: added info about sharing UIs and more
  • Loading branch information
danil-pavlov authored May 15, 2023
2 parents 09efb4b + f3055be commit 3501d74
Show file tree
Hide file tree
Showing 23 changed files with 175 additions and 548 deletions.
Binary file removed docs/images/get-started/js-new-project-1.png
Binary file not shown.
Binary file removed docs/images/get-started/js-new-project-2.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/images/multiplatform/kotlin-multiplatform.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/images/multiplatform/multiplatform+compose.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions docs/kr.tree
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<toc-element id="multiplatform-get-started.md" accepts-web-file-names="building-mpp-with-gradle.html,intro-to-kotlin-mpp.html,mpp-intro.html,mpp-get-started.html,multiplatform-tutorials.html"/>
<toc-element id="multiplatform-discover-project.md" accepts-web-file-names="mpp-discover-project.html"/>
<toc-element id="multiplatform-set-up-targets.md" toc-title="Set up targets manually" accepts-web-file-names="mpp-set-up-targets.html"/>
<toc-element id="multiplatform-full-stack-app.md"/>
<toc-element id="multiplatform-full-stack-app.md" hidden="true"/>
</toc-element>
<toc-element toc-title="Creating multiplatform libraries">
<toc-element id="multiplatform-library.md" accepts-web-file-names="working-with-klib.html,multiplatform-create-lib.html,mpp-create-lib.html"/>
Expand Down Expand Up @@ -244,8 +244,7 @@

<toc-element toc-title="JavaScript">

<toc-element id="js-get-started.md" accepts-web-file-names="setting-up.html,kotlin-to-javascript.html,create-library-js.html,getting-started-with-intellij-idea.html,getting-started-with-maven.html"/>
<toc-element id="js-project-setup.md" accepts-web-file-names="command-line-library-js.html,working-with-javascript.html"/>
<toc-element id="js-project-setup.md" accepts-web-file-names="command-line-library-js.html,working-with-javascript.html,setting-up.html,kotlin-to-javascript.html,create-library-js.html,getting-started-with-intellij-idea.html,getting-started-with-maven.html"/>
<toc-element id="running-kotlin-js.md"/>
<toc-element id="dev-server-continuous-compilation.md"/>
<toc-element id="js-debugging.md" accepts-web-file-names="debugging-kotlin-in-browser.html"/>
Expand All @@ -264,8 +263,7 @@
<toc-element id="js-reflection.md"/>
<toc-element id="typesafe-html-dsl.md"/>
</toc-element>
<toc-element id="js-samples.md" toc-title="Samples"/>
<toc-element id="js-react.md"/>
<toc-element id="js-react.md" hidden="true"/>
</toc-element>

<toc-element toc-title="Scripting">
Expand Down
46 changes: 29 additions & 17 deletions docs/topics/android-overview.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
[//]: # (title: Kotlin for Android)

Android mobile development has been Kotlin-first since Google I/O in 2019.
Android mobile development has been [Kotlin-first](https://developer.android.com/kotlin/first) since Google I/O in 2019.

Over 50% of professional Android developers use Kotlin as their primary language, while only 30% use Java as their
main language. 70% of developers whose primary language is Kotlin say that Kotlin makes them more productive.

Using Kotlin for Android development, you can benefit from:

* **Less code combined with greater readability**. Spend less time writing your code and working to understand the code of others.
* **Mature language and environment**. Since its creation in 2011, Kotlin has developed continuously, not only as a language
but as a whole ecosystem with robust tooling. Now it's seamlessly integrated in Android Studio and is actively used by many companies
for developing Android applications.
* **Kotlin support in Android Jetpack and other libraries**. [KTX extensions](https://developer.android.com/kotlin/ktx) add Kotlin language features,
such as coroutines, extension functions, lambdas, and named parameters, to existing Android libraries.
* **Interoperability with Java**. You can use Kotlin along with the Java programming language in your applications without needing to migrate all your code
to Kotlin.
* **Support for multiplatform development**. You can use Kotlin for developing not only Android but also [iOS](https://kotlinlang.org/lp/multiplatform/), backend, and web applications.
Enjoy the benefits of sharing the common code among the platforms.
* **Code safety**. Less code and better readability lead to fewer errors. The Kotlin compiler detects these remaining errors, making the code safe.
* **Less code combined with greater readability**. Spend less time writing your code and working to understand the code
of others.
* **Fewer common errors**. Apps built with Kotlin are 20% less likely to crash based
on [Google's internal data](https://medium.com/androiddevelopers/fewer-crashes-and-more-stability-with-kotlin-b606c6a6ac04).
* **Kotlin support in Jetpack libraries**. [Jetpack Compose](https://developer.android.com/jetpack/compose) is Android's
recommended modern toolkit for building native UI in Kotlin.
[KTX extensions](https://developer.android.com/kotlin/ktx) add Kotlin language features, like coroutines,
extension functions, lambdas, and named parameters to existing Android libraries.
* **Support for multiplatform development**. Kotlin Multiplatform allows development for not only Android but
also [iOS](https://kotlinlang.org/lp/multiplatform/), backend, and web applications.
[Some Jetpack libraries](https://developer.android.com/kotlin/multiplatform) are already multiplatform.
[Compose Multiplatform](https://www.jetbrains.com/lp/compose-multiplatform/), JetBrains' declarative UI framework
based on Kotlin and Jetpack Compose, makes it possible to share UIs across platforms – iOS, Android, desktop, and web.
* **Mature language and environment**. Since its creation in 2011, Kotlin has developed continuously, not only as a
language but as a whole ecosystem with robust tooling. Now it's seamlessly integrated into [Android Studio](https://developer.android.com/studio)
and is actively used by many companies for developing Android applications.
* **Interoperability with Java**. You can use Kotlin along with the Java programming language in your applications
without needing to migrate all your code to Kotlin.
* **Easy learning**. Kotlin is very easy to learn, especially for Java developers.
* **Big community**. Kotlin has great support and many contributions from the community, which is growing all over the world.
According to Google, over 60% of the top 1000 apps on the Play Store use Kotlin.
* **Big community**. Kotlin has great support and many contributions from the community, which is growing all over the
world. Over 95% of the top thousand Android apps use Kotlin.

Many startups and Fortune 500 companies have already developed Android applications using Kotlin – see the list at [the Google website for Kotlin developers](https://developer.android.com/kotlin).
Many startups and Fortune 500 companies have already developed Android applications using Kotlin, see the list
on [the Google website for Android developers](https://developer.android.com/kotlin/stories).

If you want to start using Kotlin for Android development, read [Google's recommendation for getting started with Kotlin on Android](https://developer.android.com/kotlin/get-started).
To start using Kotlin for:

If you're new to Android and want to learn to create applications with Kotlin, check out [this Udacity course](https://www.udacity.com/course/developing-android-apps-with-kotlin--ud9012).
* Android development, read [Google's documentation for developing Android apps with Kotlin](https://developer.android.com/kotlin/get-started).
* Developing cross-platform mobile applications, see [Get started with Kotlin Multiplatform for Android and iOS](multiplatform-mobile-getting-started.md).
5 changes: 1 addition & 4 deletions docs/topics/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ For more information, check out [the resource on server-side development](server

### Can I use Kotlin for web development?

Yes. In addition to using for backend web, you can also use Kotlin/JS for client-side web. Kotlin can use definitions from
[DefinitelyTyped](https://definitelytyped.org) to get static typing for common JavaScript libraries, and it is compatible
with existing module systems such as AMD and CommonJS.
For more information, check out [the resource on client-side development](js-overview.md).
Yes. In addition to using for backend web, you can also use Kotlin/Wasm for client-side web. Learn how to [get started with Kotlin/Wasm](wasm-get-started.md).

### Can I use Kotlin for desktop development?

Expand Down
59 changes: 7 additions & 52 deletions docs/topics/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,49 +118,6 @@ If you've encountered any difficulties or problems, report an issue to our [issu

</tab>

<tab id="frontend" title="Frontend web app">

Kotlin provides an ability to transpile your Kotlin code, the Kotlin standard library, and any compatible dependencies to JavaScript.

Here you'll learn how to develop and improve your frontend web application using [Kotlin/JS](js-overview.md).

1. **Create your first frontend web application:**

* To start from scratch, [create a basic browser application with the IntelliJ IDEA project wizard](js-project-setup.md).
* If you prefer more robust examples, complete the [Build a web application with React and Kotlin/JS](js-react.md) tutorial. It includes a sample project that can serve as a good starting point for your own projects, and contains useful snippets and templates.
* Check out the list of [Kotlin/JS samples](js-samples.md) for more ideas on how to use Kotlin/JS.

2. **Use libraries in your application.** Learn more about [adding dependencies](js-project-setup.md#dependencies).

|Library | Details |
|--------|---------|
|[stdlib](https://kotlinlang.org/api/latest/jvm/stdlib/) | The Kotlin standard library included in all projects by default. |
|[kotlinx.browser](browser-api-dom.md)| The Kotlin library for accessing browser-specific functionality, including typical top-level objects such as document and window. |
|[kotlinx.html](typesafe-html-dsl.md) | The Kotlin library for generating DOM elements using statically-typed HTML builders.|
|[Ktor](https://ktor.io/) | The Kotlin multiplatform library for networking. |
|[KVision](https://kvision.io/) | A third-party object-oriented web framework for Kotlin/JS.|
|[fritz2](https://www.fritz2.dev/)| A third-party lightweight, high-performance, independent library for building reactive web apps in Kotlin that are heavily dependent on coroutines and flows.|
|[Doodle](https://nacular.github.io/doodle/) | A third-party vector-based UI framework that uses browser's capabilities to draw user interfaces.|
|Compose for Web, a part of [Compose Multiplatform](https://www.jetbrains.com/lp/compose-mpp/) | The JetBrains framework that brings [Google's Jetpack Compose UI toolkit](https://developer.android.com/jetpack/compose) to the browser. |
|[kotlin-wrappers](https://github.com/JetBrains/kotlin-wrappers) | Provide convenient abstractions and deep integrations for one of the most popular JavaScript frameworks. Kotlin wrappers also provide support for a number of adjacent technologies like `react-redux`, `react-router`, or `styled-components`. |

3. **Learn more about Kotlin for frontend web development:**

* The [new Kotlin/JS IR compiler](js-ir-compiler.md).
* [Using dependencies from npm](using-packages-from-npm.md).
* [Using Kotlin code from JavaScript](js-to-kotlin-interop.md).

4. **Join the Kotlin frontend web community:**

* ![Slack](slack.svg){width=25}{type="joined"} Slack: [get an invite](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up) and join the [#getting-started](https://kotlinlang.slack.com/archives/C0B8MA7FA) and [#javascript](https://kotlinlang.slack.com/archives/C0B8L3U69) channels.
* ![StackOverflow](stackoverflow.svg){width=25}{type="joined"} StackOverflow: subscribe to the ["kotlin-js" tag](https://stackoverflow.com/questions/tagged/kotlin-js).

5. **Follow Kotlin** on ![Twitter](twitter.svg){width=25}{type="joined"} [Twitter](https://twitter.com/kotlin), ![Reddit](reddit.svg){width=25}{type="joined"} [Reddit](https://www.reddit.com/r/Kotlin/), and ![YouTube](youtube.svg){width=25}{type="joined"} [Youtube](https://www.youtube.com/channel/UCP7uiEZIqci43m22KDl0sNw), and don't miss any important ecosystem updates.

If you've encountered any difficulties or problems, report an issue to our [issue tracker](https://youtrack.jetbrains.com/issues/KT).

</tab>

<tab id="android" title="Android app">

* If you want to start using Kotlin for Android development, read [Google's recommendation for getting started with Kotlin on Android](https://developer.android.com/kotlin/get-started).
Expand All @@ -180,17 +137,15 @@ Here you'll learn how to develop and publish a multiplatform library:
1. **Create a multiplatform library:**

* Complete the [Create and publish a multiplatform library](multiplatform-library.md) tutorial. It shows how to create a multiplatform library for JVM, JS, and Native platforms, test it and publish to a local Maven repository.
* Build a full stack web application using [this tutorial](multiplatform-full-stack-app.md).

2. **Use libraries in your application.** Learn more about [adding dependencies on libraries](multiplatform-add-dependencies.md).
2. **Use libraries in your application:**

|Library| Details |
|---------------------------------------------------------------------------------------------------------|-------|
| Ktor | [Docs](https://ktor.io/docs/) and [sample](multiplatform-full-stack-app.md#build-the-backend). |
| Serialization | [Docs](serialization.md) and [sample](multiplatform-full-stack-app.md). |
| Coroutines | [Docs](coroutines-overview.md). |
| DateTime | [Docs](https://github.com/Kotlin/kotlinx-datetime#readme). |

* [Ktor](https://ktor.io/docs/)
* [Serialization](serialization.md)
* [Coroutines](coroutines-overview.md)
* [DateTime](https://github.com/Kotlin/kotlinx-datetime#readme)

> Learn more about [adding dependencies on libraries](multiplatform-add-dependencies.md).
> You can also find a multiplatform library in the [community-driven list](https://libs.kmp.icerock.dev/).
>
{type="tip"}
Expand Down
Loading

0 comments on commit 3501d74

Please sign in to comment.