Comments (2)
I've managed to add the js target with these dependencies:
[...]
js()
[...]
sourceSets["jsMain"].dependencies {
implementation(Deps.Ktor.js) //"io.ktor:ktor-client-js:${Versions.ktor}"
implementation(Deps.Ktor.jsCore) //"io.ktor:ktor-client-core-js:${Versions.ktor}"
implementation(Deps.Ktor.jsJson) //"io.ktor:ktor-client-json-js:${Versions.ktor}"
implementation(Deps.Ktor.jsLogging) //"io.ktor:ktor-client-logging-js:${Versions.ktor}"
implementation(Deps.Ktor.jsSerialization) //"io.ktor:ktor-client-serialization-js:${Versions.ktor}"
implementation(Deps.Coroutines.js) //"org.jetbrains.kotlinx:kotlinx-coroutines-core-js:${Versions.coroutines}"
implementation(Deps.koinCoreJS) //"org.koin:koin-core-js:${Versions.koin}"
}
There's not a version of sqldelight for js, so I worked around it:,
//stubbing sql driver since it's not yet present in js
val sqlDriver = object : SqlDriver {
override fun close() {
}
override fun currentTransaction(): Transacter.Transaction? = null
override fun execute(
identifier: Int?,
sql: String,
parameters: Int,
binders: (SqlPreparedStatement.() -> Unit)?
) {}
override fun executeQuery(
identifier: Int?,
sql: String,
parameters: Int,
binders: (SqlPreparedStatement.() -> Unit)?
): SqlCursor = object : SqlCursor {
override fun close() {}
override fun getBytes(index: Int): ByteArray? = null
override fun getDouble(index: Int): Double? = null
override fun getLong(index: Int): Long? = null
override fun getString(index: Int): String? = null
override fun next(): Boolean = false
}
override fun newTransaction(): Transacter.Transaction = object : Transacter.Transaction() {
override val enclosingTransaction: Transacter.Transaction?
get() = null
override fun endTransaction(successful: Boolean) {
}
}
}
I've already modified the whole template because I want to use redux-kotlin as the architecture, but I could make a pull request where I add js + tests to this template with a react companion project if you are interested, let me know!
Meanwhile I'll test everything in my project
from kampkit.
Hi, Thanks for checking out KaMPKit. As you found, we want to keep it focused on Mobile development and intentionally don't include other targets. Heads up, SQLDelight does have an in memory js driver cashapp/sqldelight#1486 .
But it's not currently published so you need to build it:
cashapp/sqldelight#1667
from kampkit.
Related Issues (20)
- JS/React model HOT 1
- KaMPKit - 1.8 Beta testing HOT 4
- Adding C++/C header example HOT 3
- Test SQLDelight 2 alpha HOT 1
- single and canceled scope HOT 1
- KaMPKit - 1.8 Release Testing HOT 1
- Demonstrate new android sourceSet layout
- `./gradlew build` fails on `BreedViewModelTest` HOT 3
- Try debugging with KaMP Kit and Kotlin 1.8
- iOS tests are failing HOT 1
- AndroidSqliteDriver is never used HOT 1
- Enabling configuration cache in gradle properties breaks xcode build HOT 3
- help help help! #16 HOT 4
- Update dependency versions
- ios app not behaving as expected when BreedListScreen isn't the rootView HOT 1
- Can't build iOS - minimum deployment target is too low / APIs used require a too high minimum deployment target HOT 1
- Can't build iOS from XCode - Framework not found Pods_KaMPKitiOS HOT 1
- Add a sample for Compose Multiplatform HOT 1
- Feature Request: Add Build Config and Build Flavor like capability in KMM HOT 1
- Release build fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kampkit.