Kotlin JS - annotations processor


Is it possible to somehow run an annotations processor in Kotlin JS project?

I know Kotlin JS projects can’t rely on any Java dependencies but in theory (as long as generated code does not rely on Java) to process annotations JVM would only be needed at compile time so it should be possible in general.

Is there a way to achieve this at this moment?


How would the JavaScript target compiler know which Java classes are acceptable, and which are not? Java annotations can depend on other Java classes, and this way they (can) drag in a lot of other Java classes.

My guess is that the only way to support this, is to add a TypeScript target, so decorators can be used.


Can someone from the Jetbrains team acknowledge that it is not possible ? Is this something you are working on now or it will not be possible to process annotations from Kotlin classes when compiling to JS in the foreseeable future? I am currently working on a framework to create custom elements in Kotlin so it would be really useful to eliminate some boilerplate :slight_smile:

Thanks a lot !