Vampire
08/21/2020, 11:05 AMtry {
/* ... */
} catch (error) {
if (error.name === cache.ValidationError.name) {
throw error
} else if (error.name === cache.ReserveCacheError.name) {
<http://core.info|core.info>(error.message)
} else {
core.warning(error.message)
}
}
Big Chungus
08/21/2020, 5:14 PMVictor Harlan Lacson
08/21/2020, 10:01 PMir
compiler.
I encounterd an issue when exporting a class with @JsExport.
this happens when a class contains a field of another class
Can't find name for declaration FUN SYNTHESIZED_DECLARATION name:B$Create$ visibility:public modality:FINAL <> (id:<http://kotlin.Int|kotlin.Int>, a:A)
and this when i have an empty constructor on class A
Can't find name for declaration FUN SYNTHESIZED_DECLARATION name:Item_init_$Create$ visibility:public modality:FINAL <> () returnType:B
for example
@JsExport
data class A(val id: Int, val some: String)
@JsExport
data class B(val id: Int , val a: A?) {
@JsName("empty_constructor")
constuctor(): this(0,null)
}
would realy appreciate some work aroundfkrauthan
08/22/2020, 4:41 AMturansky
08/22/2020, 11:46 AMval myDynamicConstructor = ... // for class T
val myClass = myDynamicConstructor.unsafeCast<JsClass<T>>()
val t: T = myClass.newInstance()
Gunslingor
08/22/2020, 2:32 PM`grapesjs-lory-slider` = jsObject<dynamic> {
"name contains illegal identifiers that can't appear in javascript identifiers"
In JS it works like this:
'grapesjs-lory-slider': {
sliderBlock: {
category: 'Extra'
}
iari
08/23/2020, 9:53 AMplugins {
kotlin("js") version "1.4.0"
}
results in
Error resolving plugin [id: 'org.jetbrains.kotlin.js', version: '1.4.0']for me.
Gunslingor
08/23/2020, 3:48 PMGunslingor
08/24/2020, 1:33 AMconst $ = Backbone.$;
//JS Example
or
val $ = Grapes.$;
//KotlinJS Where Grapes is an External Object.
Gunslingor
08/24/2020, 4:39 PM// Simple warn notifier
var origWarn = console.warn;
toastr.options = {
closeButton: true,
preventDuplicates: true,
showDuration: 250,
hideDuration: 150
};
console.warn = function (msg) {
if (msg.indexOf('[undefined]') == -1) {
toastr.warning(msg);
}
origWarn(msg);
};
mohamadreza jafarzade
08/24/2020, 8:04 PMGunslingor
08/25/2020, 2:16 AM// Add and beautify tooltips
[['sw-visibility', 'Show Borders'], ['preview', 'Preview'], ['fullscreen', 'Fullscreen'],
['export-template', 'Export'], ['undo', 'Undo'], ['redo', 'Redo'],
['gjs-open-import-webpage', 'Import'], ['canvas-clear', 'Clear canvas']]
.forEach(function(item) {
pn.getButton('options', item[0]).set('attributes', {title: item[1], 'data-tooltip-pos': 'bottom'});
});
[['open-sm', 'Style Manager'], ['open-layers', 'Layers'], ['open-blocks', 'Blocks']]
.forEach(function(item) {
pn.getButton('views', item[0]).set('attributes', {title: item[1], 'data-tooltip-pos': 'bottom'});
});
var titles = document.querySelectorAll('*[title]');
for (var i = 0; i < titles.length; i++) {
var el = titles[i];
var title = el.getAttribute('title');
title = title ? title.trim(): '';
if(!title)
break;
el.setAttribute('data-tooltip', title);
el.setAttribute('title', '');
}
KJS
val toolTips = arrayOf(
arrayOf("sw-visibility", "Show Borders"),
arrayOf("preview", "Preview"),
arrayOf("fullscreen", "Fullscreen"),
arrayOf("export-template", "Export"),
arrayOf("undo", "Undo"),
arrayOf("redo", "Redo"),
arrayOf("gjs-open-import-webpage", "Import"),
arrayOf("canvas-clear", "Clear canvas")
)
toolTips.forEach {
val openTmBtn = panels.getButton("views", "open-tm")
openTmBtn.set("title", it[1])
openTmBtn.set("data-tooltip-pos", "bottom")
}
val titles = document.querySelectorAll("*[title]")
for(index in 0..titles.length) {
val el = titles.item(index)
var title = el?.parentElement?.getAttribute("title")?.trim() ?: ""
if(title.isNotEmpty()) {
el?.parentElement?.setAttribute("data-tooltip", title)
el?.parentElement?.setAttribute("title", "")
}
}
Gunslingor
08/25/2020, 2:20 PMJorrit
08/25/2020, 5:19 PM@SomethingGoesHere?
external fun polyfilled(args: Int)
Using @JsModule("npmmodule") at least doesn't work, there's no require('npmmodule')
output the JS file. I can call require
manually but that doesn't seem like the right solution.Franco
08/26/2020, 12:26 AM/test/:id
) using the React Router wrapper and I can't make it work. I tried something similar to the example in the README (https://github.com/JetBrains/kotlin-wrappers/blob/master/kotlin-react-router-dom/README.md) but that doesn't work as match
can't be found when calling props.match.params.id
. Does anyone know how to do this?
This is my example:
interface IdProps : RProps {
var id: Int
}
class RootComponent : RComponent<RProps, RState>() {
override fun RBuilder.render() {
hashRouter { // or "browserRouter"
switch {
route<IdProps>("/user/:id") { child(Comp2::class) {} }
}
}
}
}
class Comp2 : RComponent<IdProps, RState>() {
override fun RBuilder.render() {
div {
+"User id: ${props.match.params.id}"
}
}
}
Gunslingor
08/26/2020, 2:18 AMclass master(body: Element) {
val master = document.create.div("d-block") {
childObject()
+"MasterView"
)
init {
body.appendChild(editor)
masterController()
}
}
class childObject(body: Element) {
val child= document.create.div("d-block") {
childObject()
+"ChildView"
)
init {
body.appendChild(editor)
childController()
}
}
Mikołaj Kąkol
08/27/2020, 8:59 AMsuspend
functions, but with Flow
I've got d.ts
result like: longAdd(a: number, b: number): kotlinx.coroutines.flow.Flow<number>;
. Any idea if we can use it?Mranders
08/27/2020, 12:52 PMFAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':hltv-app:browserProductionWebpack'.
> Module 'kotlin-extensions' not found
Module 'kotlin-react' not found
Module 'kotlin-styled' not found
Module 'kotlin-wrappers-kotlin-css' not found
We have the following dependencies declared:
implementation "org.jetbrains:kotlin-react:16.13.1-pre.111-kotlin-1.4.0"
implementation "org.jetbrains:kotlin-react-dom:16.13.1-pre.111-kotlin-1.4.0"
implementation "org.jetbrains:kotlin-react-router-dom:5.1.2-pre.112-kotlin-1.4.0"
implementation "org.jetbrains:kotlin-styled:1.0.0-pre.112-kotlin-1.4.0"
implementation "org.jetbrains:kotlin-extensions:1.0.1-pre.112-kotlin-1.4.0"
.. And the following NPM dependencies:
implementation(npm("react", "16.13.1"))
implementation(npm("react-dom", "16.13.1"))
implementation(npm("react-router-dom", "5.2.0"))
Has anyone experienced this error, and have some way to solve it?ESchouten
08/27/2020, 2:29 PMJoost Klitsie
08/28/2020, 8:14 AMJorrit
08/29/2020, 12:34 PM3bdoelnaggar
08/29/2020, 4:45 PMimplementation(npm("react-router", "5.2.0"))
implementation(npm("react-router-dom", "5.2.0"))
implementation("org.jetbrains:kotlin-react-router-dom:5.1.2-pre.112-kotlin-1.4.0")
Sangeet Narayan
08/30/2020, 5:29 AMGurupad Mamadapur [FH]
08/31/2020, 11:24 AMdazza5000
08/31/2020, 4:33 PMe: org.jetbrains.kotlin.js.facade.exceptions.TranslationRuntimeException: Unexpected error occurred compiling the following fragment: 'package com.fivestars.integration.file.model
Patrick Doering
08/31/2020, 7:21 PMagrosner
09/01/2020, 2:17 PMnpm
dependency to a project running kotlin 1.4 using the new IR JS compiler, and I try to run the project, I receive an error:
Could not determine the dependencies of task ':js-react:jsTestPackageJson'.
> NPM Dependencies already resolved and installed
If I remove any npm dependency, the error goes away, but seems like its something do with npm
dependencies
sample here: https://github.com/monstar-lab-oss/kedux/blob/master/app/build.gradle.kts uncomment any npm
dependency and it wont runRob Murdock
09/02/2020, 12:46 PMbill1550
09/02/2020, 5:30 PMdazza5000
09/03/2020, 2:22 PMdazza5000
09/03/2020, 2:22 PMftomassetti
09/03/2020, 3:47 PMnpm i kotlin
but I still get the same errordazza5000
09/03/2020, 7:28 PM