When do we need the *.meta.js files?


#1

It says in the docs: “In addition, each of these also have a corresponding {file}.meta.js meta file which will be used for reflection and other functionality.”

Q1: does this mean we only need to include these files if we are using reflection?
Q2: what is the “other functionality”?


#2

I think it’s a mistake in then documentation. JS backend for Kotlin does not support reflection at all. What this .meta.js file is needed for is to provide metadata to compiler. When you distribute Kotlin library, you get JS file which is insufficient for compiler to understand which actual classes and function are there in the library. .meta.js together with set of .kjsm files should also be ditributed to provide all this information to compiler.