Nacho Ruiz Martin
12/27/2023, 1:08 PM@JsExport
. There must be a reason, right?
When I say everything I mean everything used. Just as it is exported to JS but with name mangling.
Thanks!
C.C: @Arkadii IvanovArtem Kobzar
12/27/2023, 1:20 PMArkadii Ivanov
12/27/2023, 1:58 PMArtem Kobzar
12/27/2023, 2:51 PMArtem Kobzar
12/27/2023, 2:52 PMArkadii Ivanov
12/27/2023, 3:02 PMdecompose
module. In this case we can access all types in Xcode and write SwiftUI code.
It would be also nice to do the same with JS - export the shared
Kotlin module and write React in pure JavaScript.
As an idea, maybe provide some Gradle Kotlin DSL? Perhaps, something similar to apiValidation
in https://github.com/Kotlin/binary-compatibility-validator. It could be something like:
kotlin {
js {
exportedTypes.addAll(
"com.arkivanov.decompose.router.stack.ChildStack",
"com.arkivanov.decompose.value.Value",
...
)
}
}
turansky
12/27/2023, 3:35 PMArtem Kobzar
12/27/2023, 3:39 PMturansky
12/27/2023, 3:41 PMandylamax
12/27/2023, 4:20 PMEdoardo Luppi
12/27/2023, 8:35 PMI may need to export some types from those libraries even if the developer hasn't annotated them with JsExportThis is an ecosystem maturity issue. We should encourage everyone to cover all of the stable platforms. Exporting stuff you don't own sounds more like a workaround than an actual solution.
Edoardo Luppi
12/27/2023, 8:36 PMJsExport
. It's usually just the front facing API.Edoardo Luppi
12/27/2023, 8:39 PMEdoardo Luppi
12/27/2023, 8:42 PMany
in the exported declarations.Arkadii Ivanov
12/27/2023, 8:58 PMThis is an ecosystem maturity issueGiven the information above regarding the size, and as a library developer, I think I disagree. For example a library can be a multipurpose library, and only small part of it could be used in a project, and only a subset of that small part may be required by the consuming JS code. So exporting the whole public API of a library just in case looks indeed an overhead for most of the consuming projects. This essentially looks equivalent to "export everything by default", which has known downsides. On the other head, the proposed solution with automatic transitive export looks reasonable, I would probably lean towards it instead.
Big Chungus
12/28/2023, 2:10 PM@JsExport
typealias MyArray<T> = kotlin.Array<T>
Big Chungus
12/28/2023, 2:12 PMBig Chungus
12/28/2023, 2:50 PMArkadii Ivanov
01/08/2024, 2:23 PMBig Chungus
01/08/2024, 2:45 PMNacho Ruiz Martin
01/08/2024, 3:10 PM