Reflection methods available in Kotlin JS

Based on the documentation, the function getDelegate should be available in javascript.

When I use it in Intellij i get the error " Unsupported [This reflection API is not supported yet in JavaScript]".

Does anybody know if the documentation is wrong or if Intellij is wrong?

Hi there, IntelliJ is right, it’s the Kotlin documentation that is messed up (but only for reflection for some reason).

There are tickets open to fix the doc, but there is no deadline for it yet

Well that’s disappointing. I made a whole document rendering library in jvm that is dependent on passing around kproperty0 objects with delegates attached to them. Was hoping to multiplatform for DOM rendering.

Do you know if there Is an effort to implement more of the reflect library for js out there? I’d throw my hat into the ring if I could find a place to start.

I know they want to, but they never gave any deadline, Kotlin/Native have more or less the same limitations.
My bet is that they want to finish their compiler backend refactor which aim to unify the compiler across all platforms using to implement proper reflection on JS and Native but it’s just a guess

The issue related to the bug in the reference – KT-32186

Do you know if there Is an effort to implement more of the reflect library for js out there?

We still going to implement full reflection for Kotlin/JS (KT-13775). We want to make it DCE friendly, so probably we’ll add some restrictions like “you have to explicitly configure what should be available by reflection”. But more likely at first firstly we’ll implement some light reflection on top of JS capabilities (KT-13776).
Unfortunately there is NO any ETA yet for both issues.

Feel free to vote or star all mentioned issues to get updates.