Edoardo Luppi
07/05/2023, 1:03 PMAny?
type, but the API is not explicit anymore.
- https://youtrack.jetbrains.com/issue/KT-60140
Fix the naming ourselves, just be more careful at the moment.
- https://youtrack.jetbrains.com/issue/KT-60141
Can't do anything about it, but it's only inside IntelliJ IDEA, so we should be safe.
- No equivalent of @JvmStatic
, to avoid dealing with MyObject.getInstance().MY_CONST
in TypeScript.
We'd like <http://MyObject.MY|MyObject.MY>_CONST
or MyObject.myMethod()
.
- https://youtrack.jetbrains.com/issue/KT-53993
We want to be able to customize the outputted JS code if necessary (especially if the Kotlin team cannot release a fix in a timeframe that works for us).
Should never happen, but better safe than sorry.Edoardo Luppi
07/05/2023, 1:03 PMfranztesca
07/05/2023, 1:18 PM@JsExport
https://youtrack.jetbrains.com/issue/KT-47200/KJS-IR-Define-exports-without-JsExport
• How do you deal with the need of wrapping common suspending API is Js Promises? https://youtrack.jetbrains.com/issue/KT-56281
For me these are impacting DevEx a lotEdoardo Luppi
07/05/2023, 1:27 PMHow do you deal with collections not being exportable
Array
everywhere.
Fortunately for us, it's enough as we deal with a protocol layer, so very simple types on the API surface.
annotating a lot of the common code with theNo big deal here. I've got a lot of common code@JsExport
JsExport
-ed, and annotated with Jvm stuff.
Everything is centralized and explicit in commonMain
, so for me it is a win.
How do you deal with the need of wrapping common suspending API is Js PromisesI've build an API type that wraps both promises and futures, so in common code we deal with a single object. But yes, it's important to have automatic conversion, see KT-53993, last comment
franztesca
07/05/2023, 1:42 PMEdoardo Luppi
07/05/2023, 1:47 PMCompletableFuture
API. Maybe for other platform it's not that easy tho, perfectly understandable.
JsExport is more botheringYeah I get it. I'm a bit on the opposite side, I prefer being explicit on everything, so I know what I'm actually exporting on the code itself, and not in my build configuration, which might get overlooked.
Arrays are not really idiomaticThat's reasonable too. Well at least we have a decent list here. Hopefully some of these can be solved.
Edoardo Luppi
07/05/2023, 1:54 PMexpect class
/ actual typealias
approach to expose a List
on the JVM layer, and an Array
on the JS layer? Could be done with other types too proably.franztesca
07/06/2023, 4:44 PMexpect class MyListWrapper<T>
expect fun <T> List<T>.wrapped(): MyListWrapper<T>
public myApi(): MyListWrapper<Int> {
internalStuff().wrapped()
}
internal internalStuff(): List<Int>
or do you also use it for internal stuff?
That may work, it just doesn't make dev ex so nice. I'd love to see an official solution or compiler plugin or a library very well done. Something that doesn't feel a personal workaround (just like they did for coroutines interop for ios for example)Seth Madison
07/06/2023, 4:44 PMArtem Kobzar
07/06/2023, 7:43 PMbigint
instead of our wrappers, so, it should be better when we will implement it.
4. For the issue (https://youtrack.jetbrains.com/issue/KT-56281), we are also working on a new design for coroutines compilation, so, with the design, it would be possible to export them and use on the JS side.Artem Kobzar
07/06/2023, 7:44 PMEdoardo Luppi
07/06/2023, 7:51 PMUByteArray
to Uint8array
?