is there a way to setup a compose library (even wi...
# compose-web
a
is there a way to setup a compose library (even with `expect`/`actual`) so that I can have different implementation for Compose4Web (Dom) and Compose4Web (Canvas) ?
j
Define two JS targets in yoru build and that should work as expected
a
and how would I consume the lib??
j
Like from JS or from other Kotlin Gradle projects?
b
Hmm, looks like a job for gradle metadata nd build flavours. However this would also involve a mini plugin to consume the metadata on the consumer's end.
Unless gradle metadata already supports matching by other dependencies
a
if I am going to have two js targets, how would gradle resolve which target to use in a kotlin js project using compose 4 web (dom) and another that uses compose 4 web (canvas)? Do I use gradle attributes??
h
Keep in mind creating another intermediate JS source set does not work https://youtrack.jetbrains.com/issue/KT-44332/HMPP-Support-code-sharing-between-two-JS-targets
b
That could be worked around with an intermediate module as a dependency
h
gradle module are oft a good workaround or better, but expect/actual with a common js actual and another targets would not work.
a
well, I guess then that currently I can't implement such a common library for compose canvas and compose web