frank
06/10/2020, 8:29 PMkotlin-react
libs manually in my html but it can't find module
variable in the React libs.
<script type="text/javascript" src="lib/kotlin/kotlin.js"> </script>
<script type="text/javascript" src="lib/kotlin/kotlinx-html-js.js"></script>
<script type="text/javascript" src="lib/kotlin/kotlin-wrappers-kotlin-react-jsLegacy.js"></script>
<script type="text/javascript" src="lib/kotlin/kotlin-wrappers-kotlin-react-dom-jsLegacy.js"></script>
<script type="text/javascript" src="js/webapp.js"></script>
ReferenceError: module is not defined kotlin-wrappers-kotlin-react-jsLegacy.js:845:1
ReferenceError: module is not defined kotlin-wrappers-kotlin-react-dom-jsLegacy.js:2472:1
My steps:
1. Copy js libs of Gradle local repo into my Project
2. Import js libs in my html
Suggestions how to import Kotlin/JS libs?dazza5000
06/10/2020, 10:42 PMdata
classes when integrating with existing javascript projects?aerb
06/14/2020, 12:45 AMBig Chungus
06/14/2020, 4:08 PMSubroh Nishikori
06/14/2020, 5:05 PMbrowserDevelopmentWebpack
and load it into the Storybook.
Also, a file simply transpiled to JS will cause great difficulty in resolving library dependencies for `kotlin-wrappers`(Because the npm module distribution has stopped since pre.91😭)
Do you have any good ideas about this?Big Chungus
06/14/2020, 6:49 PMconst elm = vnode.elm = oldVnode.elm!
janvladimirmostert
06/14/2020, 8:56 PMjs(IR) {
browser {
dceTask {
keep(
...
)
}
binaries.executable()
}
}
Locally this project seems to be using ES6 modules
import ChatMessageList from './chat-message-list';
When i auto import Kotlin classes, it does this
import ApplicationState = module_name.com.domain.ApplicationState;
this compiles, but does not work when i run the html file with the generated JS
i can see the generated KotlinJS in the Parceble js output, but it seems the KotlinJS is using a different module system or something, i'm not very familiar with TypeScript and NPM yetjanvladimirmostert
06/14/2020, 9:14 PMbinaries.executable()
, what happens with the generated JS files?
All i'm seeing is a package.json
and package.json.hash
where there used to be a js fileSean Najera
06/15/2020, 1:36 AMbrowserDevelopmentRun
I get the following error
org.jetbrains.kotlin.gradle.targets.js.npm.KotlinNpmResolutionManager$ResolutionState$Installed cannot be cast to org.jetbrains.kotlin.gradle.targets.js.npm.KotlinNpmResolutionManager$ResolutionState$Configuring
But when using IntelliJ, the task runs fine.Hannes Tenter
06/15/2020, 9:23 AMjanvladimirmostert
06/15/2020, 11:23 AMdeclare namespace blah {
type Nullable<T> = T | null | undefined
namespace com.blah {
is there a way to make it export the namespace like this?
export declare namespace blah {
type Nullable<T> = T | null | undefined
namespace com.blah {
GarouDan
06/16/2020, 4:59 PMpublish
a kotlin mpp library (the js part) to npm
?
I’d like js npm users consume and use my library as well.
Please let me know if you have an example or a project configuration that I could use.Danilo Herrera
06/16/2020, 10:36 PMPatrick
06/17/2020, 1:51 PMfkrauthan
06/17/2020, 8:59 PMTristan MARIE
06/18/2020, 5:19 PMDima Avdeev
06/19/2020, 6:54 AMAlexander Minyaev
06/19/2020, 7:07 PMPavel Petkevich
06/20/2020, 9:56 AM./gradlew :client:run --continuous
and it will run continuously our website on the localhost. (works fine).
But my target is to run it from the server module, usign this shell command:
./gradlew :server:run --continuous
and it runs perfectly but not presenting the page….
-----------------------------------
Possible solution:
I would say that I know the root cause: It happens because the server module has no access to the pregenerated file - "build/distributions/client.js"
. Also I’m trying to copy it with this code in `build.gradle.kts(:server)`:
val processResources by tasks.existing(ProcessResources::class)
processResources {
from(project(":client").tasks.getByName("browserProductionWebpack").path)
// dependsOn(project(":client").tasks.getByName("browserProductionWebpack")) - also doesn't work...
}
In case someone already faced with this kind of problem, maybe you can help me to figure out the best solution. 😄
Thank you in advance 😄CLOVIS
06/20/2020, 1:48 PMimport org.w3c.files.Blob
import org.w3c.files.File
val data: Blob = ...
File(
Array<Blob>(1) {data},
"image.png"
)
This is in jsTest of a Multiplatform project. The IDE doesn't have a problem with it, nor does Gradle. When I run it, I get:
ReferenceError: File is not defined
The generated JS code in build/
looks like:
new File(array, 'image.png')
where array
is generated with a normal for
loop. The IDE does link it with what appears to me as the correct definition, in a TypeScript file.
I'm running Chromium 83, and according to https://caniuse.com/#feat=fileapi it is supported.
Sorry if that's something dumb or obvious, I'm new to the JS world and I'm completely lost as to what could cause this, especially since the error message doesn't hint toward anything.
The File constructor is even defined in the Kotlin standard library for JS: https://kotlinlang.org/api/latest/jvm/stdlib/org.w3c.files/-file/-init-.htmlAlexander Minyaev
06/22/2020, 8:52 AMRComponent
(RBuilder
)? Details in thread.zeugederunity
06/22/2020, 12:35 PMUncaught TypeError: Cannot read property 'slash' of undefined
at eval (kotlin-react-router-dom.js:10)
at eval (kotlin-react-router-dom.js:276)
at Object.../../packages_imported/kotlin-react-router-dom/0.0.0/kotlin-react-router-dom.js (firmensuche.js:987)
at __webpack_require__ (firmensuche.js:30)
at eval (firmensuche.js:3)
at eval (firmensuche.js:8)
at Object../kotlin/firmensuche.js (firmensuche.js:1399)
at __webpack_require__ (firmensuche.js:30)
at Object.0 (firmensuche.js:1411)
at __webpack_require__ (firmensuche.js:30)
I'm quite new to JS & React in general, so i don't really know why this property isn't defined. (My best guess is that it has something to do with incompartible versions,)
My Dependencies in the gradle.kts are:
val react_version = "16.13.1"
val react_router_version = "5.1.2"
val kotlin_react_version = "16.13.1-pre.105-kotlin-1.3.72"
val kotlin_react_router_dom = "5.1.2-pre.109-kotlin-1.3.72"
implementation(npm("react",react_version))
implementation(npm("react-dom",react_version))
implementation(npm("react-is",react_version))
implementation(npm("react-router-dom",react_router_version))
implementation("org.jetbrains:kotlin-react:$kotlin_react_version")
implementation("org.jetbrains:kotlin-react-dom:$kotlin_react_version")
implementation("org.jetbrains:kotlin-react-router-dom:$kotlin_react_router_dom")
Does anyone of you know how to fix that error?
Thank you in advance!Robert Jaros
06/22/2020, 4:07 PMkarma-kotlin-reporter
? I've replaced mocha
with qunit
and everything works fine, but reports are written in files with >
character in filenames. It works on Linux but doesn't work on Windows.zeugederunity
06/23/2020, 7:51 AMAntonios Barotsis
06/23/2020, 7:27 PMval discord = require("discord.js");
val client = discord.Client()
compiles to this
var discord = require('discord.js');
var client = discord.Client();
which gives me an error because it should instead be
var discord = require('discord.js');
var client = new discord.Client();
How do I invoke ``new`` seeing as how its not a kotlin keyword?
Edit: Im not sure if this has something to do with the way I imported the package, this is the require function, I did not make any external classes
external fun require(module: String): dynamic
Antonios Barotsis
06/24/2020, 8:53 PMclient.on(('ready'), msg => { // do stuff here })
How can I define this event in my external class and how do I then use it?PHondogo
06/24/2020, 9:16 PMJeff
06/26/2020, 8:01 AMFAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':kotlinNpmInstall'.
> org.jetbrains.kotlin.gradle.targets.js.npm.KotlinNpmResolutionManager$ResolutionState$Installed cannot be cast to org.jetbrains.kotlin.gradle.targets.js.npm.KotlinNpmResolutionManager$ResolutionState$Configuring
zeugederunity
06/26/2020, 12:19 PMNikky
06/27/2020, 10:39 AM1.4-M2
to make use of better dce in js, the jsBrowserProductionWebpack
task disappeared
i use it to copy from build/distributions
into the shadowJar resources
which task would replace that ?
PS: i also do nto see the webpack run tasks and dce tasks that should be there, but gradle does nto log any obvious errorsNikky
06/27/2020, 10:39 AM1.4-M2
to make use of better dce in js, the jsBrowserProductionWebpack
task disappeared
i use it to copy from build/distributions
into the shadowJar resources
which task would replace that ?
PS: i also do nto see the webpack run tasks and dce tasks that should be there, but gradle does nto log any obvious errorsturansky
06/27/2020, 11:10 AMbinaries.executable()
added?Nikky
06/27/2020, 11:15 AM