JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.34k stars 1.12k forks source link

Use compose resources without skiko on Js and Wasm targets #4495

Open rjaros opened 3 months ago

rjaros commented 3 months ago

Currently the resources library depends on compose-foundation which depends on compose-ui and skiko. This makes a problem with bundle size, when using it with compose-based frameworks other then compose-web, which don't draw on canvas and don't use skiko (e.g. compose-html, kilua).

Could you consider extracting some core functionality, like files and strings, which could be really useful for all compose apps, even those not using any graphics? E.g. creating a "core resources lib" without dependencies on foundations, ui and skiko.

Burtan commented 3 months ago

This core functionality is in fact useful for all kotlin-multiplatform apps.

pjBooms commented 3 months ago

Yes, initially we thought to provide the core functionality on KMP level. However it would take more time to appear in KMP and in fact resources are crucial for Compose so as a first step we introduced them in Compose Multiplatform only. Though I believe the core functionality will appear in KMP as well some day. You may vote for the respective issue here: https://youtrack.jetbrains.com/issue/KT-49981/Multiplatform-API-to-access-library-and-application-resources

ellet0 commented 3 months ago

Consider creating the same issue on YouTrack JetBrains