Skip to content

Reduce API indirection #592

@sargunv

Description

@sargunv

Just about every API we expose in maplibre-compose goes through multiple layers of indirection to the actual implementation:

  • The KMP API, typically a pure Kotlin class or an expect/actual class
  • Calls the platform API (MapLibre Android, MapLibre iOS, maplibre-native-bindings, etc)
  • Calls the C++ native core API

Except for JS, where the KMP API calls the JS API.

Previously, the KMP API was the only one we controlled, and it's the one we used to unify the varying platform APIs. But with the native core integration for desktop, we now control one of the platform APIs, so we're now writing two layers ourselves instead of one.

Probably after #572, we should look at collapsing two of the layers into one, eliminating indirection and simplifying the API by matching the original one more closely.

The remaining complication will be in how to unify the native core and JS APIs into one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api ergonomicsImproves API usability without net-new functionalityblockedThe issue or PR is blocked by another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions