sqldelight
sqldelight copied to clipboard
Support wasmJs target
What's impossible for now:
- Commonization of
WebWorkerDrivercan't be done without support for Kotlin arrays interop withwasmJs: https://youtrack.jetbrains.com/issue/KT-57125/Add-interop-with-JavaScript-arrays-to-Kotlin-Wasm
Changes:
- Enable
wasmJstarget inMultiplatformConventionsand:driver-test. - Migrate to use kotlin multiplatform default hierarchy template.
- Add
jsCommonsource set containing common code forjsandwasmJstargets. - Added
jsNativeCommonsource set to:runtimemodule containing common code fornative,js, andwasmJstargets. - Enable
watchosDeviceArm64andlinuxArm64because of failing tests. - Support
WebWorkerDriverforwasmJstarget. Fix all tests to be passing.
Is the conversion to .gradle.kts required to enable the wasmJs target? If not, it would be best to leave that conversion for a different PR since this one has a lot of files that are just moved and it's more difficult to review the actual changes here.
Sure, I will revert this change
@dellisd Hi! I've rebased on the latest master. Here are changes since your comment:
- Reverted the migration to
.gradle.kts. - Made
web-worker-drivertests forjsandwasmJscommon. - Made
createWebWorkerDriverhelper function which allows creating the defaultWebWorkerDriverin thejsCommonsourceSet. - Upgraded Kotlin to
2.0.0-Beta3and KSP to2.0.0-Beta3-1.0.17
@dellisd Hi! I've rebased on latest master. Here're changes since my previous comment:
- Upgraded Kotlin to
2.0.0-Beta4and KSP to2.0.0-Beta4-1.0.17 - Upgraded
kotlinx.coroutinesto1.8.0withwasmJssupport - Temporarily added Sonatype repository containing Turbine
1.1.0-SNAPSHOT
I'm not sure why, but instrumentation tests are failing on CI. They're passing locally on my M1 Max. https://github.com/IlyaGulya/sqldelight/actions/runs/7957378205/job/21719986393
Turbine 1.1.0 with wasmJs support is out
Replaced Turbine snapshot with 1.1.0
Currently trying to fix tests 🙂
@dellisd Hi! All tests are passing. I was able to rollback the kotlin 2.0 upgrade, so I think it can be merged after the code review 🙂 Please take a look when you will have time.
Do you need Kotlin 2.0 for this change too? I bumped it in this PR #5217, but I will break my PR into smaller ones.
Do you need Kotlin 2.0 for this change too? I bumped it in this PR #5217, but I will break my PR into smaller ones.
Not really. But I will be happy to rebase on 2.0 once it's merged 🙂
Any updates on this?
Any update on the same.
Any update on this please?
I am also interested in wasm support, it would be very nice to have it ready.
can we get an alpha (early access) version with this change to try it out ? 🙏
I was developing a multiplatform library and needed to implement a database. After adding SQLDelight, I realized that the plugin causes errors in the wasmjs module, essentially forcing me to remove this module because there's no way to ignore the error and use SQLDelight on other platforms while handling storage differently in wasm. Currently, libraries like Koin, Ktor, ViewModel, and Lifecycle support wasm, and the lack of SQLDelight support is noticeable.