Tristan Blakers
11/03/2020, 1:42 AM@JsName("TestClass")
data class TestClass(val num: Int) {
fun half() = num / 2
}
@JsName("doubleNum")
fun TestClass.doubleNum() = this.num * 2
In the above, I can create instances of TestClass and use the half method, but (perhaps unsurprisingly) the doubleNum() method doesn't exist on the object...Alexander Klimov
11/03/2020, 10:04 AM> Task :kotlinNpmInstall
`warning workspace-aggregator-17c92542-f070-464f-b6a6-41dbd344139e > foo > plotly.js > point-cluster > bubleify > buble > os-homedir@2.0.0: This is not needed anymore. Use require('os').homedir()
instead.`
error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\\Users\\Dell\\AppData\\Local\\Yarn\\Cache\\v6\\npm-plotly-js-1.54.6-ed021aa8da85759c69602c97bd3dab2b09eeec22-integrity\\node_modules\\plotly.js\\.yarn-tarball.tgz'"
.
I've tried to google, but nothin about it in Kotlin context.
As fas as I understand, it's due to Win 10 prevents some disk-operations on system disk (C:)
Does anybody workaround for this case?
Can I specify yarn's cache directory on another disk then C:Björn Mayer
11/03/2020, 10:18 AMbrowserProductionWebpack
build?Marc Knaup
11/04/2020, 12:47 AMassets/image.<somehash>.png
for example and can also reference it properly.Marc Knaup
11/04/2020, 3:11 AMdistribution
? And devServer
also shouldn’t serve files from the resources folder directly.
Edit 1: I need to keep the folder marked as a resources folder.
index.html
is a notable exception because it’s not copied by a Webpack loader.hallvard
11/05/2020, 12:02 PMjs { moduleName = "myModuleName" }
to adjust my module name, but according to the docs, this «_does not affect the webpacked output_». In the top of the produced .js file in my project, I find this: root["jsapi"] = factory()
. Now how do I go about having Gradle change that string from the project name (jsapi) into something else?Yan Pujante
11/05/2020, 5:38 PM...
kotlin {
js(IR) {
browser {
binaries.executable()
webpackTask {
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
}
}
}
My project includes a bunch of files that I would like to bundle into a zip file during the build and made available to both the run mode and prod mode (I am using jszip from kotlin to load the zip file but the zip file needs to be generated). Can somebody point me into what I should do to make this happen?steamstreet
11/05/2020, 10:20 PMtasks["jsBrowserWebpack"].enabled = false
in my build files for JS libraries.christophsturm
11/06/2020, 10:47 AMMarc Knaup
11/06/2020, 5:23 PMUsing inline classes as parameter type or return type of external declarations is not supportedNoooo 😭 Will this limitation stay?
patrickdelconte
11/06/2020, 7:59 PM./gradlew run myargs
or ./gradlew run --args='myargs'
ankushg
11/06/2020, 8:54 PMkotlinx-serialization-kotlinx-serialization-*-jsLegacy
module names are broken with npm because npm doesn't support uppercase characters in package names
Does anyone know of a workaround? Is this being worked on?Big Chungus
11/07/2020, 5:12 PMYan Pujante
11/07/2020, 7:21 PMkotlin {
js(IR) {
browser {
binaries.executable()
webpackTask {
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
}
}
}
which automatically picks up all resources from src/main/resources
. How do I add another folder?Andrew
11/08/2020, 4:31 AMMarc Knaup
11/08/2020, 5:17 PMbbaldino
11/09/2020, 8:14 PMSlackbot
11/10/2020, 11:28 AMrobstoll
11/10/2020, 8:45 PMkotlin{ js { nodejs() }}
I would like to see more than just the first line in case of a failure in the consoleYan Pujante
11/10/2020, 10:46 PMkotlin {
js(IR) {
browser {
binaries.executable()
webpackTask {
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
}
}
}
When I run the build
target it builds and put the result under <buildDir>/distributions
. I obviously can use File(buildDir, "distributions")
to access this folder, but I am sure there is some magic variable to get to it. And I suppose my second question/frustration is how on earth can you discover this kind of things without having to ask around in the slack channel? Although I am a big fan of gradle in general, I find it so not discoverable...Dmitry Romanov [JB]
11/11/2020, 8:49 AMCLOVIS
11/11/2020, 11:37 AMorg.w3c.files.File
as argument, but I don't know how to build one from JS (on JVM I could just new java.io.File("path")
but I've heard that's not possible on JS?)Marc Knaup
11/11/2020, 5:01 PM@JsModule("@emotion/stylis")
@JsNonModule
external class Stylis(
options: StylisOptions = definedExternally,
)
val stylis = Stylis() // runtime: Stylis is not a constructor
At runtime Stylis
is actually a Module and Stylis.default
is the actual class 🤔Marc Knaup
11/11/2020, 7:53 PMMarc Knaup
11/12/2020, 2:33 AMsuspend fun foo(): T
instead of fun foo(): Promise<T>
in an external interface
?andrewreitz
11/13/2020, 4:37 PMMauily
11/13/2020, 6:45 PMDaan
11/13/2020, 11:01 PMlibraryFunction({ optionalArg1: 'value', optionalArg2: true });
So far, I've been using this utility function:
fun <T> obj(block: T.() -> Unit): T =
js("{}").unsafeCast<T>().apply(block)
Which can be used like this:
libraryFunction(obj { optionalArg1 = "value"; optionalArg2 = true })
Given the following external declarations:
external interface Args {
optionalArg1: String
optionalArg2: Boolean
}
external fun libraryFunction(args: Args)
Axel-F B
11/14/2020, 12:50 PMandrewreitz
11/14/2020, 6:54 PM