<@U33H6SB2B> every time I come back to try KotlinJ...
# javascript
e
@turansky every time I come back to try KotlinJS I find this https://youtrack.jetbrains.com/issue/KT-37710/KJS-JsExport.-Global-root-namespace-support issue as a blocker. Are you aware of any sort of workaround? Maybe with a compiler plugin the package name could be modified to whatever namespace name is needed?
t
With compiler plugin you can build any export structure, which you want. Single requirement - root export support (probably it’s already supported for ES module kind).
e
@turansky yup, ES6 is already built like that on the root. It's funny because it seems from one side we want namespace, from the other we don't want the namespace generated as Kotlin does. My question is, what's blocking the JS team to implement a
JsName
-like annotation for the namespace?
With compiler plugin
Would the compiler plugin target the new IR? If yes, I guess there is still no guidelines, right?
t
Would the compiler plugin target the new IR?
Yes, only with IR it’s possible 🙂
My question is, what’s blocking the JS team to implement a
JsName
-like annotation for the namespace?
Namespaces strictly not recommended by Google best practices Separate JS file is already “namespace” NPM package is already “namespace” Modern NPM libraries remove namespaces when migrate on ES classes to unlock bundle optimization. In such situation 3rd level namespace doesn’t look like priority issue 😐
e
Thanks! Sounds "reasonable". Although it's been three years 😐 Do you have any resource for IR compiler plugin development? If I can somehow do it I'll try, I just don't want to lose two weeks
Also because it's difficult to justify it
t
Before ES modules, when libraries mount point was
window
, “package as namespace” was fine
But now it does’t work at start
And Kotlin/JS team as I see actively remove non-effective practices from JS output
👀 1
e
@turansky in your opinion at the current state does it make sense to pursue a multiplatform project targeting Node and JVM? The problem is I don't want to find myself in the middle of the project with a blocking issue that won't be fixed in a reasonable amount of time.
t
Depends on your needs
e
@turansky it would be strictly a TCP protocol layer. Pure socket communication with an higher level of abstraction, standard service pattern