Andrew Reed
04/29/2021, 4:39 PMandylamax
05/02/2021, 8:11 AMJS(IR)
target to have its main configuration target browser
while it's test configuration target node
?
I need to be able to write my integration tests with javascript
and I am too tired to creating a whole new jvm
target just for the purpose of testing
a web app.
Suggestions?WukongRework.exe
05/02/2021, 9:37 PM@JsModule("mathjs")
and @JsNonModule
was the best way to solve npm packages on the kotlin side (according to the docs https://kotlinlang.org/docs/using-packages-from-npm.html) however this didnt work and to quote my friend: "i had literally no idea if the npm install worked like there was just no feedback on it because no gradle errors but like there wasn't any positive confirmation so while everything wasn't working i wasn't even sure if the dependency worked" and "just what the sample tells me to do but it straight up didnt work and the only error was "lusolve is not a function" like it just was completely useless and there' s no error on compilation either it's just a runtime error"
they ended up finding out a solution to fix the problem (linked in the pictures below) and it was an abstract external class marked with @JsModule
and a companion object storing all of the needed functions
i have two questions: i understand that kotlin JS is a relatively new target and doesnt get as much love as JVM or even native from wat ive seen, but y is documentation so poor on this? (is this something that should be brought up in #docs-revamped or is it already a known problem?) i also understand that the JS / npm / node ecosystem is very large and was wondering if these "hacks" will be the norm of doing things moving forward or if there are plans to make them better
side note: sorry for the language in these pictures, it was late at night and they had spent a lot of time trying to figure this outTarun Chawla
05/04/2021, 3:38 PM<Prev Button/a> <Image> <Next Button/a>
Am using Bulma css framework to design things. Do you have any suggestions which I should take care while implementing it?Ethan Davidson
05/05/2021, 3:04 AMTarun Chawla
05/05/2021, 12:13 PMbsimmons
05/05/2021, 2:41 PMhikamaeng
05/06/2021, 2:40 AMwillyrs
05/06/2021, 5:59 AMRescribet
05/06/2021, 1:09 PM.d.ts
files for the JS IR output?Tarun Chawla
05/07/2021, 9:07 AMUncaught
Object { "message_8yp7un$_0": undefined, "cause_th0jdv$_0": null, stack: "i/</e.captureStack@http://localhost:9000/static/output.js:3:209256\n$n@http://localhost:9000/static/output.js:3:54266\ngn@http://localhost:9000/static/output.js:3:54329\nbn@http://localhost:9000/static/output.js:3:54433\nPn@http://localhost:9000/static/output.js:3:55118\ni/</e.throwNPE@http://localhost:9000/static/output.js:3:213780\ni/t.ensureNotNull@http://localhost:9000/static/output.js:3:15312\ni/le.prototype.addRestaurantPage/<@http://localhost:9000/static/output.js:30:8941\nC@http://localhost:9000/static/output.js:10:610418\nH.render_2955dm$@http://localhost:9000/static/output.js:10:911384\ni/le.prototype.addRestaurantPage@http://localhost:9000/static/output.js:30:8899\nve@http://localhost:9000/static/output.js:30:9565\ni@http://localhost:9000/static/output.js:30:134260\n@http://localhost:9000/static/output.js:30:134271\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:30:1183\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:1:1139\n@http://localhost:9000/static/output.js:1:1150\n@http://localhost:9000/static/output.js:1:203\n@http://localhost:9000/static/output.js:1:207\n", name: "NullPointerException" }
"cause_th0jdv$_0": null
"message_8yp7un$_0": undefined
name: "NullPointerException"
stack: "i/</e.captureStack@http://localhost:9000/static/output.js:3:209256\n$n@http://localhost:9000/static/output.js:3:54266\ngn@http://localhost:9000/static/output.js:3:54329\nbn@http://localhost:9000/static/output.js:3:54433\nPn@http://localhost:9000/static/output.js:3:55118\ni/</e.throwNPE@http://localhost:9000/static/output.js:3:213780\ni/t.ensureNotNull@http://localhost:9000/static/output.js:3:15312\ni/le.prototype.addRestaurantPage/<@http://localhost:9000/static/output.js:30:8941\nC@http://localhost:9000/static/output.js:10:610418\nH.render_2955dm$@http://localhost:9000/static/output.js:10:911384\ni/le.prototype.addRestaurantPage@http://localhost:9000/static/output.js:30:8899\nve@http://localhost:9000/static/output.js:30:9565\ni@http://localhost:9000/static/output.js:30:134260\n@http://localhost:9000/static/output.js:30:134271\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:30:1183\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:1:1139\n@http://localhost:9000/static/output.js:1:1150\n@http://localhost:9000/static/output.js:1:203\n@http://localhost:9000/static/output.js:1:207\n"
<prototype>: Object { constructor: Pn(t), stack: "" }
How to map this error to the Kotlin code? Earlier if I used to caught these errors, I was able to fix it on spot somehow relating it to kotlin code am writing. But not now because I have written lots of code and suddenly this error is coming in browser console am clueless on how to debug this. can you please point me to the right direction?Jaroslav
05/07/2021, 10:54 AMJoost Klitsie
05/07/2021, 1:06 PMexternal value class Whatever(whatever: String)
?Animesh Sahu
05/07/2021, 1:42 PMUnit.INSTANCE
from Java side, whereas if you like to use SAM interface you cannot export it to js 😂. Any suggestion to make both part happy?Martin Feldsztejn
05/07/2021, 10:51 PMMartin Feldsztejn
05/08/2021, 5:48 AMyunxing
05/09/2021, 1:48 PMandrewreitz
05/09/2021, 3:37 PMtest/resources
how do I load that file in a test? I’m trying fetch("./myfile")
and it is returning a not found error.Ayfri
05/09/2021, 11:14 PMexport enum UPDATE_PRIORITY {
INTERACTION = 50,
HIGH = 25,
NORMAL = 0,
LOW = -25,
UTILITY = -50,
}
And a function that have a parameter of this :
function test(priority: UPDATE_PRIORITY = UPDATE_PRIORITY.HIGH): void
?yunxing
05/10/2021, 3:02 PMjs("require('fs')").readFileSync
in kotlin, is there a way to tell what the return type is? The only document I can find is on nodejs, where it says a buffer is returned. However I don't know how to access that in kotlinRobert Jaros
05/10/2021, 4:27 PMJonathan Smith
05/10/2021, 7:06 PMsteamstreet
05/10/2021, 8:25 PMTomasz Krakowiak
05/11/2021, 9:17 PMconst val DEBUG = false
fun doSomething(debug : Boolean) {
if(debug) {
doSomeDebugStuff()
}
}
Would DCE get rid of doSomeDebugStuff
from output js? Would it work across libraries? Would it work if I would store debug as field of some class?Andrey Ivanov
05/12/2021, 12:54 PMjmfayard
05/12/2021, 7:34 PMexpect fun executeExternalCommand(args: List<String>, options): String
On the JVM, I can use ProcessBuilder(),
On Native, I use popen
,
but how do I do that on Node/JS?jmfayard
05/12/2021, 7:35 PMrnett
05/12/2021, 10:26 PMKClass.qualifiedName
? It's proving to be quite a pain for some RPC things. I'm not aware of a youtrack issue for it.Arjan van Wieringen
05/13/2021, 5:53 AM@JSExport
-ed functions and classes from the module. Is this significantly different in IR compared to the stable Kotlin/JS?Pepijn de Vos
05/13/2021, 3:40 PM[
{
x: [1, 2, 3],
y: [2, 6, 3],
type: 'scatter',
mode: 'lines+markers',
marker: {color: 'red'},
},
{type: 'bar', x: [1, 2, 3], y: [2, 5, 3]},
]
Pepijn de Vos
05/13/2021, 3:40 PM[
{
x: [1, 2, 3],
y: [2, 6, 3],
type: 'scatter',
mode: 'lines+markers',
marker: {color: 'red'},
},
{type: 'bar', x: [1, 2, 3], y: [2, 5, 3]},
]
andylamax
05/13/2021, 4:33 PMval arr = arrayOf(
jsObject {
x = arrayOf(1,2,3)
y = arrayOf(2,6,3)
type = "scatter"
mode = "lines+markees"
marker = jsObject {
color = "red"
}
},
jsObject {
type = "bar"
x = arrayOf(1,2,3)
y = arrayOf(2,5,3)
}
)