sdeleuze
06/20/2019, 1:58 PMrobstoll
06/20/2019, 6:44 PMJavaScript name (foo_cbqzx6$) generated for this declaration clashes with another declaration
but I cannot really see why it happens for some functions but not for others. Could it be a bug I should report?U75957
06/21/2019, 9:45 AMextends
, we get defective inheritance (in short, it does not work). As workaround I do such thing:
class Kotlin : TypeScript() {
init {
tslib.__extends(Kotlin::class.js, TypeScript::class.js)
}
}
Can this be done somehow more elegantly / correctly? I think extending of TS class should be supported by Kotlin/JS. With annotation of external TS class or somehow else.U75957
06/21/2019, 11:27 AMthis::class.supertypes
is marked as supported for JS in the documentation. But in fact compiler produce error Unsupported [This reflection API is not supported yet in JavaScript]
sdeleuze
06/22/2019, 6:33 AMYan Pujante
06/23/2019, 4:43 PMproject.afterEvaluate {
val outputDir = project.buildDir
.resolve(DEFAULT_OUT_DIR)
.resolve(kotlinCompilation.target.disambiguationClassifier?.let { "$it/" }.orEmpty() + kotlinCompilation.name)
val configuration = project.configurations.getByName(kotlinCompilation.compileDependencyConfigurationName)
with(dceTask) {
classpath = configuration
destinationDir = dceTask.dceOptions.outputDirectory?.let { File(it) } ?: outputDir
source(kotlinTask.outputFile)
}
}
the destinationDir
variable is not available until afterEvaluate
. Is there a specific reason?
In my build file I have this:
task assembleWeb(type: Sync) {
configurations.compile.each { File file ->
from(zipTree(file.absolutePath), {
includeEmptyDirs = false
include { fileTreeElement ->
def path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") ||
!path.startsWith("META-INF/"))
}
})
}
from compileKotlin2Js.destinationDir
// from runDceKotlinJs.destinationDir
into webDir.child("dynamic").child("js")
dependsOn classes
}
and compileKotlin2Js.destinationDir
is available... but if I uncomment runDceKotlinJs.destinationDir
it is null
unless I wrap the entire thing in afterEvaluate{}
.
That doesn't seem right...Ilya Goncharov [JB]
06/24/2019, 3:29 PMERROR in ....
Module not found: Error: Can't resolve 'foo/bar.svg' in ...
victoralissont5
06/25/2019, 11:14 PMEduard Minasyan
06/26/2019, 8:13 PMU75957
06/27/2019, 11:12 AMjs("{'Content-Type':'application/json'}")
Produce: {Content-Type: 'application/json'}
Content-Type
without quotes is not valid js code. Produce error Unexpected token
Is it compiler bug or I miss something?ankushg
06/27/2019, 7:49 PMdata class Foo(val bar: Int)
as a parameter, I can call it from JS and pass in the blob {"bar": 1}
and it will Just Work.
Is this officially supported, or is it just an unreliable side-effect of how Kotlin/JS internally represents data classes?
Does this work with nested classes (e.g., data class Foo2(val myBar: Bar)
and data class Bar(...)
)?
If I had a class that was declared as data class Foo3(val bar: SomeEnumClass)
, is there a simple way to allow me to call it from JS using a blob with an Int
map it to SomeEnumClass
in Kotlin? Maybe something like an alternate constructor or property with a backing fields?Ilya Goncharov [JB]
06/29/2019, 9:11 AMcompileKotlinJs {
kotlinOptions {
sourceMapEmbedSources = "always"
}
}
But I think, it should be more elegantaltavir
06/30/2019, 11:11 AMelement.clientWidth
works with bootstrap columns, but if I have some kind of inner structure, element.clientWidth
returns zero. As far as I can understand it happens because when I take the measurement, the element is not yet rendered. What is the best way to treat this problem?turansky
06/30/2019, 2:29 PMMark
06/30/2019, 6:48 PMgalex
07/01/2019, 11:26 AMorg.jetbrains.kotlin.js
gradle plugin has capabilities to deploy the code as an npm module? Where can I find its documentation?Fudge
07/01/2019, 12:37 PMTristan Caron
07/01/2019, 7:53 PMFudge
07/02/2019, 2:36 PMobject
from Javascript`?
Kotlin:
package foo.bar
object Obj {
fun func() = 2
}
JS:
var x = foo.bar.Obj.func() // Invalid!
Tristan Caron
07/04/2019, 12:23 AMbuild.gradle.kts
, There were some errors during scripts dependencies resolution, some resolution might be missing
.
When I try to use the function npm
it says it’s unresolved: implementation(npm("lib", "0.0.0"))
I am using Kotlin 1.3.41Ryan Batchelder
07/05/2019, 3:37 PMJoffrey
07/08/2019, 4:26 PMTuan Kiet
07/09/2019, 1:56 AMsuspend
function from js
site? or are we shouldn’t call at all?Casey Brooks
07/10/2019, 9:45 PMjsBrowserWebpack
to create the bundle, and added it to my HTML page with a <script>
tag, but i can’t figure out how to access my module from thereaakira
07/11/2019, 2:03 AMaakira
07/11/2019, 12:13 PMkotlin.js
file on website created using Kotlin/JS ?
I download the kotlin.js file when I open this website(https://turanukimaru.github.io/FEHSIM/).
So, I can’t find the website created by Kotlin/JS if we can hide a kotlin.js file.
I saw it by network tab in chrome developer tools.xlj44400
07/13/2019, 3:03 AMo.semen
07/15/2019, 9:19 AMimplementation(npm("@jetbrains/kotlin-react", "16.6.0-pre.67"))
implementation(npm("@jetbrains/kotlin-react-dom", "16.6.0-pre.67"))
in js{}
and js{ browser {} }
sections
as well as
kotlinFrontend {
npm {
dependency("@jetbrains/kotlin-react")
dependency("@jetbrains/kotlin-react-dom")
dependency("core-js", "^2.0.0")
dependency("react", "16.8.3")
dependency("react-dom", "16.8.3")
}
}
but it does not help.
Posted in #reactU75957
07/16/2019, 2:16 PMexternal interface A {
fun foo(p1: Any)
}
fun main() {
A::foo.name
}
produce such js code:
getCallableRef('foo', function ($receiver, p1) {
return $receiver.foo(p1), Unit;
}).callableName;
It looks like a lot of excess. I expect just 'foo'
.BearDev
07/18/2019, 10:06 PMC:\Users\User\IdeaProjects\TestMulti2\build\js\packages\TestMulti2\node_modules\.bin\webpack:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
FAILURE: Build failed with an exception.
Like I said, this is a project created fresh from the template with 0 modifications made. Thanks in advance.