Hello! What is the difference between: ```kotlinx....
# javascript
r
Hello! What is the difference between:
Copy code
kotlinx.browser.window
and
Copy code
web.window.window
Which of those "windows" should we use? I see that is not just different import, those objects provides different methods
a
I'm not sure we have
web
package in the standard library. Do you have some third-party library for adding such a package?
r
it comes from jetbrains.kotlin-wrappers:kotlin-browser-js
a
@turansky ^^
t
For all stable browser API -
web.window.window
r
so kotlinx will be deprecated?
e
If you mean kotlinx-browser, those are for the
wasmJs
target
r
Yes, I mean kotlinx.browser. It is available in js target for browser, not only in wasmJs
e
Ah now I get what you mean. Those declarations come from the kotlin-dom-api-compat library, which is included by default alongside the stdlib. What I'd do is exclude kotlin-dom-api-compat with
Copy code
kotlin.js.stdlib.dom.api.included=false
and use kotlin-browser from kotlin-wrappers, as you're already doing, it seems.
r
this line will exclude web.window or kotlinx.browser.window? kotlin.js.stdlib.dom.api.included=false
t
Also IDEA exclude we use
r
Thanks, I'll check it out
e
I've quickly tested
kotlin.js.stdlib.dom.api.included=false
as I've last used it a long time ago. Strangely enough, I can still compile with a function like
Copy code
fun dummy() {
  kotlinx.browser.window
}
But if I try to use
org.w3c.dom.XMLDocument
, which also comes from the
compat
library, it errors out.
t
It excludes
org.w3c
and
org.khronos.*
only
e
Ah, didn't know that! Why?
t
Because no issue 🙂
e
Looks like I'll have to create an issue then
🔥 1