You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The kotlin-browser module from kotlin-wrappers provides some "browser APIs missing from the standard library", including ResizeObserver. I noticed that this library has its own, added probably because the ones in kotlin-wrappers were not widely known. And as I read in their docs they seem also to use karakum to generate some Kotlin declarations directly from TypeScript, which saves some manual effort. So I have a maybe immature suggestion to leverage the APIs available in kotlin-wrappers and port the APIs available here but missing there if there are any. In this way, code duplication can be reduced, there is a single source of truth for the APIs, and the APIs become easily maintainable and more widely usable.
The text was updated successfully, but these errors were encountered:
ShreckYe
changed the title
A suggestion to leverage ResizeObserver and possibly other APIs from kotiln-wrappers
A suggestion to use ResizeObserver and possibly other APIs from kotiln-wrappers
Dec 9, 2024
I'm aware of kotlin-wrappers but unfortunately it is not compatible with Compose HTML, so we are up to doing things on our own for now. It's on the Compose HTML team to fix it but it doesn't look like they intend to, sadly.
It's definitely worth investigating karakum to see if we can make our lives easier, but I found in practice adding things by hand has been the best way forward. I think in one case we even came up with a more Kotlin-idiomatic version of some observer (maybe even resize observer?) which automatic tools wouldn't have generated.
bitspittle
changed the title
A suggestion to use ResizeObserver and possibly other APIs from kotiln-wrappers
Investigate karakum to see if there's an automated way to generate more code for Kobweb's version of missing stdlib classes.
Dec 10, 2024
I'm aware of kotlin-wrappers but unfortunately it is not compatible with Compose HTML, so we are up to doing things on our own for now. It's on the Compose HTML team to fix it but it doesn't look like they intend to, sadly.
The kotlin-browser module from kotlin-wrappers provides some "browser APIs missing from the standard library", including
ResizeObserver
. I noticed that this library has its own, added probably because the ones in kotlin-wrappers were not widely known. And as I read in their docs they seem also to use karakum to generate some Kotlin declarations directly from TypeScript, which saves some manual effort. So I have a maybe immature suggestion to leverage the APIs available in kotlin-wrappers and port the APIs available here but missing there if there are any. In this way, code duplication can be reduced, there is a single source of truth for the APIs, and the APIs become easily maintainable and more widely usable.The text was updated successfully, but these errors were encountered: