https://kotlinlang.org logo
Title
d

Dragos Rachieru

04/27/2022, 2:13 PM
Hello, I want to start adding support for
js
and
ios
in my app using the dev builds, but they don't support
material3
yet. Going through the code here I have found that in the
build.gradle
these platforms are not defined. Can you add
js
and
darwin
in the next version? I saw that there's only one file to create an actual which is just something that returns some hardcoded strings and can be copied from desktop.
c

Casey Brooks

04/27/2022, 2:44 PM
I don’t think it’s as easy as just adding the targets, because Compose Material depends on skiko and all the other canvas-based UI Compose artifacts. JB is working on adding support for those targets, but it’s not there yet. What you may be interested in trying is setting up an intermediate
composeMain
sourceSet in your MPP config, which Android and Desktop extend. So you can use the Material stuff in those targets, and regular MPP stuff in the common and iOS/JS targets. Here’s an example https://github.com/copper-leaf/ballast/tree/main/examples/mpp
d

Dragos Rachieru

04/28/2022, 8:15 AM
what I mean is that it looks like all the code is in
commonMain
for `ios`/`js` and that the
material
module already has support for `ios`/`js` and
material3
is using libraries that already add support for `ios`/`js`, I know that
material3
is still in experimental, but I thought it requires very little effort to add support and add it for the next release.