U75957
07/21/2019, 8:48 AM/* generated by dukat */ external open class A {
open fun foo()
open fun foo(p: Int)
}
/* abstract or */ open class B : A() // <--- OK. No errors
class C : B() // <--- Error: JavaScript name foo is generated for different inherited members: fun foo(): Unit and fun foo(p: Int): Unit
What's wrong?Big Chungus
07/21/2019, 11:03 AMaltavir
07/21/2019, 11:27 AMOrbitControls
module which just resides in node_modules/three/examples/jsm/controls/OrbitControls.js
. On frontend plugin I just used a direct path to this module like @file:JsModule("../../node_modules/three/examples/jsm/controls/OrbitControls.js")
. Now I can't use it since node_modules
is no longer in build directory on 1.3.50
. Are there any suggestions?Casey Brooks
07/22/2019, 7:50 PMaltavir
07/24/2019, 2:25 PMfun testRead() {
window.fetch("<https://drive.google.com/open?id=1w5e7fILMN83JGgB8WANJUYm8OW2s0WVO>").then {
println("Fetched!")
val string = it.body as String
val xml = GDML.format.parse(GDML.serializer(), string)
println(xml.world)
}.catch {
println("Fetch failed")
println(it.message)
}
}
What should I change to make it worklinux_china
07/24/2019, 4:40 PMlinux_china
07/24/2019, 4:40 PMutikeev
07/25/2019, 8:41 AMeffector
lib for Kotlin and stumbled upon the next problem. There are different config types in effector
which are normalised before passing to factory. Normalisation uses Object.assign
and leads to erasure of property getters, so the result object has generated property names, but no getters with initial names:
nameOrConfig: createEffectConfig$ObjectLiteral
handler_80ch0g$_0: ƒ fetchUser$lambda(payload)
name_7uss69$_0: "Get user"
handler: (...)
name: (...)
after normalisation becomes
config:
handler_80ch0g$_0: ƒ fetchUser$lambda(payload)
name_7uss69$_0: "Get user"
and handler
and name
properties are now unreachable for the library.
The only way I found is using js { ... }
wrapper and return dynamic object instead. Is there more Kotlin way to approach this problem?thana
07/25/2019, 1:36 PMPromise.reject()
require a Throwable
argument while in JS you can reject with any value?Joffrey
07/25/2019, 3:00 PMCould not determine the dependencies of task ':sw-ui-kt:packageJson'.
> project ':sw-client' is not configured for JS usage
Where sw-client
is a Kotlin multiplatform subproject, and sw-ui-kt
is a Kotlin/JS subproject depending on `sw-client`:
kotlin {
target {
browser()
}
sourceSets {
main {
dependencies {
implementation(kotlin("stdlib-js"))
implementation(project(":sw-client"))
//...
Is it normal not to be able to depend on a multiplatform project from a JS one?
Is there a way to declare the local dependency to the JS part of the multiplatform project?Soren Valle
07/25/2019, 7:07 PMthana
07/26/2019, 12:04 PMdybamic
which obviously makes handling hard in kotlin itselfZachary Grafton
07/26/2019, 9:17 PMczuckie
07/27/2019, 9:13 AMfcosta
07/29/2019, 1:38 PM$ ./gradlew :common:client:jsTest --console=plain
> Configure project :common:client
Kotlin Multiplatform Projects are an experimental feature.
> Task :kotlinNodeJsSetup SKIPPED
> Task :common:core:jsProcessResources NO-SOURCE
> Task :kotlinNpmResolve FAILED
> Task :common:client:nodeSetup
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':kotlinNpmResolve'.
> Could not resolve all dependencies for configuration ':common:client:chatapp-client-npm'.
> Could not find org.jetbrains.kotlin:kotlin-stdlib-common:1.3.41.
Searched in the following locations: <https://nodejs.org/dist/v1.3.41/kotlin-stdlib-common.jar>
Required by:
project :common:client
project :common:client > project :common:core
> Could not find org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:0.11.1.
Searched in the following locations: <https://nodejs.org/dist/v0.11.1/kotlinx-serialization-runtime-common.jar>
Required by:
project :common:client
project :common:client > project :common:core
> Could not find org.jetbrains.kotlin:kotlin-stdlib-js:1.3.41.
Searched in the following locations: <https://nodejs.org/dist/v1.3.41/kotlin-stdlib-js.jar>
Required by:
project :common:client
project :common:client > project :common:core
> Could not find org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:0.11.1.
Searched in the following locations: <https://nodejs.org/dist/v0.11.1/kotlinx-serialization-runtime-js.jar>
Required by:
project :common:client
project :common:client > project :common:core
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD FAILED in 2s
2 actionable tasks: 2 executed
I was wondering why Gradle is trying to search for jars in nodejs
? Any hint?Big Chungus
07/29/2019, 6:56 PMSoren Valle
07/29/2019, 9:03 PMJoffrey
07/29/2019, 10:10 PMbrowserRun
from the new Kotlin/JS gradle plugin?
Where am I supposed to place my index.html
and other static public files?
I'm seeing a blank page with the text "Cannot GET /" at the top left-hand corner.vsazel
07/30/2019, 10:38 AMfun createRandomFile(path: String, size: Long) {
val fd = openSync(path, "a+")
ftruncateSync(fd, size)
closeSync(fd)
}
ftruncateSync is Node.js function defined in Kotlin as:
external fun ftruncateSync(fd: Number, len: Number? = definedExternally /* null */): Unit = definedExternally
I can pass Int to ftruncateSync
with no problems, but top size is 1GiB for the file, because size of Int is limited.
When I use Long, it ends with The "len" argument must be of type number. Received type object
. So obviously there is no conversion for Long. Can this be done somehow?diodredd
07/30/2019, 11:58 AM(function (_, Kotlin) {
'use strict';
var println = Kotlin.kotlin.io.println_s8jyv4$;
function main(args) {
println('Hello Javascript, from' + args[2]);
}
_.main_kand9s$ = main;
main([]);
Kotlin.defineModule('output', _);
return _;
}(module.exports, require('kotlin')));
fcosta
07/30/2019, 1:22 PMcore
and client
. I'm migrating them to 1.3.41
. When I try to run jsTest
task on client
module, the following error appears. Curious that, after some retries, the tests pass... 🤔 Maybe some lazy sync between modules? Have anyone already had this problem?gaetan
07/31/2019, 4:00 PMjs("typeof window !== undefined") as Boolean
fcosta
08/02/2019, 7:44 PMdevDependency
in the new Kotlin JS plugin?Joffrey
08/02/2019, 9:21 PMBig Chungus
08/03/2019, 12:28 PMJuanoterocas
08/03/2019, 5:22 PMCarson Graham
08/05/2019, 9:14 PMJuanoterocas
08/07/2019, 5:05 PMSoren Valle
08/09/2019, 11:13 AMSoren Valle
08/10/2019, 5:21 PMSoren Valle
08/10/2019, 5:21 PManton.bannykh
08/13/2019, 2:04 PMDominaezzz
08/22/2019, 12:57 AMsnrostov
08/23/2019, 9:07 AMlocal
npm dependency?yarn
workspaces.Dominaezzz
08/23/2019, 9:09 AMlibrary-version.tgz
file that I need to include as dependency.yarn add
supports. When I do npm("http://....../package.tgz", "")
, @
gets appended to the end of the resolved dependency, causing resolution to fail.snrostov
08/23/2019, 9:17 AMimplementation npm("@fancyapps/fancybox", "<https://github.com/fancyapps/fancybox#3.0>")
npm("package", "http://....../package.tgz")
Dominaezzz
08/23/2019, 10:31 AMimplementation(npm("@olm/olm","<https://packages.matrix.org/npm/olm/olm-3.1.0.tgz>"))
.js("""
global.Olm = require('olm')
""")
I get
Error: Cannot find module 'olm'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at test (/home/dominaezzz/IdeaProjects/MatrixKt/olm/src/jsMain/kotlin/sample/SampleJs.kt:13:22)
at SampleTestsJS.testHello (/home/dominaezzz/IdeaProjects/MatrixKt/olm/src/jsTest/kotlin/sample/SampleTestsJS.kt:11:9)
at /home/dominaezzz/IdeaProjects/MatrixKt/build/js/packages/MatrixKt-olm-test/kotlin/MatrixKt-olm-test.js:60:38
at Object.fn [as test] (/home/dominaezzz/IdeaProjects/MatrixKt/build/js/packages_imported/kotlin-test-nodejs-runner/src/KotlinTestRunner.ts:12:25)
at Object.test (/home/dominaezzz/IdeaProjects/MatrixKt/build/js/packages_imported/kotlin-test-nodejs-runner/src/KotlinTestTeamCityReporter.ts:80:28)
at test (/home/dominaezzz/IdeaProjects/MatrixKt/build/js/packages_imported/kotlin-test/1.3.41/src/main/kotlin/kotlin/test/TestApi.kt:57:15)
snrostov
08/23/2019, 12:14 PMrequire('@olm/olm')
instead of require('olm')
Dominaezzz
08/23/2019, 12:17 PMSoren Valle
08/23/2019, 12:21 PMlocal
was a js lib that I had written. I was trying to figure out how to include it as an npm dependency. So it would be properly resolved through @JsModule
file
resolution in package.json
from what I remember. npm()
didn't seem to allow for that.