Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate karakum to see if there's an automated way to generate more code for Kobweb's version of missing stdlib classes. #625

Open
ShreckYe opened this issue Dec 9, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ShreckYe
Copy link
Contributor

ShreckYe commented Dec 9, 2024

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.

@ShreckYe ShreckYe added the enhancement New feature or request label Dec 9, 2024
@ShreckYe 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
@bitspittle
Copy link
Collaborator

bitspittle commented Dec 10, 2024

Thanks for the report!

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 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
@ShreckYe
Copy link
Contributor Author

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.

I did not know this. Thanks for explaining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants