KEMBAR78
Enable Web support for demo-compose-app by siarhei-luskanau · Pull Request #780 · JetBrains/koog · GitHub
Skip to content

Conversation

siarhei-luskanau
Copy link
Contributor

@siarhei-luskanau siarhei-luskanau commented Sep 10, 2025

This commit introduces WebAssembly (Wasm) and JS browser support to the demo-compose-app.

Motivation and Context

Breaking Changes


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

koin-bom = "4.1.1"
koog = "0.4.1"
kotlin = "2.2.10"
kotlin = "2.2.20"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kotlin 2.2.20 introduce common webMain source set for js/wasmJs targets.
KT-79489 Generate Stdlib API reference for webMain source set

@siarhei-luskanau siarhei-luskanau changed the title feat: Enable Web support for demo-compose-app Enable Web support for demo-compose-app Sep 10, 2025
@siarhei-luskanau siarhei-luskanau marked this pull request as ready for review September 22, 2025 12:12
@siarhei-luskanau
Copy link
Contributor Author

siarhei-luskanau commented Sep 22, 2025

@kpavlov I have updated the PR:

  • Rebased to the latest develop branch and squashed into one commit.
  • Web target has memory based storage, so you need to copy/paste api key every app launch.
  • Ktor dependencies declaration is removed because koog provides Ktor dependencies transitively.
  • Updated to the latest agp = "8.13.0" and kotlin = "2.2.20" versions.

Jvm, Android, iOS and Web (js/wasmJs) targets work as expected for me locally.

@kpavlov
Copy link
Collaborator

kpavlov commented Sep 22, 2025

Thank you @siarhei-luskanau
I wouldn't be able to look at it today, maybe someone else could take a look

Copy link
Collaborator

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but can't verify how it works now

implementation(libs.ktor.client.darwin)
}

webMain.dependencies {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need any KTor client dependency specifically for web?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Looks like default CIO Ktor engine is used for web. Actually it works without any Ktor dependency declarations for me .

Copy link
Contributor

@aozherelyeva aozherelyeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked:

  • iOS App
  • Android App
  • Desktop App
  • Web App

assembling and work. Thank you so much for the contribution!

This commit introduces WebAssembly (Wasm) and JS browser support to the demo-compose-app.
@kpavlov kpavlov merged commit a6023e5 into JetBrains:develop Sep 23, 2025
13 of 14 checks passed
@siarhei-luskanau siarhei-luskanau deleted the example-compose-web branch September 23, 2025 14:56
karloti pushed a commit to karloti/koog that referenced this pull request Sep 25, 2025
This commit introduces WebAssembly (Wasm) and JS browser support to the
demo-compose-app.

<!--
Thank you for opening a pull request!

Please add a brief description of the proposed change here.
Also, please tick the appropriate points in the checklist below.
-->

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

---

#### Type of the changes
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update
- [ ] Tests improvement
- [x] Refactoring

#### Checklist
- [x] The pull request has a description of the proposed change
- [x] I read the [Contributing
Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md)
before opening the pull request
- [x] The pull request uses **`develop`** as the base branch
- [x] Tests for the changes have been added
- [x] All new and existing tests passed

##### Additional steps for pull requests adding a new feature
- [ ] An issue describing the proposed change exists
- [ ] The pull request includes a link to the issue
- [ ] The change was discussed and approved in the issue
- [ ] Docs have been added / updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants