Jakob K
05/27/2022, 3:16 PMIR
compiler is able to generate separate files for each module, but it seems like the distribution generated by jsBrowserDistribution
still produces a single large file. How can I generate a distribution with modularized output files (like they are generated in build/compileSync/main/productionExecutable/kotlin/
for example)?Kashismails
05/31/2022, 1:28 PMhfhbd
05/31/2022, 7:13 PMwebpackTask { cssSupport.enabled = true }
in the library (bootstrap-compose) as well as in the consumer project. Executing a full build or just browserWebpack creates working js file, which is good. But I am not able to use browserDevelopmentRun
anymore:
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See <https://webpack.js.org/concepts#loaders>
> @charset "UTF-8";/*!
How can I use the loader in browserRun
too?Ayfri
06/01/2022, 9:57 PMinterface IPointData {
public x: number;
public y: number;
}
declare class ObservablePoint<T extends any = any> extends IPointData {}
declare class DisplayObject {
public get position(): ObservablePoint;
public set position(pos: IPointData);
}
How do I type this in Kotlin ?andylamax
06/02/2022, 11:45 AMJonathan Ellis
06/02/2022, 6:32 PMJonathan Ellis
06/02/2022, 7:31 PMJonathan Ellis
06/02/2022, 7:31 PMhfhbd
06/02/2022, 8:28 PM@JsModule("@bootstrap/scss/_buttons.scss") private external val Style: dynamic
to load the style via web pack, similar what kmdc does, but who does it work as a consumer? My showcase project fails with: bootstrap module not found, because it should not explicit depend on this npm module: https://github.com/hfhbd/bootstrap-compose/pull/195Garth Gilmour
06/03/2022, 8:08 AMattrs.unsafe { +"🗑" }
But this is not supported in the new syntax.
I have tried:
dangerouslySetInnerHTML!!.__html = "🗑"
But no luck...Garth Gilmour
06/03/2022, 12:26 PMa("<http://somewhere>") {}
but this no longer compiles. Although that's what the documents show.
One would expect:
a {
href = "<http://somewhere>"
}
But this doesn't work either.Moussa
06/03/2022, 5:39 PMfetch
instead of XMLHttpRequest
Is there is a documentation for that part in KMM documentation or a workaround that you know of?Norbi
06/04/2022, 4:49 PMjsBrowserProductionWebpack
task is executed. How can I force the execution of jsBrowserDevelopmentWebpack
instead?
Thanks.Jeff Davidson
06/05/2022, 5:29 AM@file:JsQualifier("chrome.scripting")
and an external fun executeScript(...)
method, and it works fine when the namespace exists. However, if it's undefined, the generated JS fails to load even if I never actually try calling the method, since the code tries to declare a variable equal to "chrome.scripting.executeScript", which breaks. Is there a way to make such an external declaration where it does not attempt to initialize this variable unless/until the method is actually called?Racka N
06/05/2022, 7:49 PMModule not found: Error: Can't resolve 'util' in 'C:\Users\bmkil\IdeaProjects\Kotlin-Conf-React\build\js\node_modules\cacheable-lookup\source'
for a lot of Modules
and
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
I tried using this doc to resolve them but have had no luck so far. And resources regarding this are very scarce. Any help would be appreciatedRobert Jaros
06/06/2022, 6:37 PMLC_ALL=tr_TR
) the task names from the kotlin gradle plugin somehow get translated (e.g. frontendBrowserProduct�onRun
or frontendBrowserProduct�onWebpack
) and builds with some tasks.getByName("....")
calls fail. Anyone have an idea why is this happening?Racka N
06/07/2022, 9:25 AMOvsyannikov Alexey
06/07/2022, 9:59 AMCoroutineContext#get
returns is not a function
error when it is underhood have wrong name (compiled name in my case is t.get_9uvjra_k$
, but called is t.get_1pi7hg_k$
). Maybe somebody know how to fix it?Racka N
06/07/2022, 6:20 PMAyfri
06/08/2022, 6:27 AMJoost Klitsie
06/10/2022, 12:53 PMAyfri
06/10/2022, 9:11 PM.knm
file but if we see declaration of methods in these files it works by looking in the gradle cache, but it would be very useful to be able to see the entire code of libraries directly, like in JVM.Jonathan Willis
06/11/2022, 2:25 AMAnders Kielsholm
06/11/2022, 10:09 PMproductionExecutableCompileSync
. All of a sudden it however starting failing with a lot of errors when starting the application, e.g.: Error: Cannot find module './kotlin-kotlin-stdlib-js-ir.js'
. As far as I remember I haven't changed anything except for updating to newest Intellij and kotlin plugin. Updating to Kotlin 1.7.0 (from 1.6.21) didn't do any difference either. Anyone else tried the same or similar?Cheick Kante
06/13/2022, 5:43 AMMrPowerGamerBR
06/14/2022, 4:23 AMjsBrowserProductionRun
or jsBrowserDevelopmentRun
? The generated JS does work if I host it in a webserver manually.
By looking at this (https://github.com/vaadin/flow/issues/13952), it seems that the @webpack-cli/serve
package should be pinned to 1.6.1, and it seems that because the version is declared as "^1.6.1", it pulls version 1.7.0 to my project (well, at least that's what the yarn.lock file says 😛).
* What went wrong:
Execution failed for task ':web:dashboard:frontend:jsBrowserProductionRun'.
> [webpack-cli] TypeError: cli.isMultipleCompiler is not a function
[webpack-cli] TypeError: cli.isMultipleCompiler is not a function
at Command.<anonymous> (C:\Users\Leonardo\Documents\IdeaProjects\LorittaBot\LorittaCinnamon\build\js\node_modules\@webpack-cli\serve\lib\index.js:146:35)
at async Promise.all (index 1)
at async Command.<anonymous> (C:\Users\Leonardo\Documents\IdeaProjects\LorittaBot\LorittaCinnamon\build\js\node_modules\webpack-cli\lib\webpack-cli.js:1674:7)
"@webpack-cli/serve@^1.6.1":
version "1.7.0"
resolved "<https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1>"
integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==
gbaldeck
06/15/2022, 2:52 PMAchifal
06/16/2022, 12:10 PMclass IRTest {
val numberToText = js("{'1' : 'one', '2' : 'two'}")
@Test
fun test() {
val key = "1"
assertEquals(true, js("key in this.numberToText"))
}
}
fails with Cannot use 'in' operator to search for '1' in undefined
while
class IRTest {
val numberToText = js("{'1' : 'one', '2' : 'two'}")
@Test
fun test() {
val key = "1"
val numberToTextCopy = this.numberToText
assertEquals(true, js("key in numberToTextCopy"))
}
}
works as expected. Could anyone explain this behavior? Thanks in advance for your help!Tóth István Zoltán
06/16/2022, 12:10 PMgbaldeck
06/16/2022, 3:24 PMgbaldeck
06/16/2022, 3:24 PMturansky
06/18/2022, 5:13 PMgbaldeck
06/19/2022, 12:27 AMbuild.gradle.kts
file for the javascript portion of my multi project build. I have a common project and jvm project also.plugins {
kotlin("js")
}
group = "com.learner.frontend"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
val kotlinWrappersVersion = "1.0.0-pre.340"
dependencies {
implementation(project(":shared"))
implementation(enforcedPlatform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:$kotlinWrappersVersion"))
implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-styled-next")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-redux")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-redux")
testImplementation(kotlin("test-js"))
}
kotlin {
js(IR) {
binaries.executable()
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
testTask {
useKarma {
useChrome()
}
}
}
}
}
turansky
06/19/2022, 12:11 PMto test what is rendering on the screenLooks like puppeteer use case, he will install required Chrome version yourself