Eduardo Zuza
04/07/2021, 7:18 PMChristoph Hock
04/07/2021, 8:29 PMfun reloadCss() {
val iframe = document.getElementById("iframe-id")
println("Test0")
if (iframe != null && iframe is HTMLIFrameElement) {
val contentWindow = iframe.contentWindow
if (contentWindow == null) {
println("Null1")
return
}
val link = contentWindow.document.getElementById("css-link")
if (link == null) {
println("Null2")
return
}
console.log("Typeof is" + jsTypeOf(link))
console.log(link::class)
if (link is HTMLLinkElement){
val href: String = link.href.split('?')[0]
link.href = "$href?version=${currentTimeMillis()}"
println("Test1")
}
val cssLink = link.unsafeCast<HTMLLinkElement>()
val href: String = cssLink.href.split('?')[0]
cssLink.href = "$href?version=${currentTimeMillis()}"
println("Test2")
}
}
When the code above is executed the console output is as follows:napperley
04/08/2021, 12:34 AMPramod Shri
04/08/2021, 8:12 AMEduardo Zuza
04/08/2021, 5:23 PMDmitriy Tarasevich
04/08/2021, 11:14 PMPromises
which are returned using GlobalScope.promise {}
are executed immediately instead of lazily when the clients invoke Promise#then
.
I am able to lazy load the promise by setting the coroutinestart to Lazy
and then calling promise.deferred.start
from within the js code.. but its not really ideal. What I would expect is that the coroutine is kicked off when .then
is invoked.
Anyone run into this before?Dmitry Romanov [JB]
04/15/2021, 9:17 AMEtienne
04/15/2021, 12:49 PMLuc Girardin
04/15/2021, 1:32 PM@JSExport
interfaces and gives the error “`Declaration of such kind (interface) cant be exported to JS`”. I was hoping this problem would magically vanish in 1.5.0-RC, but it is still present in both LEGACY
and IR
modes. I am a bit surprised that not more people about have complained about it. Have you bumped into this issue or did one of you find a workaround? There is an issue in YouTrack about it: https://youtrack.jetbrains.com/issue/KT-45434Jaroslav
04/16/2021, 10:13 AMTarun Chawla
04/16/2021, 5:54 PM<nav class="navbar" role="navigation" aria-label="main navigation">
class I can add this way, but not sure about other attibuted.
nav(classes = "navbar") {
}
Tarun Chawla
04/16/2021, 6:37 PMTarun Chawla
04/17/2021, 7:10 AMfun HTML.index() {
head {
title("Welcome to Seller Service")
link(rel = "stylesheet", href = "<https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.css>") { }
link(rel = "stylesheet", href = "static/styles/index.css") {}
}
body {
div {
id = "index"
}
script(src = "/static/output.js") {}
script(src = "<https://use.fontawesome.com/releases/v5.3.1/js/all.js>") {}
}
}
Index component where am overriding index div:
override fun RBuilder.render() {
div(classes = "section") {
div(classes = "container") {
nav(classes = "navbar") {
div(classes = "navbar-brand"){
a(classes = "navbar-item"){
img(classes = "img-style", src = "static/images/logo-text.png", alt = "Site logo") {
}
}
}
}
}
}
}
}
Below is the img-style inside index.css:
.img-style {
max-height:300px;
}
In console am seeting this:
.navbar-item img {
max-height:1.75rem
}
.img-style {
<strike>max-height:4rem;</strike>
}
Shabinder Singh
04/17/2021, 10:09 AMsubstring on undefined
while at compile time it is a String .
However when I add a redundant as String
Cast the error disappears!
Any IDEA what could be the issue?
Anyway I reported the error to youtrack to here: https://youtrack.jetbrains.com/issue/KT-46157Tarun Chawla
04/17/2021, 12:01 PMError: Minified React error #137; visit <https://reactjs.org/docs/error-decoder.html?invariant=137&args[]=input&args[]=> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
on <http://localhost:9000/static/output.js:46>
Yl <http://localhost:9000/static/output.js:46>
cu <http://localhost:9000/static/output.js:46>
su <http://localhost:9000/static/output.js:46>
au <http://localhost:9000/static/output.js:46>
Za <http://localhost:9000/static/output.js:46>
Ja <http://localhost:9000/static/output.js:46>
Iu <http://localhost:9000/static/output.js:46>
Fu <http://localhost:9000/static/output.js:46>
eu <http://localhost:9000/static/output.js:46>
Fu <http://localhost:9000/static/output.js:46>
render <http://localhost:9000/static/output.js:46>
How to decode these errors? Any suggestions on debugging these kind of errors. Currently am just solving by going through code, this stack does not help me.Robert Jaros
04/18/2021, 8:04 PMExecution optimizations have been disabled for task ':kvision-modules:kvision-common-annotations:jsSourcesJar' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/home/rjaros/git/kvision/kvision-modules/kvision-common-annotations/build/externals/kvision-kvision-common-annotations-jsIr/src'. Reason: Task ':kvision-modules:kvision-common-annotations:jsSourcesJar' uses this output of task ':kvision-modules:kvision-common-annotations:jsIrGenerateExternalsIntegrated' without declaring an explicit or implicit dependency.
What can be done about it? I don't even have these tasks defined in my build.gradle.kts
.Chris
04/21/2021, 1:41 AM// import {api} from 'tradelimit-tradelimit-common'
const api = require('tradelimit-tradelimit-common').indicators
const tradelimit = require('tradelimit-tradelimit-common')
export default class ChartComponent extends React.Component {
componentDidMount() {
getData().then(data => {
this.setState({ data })
})
}
render() {
console.log("API IS ",api)
// console.log(indicators)
let bar = new api.Bar(123123123)
console.log(bar)
Is there a way to do import vs require using multiplatform?
val jsMain by getting {
dependencies {
implementation(kotlin("stdlib-js"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core-js:1.1.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutine_version")
}
}
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.1.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutine_version")
}
}
Tarun Chawla
04/21/2021, 1:29 PMfun setCookie(name: String, value: String, path: String = "/") {
document.cookie = "$name=$value;path=$path"
}
Below api to get cookie:
fun getCookieValue(name: String): String? {
val currentCookies = document.cookie.split(";")
for (cookiePair in currentCookies) {
val cookieKeyValue = cookiePair.split("=")
if (cookieKeyValue.first().trim() == name.trim()) {
return cookieKeyValue[1].trim()
}
}
return null
}
Two questions:
1. Is there any better way to do it?
2. How to delete a cookie key value?edwinRNDR
04/23/2021, 7:18 AMorg.khronos.webgl.WebGLRenderingContextBase
exposes compressedTexImage2D
as
fun compressedTexImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, data: ArrayBufferView)
I believe this should be:
fun compressedTexImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, data: ArrayBufferView?)
reference: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/compressedTexImage2D
What is the best place to report this?Jaroslav
04/23/2021, 8:38 AMimplementation(npm("showdown", "1.9.1"))
but it complains, that "showdown.js is not a valid Kotlin Javascript library" and rebuild of project in Idea ends with
Kotlin: [Internal Error] java.io.IOException: Failed to open zip file: /home/xxx/yyy/zzz/build/js/node_modules/showdown/dist/showdown.js
Is it problem of lib format or bad dependence or something else?Tarun Chawla
04/23/2021, 11:36 AMvar coffee = document.forms[0];
var txt = "";
var i;
for (i = 0; i < coffee.length; i++) {
if (coffee[i].checked) {
txt = txt + coffee[i].value + " ";
}
}
document.getElementById("order").value = "You ordered a coffee with: " + txt;
In kotlin I wrote below code:
val form = document.getElementById(key) as HTMLFormElement
for(element in form.elements.asList()){
console.log("element value ${element.checked}")
}
But this is not working as there is no checked property.Sean Keane
04/23/2021, 1:49 PMe: java.lang.IllegalStateException: Unsupported operation
at org.jetbrains.kotlin.backend.common.serialization.IrModuleDeserializer.referenceSimpleFunctionByLocalSignature(IrModuleDeserializer.kt:37)
turansky
04/26/2021, 6:32 AMHywel Bennett
04/26/2021, 2:30 PMAtchay Varma
04/26/2021, 3:25 PMMartin Feldsztejn
04/27/2021, 3:29 AMturansky
04/27/2021, 6:45 AMSean Keane
04/27/2021, 1:54 PMVampire
04/27/2021, 3:56 PMMarc Knaup
04/28/2021, 5:41 PMMarc Knaup
04/28/2021, 5:41 PMRobert Jaros
04/28/2021, 6:00 PMMarc Knaup
04/28/2021, 6:01 PMRobert Jaros
04/28/2021, 6:03 PMMarc Knaup
04/28/2021, 6:04 PMSean Keane
04/28/2021, 11:03 PMgradle.properties
file.
org.gradle.parallel=true
If you're building in different modules this should help.Marc Knaup
04/28/2021, 11:36 PMandylamax
04/29/2021, 12:33 AMMarc Knaup
04/29/2021, 12:42 AMandylamax
04/29/2021, 1:02 AMSean Keane
04/29/2021, 1:13 AMMarc Knaup
04/29/2021, 1:20 AMSean Keane
04/29/2021, 1:24 AMMarc Knaup
04/29/2021, 3:41 AMchristophsturm
04/29/2021, 8:45 AMSean Keane
04/29/2021, 10:15 AMMarc Knaup
04/29/2021, 2:59 PMchristophsturm
04/29/2021, 3:01 PMSean Keane
04/29/2021, 3:51 PM1.4.3-native-mt
This is my lib list:
const val kotlinReact = "17.0.2-pre.153-kotlin-1.4.32"
const val kotlinStyled = "5.2.3-pre.153-kotlin-1.4.32"
const val routerDom = "5.2.0-pre.153-kotlin-1.4.32"
const val kotlin = "1.5.0-RC"
const val ktor = "1.5.2"
const val coroutinesCore = "1.4.3-native-mt"
const val coroutinesTest = "1.4.3"
const val serializationCommon = "1.1.0"
Are you on the latest DateTime? A new release is out on the 27th April.
https://search.maven.org/search?q=a:kotlinx-datetimeMarc Knaup
04/29/2021, 4:04 PMDuration
anywhere. And I do a lot.Sean Keane
04/29/2021, 4:27 PMMarc Knaup
04/29/2021, 4:28 PMDuration
, like delay
.Sean Keane
04/29/2021, 4:37 PMkotlinx-datetime
and see if I can replicate on my side.Marc Knaup
04/29/2021, 4:37 PMrusshwolf
04/29/2021, 5:26 PMMarc Knaup
04/29/2021, 8:07 PM