|
4 | 4 |
|
5 | 5 | A simple app drawing an input field for a timezone name and time in the timezone in the HTML document
|
6 | 6 |
|
7 |
| -## Build and run |
| 7 | +Check it out: |
| 8 | + |
| 9 | +[](https://kotlin.github.io/kotlin-wasm-browser-template/). |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Set up the environment |
| 14 | + |
| 15 | +Before starting, ensure you have the necessary IDE and browser setup to run the application. |
| 16 | + |
| 17 | +### IDE |
| 18 | + |
| 19 | +We recommend using [IntelliJ IDEA 2023.1 or later](https://www.jetbrains.com/idea/) to work with the project. |
| 20 | +It supports Kotlin/Wasm out of the box. |
| 21 | + |
| 22 | +### Browser (for Kotlin/Wasm target) |
| 23 | + |
| 24 | +To run Kotlin/Wasm applications in a browser, you need a browser supporting the [Wasm Garbage Collection (GC) feature](https://github.com/WebAssembly/gc): |
| 25 | + |
| 26 | +**Chrome and Chromium-based** |
8 | 27 |
|
9 |
| -Check out the repo, navigate to the project folder, and use the following command: |
10 |
| -``` |
11 |
| -./gradlew wasmJsBrowserRun -t |
12 |
| -``` |
| 28 | +* **For version 119 or later:** |
| 29 | + |
| 30 | + Works by default. |
| 31 | + |
| 32 | +**Firefox** |
| 33 | + |
| 34 | +* **For version 120 or later:** |
| 35 | + |
| 36 | + Works by default. |
| 37 | + |
| 38 | +**Safari/WebKit** |
| 39 | + |
| 40 | +Wasm GC support is currently under |
| 41 | +[active development](https://bugs.webkit.org/show_bug.cgi?id=247394). |
| 42 | + |
| 43 | +> **Note:** |
| 44 | +> For more information about the browser versions, see the [Troubleshooting documentation](https://kotl.in/wasm_help/). |
| 45 | +
|
| 46 | +## Build and run |
13 | 47 |
|
14 |
| -## Setup Environment |
| 48 | +To build and run the application: |
15 | 49 |
|
16 |
| -To run applications built with Kotlin/Wasm in a browser, you need a browser supporting [wasm garbage collection feature](https://github.com/WebAssembly/gc): |
| 50 | +1. In IntelliJ IDEA, open the repository. |
| 51 | +2. Run the application by typing the following Gradle command in the terminal: |
17 | 52 |
|
18 |
| -- For **Chrome** and **Chromium-based** browsers (Edge, Brave etc.), it **should just work** since version 119. |
19 |
| -- For **Firefox** 120 it **should just work**. |
20 |
| -- For **Firefox** 119: |
21 |
| - 1. Open `about:config` in the browser. |
22 |
| - 2. Enable **javascript.options.wasm_gc**. |
23 |
| - 3. Refresh the page. |
| 53 | + `./gradlew wasmJsBrowserRun -t` |
| 54 | + <br> <br> |
24 | 55 |
|
25 |
| -For more information see https://kotl.in/wasm_help/. |
| 56 | +Once the application starts, open the following URL in your browser: |
26 | 57 |
|
27 |
| -## IDE |
| 58 | +`http://localhost:8080` |
28 | 59 |
|
29 |
| -We recommend using [IntelliJ IDEA 2023.1 or newer](https://www.jetbrains.com/idea/) to work with the project. |
| 60 | +> **Note:** |
| 61 | +> The port number can vary. If the port 8080 is unavailable, you can find the corresponding port number printed in the console |
| 62 | +> after building the application. |
30 | 63 |
|
31 |
| -# Feedback & Questions |
| 64 | +## Feedback and questions |
32 | 65 |
|
33 |
| -Give it a try, and share your feedback and ask questions in the Kotlin Slack [#webassembly](https://slack-chats.kotlinlang.org/c/webassembly) channel (if you’re not a member, [apply here](https://kotl.in/slack)) or on Twitter to [@bashorov](https://twitter.com/bashorov). |
| 66 | +Give it a try and share your feedback or questions in our [#webassembly](https://slack-chats.kotlinlang.org/c/webassembly) Slack channel. |
| 67 | +[Get a Slack invite](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up). |
| 68 | +You can also share your comments with [@bashorov](https://twitter.com/bashorov) on X (Twitter). |
34 | 69 |
|
35 |
| -# Learn more |
| 70 | +## Learn more |
36 | 71 |
|
37 | 72 | * [Kotlin/Wasm](https://kotl.in/wasm/)
|
38 |
| -* [Other examples](../../../#examples) |
| 73 | +* [Other Kotlin/Wasm examples](https://github.com/Kotlin/kotlin-wasm-examples/tree/main) |
0 commit comments