Ivan Đorđević
03/14/2023, 1:32 PM@JsExport
or generate promises out of them automatically?Wardell
03/14/2023, 8:30 PMDmitriy Malayev
03/16/2023, 8:47 PMrocketraman
03/16/2023, 9:06 PMcommonTest
that does TimeZone.of("US/Eastern")
. This test fails in karma/browser with Uncaught IllegalTimeZoneException: DateTimeException: unsupported ZoneId
. This appears to be a limitation of the headless execution environment, but I'm not sure. Any way to avoid this?Michal Janos
03/17/2023, 10:07 AMinternal actual fun Any.getFieldValue(fieldName: String): Any? {
val thisDynamic: dynamic = this
return thisDynamic[fieldName]
}
this works well on LEGACY, but on IR it return undefined.
I try to play with that and thisDynamic[fieldName+"_1"]
return right value, but I don't think this is safe solution.
This is any class, where I want to find value by string.
Is there any idea how to do it in IR?louiscad
03/17/2023, 4:11 PMprint(0.0.toString())
prints 0.0
on the JVM, but 0
on JS.
Is there an alternative to toString()
to get 0.0
on JS as well?spierce7
03/17/2023, 5:13 PM#13 100.6 FAILURE: Build failed with an exception.
#13 100.6
#13 100.6 * What went wrong:
#13 100.6 Could not determine the dependencies of task ':kotlinNodeJsSetup'.
#13 100.6 > Could not resolve all files for configuration ':detachedConfiguration1'.
#13 100.6 > Could not resolve org.nodejs:node:16.13.0.
#13 100.6 Required by:
#13 100.6 project :
#13 100.6 > Could not resolve org.nodejs:node:16.13.0.
#13 100.6 > Could not get resource '<https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz>'.
#13 100.6 > Could not HEAD '<https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz>'. Received status code 403 from server: Forbidden
#13 100.6
#13 100.6 * Try:
#13 100.6 > Run with --info or --debug option to get more log output.
#13 100.6 > Run with --scan to get full insights.
#13 100.6
#13 100.6 * Exception is:
#13 100.6 org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':kotlinNodeJsSetup'.
#13 100.6 at
spierce7
03/17/2023, 5:15 PMkubele
03/18/2023, 8:29 AMheroku-buildpack-static
is deprecated now and the guide they provide works for already running applications.
Have you encountered this issue?Sam Garfinkel
03/18/2023, 4:11 PMT extends string | Record<string, T>
which provides a little more information than just, what in Kotlin, has to be a Map<String, Any>
Seth Madison
03/19/2023, 2:25 AMClaude Brisson
03/19/2023, 8:00 PMIlia Tochilin
03/20/2023, 1:01 PMrocketraman
03/20/2023, 7:47 PMUncaught TypeError: components_lightbox_TobiiModule_h0nwsu.Tobii is not a function
-- I'm trying to call the default function defined here: https://github.com/midzer/tobii/blob/production/src/js/index.js#L16. I've tried a couple of different approaches to import the module, code in 🧵.Mihai Voicescu
03/21/2023, 6:52 PM{
"gender": "male"
"age": 24
}
To be in Typescript:
enum Gender {
Male = "male",
Female = "female"
}
interface Person {
gender: Gender
age: number
}
And in Kotlin:
enum class Gender {
@SerialName("male")
Male,
@SerialName("female")
Female
}
interface Person {
gender: Gender
age: number
}
Note that I am using Kotlin MultiplatformChristian H.
03/22/2023, 7:30 AMCLOVIS
03/22/2023, 1:48 PMe: java.lang.IllegalStateException: IdSignature clash: opensavvy.decouple.core/UIMetadata.initializeFor$composable|-575774612970147389[0]; Existed declaration FUN IR_EXTERNAL_DECLARATION_STUB name:initializeFor$composable visibility:public modality:ABSTRACT <> ($this:opensavvy.decouple.core.UIMetadata, content:kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>, $composer:androidx.compose.runtime.Composer?, $changed:<http://kotlin.Int|kotlin.Int>) returnType:kotlin.Unit clashed with new FUN IR_EXTERNAL_DECLARATION_STUB name:initializeFor$composable visibility:public modality:ABSTRACT <> ($this:opensavvy.decouple.core.UIMetadata, content:kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>, $composer:androidx.compose.runtime.Composer?, $changed:<http://kotlin.Int|kotlin.Int>) returnType:kotlin.Unit
xxfast
03/22/2023, 10:19 PMbrowser
and nodejs
. Are we able to have a seperate source set for js browser and js node, so that any consumer of my library be able chose one or the other depending on their setup?
js("browser", IR) {
browser()
}
js("node", IR) {
nodejs()
}
// browser project
js(IR){
browser()
}
jsMain by getting {
dependencies {
implementation(project(":myLibrary")) // gets sources from :myLibrary:browserMain
}
}
// node project
js(IR){
nodejs()
}
jsMain by getting {
dependencies {
implementation(project(":myLibrary")) // gets sources from :myLibrary:nodeMain
}
}
rocketraman
03/23/2023, 3:27 AMxxfast
03/23/2023, 7:46 PMKalalau Cantrell
03/24/2023, 1:22 PMkotlin.collections.List
can’t be exported with @JsExport
?
With my limited experience in KMP, see below for something I’ve cobbled together that’s been working but it does not seem ideal. For instance, converting to and from List
and having to create wrappers for every collection type takes away from the dream of writing business logic once at a high level and reusing it across platforms.
Does anyone have advice for doing this in perhaps a more generic way? Has anyone found a way to use expect / actual
as a better solution?
@ExperimentalJsExport
@JsExport
class PeopleList : MutableList<StarWarsPerson> by mutableListOf() {
fun toArray(): Array<StarWarsPerson> {
val array = emptyArray<StarWarsPerson>()
this.forEachIndexed { index, person ->
array[index] = person
}
return array
}
companion object {
fun fromArray(people: Array<StarWarsPerson>): PeopleList {
val peopleList = PeopleList()
peopleList.addAll(people)
return peopleList
}
}
}
@ExperimentalJsExport
@JsExport
data class StarWarsPerson(val name: String
Paul Dhaliwal
03/25/2023, 2:49 PMmodule-core
-> whole program: single JS file that includes things like stdlib, kotlinx-serialization, etc…
module-a
, which depends on module-core
-> “per-module”: single JS file for module-a
, and an additional JS file for module-core
, with the module-a.js
file correctly depending on module-core.js
(which itself includes stdlib, kotlinx-serialization etc…)Cru
03/26/2023, 2:51 PMJilles van Gurp
03/27/2023, 11:41 AM16 actionable tasks: 5 executed, 11 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jsBrowserProductionWebpack'.
> Module parse failed: Unterminated regular expression (144:33)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See <https://webpack.js.org/concepts#loaders>
| Companion_getInstance_3();
| var tmp1_div = 1000000.0;
> tmp$ret$0 = tmp0_div.if() / tmp1_div;
| tmp$ret$1 = new Pair(Unit_getInstance(), tmp$ret$0);
| tmp$ret$2 = tmp$ret$1.m4_1;
Module parse failed: Unterminated regular expression (341:33)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See <https://webpack.js.org/concepts#loaders>
| // Inline function 'kotlin.Long.div' call
| var tmp0_div = roundToLong(latitude * 1000000);
> tmp$ret$0 = tmp0_div.if() / 1000000.0;
| roundedLat = tmp$ret$0;
| var tmp$ret$1;
Mike Dawson
03/27/2023, 4:24 PMlouiscad
03/27/2023, 4:51 PMaddAll
in MutableList
is extremely slow compared to just using a forEach
+ add
?
https://youtrack.jetbrains.com/issue/KT-57607/MutableList.addAll-has-UNACCEPTABLE-performance-on-Kotlin-JS-legacy-IRJilles van Gurp
03/28/2023, 3:06 AMfranztesca
03/28/2023, 8:42 AMjs {
binaries.library()
browser {
distribution {
directory = File("$projectDir/js_output/browser/")
}
}
nodejs {
distribution {
directory = File("$projectDir/js_output/node/")
}
}
}
My goal is to compile the browser version to the output folder js_output/browser
and the node one to js_output/node
.
However this doesn't work, because apparently the Kotlin target is shared between node and browser, therefore setting the distribution in the nodejs
block overrides the one of browser
, and thus both are always compiled to the same distribution directory (js_output/node
).
I use the jsNodeProductionLibraryDistribution
and jsBrowserProductionLibraryDistribution
tasks to create the production library distributions. This is actually a KMP project.
Any hints on how to do this properly?alec
03/28/2023, 1:23 PMMike Dawson
03/29/2023, 8:06 AMMike Dawson
03/29/2023, 8:06 AMturansky
03/29/2023, 8:09 AMMike Dawson
03/29/2023, 8:10 AM