Hey! We noticed a pretty severe issue with Kotlin ...
# javascript
a
Hey! We noticed a pretty severe issue with Kotlin 2.0.0 caused by this fix 👉 https://youtrack.jetbrains.com/issue/KT-45604 As per Mathieu Côté’s comment, Kotlin now requires to run a polyfill for
globalThis
for Chrome <70, which is a pretty big undocumented breaking change, especially for use cases where KMP is used for library development. Wanted to know if reverting this change or finding another solution is something that could be considered? We’d just need confirmation of what’s intended to do based on this issue.
e
Have you tried fiddling with Webpack's configuration?
I've looked at the YT issue again, and at the follow up issue too. Could you check if this solves your problem?
Copy code
browser {
  webpackTask {
    output.globalObject = "this"
  }
}
Although, if you're building a library, and not an executable, I'm not sure the Webpack configuration will have the same effect.
a
Yeah.. doesn’t seem like this changes anything for us, sadly. We did just try it.
e
Looks like
globalThis
is hardcoded, maybe a new compiler option? So that it's hidden enough, but people that needs compatibility with older browsers can still get it.
a
Yeah, that could be a great option.
a
Could you please create an ticket for the problem? I will try to fix it soon
Well.. you were faster than me 😂
a
Also Chrome < 70 is from 2018, today it would be around 0.25% of usage which is very low As a FullStack web developer I don't see why you would support this old browsers, what is your purpose of this ?
a
100% agree with that as a Web developer. In our case, though, we also support HTML TVs. We make a library with KMP that is used on TV devices (webOS, Tizen, Xbox, PS4, PS5…) which often run very old versions of Chrome or Edge.
So.. that’s actually a pretty huge user base.
a
Ah I see, that's a pretty good reason yes !
e
@alarochelle in the smart TV market what's the status for WebAssembly? Like, will they start supporting it or it's something no one talks about?
a
I think some providers are looking into it/already support it (like Samsung or Microsoft), but honestly I haven’t heard much about it lately.
thank you color 2
m
In case somebody stumble upon this thread, we found a temporary solution (proposed by @Artem Kobzar, mvp) that works wonder, please refer to the original ticket here: https://youtrack.jetbrains.com/issue/KT-69023
K 1