· 2 min read

Resource Sharing in Compose Multiplatform

JetBrains just shared a development roadmap for 2024 detailing their focus for 2024. One item stands out above the rest: a common API for resources.
Wesley Tingey on Unsplash - https://unsplash.com/photos/grayscale-photo-of-man-and-woman-leaning-on-vehicle-icnqtN3SoqA
Credit: Wesley Tingey on Unsplash - https://unsplash.com/photos/grayscale-photo-of-man-and-woman-leaning-on-vehicle-icnqtN3SoqA

JetBrains recently made a post on their Kotlin Blog announcing their roadmap for 2024. This roadmap details a bunch of different things their team is working on such as tooling, Multiplatform core, and the library ecosystem. The one item that stands out though is their continued support for Compose Multiplatform, including one feature that a lot of developers have been looking forward to:

Implement a common API for sharing all types of resources.

Yes it looks like we’ll be able to share resources between our targets! JetBrains hasn’t detailed which resources will be sharable, but ideally we can hope to see resources such as colors, images, fonts, and localizable strings.

Why is this important?

Some might feel that it’s strange or unnecessary to add support for sharing resources, as in the past Kotlin Multiplatform was used for sharing business logic. Why not just have the resources in the platform with the UI? Well as Compose Multiplatform is becoming more mature sharing resources in common code makes more sense.

Others may say that it’s already possible to share resources with certain libraries or using wrappers for resource files. While this is true those methods can be flaky and can add a lot of headache around making sure all the platforms work correctly. This is why official API support is very exciting.

There is no official timeline with this roadmap, and focus may change in the future, but still it’s exciting to hear that JetBrains is working on this feature that many teams and developers have been waiting for.